Merge lp:~alexharrington/xibo/pyclient-122-fix into lp:xibo/1.3
- pyclient-122-fix
- Merge into faye
Proposed by
Alex Harrington
Status: | Merged |
---|---|
Merged at revision: | 213 |
Proposed branch: | lp:~alexharrington/xibo/pyclient-122-fix |
Merge into: | lp:xibo/1.3 |
Diff against target: |
1962 lines (+1081/-176) (has conflicts) 27 files modified
client/dotNET/CacheManager.cs (+75/-1) client/dotNET/FileCollector.cs (+60/-27) client/dotNET/MainForm.cs (+45/-22) client/dotNET/Properties/Settings.Designer.cs (+13/-1) client/dotNET/Properties/Settings.settings (+4/-1) client/dotNET/Region.cs (+11/-1) client/dotNET/RequiredFiles.cs (+206/-0) client/dotNET/Schedule.cs (+1/-1) client/dotNET/ScheduleManager.cs (+16/-1) client/dotNET/Web References/xmds/Reference.cs (+67/-0) client/dotNET/Web References/xmds/xmds.wsdl (+23/-0) client/dotNET/XiboClient.csproj (+1/-0) client/dotNET/app.config (+4/-1) client/dotNET/bin/Release/XiboClient.exe.config (+24/-3) client/dotNET/bin/Release/XiboClient.vshost.exe.config (+24/-3) client/python/XiboClient.py (+14/-0) server/install/database/27.sql (+9/-0) server/lib/app/kit.class.php (+3/-0) server/lib/data/display.data.class.php (+134/-29) server/lib/data/schedule.data.class.php (+5/-0) server/lib/include.php (+3/-3) server/lib/pages/display.class.php (+244/-81) server/lib/pages/layout.class.php (+6/-0) server/lib/pages/region.class.php (+5/-0) server/lib/service/service.wsdl (+23/-0) server/lib/service/xmdssoap.class.php (+60/-0) server/modules/module_db_mysql.php (+1/-1) Text conflict in client/dotNET/FileCollector.cs Text conflict in client/dotNET/Region.cs Text conflict in client/python/XiboClient.py Text conflict in server/lib/app/kit.class.php Text conflict in server/lib/data/display.data.class.php Text conflict in server/lib/pages/display.class.php |
To merge this branch: | bzr merge lp:~alexharrington/xibo/pyclient-122-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xibo Maintainters | Pending | ||
Review via email: mp+52028@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/dotNET/CacheManager.cs' | |||
2 | --- client/dotNET/CacheManager.cs 2010-04-19 21:45:10 +0000 | |||
3 | +++ client/dotNET/CacheManager.cs 2011-03-03 10:16:18 +0000 | |||
4 | @@ -25,6 +25,7 @@ | |||
5 | 25 | using System.Windows.Forms; | 25 | using System.Windows.Forms; |
6 | 26 | using System.Xml.Serialization; | 26 | using System.Xml.Serialization; |
7 | 27 | using System.Diagnostics; | 27 | using System.Diagnostics; |
8 | 28 | using System.Xml; | ||
9 | 28 | 29 | ||
10 | 29 | namespace XiboClient | 30 | namespace XiboClient |
11 | 30 | { | 31 | { |
12 | @@ -173,7 +174,7 @@ | |||
13 | 173 | /// </summary> | 174 | /// </summary> |
14 | 174 | /// <param name="path"></param> | 175 | /// <param name="path"></param> |
15 | 175 | /// <returns>True is it is and false if it isnt</returns> | 176 | /// <returns>True is it is and false if it isnt</returns> |
17 | 176 | public bool IsValid(String path) | 177 | public bool IsValidPath(String path) |
18 | 177 | { | 178 | { |
19 | 178 | // TODO: what makes a path valid? | 179 | // TODO: what makes a path valid? |
20 | 179 | // Currently a path is valid if it is in the cache | 180 | // Currently a path is valid if it is in the cache |
21 | @@ -185,6 +186,10 @@ | |||
22 | 185 | { | 186 | { |
23 | 186 | if (file.path == path) | 187 | if (file.path == path) |
24 | 187 | { | 188 | { |
25 | 189 | // If we cached it over 2 minutes ago, then check the GetLastWriteTime | ||
26 | 190 | if (file.cacheDate > DateTime.Now.AddMinutes(-2)) | ||
27 | 191 | return true; | ||
28 | 192 | |||
29 | 188 | try | 193 | try |
30 | 189 | { | 194 | { |
31 | 190 | // Check to see if this file has been modified since the MD5 cache | 195 | // Check to see if this file has been modified since the MD5 cache |
32 | @@ -209,6 +214,75 @@ | |||
33 | 209 | // Reached the end of the cache and havent found the file. | 214 | // Reached the end of the cache and havent found the file. |
34 | 210 | return false; | 215 | return false; |
35 | 211 | } | 216 | } |
36 | 217 | |||
37 | 218 | /// <summary> | ||
38 | 219 | /// Is the provided layout file a valid layout (has all media) | ||
39 | 220 | /// </summary> | ||
40 | 221 | /// <param name="layoutFile"></param> | ||
41 | 222 | /// <returns></returns> | ||
42 | 223 | public bool IsValidLayout(string layoutFile) | ||
43 | 224 | { | ||
44 | 225 | Debug.WriteLine("Checking Layout " + layoutFile + " is valid"); | ||
45 | 226 | |||
46 | 227 | if (!IsValidPath(layoutFile)) | ||
47 | 228 | return false; | ||
48 | 229 | |||
49 | 230 | // Load the XLF, get all media ID's | ||
50 | 231 | XmlDocument layoutXml = new XmlDocument(); | ||
51 | 232 | layoutXml.Load(Properties.Settings.Default.LibraryPath + @"\" + layoutFile); | ||
52 | 233 | |||
53 | 234 | XmlNodeList mediaNodes = layoutXml.SelectNodes("//media"); | ||
54 | 235 | |||
55 | 236 | foreach (XmlNode media in mediaNodes) | ||
56 | 237 | { | ||
57 | 238 | // Is this a stored media type? | ||
58 | 239 | switch (media.Attributes["type"].Value) | ||
59 | 240 | { | ||
60 | 241 | case "video": | ||
61 | 242 | case "image": | ||
62 | 243 | case "flash": | ||
63 | 244 | case "ppt": | ||
64 | 245 | |||
65 | 246 | // Get the path and see if its valid | ||
66 | 247 | if (!IsValidPath(media.InnerText)) | ||
67 | 248 | return false; | ||
68 | 249 | |||
69 | 250 | break; | ||
70 | 251 | |||
71 | 252 | default: | ||
72 | 253 | continue; | ||
73 | 254 | } | ||
74 | 255 | } | ||
75 | 256 | |||
76 | 257 | return true; | ||
77 | 258 | } | ||
78 | 259 | |||
79 | 260 | /// <summary> | ||
80 | 261 | /// Regenerate from Required Files | ||
81 | 262 | /// </summary> | ||
82 | 263 | public void Regenerate() | ||
83 | 264 | { | ||
84 | 265 | if (!File.Exists(Application.UserAppDataPath + "\\" + Properties.Settings.Default.RequiredFilesFile)) | ||
85 | 266 | return; | ||
86 | 267 | |||
87 | 268 | // Open the XML file and check each required file that isnt already there | ||
88 | 269 | XmlDocument xml = new XmlDocument(); | ||
89 | 270 | xml.Load(Application.UserAppDataPath + "\\" + Properties.Settings.Default.RequiredFilesFile); | ||
90 | 271 | |||
91 | 272 | XmlNodeList fileNodes = xml.SelectNodes("//RequiredFile/Path"); | ||
92 | 273 | |||
93 | 274 | foreach (XmlNode file in fileNodes) | ||
94 | 275 | { | ||
95 | 276 | string path = file.InnerText; | ||
96 | 277 | |||
97 | 278 | // Does the file exist? | ||
98 | 279 | if (!File.Exists(Properties.Settings.Default.LibraryPath + @"\" + path)) | ||
99 | 280 | continue; | ||
100 | 281 | |||
101 | 282 | // Add this file to the cache manager | ||
102 | 283 | Add(path, GetMD5(path)); | ||
103 | 284 | } | ||
104 | 285 | } | ||
105 | 212 | } | 286 | } |
106 | 213 | 287 | ||
107 | 214 | public struct Md5Resource | 288 | public struct Md5Resource |
108 | 215 | 289 | ||
109 | === modified file 'client/dotNET/FileCollector.cs' | |||
110 | --- client/dotNET/FileCollector.cs 2011-01-30 18:13:32 +0000 | |||
111 | +++ client/dotNET/FileCollector.cs 2011-03-03 10:16:18 +0000 | |||
112 | @@ -31,28 +31,26 @@ | |||
113 | 31 | class FileCollector | 31 | class FileCollector |
114 | 32 | { | 32 | { |
115 | 33 | private CacheManager _cacheManager; | 33 | private CacheManager _cacheManager; |
116 | 34 | private RequiredFiles _requiredFiles; | ||
117 | 35 | private XmlDocument _xml; | ||
118 | 34 | 36 | ||
119 | 35 | public FileCollector(CacheManager cacheManager, string xmlString) | 37 | public FileCollector(CacheManager cacheManager, string xmlString) |
120 | 36 | { | 38 | { |
121 | 37 | _cacheManager = cacheManager; | 39 | _cacheManager = cacheManager; |
122 | 38 | 40 | ||
124 | 39 | xml = new XmlDocument(); | 41 | // Load the XML file RF call |
125 | 42 | _xml = new XmlDocument(); | ||
126 | 43 | _xml.LoadXml(xmlString); | ||
127 | 40 | 44 | ||
137 | 41 | try | 45 | // Create a required files object |
138 | 42 | { | 46 | _requiredFiles = new RequiredFiles(); |
139 | 43 | xml.LoadXml(xmlString); | 47 | _requiredFiles.RequiredFilesXml = _xml; |
131 | 44 | } | ||
132 | 45 | catch (Exception e) | ||
133 | 46 | { | ||
134 | 47 | //Log this error | ||
135 | 48 | System.Diagnostics.Debug.WriteLine(e.Message); | ||
136 | 49 | } | ||
140 | 50 | 48 | ||
141 | 51 | // Get the key for later use | 49 | // Get the key for later use |
142 | 52 | hardwareKey = new HardwareKey(); | 50 | hardwareKey = new HardwareKey(); |
143 | 53 | 51 | ||
144 | 54 | // Make a new filelist collection | 52 | // Make a new filelist collection |
146 | 55 | files = new Collection<FileList>(); | 53 | _files = new Collection<RequiredFile>(); |
147 | 56 | 54 | ||
148 | 57 | // Create a webservice call | 55 | // Create a webservice call |
149 | 58 | xmdsFile = new XiboClient.xmds.xmds(); | 56 | xmdsFile = new XiboClient.xmds.xmds(); |
150 | @@ -73,13 +71,13 @@ | |||
151 | 73 | /// </summary> | 71 | /// </summary> |
152 | 74 | public void CompareAndCollect() | 72 | public void CompareAndCollect() |
153 | 75 | { | 73 | { |
155 | 76 | XmlNodeList fileNodes = xml.SelectNodes("/files/file"); | 74 | XmlNodeList fileNodes = _xml.SelectNodes("/files/file"); |
156 | 77 | 75 | ||
157 | 78 | //Inspect each file we have here | 76 | //Inspect each file we have here |
158 | 79 | foreach (XmlNode file in fileNodes) | 77 | foreach (XmlNode file in fileNodes) |
159 | 80 | { | 78 | { |
160 | 81 | XmlAttributeCollection attributes = file.Attributes; | 79 | XmlAttributeCollection attributes = file.Attributes; |
162 | 82 | FileList fileList = new FileList(); | 80 | RequiredFile fileList = new RequiredFile(); |
163 | 83 | 81 | ||
164 | 84 | if (attributes["type"].Value == "layout") | 82 | if (attributes["type"].Value == "layout") |
165 | 85 | { | 83 | { |
166 | @@ -120,13 +118,15 @@ | |||
167 | 120 | fileList.md5 = attributes["md5"].Value; | 118 | fileList.md5 = attributes["md5"].Value; |
168 | 121 | fileList.retrys = 0; | 119 | fileList.retrys = 0; |
169 | 122 | 120 | ||
171 | 123 | files.Add(fileList); | 121 | _files.Add(fileList); |
172 | 124 | } | 122 | } |
173 | 125 | else | 123 | else |
174 | 126 | { | 124 | { |
175 | 127 | // The MD5 of the current file and the MD5 in RequiredFiles are the same. | 125 | // The MD5 of the current file and the MD5 in RequiredFiles are the same. |
176 | 128 | // Therefore make sure this MD5 is in the CacheManager | 126 | // Therefore make sure this MD5 is in the CacheManager |
177 | 129 | _cacheManager.Add(path + ".xlf", md5); | 127 | _cacheManager.Add(path + ".xlf", md5); |
178 | 128 | |||
179 | 129 | _requiredFiles.MarkComplete(int.Parse(path), md5); | ||
180 | 130 | } | 130 | } |
181 | 131 | } | 131 | } |
182 | 132 | else | 132 | else |
183 | @@ -141,7 +141,7 @@ | |||
184 | 141 | fileList.md5 = attributes["md5"].Value; | 141 | fileList.md5 = attributes["md5"].Value; |
185 | 142 | fileList.retrys = 0; | 142 | fileList.retrys = 0; |
186 | 143 | 143 | ||
188 | 144 | files.Add(fileList); | 144 | _files.Add(fileList); |
189 | 145 | } | 145 | } |
190 | 146 | } | 146 | } |
191 | 147 | else if (attributes["type"].Value == "media") | 147 | else if (attributes["type"].Value == "media") |
192 | @@ -183,13 +183,16 @@ | |||
193 | 183 | fileList.md5 = attributes["md5"].Value; | 183 | fileList.md5 = attributes["md5"].Value; |
194 | 184 | fileList.retrys = 0; | 184 | fileList.retrys = 0; |
195 | 185 | 185 | ||
197 | 186 | files.Add(fileList); | 186 | _files.Add(fileList); |
198 | 187 | } | 187 | } |
199 | 188 | else | 188 | else |
200 | 189 | { | 189 | { |
201 | 190 | // The MD5 of the current file and the MD5 in RequiredFiles are the same. | 190 | // The MD5 of the current file and the MD5 in RequiredFiles are the same. |
202 | 191 | // Therefore make sure this MD5 is in the CacheManager | 191 | // Therefore make sure this MD5 is in the CacheManager |
203 | 192 | _cacheManager.Add(path, md5); | 192 | _cacheManager.Add(path, md5); |
204 | 193 | |||
205 | 194 | string[] filePart = path.Split('.'); | ||
206 | 195 | _requiredFiles.MarkComplete(int.Parse(filePart[0]), md5); | ||
207 | 193 | } | 196 | } |
208 | 194 | } | 197 | } |
209 | 195 | else | 198 | else |
210 | @@ -205,7 +208,7 @@ | |||
211 | 205 | fileList.md5 = attributes["md5"].Value; | 208 | fileList.md5 = attributes["md5"].Value; |
212 | 206 | fileList.retrys = 0; | 209 | fileList.retrys = 0; |
213 | 207 | 210 | ||
215 | 208 | files.Add(fileList); | 211 | _files.Add(fileList); |
216 | 209 | } | 212 | } |
217 | 210 | } | 213 | } |
218 | 211 | else if (attributes["type"].Value == "blacklist") | 214 | else if (attributes["type"].Value == "blacklist") |
219 | @@ -234,6 +237,7 @@ | |||
220 | 234 | } | 237 | } |
221 | 235 | } | 238 | } |
222 | 236 | 239 | ||
223 | 240 | <<<<<<< TREE | ||
224 | 237 | Debug.WriteLine(String.Format("There are {0} files to get", files.Count.ToString())); | 241 | Debug.WriteLine(String.Format("There are {0} files to get", files.Count.ToString())); |
225 | 238 | 242 | ||
226 | 239 | // Output a list of the files we need to get | 243 | // Output a list of the files we need to get |
227 | @@ -243,9 +247,26 @@ | |||
228 | 243 | debugMessage += string.Format("File: {0}, Type: {1}, MD5: {2}. ", fileToGet.path, fileToGet.type, fileToGet.md5); | 247 | debugMessage += string.Format("File: {0}, Type: {1}, MD5: {2}. ", fileToGet.path, fileToGet.type, fileToGet.md5); |
229 | 244 | 248 | ||
230 | 245 | Debug.WriteLine(debugMessage); | 249 | Debug.WriteLine(debugMessage); |
231 | 250 | ======= | ||
232 | 251 | Debug.WriteLine(String.Format("There are {0} files to get", _files.Count.ToString())); | ||
233 | 252 | |||
234 | 253 | // Output a list of the files we need to get | ||
235 | 254 | string debugMessage = ""; | ||
236 | 255 | |||
237 | 256 | foreach (RequiredFile fileToGet in _files) | ||
238 | 257 | debugMessage += string.Format("File: {0}, Type: {1}, MD5: {2}. ", fileToGet.path, fileToGet.type, fileToGet.md5); | ||
239 | 258 | |||
240 | 259 | Debug.WriteLine(debugMessage); | ||
241 | 260 | |||
242 | 261 | // Report the files files back to XMDS | ||
243 | 262 | _requiredFiles.ReportInventory(); | ||
244 | 263 | |||
245 | 264 | // Write Required Files | ||
246 | 265 | _requiredFiles.WriteRequiredFiles(); | ||
247 | 266 | >>>>>>> MERGE-SOURCE | ||
248 | 246 | 267 | ||
249 | 247 | // Is there anything to get? | 268 | // Is there anything to get? |
251 | 248 | if (files.Count == 0) | 269 | if (_files.Count == 0) |
252 | 249 | { | 270 | { |
253 | 250 | CollectionComplete(); | 271 | CollectionComplete(); |
254 | 251 | return; | 272 | return; |
255 | @@ -255,7 +276,7 @@ | |||
256 | 255 | _currentFile = 0; | 276 | _currentFile = 0; |
257 | 256 | 277 | ||
258 | 257 | // Preload the first filelist | 278 | // Preload the first filelist |
260 | 258 | _currentFileList = files[_currentFile]; | 279 | _currentFileList = _files[_currentFile]; |
261 | 259 | 280 | ||
262 | 260 | // Get the first file | 281 | // Get the first file |
263 | 261 | GetFile(); | 282 | GetFile(); |
264 | @@ -375,6 +396,10 @@ | |||
265 | 375 | { | 396 | { |
266 | 376 | // Add to the CacheManager | 397 | // Add to the CacheManager |
267 | 377 | _cacheManager.Add(_currentFileList.path + ".xlf", md5sum); | 398 | _cacheManager.Add(_currentFileList.path + ".xlf", md5sum); |
268 | 399 | |||
269 | 400 | // Report this completion back to XMDS | ||
270 | 401 | _requiredFiles.MarkComplete(int.Parse(_currentFileList.path), md5sum); | ||
271 | 402 | _requiredFiles.ReportInventory(); | ||
272 | 378 | } | 403 | } |
273 | 379 | 404 | ||
274 | 380 | // Fire a layout complete event | 405 | // Fire a layout complete event |
275 | @@ -445,6 +470,11 @@ | |||
276 | 445 | 470 | ||
277 | 446 | System.Diagnostics.Debug.WriteLine(string.Format("File downloaded: {0}", _currentFileList.path)); | 471 | System.Diagnostics.Debug.WriteLine(string.Format("File downloaded: {0}", _currentFileList.path)); |
278 | 447 | 472 | ||
279 | 473 | // Report this completion back to XMDS | ||
280 | 474 | string[] filePart = _currentFileList.path.Split('.'); | ||
281 | 475 | _requiredFiles.MarkComplete(int.Parse(filePart[0]), md5sum); | ||
282 | 476 | _requiredFiles.ReportInventory(); | ||
283 | 477 | |||
284 | 448 | // All the file has been recieved. Move on to the next file. | 478 | // All the file has been recieved. Move on to the next file. |
285 | 449 | _currentFile++; | 479 | _currentFile++; |
286 | 450 | } | 480 | } |
287 | @@ -475,13 +505,16 @@ | |||
288 | 475 | /// </summary> | 505 | /// </summary> |
289 | 476 | public void GetFile() | 506 | public void GetFile() |
290 | 477 | { | 507 | { |
292 | 478 | if (_currentFile > (files.Count - 1)) | 508 | if (_currentFile > (_files.Count - 1)) |
293 | 479 | { | 509 | { |
295 | 480 | System.Diagnostics.Debug.WriteLine(String.Format("Finished Recieving {0} files", files.Count)); | 510 | System.Diagnostics.Debug.WriteLine(String.Format("Finished Receiving {0} files", _files.Count)); |
296 | 481 | 511 | ||
297 | 482 | // Clean up | 512 | // Clean up |
300 | 483 | files.Clear(); | 513 | _files.Clear(); |
301 | 484 | xmdsFile.Dispose(); | 514 | xmdsFile.Dispose(); |
302 | 515 | |||
303 | 516 | // Write Required Files | ||
304 | 517 | _requiredFiles.WriteRequiredFiles(); | ||
305 | 485 | 518 | ||
306 | 486 | // Finished getting this file list | 519 | // Finished getting this file list |
307 | 487 | CollectionComplete(); | 520 | CollectionComplete(); |
308 | @@ -491,7 +524,7 @@ | |||
309 | 491 | // Get the current file into the currentfilelist if the current one is finished | 524 | // Get the current file into the currentfilelist if the current one is finished |
310 | 492 | if (_currentFileList.complete) | 525 | if (_currentFileList.complete) |
311 | 493 | { | 526 | { |
313 | 494 | _currentFileList = files[_currentFile]; | 527 | _currentFileList = _files[_currentFile]; |
314 | 495 | } | 528 | } |
315 | 496 | 529 | ||
316 | 497 | System.Diagnostics.Debug.WriteLine(String.Format("Getting the file : {0} chunk : {1}", _currentFileList.path, _currentFileList.chunkOffset.ToString())); | 530 | System.Diagnostics.Debug.WriteLine(String.Format("Getting the file : {0} chunk : {1}", _currentFileList.path, _currentFileList.chunkOffset.ToString())); |
317 | @@ -504,7 +537,7 @@ | |||
318 | 504 | } | 537 | } |
319 | 505 | 538 | ||
320 | 506 | [Serializable] | 539 | [Serializable] |
322 | 507 | private struct FileList | 540 | private struct RequiredFile |
323 | 508 | { | 541 | { |
324 | 509 | public string path; | 542 | public string path; |
325 | 510 | public string type; | 543 | public string type; |
326 | @@ -519,9 +552,9 @@ | |||
327 | 519 | 552 | ||
328 | 520 | private XmlDocument xml; | 553 | private XmlDocument xml; |
329 | 521 | private HardwareKey hardwareKey; | 554 | private HardwareKey hardwareKey; |
331 | 522 | private Collection<FileList> files; | 555 | private Collection<RequiredFile> _files; |
332 | 523 | private int _currentFile; | 556 | private int _currentFile; |
334 | 524 | private FileList _currentFileList; | 557 | private RequiredFile _currentFileList; |
335 | 525 | private xmds.xmds xmdsFile; | 558 | private xmds.xmds xmdsFile; |
336 | 526 | 559 | ||
337 | 527 | public event LayoutFileChangedDelegate LayoutFileChanged; | 560 | public event LayoutFileChangedDelegate LayoutFileChanged; |
338 | 528 | 561 | ||
339 | === modified file 'client/dotNET/MainForm.cs' | |||
340 | --- client/dotNET/MainForm.cs 2011-01-30 18:13:32 +0000 | |||
341 | +++ client/dotNET/MainForm.cs 2011-03-03 10:16:18 +0000 | |||
342 | @@ -72,14 +72,45 @@ | |||
343 | 72 | 72 | ||
344 | 73 | _statLog = new StatLog(); | 73 | _statLog = new StatLog(); |
345 | 74 | 74 | ||
346 | 75 | this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing); | ||
347 | 76 | this.Shown += new EventHandler(MainForm_Shown); | ||
348 | 77 | } | ||
349 | 78 | |||
350 | 79 | /// <summary> | ||
351 | 80 | /// Called after the form has been shown | ||
352 | 81 | /// </summary> | ||
353 | 82 | /// <param name="sender"></param> | ||
354 | 83 | /// <param name="e"></param> | ||
355 | 84 | void MainForm_Shown(object sender, EventArgs e) | ||
356 | 85 | { | ||
357 | 86 | // Process any stuff that has happened during the loading process | ||
358 | 87 | Application.DoEvents(); | ||
359 | 88 | |||
360 | 75 | // Create a cachemanager | 89 | // Create a cachemanager |
361 | 76 | SetCacheManager(); | 90 | SetCacheManager(); |
362 | 77 | 91 | ||
364 | 78 | this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing); | 92 | try |
365 | 93 | { | ||
366 | 94 | // Create the Schedule | ||
367 | 95 | _schedule = new Schedule(Application.UserAppDataPath + "\\" + Properties.Settings.Default.ScheduleFile, ref _cacheManager); | ||
368 | 96 | |||
369 | 97 | // Bind to the schedule change event - notifys of changes to the schedule | ||
370 | 98 | _schedule.ScheduleChangeEvent += new Schedule.ScheduleChangeDelegate(schedule_ScheduleChangeEvent); | ||
371 | 99 | |||
372 | 100 | // Initialize the other schedule components | ||
373 | 101 | _schedule.InitializeComponents(); | ||
374 | 102 | } | ||
375 | 103 | catch (Exception ex) | ||
376 | 104 | { | ||
377 | 105 | Debug.WriteLine(ex.Message, LogType.Error.ToString()); | ||
378 | 106 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); | ||
379 | 107 | Close(); | ||
380 | 108 | Dispose(); | ||
381 | 109 | } | ||
382 | 79 | } | 110 | } |
383 | 80 | 111 | ||
384 | 81 | /// <summary> | 112 | /// <summary> |
386 | 82 | /// Called when the form has finished loading | 113 | /// Called before the form has loaded for the first time |
387 | 83 | /// </summary> | 114 | /// </summary> |
388 | 84 | /// <param name="sender"></param> | 115 | /// <param name="sender"></param> |
389 | 85 | /// <param name="e"></param> | 116 | /// <param name="e"></param> |
390 | @@ -96,30 +127,13 @@ | |||
391 | 96 | Cursor.Position = new Point(_clientSize.Width, _clientSize.Height); | 127 | Cursor.Position = new Point(_clientSize.Width, _clientSize.Height); |
392 | 97 | Cursor.Hide(); | 128 | Cursor.Hide(); |
393 | 98 | 129 | ||
394 | 130 | ShowSplashScreen(); | ||
395 | 131 | |||
396 | 99 | // Change the default Proxy class | 132 | // Change the default Proxy class |
397 | 100 | OptionForm.SetGlobalProxy(); | 133 | OptionForm.SetGlobalProxy(); |
398 | 101 | 134 | ||
399 | 102 | // UserApp data | 135 | // UserApp data |
400 | 103 | Debug.WriteLine(new LogMessage("MainForm_Load", "User AppData Path: " + Application.UserAppDataPath), LogType.Info.ToString()); | 136 | Debug.WriteLine(new LogMessage("MainForm_Load", "User AppData Path: " + Application.UserAppDataPath), LogType.Info.ToString()); |
401 | 104 | |||
402 | 105 | try | ||
403 | 106 | { | ||
404 | 107 | // Create the Schedule | ||
405 | 108 | _schedule = new Schedule(Application.UserAppDataPath + "\\" + Properties.Settings.Default.ScheduleFile, ref _cacheManager); | ||
406 | 109 | |||
407 | 110 | // Bind to the schedule change event - notifys of changes to the schedule | ||
408 | 111 | _schedule.ScheduleChangeEvent += new Schedule.ScheduleChangeDelegate(schedule_ScheduleChangeEvent); | ||
409 | 112 | |||
410 | 113 | // Initialize the other schedule components | ||
411 | 114 | _schedule.InitializeComponents(); | ||
412 | 115 | } | ||
413 | 116 | catch (Exception ex) | ||
414 | 117 | { | ||
415 | 118 | Debug.WriteLine(ex.Message, LogType.Error.ToString()); | ||
416 | 119 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); | ||
417 | 120 | Close(); | ||
418 | 121 | Dispose(); | ||
419 | 122 | } | ||
420 | 123 | } | 137 | } |
421 | 124 | 138 | ||
422 | 125 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) | 139 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) |
423 | @@ -152,11 +166,20 @@ | |||
424 | 152 | } | 166 | } |
425 | 153 | catch (Exception ex) | 167 | catch (Exception ex) |
426 | 154 | { | 168 | { |
428 | 155 | Trace.WriteLine(new LogMessage("Schedule", "Unable to reuse the Cache Manager because: " + ex.Message)); | 169 | Trace.WriteLine(new LogMessage("MainForm - SetCacheManager", "Unable to reuse the Cache Manager because: " + ex.Message)); |
429 | 156 | 170 | ||
430 | 157 | // Create a new cache manager | 171 | // Create a new cache manager |
431 | 158 | _cacheManager = new CacheManager(); | 172 | _cacheManager = new CacheManager(); |
432 | 159 | } | 173 | } |
433 | 174 | |||
434 | 175 | try | ||
435 | 176 | { | ||
436 | 177 | _cacheManager.Regenerate(); | ||
437 | 178 | } | ||
438 | 179 | catch (Exception ex) | ||
439 | 180 | { | ||
440 | 181 | Trace.WriteLine(new LogMessage("MainForm - SetCacheManager", "Regenerate failed because: " + ex.Message)); | ||
441 | 182 | } | ||
442 | 160 | } | 183 | } |
443 | 161 | 184 | ||
444 | 162 | /// <summary> | 185 | /// <summary> |
445 | 163 | 186 | ||
446 | === modified file 'client/dotNET/Properties/Settings.Designer.cs' | |||
447 | --- client/dotNET/Properties/Settings.Designer.cs 2010-11-09 21:23:31 +0000 | |||
448 | +++ client/dotNET/Properties/Settings.Designer.cs 2011-03-03 10:16:18 +0000 | |||
449 | @@ -271,7 +271,7 @@ | |||
450 | 271 | 271 | ||
451 | 272 | [global::System.Configuration.ApplicationScopedSettingAttribute()] | 272 | [global::System.Configuration.ApplicationScopedSettingAttribute()] |
452 | 273 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | 273 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
454 | 274 | [global::System.Configuration.DefaultSettingValueAttribute("1.2.0")] | 274 | [global::System.Configuration.DefaultSettingValueAttribute("1.2.2")] |
455 | 275 | public string ClientVersion { | 275 | public string ClientVersion { |
456 | 276 | get { | 276 | get { |
457 | 277 | return ((string)(this["ClientVersion"])); | 277 | return ((string)(this["ClientVersion"])); |
458 | @@ -370,5 +370,17 @@ | |||
459 | 370 | this["emptyLayoutDuration"] = value; | 370 | this["emptyLayoutDuration"] = value; |
460 | 371 | } | 371 | } |
461 | 372 | } | 372 | } |
462 | 373 | |||
463 | 374 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
464 | 375 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
465 | 376 | [global::System.Configuration.DefaultSettingValueAttribute("requiredFiles.xml")] | ||
466 | 377 | public string RequiredFilesFile { | ||
467 | 378 | get { | ||
468 | 379 | return ((string)(this["RequiredFilesFile"])); | ||
469 | 380 | } | ||
470 | 381 | set { | ||
471 | 382 | this["RequiredFilesFile"] = value; | ||
472 | 383 | } | ||
473 | 384 | } | ||
474 | 373 | } | 385 | } |
475 | 374 | } | 386 | } |
476 | 375 | 387 | ||
477 | === modified file 'client/dotNET/Properties/Settings.settings' | |||
478 | --- client/dotNET/Properties/Settings.settings 2010-11-09 21:23:31 +0000 | |||
479 | +++ client/dotNET/Properties/Settings.settings 2011-03-03 10:16:18 +0000 | |||
480 | @@ -69,7 +69,7 @@ | |||
481 | 69 | <Value Profile="(Default)">cacheManager.xml</Value> | 69 | <Value Profile="(Default)">cacheManager.xml</Value> |
482 | 70 | </Setting> | 70 | </Setting> |
483 | 71 | <Setting Name="ClientVersion" Type="System.String" Scope="Application"> | 71 | <Setting Name="ClientVersion" Type="System.String" Scope="Application"> |
485 | 72 | <Value Profile="(Default)">1.2.0</Value> | 72 | <Value Profile="(Default)">1.2.2</Value> |
486 | 73 | </Setting> | 73 | </Setting> |
487 | 74 | <Setting Name="scrollStepAmount" Type="System.Decimal" Scope="User"> | 74 | <Setting Name="scrollStepAmount" Type="System.Decimal" Scope="User"> |
488 | 75 | <Value Profile="(Default)">1</Value> | 75 | <Value Profile="(Default)">1</Value> |
489 | @@ -95,5 +95,8 @@ | |||
490 | 95 | <Setting Name="emptyLayoutDuration" Type="System.Decimal" Scope="User"> | 95 | <Setting Name="emptyLayoutDuration" Type="System.Decimal" Scope="User"> |
491 | 96 | <Value Profile="(Default)">10</Value> | 96 | <Value Profile="(Default)">10</Value> |
492 | 97 | </Setting> | 97 | </Setting> |
493 | 98 | <Setting Name="RequiredFilesFile" Type="System.String" Scope="User"> | ||
494 | 99 | <Value Profile="(Default)">requiredFiles.xml</Value> | ||
495 | 100 | </Setting> | ||
496 | 98 | </Settings> | 101 | </Settings> |
497 | 99 | </SettingsFile> | 102 | </SettingsFile> |
498 | 100 | \ No newline at end of file | 103 | \ No newline at end of file |
499 | 101 | 104 | ||
500 | === modified file 'client/dotNET/Region.cs' | |||
501 | --- client/dotNET/Region.cs 2010-11-09 21:23:31 +0000 | |||
502 | +++ client/dotNET/Region.cs 2011-03-03 10:16:18 +0000 | |||
503 | @@ -309,6 +309,7 @@ | |||
504 | 309 | System.Diagnostics.Trace.WriteLine("Duration is Empty, using a default of 60.", "Region - SetNextMediaNode"); | 309 | System.Diagnostics.Trace.WriteLine("Duration is Empty, using a default of 60.", "Region - SetNextMediaNode"); |
505 | 310 | } | 310 | } |
506 | 311 | 311 | ||
507 | 312 | <<<<<<< TREE | ||
508 | 312 | // We cannot have a 0 duration here... not sure why we would... but | 313 | // We cannot have a 0 duration here... not sure why we would... but |
509 | 313 | if (options.duration == 0) | 314 | if (options.duration == 0) |
510 | 314 | options.duration = int.Parse(Properties.Settings.Default.emptyLayoutDuration.ToString()); | 315 | options.duration = int.Parse(Properties.Settings.Default.emptyLayoutDuration.ToString()); |
511 | @@ -317,6 +318,15 @@ | |||
512 | 317 | if (options.duration == 0) | 318 | if (options.duration == 0) |
513 | 318 | options.duration = 10; | 319 | options.duration = 10; |
514 | 319 | 320 | ||
515 | 321 | ======= | ||
516 | 322 | // We cannot have a 0 duration here... not sure why we would... but | ||
517 | 323 | if (options.duration == 0 && options.type != "video") | ||
518 | 324 | { | ||
519 | 325 | int emptyLayoutDuration = int.Parse(Properties.Settings.Default.emptyLayoutDuration.ToString()); | ||
520 | 326 | options.duration = (emptyLayoutDuration == 0) ? 10 : emptyLayoutDuration; | ||
521 | 327 | } | ||
522 | 328 | |||
523 | 329 | >>>>>>> MERGE-SOURCE | ||
524 | 320 | // There will be some stuff on option nodes | 330 | // There will be some stuff on option nodes |
525 | 321 | XmlNode optionNode = mediaNode.FirstChild; | 331 | XmlNode optionNode = mediaNode.FirstChild; |
526 | 322 | 332 | ||
527 | @@ -386,7 +396,7 @@ | |||
528 | 386 | if (options.type == "video" || options.type == "flash" || options.type == "image" || options.type == "powerpoint") | 396 | if (options.type == "video" || options.type == "flash" || options.type == "image" || options.type == "powerpoint") |
529 | 387 | { | 397 | { |
530 | 388 | // Use the cache manager to determine if the file is valid | 398 | // Use the cache manager to determine if the file is valid |
532 | 389 | validNode = _cacheManager.IsValid(options.uri); | 399 | validNode = _cacheManager.IsValidPath(options.uri); |
533 | 390 | } | 400 | } |
534 | 391 | } | 401 | } |
535 | 392 | 402 | ||
536 | 393 | 403 | ||
537 | === added file 'client/dotNET/RequiredFiles.cs' | |||
538 | --- client/dotNET/RequiredFiles.cs 1970-01-01 00:00:00 +0000 | |||
539 | +++ client/dotNET/RequiredFiles.cs 2011-03-03 10:16:18 +0000 | |||
540 | @@ -0,0 +1,206 @@ | |||
541 | 1 | /* | ||
542 | 2 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
543 | 3 | * Copyright (C) 2011 Daniel Garner | ||
544 | 4 | * | ||
545 | 5 | * This file is part of Xibo. | ||
546 | 6 | * | ||
547 | 7 | * Xibo is free software: you can redistribute it and/or modify | ||
548 | 8 | * it under the terms of the GNU Affero General Public License as published by | ||
549 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
550 | 10 | * any later version. | ||
551 | 11 | * | ||
552 | 12 | * Xibo is distributed in the hope that it will be useful, | ||
553 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
554 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
555 | 15 | * GNU Affero General Public License for more details. | ||
556 | 16 | * | ||
557 | 17 | * You should have received a copy of the GNU Affero General Public License | ||
558 | 18 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
559 | 19 | */ | ||
560 | 20 | using System; | ||
561 | 21 | using System.Collections.Generic; | ||
562 | 22 | using System.Collections.ObjectModel; | ||
563 | 23 | using System.Text; | ||
564 | 24 | using System.IO; | ||
565 | 25 | using System.Security.Cryptography; | ||
566 | 26 | using System.Xml; | ||
567 | 27 | using System.Diagnostics; | ||
568 | 28 | using System.Windows.Forms; | ||
569 | 29 | using System.Xml.Serialization; | ||
570 | 30 | |||
571 | 31 | namespace XiboClient | ||
572 | 32 | { | ||
573 | 33 | public class RequiredFiles | ||
574 | 34 | { | ||
575 | 35 | private XmlDocument _requiredFilesXml; | ||
576 | 36 | public Collection<RequiredFile> _requiredFiles; | ||
577 | 37 | private xmds.xmds _report; | ||
578 | 38 | |||
579 | 39 | public RequiredFiles() | ||
580 | 40 | { | ||
581 | 41 | _requiredFiles = new Collection<RequiredFile>(); | ||
582 | 42 | |||
583 | 43 | // Create a webservice call | ||
584 | 44 | _report = new XiboClient.xmds.xmds(); | ||
585 | 45 | |||
586 | 46 | // Start up the Xmds Service Object | ||
587 | 47 | _report.Credentials = null; | ||
588 | 48 | _report.Url = Properties.Settings.Default.XiboClient_xmds_xmds; | ||
589 | 49 | _report.UseDefaultCredentials = false; | ||
590 | 50 | } | ||
591 | 51 | |||
592 | 52 | /// <summary> | ||
593 | 53 | /// Set required files from the XML document | ||
594 | 54 | /// </summary> | ||
595 | 55 | private void SetRequiredFiles() | ||
596 | 56 | { | ||
597 | 57 | // Itterate through the RF XML and populate the RF collection | ||
598 | 58 | XmlNodeList fileNodes = _requiredFilesXml.SelectNodes("/files/file"); | ||
599 | 59 | |||
600 | 60 | foreach (XmlNode file in fileNodes) | ||
601 | 61 | { | ||
602 | 62 | RequiredFile rf = new RequiredFile(); | ||
603 | 63 | |||
604 | 64 | XmlAttributeCollection attributes = file.Attributes; | ||
605 | 65 | |||
606 | 66 | rf.FileType = attributes["type"].Value; | ||
607 | 67 | rf.Complete = 0; | ||
608 | 68 | rf.Md5 = ""; | ||
609 | 69 | rf.LastChecked = DateTime.Now; | ||
610 | 70 | |||
611 | 71 | if (rf.FileType == "media") | ||
612 | 72 | { | ||
613 | 73 | string[] filePart = attributes["path"].Value.Split('.'); | ||
614 | 74 | rf.Id = int.Parse(filePart[0]); | ||
615 | 75 | rf.Path = attributes["path"].Value; | ||
616 | 76 | } | ||
617 | 77 | else if (rf.FileType == "layout") | ||
618 | 78 | { | ||
619 | 79 | rf.Id = int.Parse(attributes["path"].Value); | ||
620 | 80 | rf.Path = attributes["path"].Value + ".xlf"; | ||
621 | 81 | } | ||
622 | 82 | else | ||
623 | 83 | { | ||
624 | 84 | continue; | ||
625 | 85 | } | ||
626 | 86 | |||
627 | 87 | _requiredFiles.Add(rf); | ||
628 | 88 | } | ||
629 | 89 | } | ||
630 | 90 | |||
631 | 91 | /// <summary> | ||
632 | 92 | /// Required Files XML | ||
633 | 93 | /// </summary> | ||
634 | 94 | public XmlDocument RequiredFilesXml | ||
635 | 95 | { | ||
636 | 96 | set | ||
637 | 97 | { | ||
638 | 98 | _requiredFilesXml = value; | ||
639 | 99 | SetRequiredFiles(); | ||
640 | 100 | } | ||
641 | 101 | } | ||
642 | 102 | |||
643 | 103 | /// <summary> | ||
644 | 104 | /// Mark a RequiredFile as complete | ||
645 | 105 | /// </summary> | ||
646 | 106 | /// <param name="id"></param> | ||
647 | 107 | /// <param name="md5"></param> | ||
648 | 108 | public void MarkComplete(int id, string md5) | ||
649 | 109 | { | ||
650 | 110 | foreach (RequiredFile rf in _requiredFiles) | ||
651 | 111 | { | ||
652 | 112 | if (rf.Id == id) | ||
653 | 113 | { | ||
654 | 114 | RequiredFile newRf = rf; | ||
655 | 115 | |||
656 | 116 | newRf.Complete = 1; | ||
657 | 117 | newRf.Md5 = md5; | ||
658 | 118 | |||
659 | 119 | |||
660 | 120 | _requiredFiles.Add(newRf); | ||
661 | 121 | _requiredFiles.Remove(rf); | ||
662 | 122 | |||
663 | 123 | return; | ||
664 | 124 | } | ||
665 | 125 | } | ||
666 | 126 | } | ||
667 | 127 | |||
668 | 128 | /// <summary> | ||
669 | 129 | /// Mark a RequiredFile as incomplete | ||
670 | 130 | /// </summary> | ||
671 | 131 | /// <param name="id"></param> | ||
672 | 132 | /// <param name="md5"></param> | ||
673 | 133 | public void MarkIncomplete(int id, string md5) | ||
674 | 134 | { | ||
675 | 135 | foreach (RequiredFile rf in _requiredFiles) | ||
676 | 136 | { | ||
677 | 137 | if (rf.Id == id) | ||
678 | 138 | { | ||
679 | 139 | RequiredFile newRf = rf; | ||
680 | 140 | |||
681 | 141 | newRf.Complete = 0; | ||
682 | 142 | newRf.Md5 = md5; | ||
683 | 143 | |||
684 | 144 | _requiredFiles.Add(newRf); | ||
685 | 145 | _requiredFiles.Remove(rf); | ||
686 | 146 | |||
687 | 147 | return; | ||
688 | 148 | } | ||
689 | 149 | } | ||
690 | 150 | } | ||
691 | 151 | |||
692 | 152 | /// <summary> | ||
693 | 153 | /// Writes Required Files to disk | ||
694 | 154 | /// </summary> | ||
695 | 155 | public void WriteRequiredFiles() | ||
696 | 156 | { | ||
697 | 157 | Debug.WriteLine(new LogMessage("RequiredFiles - WriteRequiredFiles", "About to Write RequiredFiles"), LogType.Info.ToString()); | ||
698 | 158 | |||
699 | 159 | try | ||
700 | 160 | { | ||
701 | 161 | using (StreamWriter streamWriter = new StreamWriter(Application.UserAppDataPath + "\\" + Properties.Settings.Default.RequiredFilesFile)) | ||
702 | 162 | { | ||
703 | 163 | XmlSerializer xmlSerializer = new XmlSerializer(typeof(RequiredFiles)); | ||
704 | 164 | |||
705 | 165 | xmlSerializer.Serialize(streamWriter, this); | ||
706 | 166 | } | ||
707 | 167 | } | ||
708 | 168 | catch (Exception ex) | ||
709 | 169 | { | ||
710 | 170 | System.Diagnostics.Trace.WriteLine(new LogMessage("RequiredFiles - WriteRequiredFiles", "Unable to write RequiredFiles to disk because: " + ex.Message)); | ||
711 | 171 | } | ||
712 | 172 | } | ||
713 | 173 | |||
714 | 174 | /// <summary> | ||
715 | 175 | /// Report Required Files to XMDS | ||
716 | 176 | /// </summary> | ||
717 | 177 | public void ReportInventory() | ||
718 | 178 | { | ||
719 | 179 | HardwareKey hardwareKey = new HardwareKey(); | ||
720 | 180 | |||
721 | 181 | // Build the XML required by media file | ||
722 | 182 | string xml = ""; | ||
723 | 183 | |||
724 | 184 | foreach (RequiredFile rf in _requiredFiles) | ||
725 | 185 | { | ||
726 | 186 | xml += string.Format("<file type=\"{0}\" id=\"{1}\" complete=\"{2}\" lastChecked=\"{3}\" md5=\"{4}\" />", | ||
727 | 187 | rf.FileType, rf.Id.ToString(), rf.Complete.ToString(), rf.LastChecked.ToString(), rf.Md5); | ||
728 | 188 | } | ||
729 | 189 | |||
730 | 190 | xml = string.Format("<files>{0}</files>", xml); | ||
731 | 191 | |||
732 | 192 | _report.MediaInventoryAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, | ||
733 | 193 | hardwareKey.Key, xml); | ||
734 | 194 | } | ||
735 | 195 | } | ||
736 | 196 | |||
737 | 197 | public struct RequiredFile | ||
738 | 198 | { | ||
739 | 199 | public string FileType; | ||
740 | 200 | public int Id; | ||
741 | 201 | public int Complete; | ||
742 | 202 | public DateTime LastChecked; | ||
743 | 203 | public string Md5; | ||
744 | 204 | public string Path; | ||
745 | 205 | } | ||
746 | 206 | } | ||
747 | 0 | 207 | ||
748 | === modified file 'client/dotNET/Schedule.cs' | |||
749 | --- client/dotNET/Schedule.cs 2010-08-22 16:49:09 +0000 | |||
750 | +++ client/dotNET/Schedule.cs 2011-03-03 10:16:18 +0000 | |||
751 | @@ -74,7 +74,7 @@ | |||
752 | 74 | _cacheManager = cacheManager; | 74 | _cacheManager = cacheManager; |
753 | 75 | 75 | ||
754 | 76 | // Create a schedule manager | 76 | // Create a schedule manager |
756 | 77 | _scheduleManager = new ScheduleManager(scheduleLocation); | 77 | _scheduleManager = new ScheduleManager(_cacheManager, scheduleLocation); |
757 | 78 | 78 | ||
758 | 79 | // Create a new Xmds service object | 79 | // Create a new Xmds service object |
759 | 80 | _xmds2 = new XiboClient.xmds.xmds(); | 80 | _xmds2 = new XiboClient.xmds.xmds(); |
760 | 81 | 81 | ||
761 | === modified file 'client/dotNET/ScheduleManager.cs' | |||
762 | --- client/dotNET/ScheduleManager.cs 2010-08-25 21:39:53 +0000 | |||
763 | +++ client/dotNET/ScheduleManager.cs 2011-03-03 10:16:18 +0000 | |||
764 | @@ -42,13 +42,15 @@ | |||
765 | 42 | private Collection<LayoutSchedule> _layoutSchedule; | 42 | private Collection<LayoutSchedule> _layoutSchedule; |
766 | 43 | private Collection<LayoutSchedule> _currentSchedule; | 43 | private Collection<LayoutSchedule> _currentSchedule; |
767 | 44 | private bool _refreshSchedule; | 44 | private bool _refreshSchedule; |
768 | 45 | private CacheManager _cacheManager; | ||
769 | 45 | 46 | ||
770 | 46 | /// <summary> | 47 | /// <summary> |
771 | 47 | /// Creates a new schedule Manager | 48 | /// Creates a new schedule Manager |
772 | 48 | /// </summary> | 49 | /// </summary> |
773 | 49 | /// <param name="scheduleLocation"></param> | 50 | /// <param name="scheduleLocation"></param> |
775 | 50 | public ScheduleManager(string scheduleLocation) | 51 | public ScheduleManager(CacheManager cacheManager, string scheduleLocation) |
776 | 51 | { | 52 | { |
777 | 53 | _cacheManager = cacheManager; | ||
778 | 52 | _location = scheduleLocation; | 54 | _location = scheduleLocation; |
779 | 53 | 55 | ||
780 | 54 | // Create an empty layout schedule | 56 | // Create an empty layout schedule |
781 | @@ -178,6 +180,19 @@ | |||
782 | 178 | // For each layout in the schedule determine if it is currently inside the _currentSchedule, and whether it should be | 180 | // For each layout in the schedule determine if it is currently inside the _currentSchedule, and whether it should be |
783 | 179 | foreach (LayoutSchedule layout in _layoutSchedule) | 181 | foreach (LayoutSchedule layout in _layoutSchedule) |
784 | 180 | { | 182 | { |
785 | 183 | // Is the layout valid in the cachemanager? | ||
786 | 184 | try | ||
787 | 185 | { | ||
788 | 186 | if (!_cacheManager.IsValidLayout(layout.id + ".xlf")) | ||
789 | 187 | continue; | ||
790 | 188 | } | ||
791 | 189 | catch | ||
792 | 190 | { | ||
793 | 191 | // TODO: Ignore this layout.. raise an error? | ||
794 | 192 | Trace.WriteLine("Unable to determine if layout is valid or not"); | ||
795 | 193 | continue; | ||
796 | 194 | } | ||
797 | 195 | |||
798 | 181 | // If this is the default, skip it | 196 | // If this is the default, skip it |
799 | 182 | if (layout.NodeName == "default") | 197 | if (layout.NodeName == "default") |
800 | 183 | { | 198 | { |
801 | 184 | 199 | ||
802 | === modified file 'client/dotNET/Web References/xmds/Reference.cs' | |||
803 | --- client/dotNET/Web References/xmds/Reference.cs 2010-11-09 21:23:31 +0000 | |||
804 | +++ client/dotNET/Web References/xmds/Reference.cs 2011-03-03 10:16:18 +0000 | |||
805 | @@ -45,6 +45,8 @@ | |||
806 | 45 | 45 | ||
807 | 46 | private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted; | 46 | private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted; |
808 | 47 | 47 | ||
809 | 48 | private System.Threading.SendOrPostCallback MediaInventoryOperationCompleted; | ||
810 | 49 | |||
811 | 48 | private bool useDefaultCredentialsSetExplicitly; | 50 | private bool useDefaultCredentialsSetExplicitly; |
812 | 49 | 51 | ||
813 | 50 | /// <remarks/> | 52 | /// <remarks/> |
814 | @@ -108,6 +110,9 @@ | |||
815 | 108 | public event SubmitStatsCompletedEventHandler SubmitStatsCompleted; | 110 | public event SubmitStatsCompletedEventHandler SubmitStatsCompleted; |
816 | 109 | 111 | ||
817 | 110 | /// <remarks/> | 112 | /// <remarks/> |
818 | 113 | public event MediaInventoryCompletedEventHandler MediaInventoryCompleted; | ||
819 | 114 | |||
820 | 115 | /// <remarks/> | ||
821 | 111 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#RegisterDisplay", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | 116 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#RegisterDisplay", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] |
822 | 112 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] | 117 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] |
823 | 113 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { | 118 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { |
824 | @@ -402,6 +407,42 @@ | |||
825 | 402 | } | 407 | } |
826 | 403 | 408 | ||
827 | 404 | /// <remarks/> | 409 | /// <remarks/> |
828 | 410 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#MediaInventory", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | ||
829 | 411 | [return: System.Xml.Serialization.SoapElementAttribute("success")] | ||
830 | 412 | public bool MediaInventory(string version, string serverKey, string hardwareKey, [System.Xml.Serialization.SoapElementAttribute("mediaInventory")] string mediaInventory1) { | ||
831 | 413 | object[] results = this.Invoke("MediaInventory", new object[] { | ||
832 | 414 | version, | ||
833 | 415 | serverKey, | ||
834 | 416 | hardwareKey, | ||
835 | 417 | mediaInventory1}); | ||
836 | 418 | return ((bool)(results[0])); | ||
837 | 419 | } | ||
838 | 420 | |||
839 | 421 | /// <remarks/> | ||
840 | 422 | public void MediaInventoryAsync(string version, string serverKey, string hardwareKey, string mediaInventory1) { | ||
841 | 423 | this.MediaInventoryAsync(version, serverKey, hardwareKey, mediaInventory1, null); | ||
842 | 424 | } | ||
843 | 425 | |||
844 | 426 | /// <remarks/> | ||
845 | 427 | public void MediaInventoryAsync(string version, string serverKey, string hardwareKey, string mediaInventory1, object userState) { | ||
846 | 428 | if ((this.MediaInventoryOperationCompleted == null)) { | ||
847 | 429 | this.MediaInventoryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMediaInventoryOperationCompleted); | ||
848 | 430 | } | ||
849 | 431 | this.InvokeAsync("MediaInventory", new object[] { | ||
850 | 432 | version, | ||
851 | 433 | serverKey, | ||
852 | 434 | hardwareKey, | ||
853 | 435 | mediaInventory1}, this.MediaInventoryOperationCompleted, userState); | ||
854 | 436 | } | ||
855 | 437 | |||
856 | 438 | private void OnMediaInventoryOperationCompleted(object arg) { | ||
857 | 439 | if ((this.MediaInventoryCompleted != null)) { | ||
858 | 440 | System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); | ||
859 | 441 | this.MediaInventoryCompleted(this, new MediaInventoryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); | ||
860 | 442 | } | ||
861 | 443 | } | ||
862 | 444 | |||
863 | 445 | /// <remarks/> | ||
864 | 405 | public new void CancelAsync(object userState) { | 446 | public new void CancelAsync(object userState) { |
865 | 406 | base.CancelAsync(userState); | 447 | base.CancelAsync(userState); |
866 | 407 | } | 448 | } |
867 | @@ -627,6 +668,32 @@ | |||
868 | 627 | } | 668 | } |
869 | 628 | } | 669 | } |
870 | 629 | } | 670 | } |
871 | 671 | |||
872 | 672 | /// <remarks/> | ||
873 | 673 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")] | ||
874 | 674 | public delegate void MediaInventoryCompletedEventHandler(object sender, MediaInventoryCompletedEventArgs e); | ||
875 | 675 | |||
876 | 676 | /// <remarks/> | ||
877 | 677 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")] | ||
878 | 678 | [System.Diagnostics.DebuggerStepThroughAttribute()] | ||
879 | 679 | [System.ComponentModel.DesignerCategoryAttribute("code")] | ||
880 | 680 | public partial class MediaInventoryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { | ||
881 | 681 | |||
882 | 682 | private object[] results; | ||
883 | 683 | |||
884 | 684 | internal MediaInventoryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | ||
885 | 685 | base(exception, cancelled, userState) { | ||
886 | 686 | this.results = results; | ||
887 | 687 | } | ||
888 | 688 | |||
889 | 689 | /// <remarks/> | ||
890 | 690 | public bool Result { | ||
891 | 691 | get { | ||
892 | 692 | this.RaiseExceptionIfNecessary(); | ||
893 | 693 | return ((bool)(this.results[0])); | ||
894 | 694 | } | ||
895 | 695 | } | ||
896 | 696 | } | ||
897 | 630 | } | 697 | } |
898 | 631 | 698 | ||
899 | 632 | #pragma warning restore 1591 | 699 | #pragma warning restore 1591 |
900 | 633 | \ No newline at end of file | 700 | \ No newline at end of file |
901 | 634 | 701 | ||
902 | === modified file 'client/dotNET/Web References/xmds/xmds.wsdl' | |||
903 | --- client/dotNET/Web References/xmds/xmds.wsdl 2010-11-09 21:23:31 +0000 | |||
904 | +++ client/dotNET/Web References/xmds/xmds.wsdl 2011-03-03 10:16:18 +0000 | |||
905 | @@ -81,6 +81,15 @@ | |||
906 | 81 | <wsdl:message name="SubmitStatsResponse"> | 81 | <wsdl:message name="SubmitStatsResponse"> |
907 | 82 | <wsdl:part name="success" type="xsd:boolean" /> | 82 | <wsdl:part name="success" type="xsd:boolean" /> |
908 | 83 | </wsdl:message> | 83 | </wsdl:message> |
909 | 84 | <wsdl:message name="MediaInventoryRequest"> | ||
910 | 85 | <wsdl:part name="version" type="xsd:string" /> | ||
911 | 86 | <wsdl:part name="serverKey" type="xsd:string" /> | ||
912 | 87 | <wsdl:part name="hardwareKey" type="xsd:string" /> | ||
913 | 88 | <wsdl:part name="mediaInventory" type="xsd:string" /> | ||
914 | 89 | </wsdl:message> | ||
915 | 90 | <wsdl:message name="MediaInventoryResponse"> | ||
916 | 91 | <wsdl:part name="success" type="xsd:boolean" /> | ||
917 | 92 | </wsdl:message> | ||
918 | 84 | <wsdl:portType name="xmdsPortType"> | 93 | <wsdl:portType name="xmdsPortType"> |
919 | 85 | <wsdl:operation name="RegisterDisplay"> | 94 | <wsdl:operation name="RegisterDisplay"> |
920 | 86 | <documentation>Registered the Display on the Xibo Network</documentation> | 95 | <documentation>Registered the Display on the Xibo Network</documentation> |
921 | @@ -122,6 +131,11 @@ | |||
922 | 122 | <wsdl:input message="tns:SubmitStatsRequest" /> | 131 | <wsdl:input message="tns:SubmitStatsRequest" /> |
923 | 123 | <wsdl:output message="tns:SubmitStatsResponse" /> | 132 | <wsdl:output message="tns:SubmitStatsResponse" /> |
924 | 124 | </wsdl:operation> | 133 | </wsdl:operation> |
925 | 134 | <wsdl:operation name="MediaInventory"> | ||
926 | 135 | <documentation>Report back the clients MediaInventory</documentation> | ||
927 | 136 | <wsdl:input message="tns:MediaInventoryRequest" /> | ||
928 | 137 | <wsdl:output message="tns:MediaInventoryResponse" /> | ||
929 | 138 | </wsdl:operation> | ||
930 | 125 | </wsdl:portType> | 139 | </wsdl:portType> |
931 | 126 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> | 140 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> |
932 | 127 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> | 141 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> |
933 | @@ -197,6 +211,15 @@ | |||
934 | 197 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | 211 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> |
935 | 198 | </wsdl:output> | 212 | </wsdl:output> |
936 | 199 | </wsdl:operation> | 213 | </wsdl:operation> |
937 | 214 | <wsdl:operation name="MediaInventory"> | ||
938 | 215 | <soap:operation soapAction="urn:xmds#MediaInventory" style="rpc" /> | ||
939 | 216 | <wsdl:input> | ||
940 | 217 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
941 | 218 | </wsdl:input> | ||
942 | 219 | <wsdl:output> | ||
943 | 220 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
944 | 221 | </wsdl:output> | ||
945 | 222 | </wsdl:operation> | ||
946 | 200 | </wsdl:binding> | 223 | </wsdl:binding> |
947 | 201 | <wsdl:service name="xmds"> | 224 | <wsdl:service name="xmds"> |
948 | 202 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> | 225 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> |
949 | 203 | 226 | ||
950 | === modified file 'client/dotNET/XiboClient.csproj' | |||
951 | --- client/dotNET/XiboClient.csproj 2011-02-09 17:15:43 +0000 | |||
952 | +++ client/dotNET/XiboClient.csproj 2011-03-03 10:16:18 +0000 | |||
953 | @@ -161,6 +161,7 @@ | |||
954 | 161 | <Compile Include="Region.cs"> | 161 | <Compile Include="Region.cs"> |
955 | 162 | <SubType>Component</SubType> | 162 | <SubType>Component</SubType> |
956 | 163 | </Compile> | 163 | </Compile> |
957 | 164 | <Compile Include="RequiredFiles.cs" /> | ||
958 | 164 | <Compile Include="Rss.cs"> | 165 | <Compile Include="Rss.cs"> |
959 | 165 | <SubType>Form</SubType> | 166 | <SubType>Form</SubType> |
960 | 166 | </Compile> | 167 | </Compile> |
961 | 167 | 168 | ||
962 | === modified file 'client/dotNET/app.config' | |||
963 | --- client/dotNET/app.config 2010-11-09 21:23:31 +0000 | |||
964 | +++ client/dotNET/app.config 2011-03-03 10:16:18 +0000 | |||
965 | @@ -79,6 +79,9 @@ | |||
966 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> |
967 | 80 | <value>10</value> | 80 | <value>10</value> |
968 | 81 | </setting> | 81 | </setting> |
969 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
970 | 83 | <value>requiredFiles.xml</value> | ||
971 | 84 | </setting> | ||
972 | 82 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
973 | 83 | </userSettings> | 86 | </userSettings> |
974 | 84 | <applicationSettings> | 87 | <applicationSettings> |
975 | @@ -102,7 +105,7 @@ | |||
976 | 102 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
977 | 103 | </setting> | 106 | </setting> |
978 | 104 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
980 | 105 | <value>1.2.0</value> | 108 | <value>1.2.2</value> |
981 | 106 | </setting> | 109 | </setting> |
982 | 107 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
983 | 108 | <value>900</value> | 111 | <value>900</value> |
984 | 109 | 112 | ||
985 | === modified file 'client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll' | |||
986 | 110 | Binary files client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll 2011-03-03 10:16:18 +0000 differ | 113 | Binary files client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll 2011-03-03 10:16:18 +0000 differ |
987 | === modified file 'client/dotNET/bin/Release/AxInterop.WMPLib.dll' | |||
988 | 111 | Binary files client/dotNET/bin/Release/AxInterop.WMPLib.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/AxInterop.WMPLib.dll 2011-03-03 10:16:18 +0000 differ | 114 | Binary files client/dotNET/bin/Release/AxInterop.WMPLib.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/AxInterop.WMPLib.dll 2011-03-03 10:16:18 +0000 differ |
989 | === modified file 'client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll' | |||
990 | 112 | Binary files client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll 2011-03-03 10:16:18 +0000 differ | 115 | Binary files client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll 2011-03-03 10:16:18 +0000 differ |
991 | === modified file 'client/dotNET/bin/Release/Interop.WMPLib.dll' | |||
992 | 113 | Binary files client/dotNET/bin/Release/Interop.WMPLib.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/Interop.WMPLib.dll 2011-03-03 10:16:18 +0000 differ | 116 | Binary files client/dotNET/bin/Release/Interop.WMPLib.dll 2010-04-19 21:45:10 +0000 and client/dotNET/bin/Release/Interop.WMPLib.dll 2011-03-03 10:16:18 +0000 differ |
993 | === modified file 'client/dotNET/bin/Release/XiboClient.exe.config' | |||
994 | --- client/dotNET/bin/Release/XiboClient.exe.config 2010-04-19 21:45:10 +0000 | |||
995 | +++ client/dotNET/bin/Release/XiboClient.exe.config 2011-03-03 10:16:18 +0000 | |||
996 | @@ -14,7 +14,7 @@ | |||
997 | 14 | <value>DEFAULT</value> | 14 | <value>DEFAULT</value> |
998 | 15 | </setting> | 15 | </setting> |
999 | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> |
1001 | 17 | <value>http://localhost/xibo/xmds.php</value> | 17 | <value>http://localhost/Series%201.2/server-121-soap-wsdl/server/xmds.php</value> |
1002 | 18 | </setting> | 18 | </setting> |
1003 | 19 | <setting name="ServerKey" serializeAs="String"> | 19 | <setting name="ServerKey" serializeAs="String"> |
1004 | 20 | <value>yourserverkey</value> | 20 | <value>yourserverkey</value> |
1005 | @@ -61,6 +61,27 @@ | |||
1006 | 61 | <setting name="scrollStepAmount" serializeAs="String"> | 61 | <setting name="scrollStepAmount" serializeAs="String"> |
1007 | 62 | <value>1</value> | 62 | <value>1</value> |
1008 | 63 | </setting> | 63 | </setting> |
1009 | 64 | <setting name="sizeX" serializeAs="String"> | ||
1010 | 65 | <value>0</value> | ||
1011 | 66 | </setting> | ||
1012 | 67 | <setting name="sizeY" serializeAs="String"> | ||
1013 | 68 | <value>0</value> | ||
1014 | 69 | </setting> | ||
1015 | 70 | <setting name="offsetX" serializeAs="String"> | ||
1016 | 71 | <value>0</value> | ||
1017 | 72 | </setting> | ||
1018 | 73 | <setting name="offsetY" serializeAs="String"> | ||
1019 | 74 | <value>0</value> | ||
1020 | 75 | </setting> | ||
1021 | 76 | <setting name="expireModifiedLayouts" serializeAs="String"> | ||
1022 | 77 | <value>True</value> | ||
1023 | 78 | </setting> | ||
1024 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | ||
1025 | 80 | <value>10</value> | ||
1026 | 81 | </setting> | ||
1027 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
1028 | 83 | <value>requiredFiles.xml</value> | ||
1029 | 84 | </setting> | ||
1030 | 64 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
1031 | 65 | </userSettings> | 86 | </userSettings> |
1032 | 66 | <applicationSettings> | 87 | <applicationSettings> |
1033 | @@ -75,7 +96,7 @@ | |||
1034 | 75 | <value>blacklist.xml</value> | 96 | <value>blacklist.xml</value> |
1035 | 76 | </setting> | 97 | </setting> |
1036 | 77 | <setting name="Version" serializeAs="String"> | 98 | <setting name="Version" serializeAs="String"> |
1038 | 78 | <value>1</value> | 99 | <value>2</value> |
1039 | 79 | </setting> | 100 | </setting> |
1040 | 80 | <setting name="StatsLogFile" serializeAs="String"> | 101 | <setting name="StatsLogFile" serializeAs="String"> |
1041 | 81 | <value>stats.xml</value> | 102 | <value>stats.xml</value> |
1042 | @@ -84,7 +105,7 @@ | |||
1043 | 84 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
1044 | 85 | </setting> | 106 | </setting> |
1045 | 86 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
1047 | 87 | <value>1.0.7</value> | 108 | <value>1.2.2</value> |
1048 | 88 | </setting> | 109 | </setting> |
1049 | 89 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
1050 | 90 | <value>900</value> | 111 | <value>900</value> |
1051 | 91 | 112 | ||
1052 | === modified file 'client/dotNET/bin/Release/XiboClient.vshost.exe.config' | |||
1053 | --- client/dotNET/bin/Release/XiboClient.vshost.exe.config 2010-04-19 21:45:10 +0000 | |||
1054 | +++ client/dotNET/bin/Release/XiboClient.vshost.exe.config 2011-03-03 10:16:18 +0000 | |||
1055 | @@ -14,7 +14,7 @@ | |||
1056 | 14 | <value>DEFAULT</value> | 14 | <value>DEFAULT</value> |
1057 | 15 | </setting> | 15 | </setting> |
1058 | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> |
1060 | 17 | <value>http://localhost/xibo/xmds.php</value> | 17 | <value>http://localhost/Series%201.2/server-121-soap-wsdl/server/xmds.php</value> |
1061 | 18 | </setting> | 18 | </setting> |
1062 | 19 | <setting name="ServerKey" serializeAs="String"> | 19 | <setting name="ServerKey" serializeAs="String"> |
1063 | 20 | <value>yourserverkey</value> | 20 | <value>yourserverkey</value> |
1064 | @@ -61,6 +61,27 @@ | |||
1065 | 61 | <setting name="scrollStepAmount" serializeAs="String"> | 61 | <setting name="scrollStepAmount" serializeAs="String"> |
1066 | 62 | <value>1</value> | 62 | <value>1</value> |
1067 | 63 | </setting> | 63 | </setting> |
1068 | 64 | <setting name="sizeX" serializeAs="String"> | ||
1069 | 65 | <value>0</value> | ||
1070 | 66 | </setting> | ||
1071 | 67 | <setting name="sizeY" serializeAs="String"> | ||
1072 | 68 | <value>0</value> | ||
1073 | 69 | </setting> | ||
1074 | 70 | <setting name="offsetX" serializeAs="String"> | ||
1075 | 71 | <value>0</value> | ||
1076 | 72 | </setting> | ||
1077 | 73 | <setting name="offsetY" serializeAs="String"> | ||
1078 | 74 | <value>0</value> | ||
1079 | 75 | </setting> | ||
1080 | 76 | <setting name="expireModifiedLayouts" serializeAs="String"> | ||
1081 | 77 | <value>True</value> | ||
1082 | 78 | </setting> | ||
1083 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | ||
1084 | 80 | <value>10</value> | ||
1085 | 81 | </setting> | ||
1086 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
1087 | 83 | <value>requiredFiles.xml</value> | ||
1088 | 84 | </setting> | ||
1089 | 64 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
1090 | 65 | </userSettings> | 86 | </userSettings> |
1091 | 66 | <applicationSettings> | 87 | <applicationSettings> |
1092 | @@ -75,7 +96,7 @@ | |||
1093 | 75 | <value>blacklist.xml</value> | 96 | <value>blacklist.xml</value> |
1094 | 76 | </setting> | 97 | </setting> |
1095 | 77 | <setting name="Version" serializeAs="String"> | 98 | <setting name="Version" serializeAs="String"> |
1097 | 78 | <value>1</value> | 99 | <value>2</value> |
1098 | 79 | </setting> | 100 | </setting> |
1099 | 80 | <setting name="StatsLogFile" serializeAs="String"> | 101 | <setting name="StatsLogFile" serializeAs="String"> |
1100 | 81 | <value>stats.xml</value> | 102 | <value>stats.xml</value> |
1101 | @@ -84,7 +105,7 @@ | |||
1102 | 84 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
1103 | 85 | </setting> | 106 | </setting> |
1104 | 86 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
1106 | 87 | <value>1.0.7</value> | 108 | <value>1.2.2</value> |
1107 | 88 | </setting> | 109 | </setting> |
1108 | 89 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
1109 | 90 | <value>900</value> | 111 | <value>900</value> |
1110 | 91 | 112 | ||
1111 | === modified file 'client/python/XiboClient.py' | |||
1112 | --- client/python/XiboClient.py 2011-02-10 22:25:35 +0000 | |||
1113 | +++ client/python/XiboClient.py 2011-03-03 10:16:18 +0000 | |||
1114 | @@ -48,7 +48,11 @@ | |||
1115 | 48 | import PIL.Image | 48 | import PIL.Image |
1116 | 49 | import math | 49 | import math |
1117 | 50 | 50 | ||
1118 | 51 | <<<<<<< TREE | ||
1119 | 51 | version = "1.3.0a1" | 52 | version = "1.3.0a1" |
1120 | 53 | ======= | ||
1121 | 54 | version = "1.2.2a1" | ||
1122 | 55 | >>>>>>> MERGE-SOURCE | ||
1123 | 52 | 56 | ||
1124 | 53 | # What layout schema version is supported | 57 | # What layout schema version is supported |
1125 | 54 | schemaVersion = 1 | 58 | schemaVersion = 1 |
1126 | @@ -908,8 +912,18 @@ | |||
1127 | 908 | tmpSize = long(f.attributes['size'].value) | 912 | tmpSize = long(f.attributes['size'].value) |
1128 | 909 | tmpHash = str(f.attributes['md5'].value) | 913 | tmpHash = str(f.attributes['md5'].value) |
1129 | 910 | tmpType = str(f.attributes['type'].value) | 914 | tmpType = str(f.attributes['type'].value) |
1130 | 915 | <<<<<<< TREE | ||
1131 | 911 | tmpId = int(f.attributes['id'].value) | 916 | tmpId = int(f.attributes['id'].value) |
1132 | 912 | 917 | ||
1133 | 918 | ======= | ||
1134 | 919 | try: | ||
1135 | 920 | tmpId = int(f.attributes['id'].value) | ||
1136 | 921 | except: | ||
1137 | 922 | # Layout background images don't come down with IDs | ||
1138 | 923 | # Blame Dan :D | ||
1139 | 924 | tmpId = 0 | ||
1140 | 925 | |||
1141 | 926 | >>>>>>> MERGE-SOURCE | ||
1142 | 913 | if os.path.isfile(tmpPath) and os.path.getsize(tmpPath) == tmpSize: | 927 | if os.path.isfile(tmpPath) and os.path.getsize(tmpPath) == tmpSize: |
1143 | 914 | # File exists and is the right size | 928 | # File exists and is the right size |
1144 | 915 | # See if we checksummed it recently | 929 | # See if we checksummed it recently |
1145 | 916 | 930 | ||
1146 | === added file 'server/install/database/27.sql' | |||
1147 | --- server/install/database/27.sql 1970-01-01 00:00:00 +0000 | |||
1148 | +++ server/install/database/27.sql 2011-03-03 10:16:18 +0000 | |||
1149 | @@ -0,0 +1,9 @@ | |||
1150 | 1 | |||
1151 | 2 | ALTER TABLE `display` ADD `MediaInventoryStatus` TINYINT NOT NULL , | ||
1152 | 3 | ADD `MediaInventoryXml` LONGTEXT NULL; | ||
1153 | 4 | |||
1154 | 5 | /* VERSION UPDATE */ | ||
1155 | 6 | /* Set the version table, etc */ | ||
1156 | 7 | UPDATE `version` SET `app_ver` = '1.2.2', `XmdsVersion` = 2; | ||
1157 | 8 | UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE'; | ||
1158 | 9 | UPDATE `version` SET `DBVersion` = '27'; | ||
1159 | 0 | \ No newline at end of file | 10 | \ No newline at end of file |
1160 | 1 | 11 | ||
1161 | === modified file 'server/lib/app/kit.class.php' | |||
1162 | --- server/lib/app/kit.class.php 2011-02-28 15:37:03 +0000 | |||
1163 | +++ server/lib/app/kit.class.php 2011-03-03 10:16:18 +0000 | |||
1164 | @@ -405,8 +405,11 @@ | |||
1165 | 405 | { | 405 | { |
1166 | 406 | include_once('lib/service/' . $class . '.class.php'); | 406 | include_once('lib/service/' . $class . '.class.php'); |
1167 | 407 | } | 407 | } |
1168 | 408 | <<<<<<< TREE | ||
1169 | 408 | 409 | ||
1170 | 409 | return; | 410 | return; |
1171 | 411 | ======= | ||
1172 | 412 | >>>>>>> MERGE-SOURCE | ||
1173 | 410 | } | 413 | } |
1174 | 411 | 414 | ||
1175 | 412 | /** | 415 | /** |
1176 | 413 | 416 | ||
1177 | === modified file 'server/lib/data/display.data.class.php' | |||
1178 | --- server/lib/data/display.data.class.php 2011-02-10 20:42:24 +0000 | |||
1179 | +++ server/lib/data/display.data.class.php 2011-03-03 10:16:18 +0000 | |||
1180 | @@ -251,7 +251,7 @@ | |||
1181 | 251 | * @return | 251 | * @return |
1182 | 252 | * @param $license Object | 252 | * @param $license Object |
1183 | 253 | */ | 253 | */ |
1185 | 254 | public function Touch($license, $clientAddress = '') | 254 | public function Touch($license, $clientAddress = '', $mediaInventoryComplete = 0, $mediaInventoryXml = '') |
1186 | 255 | { | 255 | { |
1187 | 256 | $db =& $this->db; | 256 | $db =& $this->db; |
1188 | 257 | $time = time(); | 257 | $time = time(); |
1189 | @@ -266,6 +266,13 @@ | |||
1190 | 266 | if ($clientAddress != '') | 266 | if ($clientAddress != '') |
1191 | 267 | $SQL .= sprintf(" , ClientAddress = '%s' ", $db->escape_string($clientAddress)); | 267 | $SQL .= sprintf(" , ClientAddress = '%s' ", $db->escape_string($clientAddress)); |
1192 | 268 | 268 | ||
1193 | 269 | // Media Inventory Settings (if appropriate) | ||
1194 | 270 | if ($mediaInventoryComplete != 0) | ||
1195 | 271 | $SQL .= sprintf(" , MediaInventoryStatus = %d ", $mediaInventoryComplete); | ||
1196 | 272 | |||
1197 | 273 | if ($mediaInventoryXml != '') | ||
1198 | 274 | $SQL .= sprintf(" , MediaInventoryXml = '%s' ", $mediaInventoryXml); | ||
1199 | 275 | |||
1200 | 269 | // Restrict to the display license | 276 | // Restrict to the display license |
1201 | 270 | $SQL .= " WHERE license = '%s'"; | 277 | $SQL .= " WHERE license = '%s'"; |
1202 | 271 | $SQL = sprintf($SQL, $time, $license); | 278 | $SQL = sprintf($SQL, $time, $license); |
1203 | @@ -282,33 +289,131 @@ | |||
1204 | 282 | 289 | ||
1205 | 283 | return true; | 290 | return true; |
1206 | 284 | } | 291 | } |
1235 | 285 | 292 | <<<<<<< TREE | |
1236 | 286 | /** | 293 | |
1237 | 287 | * Edits the default layout for a display | 294 | /** |
1238 | 288 | * @param <type> $displayId | 295 | * Edits the default layout for a display |
1239 | 289 | * @param <type> $defaultLayoutId | 296 | * @param <type> $displayId |
1240 | 290 | * @return <type> | 297 | * @param <type> $defaultLayoutId |
1241 | 291 | */ | 298 | * @return <type> |
1242 | 292 | public function EditDefaultLayout($displayId, $defaultLayoutId) | 299 | */ |
1243 | 293 | { | 300 | public function EditDefaultLayout($displayId, $defaultLayoutId) |
1244 | 294 | $db =& $this->db; | 301 | { |
1245 | 295 | 302 | $db =& $this->db; | |
1246 | 296 | Debug::LogEntry($db, 'audit', 'IN', 'Display', 'EditDefaultLayout'); | 303 | |
1247 | 297 | 304 | Debug::LogEntry($db, 'audit', 'IN', 'Display', 'EditDefaultLayout'); | |
1248 | 298 | $SQL = sprintf('UPDATE display SET defaultLayoutId = %d WHERE displayID = %d ', $defaultLayoutId, $displayId); | 305 | |
1249 | 299 | 306 | $SQL = sprintf('UPDATE display SET defaultLayoutId = %d WHERE displayID = %d ', $defaultLayoutId, $displayId); | |
1250 | 300 | if (!$db->query($SQL)) | 307 | |
1251 | 301 | { | 308 | if (!$db->query($SQL)) |
1252 | 302 | trigger_error($db->error()); | 309 | { |
1253 | 303 | $this->SetError(25012, __('Error updating this displays default layout.')); | 310 | trigger_error($db->error()); |
1254 | 304 | 311 | $this->SetError(25012, __('Error updating this displays default layout.')); | |
1255 | 305 | return false; | 312 | |
1256 | 306 | } | 313 | return false; |
1257 | 307 | 314 | } | |
1258 | 308 | 315 | ||
1259 | 309 | Debug::LogEntry($db, 'audit', 'OUT', 'Display', 'EditDefaultLayout'); | 316 | |
1260 | 310 | 317 | Debug::LogEntry($db, 'audit', 'OUT', 'Display', 'EditDefaultLayout'); | |
1261 | 311 | return true; | 318 | |
1262 | 312 | } | 319 | return true; |
1263 | 320 | } | ||
1264 | 321 | ======= | ||
1265 | 322 | |||
1266 | 323 | /** | ||
1267 | 324 | * Flags a display as being incomplete | ||
1268 | 325 | * @param <type> $displayId | ||
1269 | 326 | */ | ||
1270 | 327 | private function FlagIncomplete($displayId) | ||
1271 | 328 | { | ||
1272 | 329 | $db =& $this->db; | ||
1273 | 330 | |||
1274 | 331 | Debug::LogEntry($db, 'audit', sprintf('Flag DisplayID %d incomplete.', $displayId), 'display', 'NotifyDisplays'); | ||
1275 | 332 | |||
1276 | 333 | $SQL = sprintf("UPDATE display SET MediaInventoryStatus = 3 WHERE displayID = %d", $displayId); | ||
1277 | 334 | |||
1278 | 335 | if (!$db->query($SQL)) | ||
1279 | 336 | { | ||
1280 | 337 | trigger_error($db->error()); | ||
1281 | 338 | return $this->SetError(25004, 'Unable to Flag Display as incomplete'); | ||
1282 | 339 | } | ||
1283 | 340 | |||
1284 | 341 | return true; | ||
1285 | 342 | } | ||
1286 | 343 | |||
1287 | 344 | /** | ||
1288 | 345 | * Notify displays of this layout change | ||
1289 | 346 | * @param <type> $layoutId | ||
1290 | 347 | */ | ||
1291 | 348 | public function NotifyDisplays($layoutId) | ||
1292 | 349 | { | ||
1293 | 350 | $db =& $this->db; | ||
1294 | 351 | $currentdate = time(); | ||
1295 | 352 | $rfLookahead = Kit::ValidateParam(Config::GetSetting($db,'REQUIRED_FILES_LOOKAHEAD'), _INT); | ||
1296 | 353 | |||
1297 | 354 | $rfLookahead = $currentdate + $rfLookahead; | ||
1298 | 355 | |||
1299 | 356 | Debug::LogEntry($db, 'audit', sprintf('Checking for Displays to refresh on Layout %d', $layoutId), 'display', 'NotifyDisplays'); | ||
1300 | 357 | |||
1301 | 358 | // Which displays does a change to this layout effect? | ||
1302 | 359 | $SQL = " SELECT DISTINCT display.DisplayID "; | ||
1303 | 360 | $SQL .= " FROM schedule_detail "; | ||
1304 | 361 | $SQL .= " INNER JOIN lkdisplaydg "; | ||
1305 | 362 | $SQL .= " ON lkdisplaydg.DisplayGroupID = schedule_detail.DisplayGroupID "; | ||
1306 | 363 | $SQL .= " INNER JOIN display "; | ||
1307 | 364 | $SQL .= " ON lkdisplaydg.DisplayID = display.displayID "; | ||
1308 | 365 | $SQL .= " WHERE schedule_detail.layoutID = %d "; | ||
1309 | 366 | $SQL .= " AND schedule_detail.FromDT < %d AND schedule_detail.ToDT > %d "; | ||
1310 | 367 | $SQL .= " UNION "; | ||
1311 | 368 | $SQL .= " SELECT DisplayID FROM display WHERE DefaultLayoutID = %d"; | ||
1312 | 369 | |||
1313 | 370 | $SQL = sprintf($SQL, $layoutId, $rfLookahead, $currentdate - 3600, $layoutId); | ||
1314 | 371 | |||
1315 | 372 | Debug::LogEntry($db, 'audit', $SQL, 'display', 'NotifyDisplays'); | ||
1316 | 373 | |||
1317 | 374 | if (!$result = $db->query($SQL)) | ||
1318 | 375 | { | ||
1319 | 376 | trigger_error($db->error()); | ||
1320 | 377 | return $this->SetError(25037, __('Unable to get layouts for Notify')); | ||
1321 | 378 | } | ||
1322 | 379 | |||
1323 | 380 | while ($row = $db->get_assoc_row($result)) | ||
1324 | 381 | { | ||
1325 | 382 | // Notify each display in turn | ||
1326 | 383 | $displayId = Kit::ValidateParam($row['DisplayID'], _INT); | ||
1327 | 384 | $this->FlagIncomplete($displayId); | ||
1328 | 385 | } | ||
1329 | 386 | } | ||
1330 | 387 | |||
1331 | 388 | /** | ||
1332 | 389 | * Edits the default layout for a display | ||
1333 | 390 | * @param <type> $displayId | ||
1334 | 391 | * @param <type> $defaultLayoutId | ||
1335 | 392 | * @return <type> | ||
1336 | 393 | */ | ||
1337 | 394 | public function EditDefaultLayout($displayId, $defaultLayoutId) | ||
1338 | 395 | { | ||
1339 | 396 | $db =& $this->db; | ||
1340 | 397 | |||
1341 | 398 | Debug::LogEntry($db, 'audit', 'IN', 'Display', 'EditDefaultLayout'); | ||
1342 | 399 | |||
1343 | 400 | $SQL = sprintf('UPDATE display SET defaultLayoutId = %d WHERE displayID = %d ', $defaultLayoutId, $displayId); | ||
1344 | 401 | |||
1345 | 402 | if (!$db->query($SQL)) | ||
1346 | 403 | { | ||
1347 | 404 | trigger_error($db->error()); | ||
1348 | 405 | $this->SetError(25012, __('Error updating this displays default layout.')); | ||
1349 | 406 | |||
1350 | 407 | return false; | ||
1351 | 408 | } | ||
1352 | 409 | |||
1353 | 410 | // Flag this display as not having all the content | ||
1354 | 411 | $this->FlagIncomplete($displayId); | ||
1355 | 412 | |||
1356 | 413 | Debug::LogEntry($db, 'audit', 'OUT', 'Display', 'EditDefaultLayout'); | ||
1357 | 414 | |||
1358 | 415 | return true; | ||
1359 | 416 | } | ||
1360 | 417 | >>>>>>> MERGE-SOURCE | ||
1361 | 313 | } | 418 | } |
1362 | 314 | ?> | 419 | ?> |
1363 | 315 | 420 | ||
1364 | === modified file 'server/lib/data/schedule.data.class.php' | |||
1365 | --- server/lib/data/schedule.data.class.php 2011-02-10 19:46:44 +0000 | |||
1366 | +++ server/lib/data/schedule.data.class.php 2011-03-03 10:16:18 +0000 | |||
1367 | @@ -164,6 +164,11 @@ | |||
1368 | 164 | } | 164 | } |
1369 | 165 | } | 165 | } |
1370 | 166 | } | 166 | } |
1371 | 167 | |||
1372 | 168 | // Notify (dont error) | ||
1373 | 169 | Kit::ClassLoader('Display'); | ||
1374 | 170 | $displayObject = new Display($db); | ||
1375 | 171 | $displayObject->NotifyDisplays($layoutID); | ||
1376 | 167 | 172 | ||
1377 | 168 | Debug::LogEntry($db, 'audit', 'OUT', 'Schedule', 'Add'); | 173 | Debug::LogEntry($db, 'audit', 'OUT', 'Schedule', 'Add'); |
1378 | 169 | 174 | ||
1379 | 170 | 175 | ||
1380 | === modified file 'server/lib/include.php' | |||
1381 | --- server/lib/include.php 2011-02-28 15:37:03 +0000 | |||
1382 | +++ server/lib/include.php 2011-03-03 10:16:18 +0000 | |||
1383 | @@ -107,8 +107,8 @@ | |||
1384 | 107 | Config::Version($db); | 107 | Config::Version($db); |
1385 | 108 | 108 | ||
1386 | 109 | // Does the version in the DB match the version of the code? | 109 | // Does the version in the DB match the version of the code? |
1389 | 110 | if (DBVERSION != '26') | 110 | if (DBVERSION != '27') |
1390 | 111 | die(sprintf('Incompatible database version detected. Please ensure your database and website versions match. You have %d and the website for %d', DBVERSION, 25)); | 111 | die(sprintf('Incompatible database version detected. Please ensure your database and website versions match. You have %d and the website for %d', DBVERSION, 27)); |
1391 | 112 | 112 | ||
1392 | 113 | // What is the production mode of the server? | 113 | // What is the production mode of the server? |
1393 | 114 | if(Config::GetSetting($db, "SERVER_MODE")=="Test") ini_set('display_errors', 1); | 114 | if(Config::GetSetting($db, "SERVER_MODE")=="Test") ini_set('display_errors', 1); |
1394 | @@ -143,4 +143,4 @@ | |||
1395 | 143 | $pageManager->Render(); | 143 | $pageManager->Render(); |
1396 | 144 | 144 | ||
1397 | 145 | die(); | 145 | die(); |
1398 | 146 | ?> | ||
1399 | 147 | \ No newline at end of file | 146 | \ No newline at end of file |
1400 | 147 | ?> | ||
1401 | 148 | 148 | ||
1402 | === modified file 'server/lib/pages/display.class.php' | |||
1403 | --- server/lib/pages/display.class.php 2011-02-13 17:16:01 +0000 | |||
1404 | +++ server/lib/pages/display.class.php 2011-03-03 10:16:18 +0000 | |||
1405 | @@ -37,6 +37,8 @@ | |||
1406 | 37 | private $email_alert; | 37 | private $email_alert; |
1407 | 38 | private $alert_timeout; | 38 | private $alert_timeout; |
1408 | 39 | private $ajax; | 39 | private $ajax; |
1409 | 40 | private $mediaInventoryStatus; | ||
1410 | 41 | private $mediaInventoryXml; | ||
1411 | 40 | 42 | ||
1412 | 41 | function __construct(database $db, user $user) | 43 | function __construct(database $db, user $user) |
1413 | 42 | { | 44 | { |
1414 | @@ -71,7 +73,9 @@ | |||
1415 | 71 | display.isAuditing, | 73 | display.isAuditing, |
1416 | 72 | display.email_alert, | 74 | display.email_alert, |
1417 | 73 | display.alert_timeout, | 75 | display.alert_timeout, |
1419 | 74 | display.ClientAddress | 76 | display.ClientAddress, |
1420 | 77 | display.MediaInventoryStatus, | ||
1421 | 78 | display.MediaInventoryXml | ||
1422 | 75 | FROM display | 79 | FROM display |
1423 | 76 | WHERE display.displayid = %d | 80 | WHERE display.displayid = %d |
1424 | 77 | SQL; | 81 | SQL; |
1425 | @@ -95,8 +99,10 @@ | |||
1426 | 95 | $this->licensed = Kit::ValidateParam($row[4], _INT); | 99 | $this->licensed = Kit::ValidateParam($row[4], _INT); |
1427 | 96 | $this->inc_schedule = Kit::ValidateParam($row[5], _INT); | 100 | $this->inc_schedule = Kit::ValidateParam($row[5], _INT); |
1428 | 97 | $this->auditing = Kit::ValidateParam($row[6], _INT); | 101 | $this->auditing = Kit::ValidateParam($row[6], _INT); |
1431 | 98 | $this->email_alert = Kit::ValidateParam($row[7], _INT); | 102 | $this->email_alert = Kit::ValidateParam($row[7], _INT); |
1432 | 99 | $this->alert_timeout = Kit::ValidateParam($row[8], _INT); | 103 | $this->alert_timeout = Kit::ValidateParam($row[8], _INT); |
1433 | 104 | $this->mediaInventoryStatus = Kit::ValidateParam($row[9], _INT); | ||
1434 | 105 | $this->mediaInventoryXml = Kit::ValidateParam($row[10], _HTMLSTRING); | ||
1435 | 100 | } | 106 | } |
1436 | 101 | } | 107 | } |
1437 | 102 | 108 | ||
1438 | @@ -309,7 +315,12 @@ | |||
1439 | 309 | CASE WHEN display.licensed = 1 THEN '<img src="img/act.gif">' ELSE '<img src="img/disact.gif">' END AS licensed, | 315 | CASE WHEN display.licensed = 1 THEN '<img src="img/act.gif">' ELSE '<img src="img/disact.gif">' END AS licensed, |
1440 | 310 | CASE WHEN display.email_alert = 1 THEN '<img src="img/act.gif">' ELSE '<img src="img/disact.gif">' END AS email_alert, | 316 | CASE WHEN display.email_alert = 1 THEN '<img src="img/act.gif">' ELSE '<img src="img/disact.gif">' END AS email_alert, |
1441 | 311 | displaygroup.DisplayGroupID, | 317 | displaygroup.DisplayGroupID, |
1443 | 312 | display.ClientAddress | 318 | display.ClientAddress, |
1444 | 319 | CASE WHEN display.MediaInventoryStatus = 1 THEN '<img src="img/act.gif">' | ||
1445 | 320 | WHEN display.MediaInventoryStatus = 2 THEN '<img src="img/warn.gif">' | ||
1446 | 321 | ELSE '<img src="img/disact.gif">' | ||
1447 | 322 | END AS MediaInventoryStatus, | ||
1448 | 323 | display.MediaInventoryXml | ||
1449 | 313 | FROM display | 324 | FROM display |
1450 | 314 | INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID | 325 | INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID |
1451 | 315 | INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID | 326 | INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID |
1452 | @@ -340,7 +351,13 @@ | |||
1453 | 340 | $msgDelete = __('Delete'); | 351 | $msgDelete = __('Delete'); |
1454 | 341 | $msgGroupSecurity = __('Group Security'); | 352 | $msgGroupSecurity = __('Group Security'); |
1455 | 342 | $msgClientAddress = __('IP Address'); | 353 | $msgClientAddress = __('IP Address'); |
1457 | 343 | $msgDefault = __('Default Layout'); | 354 | <<<<<<< TREE |
1458 | 355 | $msgDefault = __('Default Layout'); | ||
1459 | 356 | ======= | ||
1460 | 357 | $msgDefault = __('Default Layout'); | ||
1461 | 358 | $msgStatus = __('Status'); | ||
1462 | 359 | $msgMediaInventory = __('Media Inventory'); | ||
1463 | 360 | >>>>>>> MERGE-SOURCE | ||
1464 | 344 | 361 | ||
1465 | 345 | $output = <<<END | 362 | $output = <<<END |
1466 | 346 | <div class="info_table"> | 363 | <div class="info_table"> |
1467 | @@ -356,6 +373,7 @@ | |||
1468 | 356 | <th>$msgLogIn</th> | 373 | <th>$msgLogIn</th> |
1469 | 357 | <th>$msgLastA</th> | 374 | <th>$msgLastA</th> |
1470 | 358 | <th>$msgClientAddress</th> | 375 | <th>$msgClientAddress</th> |
1471 | 376 | <th>$msgStatus</th> | ||
1472 | 359 | <th>$msgAction</th> | 377 | <th>$msgAction</th> |
1473 | 360 | </tr> | 378 | </tr> |
1474 | 361 | </thead> | 379 | </thead> |
1475 | @@ -385,6 +403,7 @@ | |||
1476 | 385 | // Do we want to make a VNC link out of the display name? | 403 | // Do we want to make a VNC link out of the display name? |
1477 | 386 | $vncTemplate = Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNCLINK'); | 404 | $vncTemplate = Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNCLINK'); |
1478 | 387 | $linkTarget = Kit::ValidateParam(Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNC_TGT'), _STRING); | 405 | $linkTarget = Kit::ValidateParam(Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNC_TGT'), _STRING); |
1479 | 406 | $mediaInventoryStatusLight = Kit::ValidateParam($aRow[10], _STRING); | ||
1480 | 388 | 407 | ||
1481 | 389 | if ($vncTemplate != '' && $clientAddress != '') | 408 | if ($vncTemplate != '' && $clientAddress != '') |
1482 | 390 | { | 409 | { |
1483 | @@ -396,22 +415,42 @@ | |||
1484 | 396 | $display = sprintf('<a href="' . $vncTemplate . '" title="VNC to ' . $display . '" target="' . $linkTarget . '">' . $display . '</a>', $clientAddress); | 415 | $display = sprintf('<a href="' . $vncTemplate . '" title="VNC to ' . $display . '" target="' . $linkTarget . '">' . $display . '</a>', $clientAddress); |
1485 | 397 | } | 416 | } |
1486 | 398 | 417 | ||
1503 | 399 | $buttons = ''; | 418 | <<<<<<< TREE |
1504 | 400 | 419 | $buttons = ''; | |
1505 | 401 | if ($user->usertypeid == 1) | 420 | |
1506 | 402 | { | 421 | if ($user->usertypeid == 1) |
1507 | 403 | $buttons = <<<END | 422 | { |
1508 | 404 | <button class='XiboFormButton' href='index.php?p=display&q=displayForm&displayid=$displayid'><span>$msgEdit</span></button> | 423 | $buttons = <<<END |
1509 | 405 | <button class='XiboFormButton' href='index.php?p=display&q=DeleteForm&displayid=$displayid'><span>$msgDelete</span></button> | 424 | <button class='XiboFormButton' href='index.php?p=display&q=displayForm&displayid=$displayid'><span>$msgEdit</span></button> |
1510 | 406 | <button class="XiboFormButton" href="index.php?p=displaygroup&q=GroupSecurityForm&DisplayGroupID=$displayGroupID&DisplayGroup=$displayName"><span>$msgGroupSecurity</span></button> | 425 | <button class='XiboFormButton' href='index.php?p=display&q=DeleteForm&displayid=$displayid'><span>$msgDelete</span></button> |
1511 | 407 | <button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=$displayid"><span>$msgDefault</span></button> | 426 | <button class="XiboFormButton" href="index.php?p=displaygroup&q=GroupSecurityForm&DisplayGroupID=$displayGroupID&DisplayGroup=$displayName"><span>$msgGroupSecurity</span></button> |
1512 | 408 | END; | 427 | <button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=$displayid"><span>$msgDefault</span></button> |
1513 | 409 | } | 428 | END; |
1514 | 410 | else | 429 | } |
1515 | 411 | { | 430 | else |
1516 | 412 | $buttons = '<button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=' . $displayid . '"><span>' . $msgDefault . '</span></button>'; | 431 | { |
1517 | 413 | } | 432 | $buttons = '<button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=' . $displayid . '"><span>' . $msgDefault . '</span></button>'; |
1518 | 414 | 433 | } | |
1519 | 434 | |||
1520 | 435 | ======= | ||
1521 | 436 | $buttons = ''; | ||
1522 | 437 | |||
1523 | 438 | if ($user->usertypeid == 1) | ||
1524 | 439 | { | ||
1525 | 440 | $buttons = <<<END | ||
1526 | 441 | <button class='XiboFormButton' href='index.php?p=display&q=displayForm&displayid=$displayid'><span>$msgEdit</span></button> | ||
1527 | 442 | <button class='XiboFormButton' href='index.php?p=display&q=DeleteForm&displayid=$displayid'><span>$msgDelete</span></button> | ||
1528 | 443 | <button class="XiboFormButton" href="index.php?p=displaygroup&q=GroupSecurityForm&DisplayGroupID=$displayGroupID&DisplayGroup=$displayName"><span>$msgGroupSecurity</span></button> | ||
1529 | 444 | <button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=$displayid"><span>$msgDefault</span></button> | ||
1530 | 445 | <button class="XiboFormButton" href="index.php?p=display&q=MediaInventory&DisplayId=$displayid"><span>$msgMediaInventory</span></button> | ||
1531 | 446 | END; | ||
1532 | 447 | } | ||
1533 | 448 | else | ||
1534 | 449 | { | ||
1535 | 450 | $buttons = '<button class="XiboFormButton" href="index.php?p=display&q=DefaultLayoutForm&DisplayId=' . $displayid . '"><span>' . $msgDefault . '</span></button>'; | ||
1536 | 451 | } | ||
1537 | 452 | |||
1538 | 453 | >>>>>>> MERGE-SOURCE | ||
1539 | 415 | $output .= <<<END | 454 | $output .= <<<END |
1540 | 416 | 455 | ||
1541 | 417 | <tr> | 456 | <tr> |
1542 | @@ -424,7 +463,12 @@ | |||
1543 | 424 | <td>$loggedin</td> | 463 | <td>$loggedin</td> |
1544 | 425 | <td>$lastaccessed</td> | 464 | <td>$lastaccessed</td> |
1545 | 426 | <td>$clientAddress</td> | 465 | <td>$clientAddress</td> |
1547 | 427 | <td>$buttons</td> | 466 | <<<<<<< TREE |
1548 | 467 | <td>$buttons</td> | ||
1549 | 468 | ======= | ||
1550 | 469 | <td>$mediaInventoryStatusLight</td> | ||
1551 | 470 | <td>$buttons</td> | ||
1552 | 471 | >>>>>>> MERGE-SOURCE | ||
1553 | 428 | END; | 472 | END; |
1554 | 429 | } | 473 | } |
1555 | 430 | $output .= "</tbody></table></div>"; | 474 | $output .= "</tbody></table></div>"; |
1556 | @@ -661,64 +705,183 @@ | |||
1557 | 661 | $response->SetFormSubmitResponse(__("The Display has been Deleted")); | 705 | $response->SetFormSubmitResponse(__("The Display has been Deleted")); |
1558 | 662 | $response->Respond(); | 706 | $response->Respond(); |
1559 | 663 | } | 707 | } |
1619 | 664 | 708 | <<<<<<< TREE | |
1620 | 665 | /** | 709 | |
1621 | 666 | * Form for editing the default layout of a display | 710 | /** |
1622 | 667 | */ | 711 | * Form for editing the default layout of a display |
1623 | 668 | public function DefaultLayoutForm() | 712 | */ |
1624 | 669 | { | 713 | public function DefaultLayoutForm() |
1625 | 670 | $db =& $this->db; | 714 | { |
1626 | 671 | $response = new ResponseManager(); | 715 | $db =& $this->db; |
1627 | 672 | 716 | $response = new ResponseManager(); | |
1628 | 673 | $displayId = Kit::GetParam('DisplayId', _GET, _INT); | 717 | |
1629 | 674 | 718 | $displayId = Kit::GetParam('DisplayId', _GET, _INT); | |
1630 | 675 | if (!$defaultLayoutId = $this->db->GetSingleValue(sprintf("SELECT defaultlayoutid FROM display WHERE displayid = %d", $displayId), | 719 | |
1631 | 676 | 'defaultlayoutid', _INT)) | 720 | if (!$defaultLayoutId = $this->db->GetSingleValue(sprintf("SELECT defaultlayoutid FROM display WHERE displayid = %d", $displayId), |
1632 | 677 | { | 721 | 'defaultlayoutid', _INT)) |
1633 | 678 | trigger_error($db->error()); | 722 | { |
1634 | 679 | trigger_error(__('Unable to get the default layout'), E_USER_ERROR); | 723 | trigger_error($db->error()); |
1635 | 680 | } | 724 | trigger_error(__('Unable to get the default layout'), E_USER_ERROR); |
1636 | 681 | 725 | } | |
1637 | 682 | $msgDefault = __('Default Layout'); | 726 | |
1638 | 683 | $layoutList = dropdownlist('SELECT layoutid, layout FROM layout WHERE retired = 0 ORDER by layout', 'defaultlayoutid', $defaultLayoutId); | 727 | $msgDefault = __('Default Layout'); |
1639 | 684 | 728 | $layoutList = dropdownlist('SELECT layoutid, layout FROM layout WHERE retired = 0 ORDER by layout', 'defaultlayoutid', $defaultLayoutId); | |
1640 | 685 | $form = <<<END | 729 | |
1641 | 686 | <form id="DefaultLayoutForm" class="XiboForm" method="post" action="index.php?p=display&q=DefaultLayout&DisplayId=$displayId"> | 730 | $form = <<<END |
1642 | 687 | <input type="hidden" name="DisplayId" value="$displayId"> | 731 | <form id="DefaultLayoutForm" class="XiboForm" method="post" action="index.php?p=display&q=DefaultLayout&DisplayId=$displayId"> |
1643 | 688 | <table> | 732 | <input type="hidden" name="DisplayId" value="$displayId"> |
1644 | 689 | <tr> | 733 | <table> |
1645 | 690 | <td>$msgDefault<span class="required">*</span></td> | 734 | <tr> |
1646 | 691 | <td>$layoutList</td> | 735 | <td>$msgDefault<span class="required">*</span></td> |
1647 | 692 | </tr> | 736 | <td>$layoutList</td> |
1648 | 693 | </table> | 737 | </tr> |
1649 | 694 | </form> | 738 | </table> |
1650 | 695 | END; | 739 | </form> |
1651 | 696 | 740 | END; | |
1652 | 697 | $response->SetFormRequestResponse($form, __('Edit Default Layout'), '300px', '150px'); | 741 | |
1653 | 698 | $response->AddButton(__('Cancel'), 'XiboDialogClose()'); | 742 | $response->SetFormRequestResponse($form, __('Edit Default Layout'), '300px', '150px'); |
1654 | 699 | $response->AddButton(__('Save'), '$("#DefaultLayoutForm").submit()'); | 743 | $response->AddButton(__('Cancel'), 'XiboDialogClose()'); |
1655 | 700 | $response->Respond(); | 744 | $response->AddButton(__('Save'), '$("#DefaultLayoutForm").submit()'); |
1656 | 701 | } | 745 | $response->Respond(); |
1657 | 702 | 746 | } | |
1658 | 703 | /** | 747 | |
1659 | 704 | * Edit the default layout for a display | 748 | /** |
1660 | 705 | */ | 749 | * Edit the default layout for a display |
1661 | 706 | public function DefaultLayout() | 750 | */ |
1662 | 707 | { | 751 | public function DefaultLayout() |
1663 | 708 | $db =& $this->db; | 752 | { |
1664 | 709 | $response = new ResponseManager(); | 753 | $db =& $this->db; |
1665 | 710 | $displayObject = new Display($db); | 754 | $response = new ResponseManager(); |
1666 | 711 | 755 | $displayObject = new Display($db); | |
1667 | 712 | $displayId = Kit::GetParam('DisplayId', _POST, _INT); | 756 | |
1668 | 713 | $defaultLayoutId = Kit::GetParam('defaultlayoutid', _POST, _INT); | 757 | $displayId = Kit::GetParam('DisplayId', _POST, _INT); |
1669 | 714 | 758 | $defaultLayoutId = Kit::GetParam('defaultlayoutid', _POST, _INT); | |
1670 | 715 | if (!$displayObject->EditDefaultLayout($displayId, $defaultLayoutId)) | 759 | |
1671 | 716 | { | 760 | if (!$displayObject->EditDefaultLayout($displayId, $defaultLayoutId)) |
1672 | 717 | trigger_error(__('Cannot Edit this Display'), E_USER_ERROR); | 761 | { |
1673 | 718 | } | 762 | trigger_error(__('Cannot Edit this Display'), E_USER_ERROR); |
1674 | 719 | 763 | } | |
1675 | 720 | $response->SetFormSubmitResponse(__('Display Saved.')); | 764 | |
1676 | 721 | $response->Respond(); | 765 | $response->SetFormSubmitResponse(__('Display Saved.')); |
1677 | 722 | } | 766 | $response->Respond(); |
1678 | 767 | } | ||
1679 | 768 | ======= | ||
1680 | 769 | |||
1681 | 770 | /** | ||
1682 | 771 | * Form for editing the default layout of a display | ||
1683 | 772 | */ | ||
1684 | 773 | public function DefaultLayoutForm() | ||
1685 | 774 | { | ||
1686 | 775 | $db =& $this->db; | ||
1687 | 776 | $response = new ResponseManager(); | ||
1688 | 777 | |||
1689 | 778 | $displayId = Kit::GetParam('DisplayId', _GET, _INT); | ||
1690 | 779 | |||
1691 | 780 | if (!$defaultLayoutId = $this->db->GetSingleValue(sprintf("SELECT defaultlayoutid FROM display WHERE displayid = %d", $displayId), | ||
1692 | 781 | 'defaultlayoutid', _INT)) | ||
1693 | 782 | { | ||
1694 | 783 | trigger_error($db->error()); | ||
1695 | 784 | trigger_error(__('Unable to get the default layout'), E_USER_ERROR); | ||
1696 | 785 | } | ||
1697 | 786 | |||
1698 | 787 | $msgDefault = __('Default Layout'); | ||
1699 | 788 | $layoutList = dropdownlist('SELECT layoutid, layout FROM layout WHERE retired = 0 ORDER by layout', 'defaultlayoutid', $defaultLayoutId); | ||
1700 | 789 | |||
1701 | 790 | $form = <<<END | ||
1702 | 791 | <form id="DefaultLayoutForm" class="XiboForm" method="post" action="index.php?p=display&q=DefaultLayout&DisplayId=$displayId"> | ||
1703 | 792 | <input type="hidden" name="DisplayId" value="$displayId"> | ||
1704 | 793 | <table> | ||
1705 | 794 | <tr> | ||
1706 | 795 | <td>$msgDefault<span class="required">*</span></td> | ||
1707 | 796 | <td>$layoutList</td> | ||
1708 | 797 | </tr> | ||
1709 | 798 | </table> | ||
1710 | 799 | </form> | ||
1711 | 800 | END; | ||
1712 | 801 | |||
1713 | 802 | $response->SetFormRequestResponse($form, __('Edit Default Layout'), '300px', '150px'); | ||
1714 | 803 | $response->AddButton(__('Cancel'), 'XiboDialogClose()'); | ||
1715 | 804 | $response->AddButton(__('Save'), '$("#DefaultLayoutForm").submit()'); | ||
1716 | 805 | $response->Respond(); | ||
1717 | 806 | } | ||
1718 | 807 | |||
1719 | 808 | /** | ||
1720 | 809 | * Edit the default layout for a display | ||
1721 | 810 | */ | ||
1722 | 811 | public function DefaultLayout() | ||
1723 | 812 | { | ||
1724 | 813 | $db =& $this->db; | ||
1725 | 814 | $response = new ResponseManager(); | ||
1726 | 815 | $displayObject = new Display($db); | ||
1727 | 816 | |||
1728 | 817 | $displayId = Kit::GetParam('DisplayId', _POST, _INT); | ||
1729 | 818 | $defaultLayoutId = Kit::GetParam('defaultlayoutid', _POST, _INT); | ||
1730 | 819 | |||
1731 | 820 | if (!$displayObject->EditDefaultLayout($displayId, $defaultLayoutId)) | ||
1732 | 821 | { | ||
1733 | 822 | trigger_error(__('Cannot Edit this Display'), E_USER_ERROR); | ||
1734 | 823 | } | ||
1735 | 824 | |||
1736 | 825 | $response->SetFormSubmitResponse(__('Display Saved.')); | ||
1737 | 826 | $response->Respond(); | ||
1738 | 827 | } | ||
1739 | 828 | |||
1740 | 829 | /** | ||
1741 | 830 | * Shows the inventory XML for the display | ||
1742 | 831 | */ | ||
1743 | 832 | public function MediaInventory() | ||
1744 | 833 | { | ||
1745 | 834 | $db =& $this->db; | ||
1746 | 835 | $response = new ResponseManager(); | ||
1747 | 836 | $displayId = Kit::GetParam('DisplayId', _GET, _INT); | ||
1748 | 837 | |||
1749 | 838 | if ($displayId == 0) | ||
1750 | 839 | trigger_error(__('No DisplayId Given')); | ||
1751 | 840 | |||
1752 | 841 | // Get the media inventory xml for this display | ||
1753 | 842 | $SQL = "SELECT MediaInventoryXml FROM display WHERE DisplayId = %d"; | ||
1754 | 843 | $SQL = sprintf($SQL, $displayId); | ||
1755 | 844 | |||
1756 | 845 | if (!$mediaInventoryXml = $db->GetSingleValue($SQL, 'MediaInventoryXml', _HTMLSTRING)) | ||
1757 | 846 | { | ||
1758 | 847 | trigger_error($db->error()); | ||
1759 | 848 | trigger_error(__('Unable to get the Inventory for this Display'), E_USER_ERROR); | ||
1760 | 849 | } | ||
1761 | 850 | |||
1762 | 851 | // Load the XML into a DOMDocument | ||
1763 | 852 | $document = new DOMDocument("1.0"); | ||
1764 | 853 | |||
1765 | 854 | if (!$document->loadXML($mediaInventoryXml)) | ||
1766 | 855 | trigger_error(__('Invalid Media Inventory'), E_USER_ERROR); | ||
1767 | 856 | |||
1768 | 857 | // Output a table | ||
1769 | 858 | $table = '<table><tr><th>Type</th><th>Id</th><th>Complete</th><th>Last Checked</th><th>MD5</th></tr>'; | ||
1770 | 859 | |||
1771 | 860 | $xpath = new DOMXPath($document); | ||
1772 | 861 | $fileNodes = $xpath->query("//file"); | ||
1773 | 862 | |||
1774 | 863 | foreach ($fileNodes as $node) | ||
1775 | 864 | { | ||
1776 | 865 | $type = $node->getAttribute('type'); | ||
1777 | 866 | $id = $node->getAttribute('id'); | ||
1778 | 867 | $complete = $node->getAttribute('complete'); | ||
1779 | 868 | $lastChecked = $node->getAttribute('lastChecked'); | ||
1780 | 869 | $md5 = $node->getAttribute('md5'); | ||
1781 | 870 | |||
1782 | 871 | if ($complete == 0) | ||
1783 | 872 | $complete = __('No'); | ||
1784 | 873 | else | ||
1785 | 874 | $complete = __('Yes'); | ||
1786 | 875 | |||
1787 | 876 | $table .= sprintf('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>', $type, $id, $complete, $lastChecked, $md5); | ||
1788 | 877 | } | ||
1789 | 878 | |||
1790 | 879 | $table .= '</table>'; | ||
1791 | 880 | |||
1792 | 881 | $response->SetFormRequestResponse($table, __('Media Inventory'), '550px', '350px'); | ||
1793 | 882 | $response->AddButton(__('Close'), 'XiboDialogClose()'); | ||
1794 | 883 | $response->Respond(); | ||
1795 | 884 | } | ||
1796 | 885 | >>>>>>> MERGE-SOURCE | ||
1797 | 723 | } | 886 | } |
1798 | 724 | ?> | 887 | ?> |
1799 | 725 | 888 | ||
1800 | === modified file 'server/lib/pages/layout.class.php' | |||
1801 | --- server/lib/pages/layout.class.php 2011-02-28 15:58:42 +0000 | |||
1802 | +++ server/lib/pages/layout.class.php 2011-03-03 10:16:18 +0000 | |||
1803 | @@ -325,6 +325,12 @@ | |||
1804 | 325 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); | 325 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); |
1805 | 326 | } | 326 | } |
1806 | 327 | 327 | ||
1807 | 328 | // Notify (dont error) | ||
1808 | 329 | Kit::ClassLoader('display'); | ||
1809 | 330 | $displayObject = new Display($db); | ||
1810 | 331 | $displayObject->NotifyDisplays($this->layoutid); | ||
1811 | 332 | |||
1812 | 333 | |||
1813 | 328 | $response->SetFormSubmitResponse(__('Layout Details Changed.')); | 334 | $response->SetFormSubmitResponse(__('Layout Details Changed.')); |
1814 | 329 | $response->Respond(); | 335 | $response->Respond(); |
1815 | 330 | } | 336 | } |
1816 | 331 | 337 | ||
1817 | === modified file 'server/lib/pages/region.class.php' | |||
1818 | --- server/lib/pages/region.class.php 2010-05-29 11:16:24 +0000 | |||
1819 | +++ server/lib/pages/region.class.php 2011-03-03 10:16:18 +0000 | |||
1820 | @@ -76,6 +76,11 @@ | |||
1821 | 76 | $this->errMsg = __("Unable to Update that layouts XML with a new Media Node"); | 76 | $this->errMsg = __("Unable to Update that layouts XML with a new Media Node"); |
1822 | 77 | return false; | 77 | return false; |
1823 | 78 | } | 78 | } |
1824 | 79 | |||
1825 | 80 | // Notify (dont error) | ||
1826 | 81 | Kit::ClassLoader('display'); | ||
1827 | 82 | $displayObject = new Display($db); | ||
1828 | 83 | $displayObject->NotifyDisplays($layoutid); | ||
1829 | 79 | 84 | ||
1830 | 80 | return true; | 85 | return true; |
1831 | 81 | } | 86 | } |
1832 | 82 | 87 | ||
1833 | === modified file 'server/lib/service/service.wsdl' | |||
1834 | --- server/lib/service/service.wsdl 2010-01-31 00:38:32 +0000 | |||
1835 | +++ server/lib/service/service.wsdl 2011-03-03 10:16:18 +0000 | |||
1836 | @@ -80,6 +80,15 @@ | |||
1837 | 80 | <message name="SubmitStatsResponse"> | 80 | <message name="SubmitStatsResponse"> |
1838 | 81 | <part name="success" type="xsd:boolean" /> | 81 | <part name="success" type="xsd:boolean" /> |
1839 | 82 | </message> | 82 | </message> |
1840 | 83 | <message name="MediaInventoryRequest"> | ||
1841 | 84 | <part name="version" type="xsd:string" /> | ||
1842 | 85 | <part name="serverKey" type="xsd:string" /> | ||
1843 | 86 | <part name="hardwareKey" type="xsd:string" /> | ||
1844 | 87 | <part name="mediaInventory" type="xsd:string" /> | ||
1845 | 88 | </message> | ||
1846 | 89 | <message name="MediaInventoryResponse"> | ||
1847 | 90 | <part name="success" type="xsd:boolean" /> | ||
1848 | 91 | </message> | ||
1849 | 83 | <portType name="xmdsPortType"> | 92 | <portType name="xmdsPortType"> |
1850 | 84 | <operation name="RegisterDisplay"> | 93 | <operation name="RegisterDisplay"> |
1851 | 85 | <documentation>Registered the Display on the Xibo Network</documentation> | 94 | <documentation>Registered the Display on the Xibo Network</documentation> |
1852 | @@ -121,6 +130,11 @@ | |||
1853 | 121 | <input message="tns:SubmitStatsRequest"/> | 130 | <input message="tns:SubmitStatsRequest"/> |
1854 | 122 | <output message="tns:SubmitStatsResponse"/> | 131 | <output message="tns:SubmitStatsResponse"/> |
1855 | 123 | </operation> | 132 | </operation> |
1856 | 133 | <operation name="MediaInventory"> | ||
1857 | 134 | <documentation>Report back the clients MediaInventory</documentation> | ||
1858 | 135 | <input message="tns:MediaInventoryRequest" /> | ||
1859 | 136 | <output message="tns:MediaInventoryResponse" /> | ||
1860 | 137 | </operation> | ||
1861 | 124 | </portType> | 138 | </portType> |
1862 | 125 | <binding name="xmdsBinding" type="tns:xmdsPortType"> | 139 | <binding name="xmdsBinding" type="tns:xmdsPortType"> |
1863 | 126 | <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> | 140 | <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> |
1864 | @@ -196,6 +210,15 @@ | |||
1865 | 196 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> | 210 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> |
1866 | 197 | </output> | 211 | </output> |
1867 | 198 | </operation> | 212 | </operation> |
1868 | 213 | <operation name="MediaInventory"> | ||
1869 | 214 | <soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/> | ||
1870 | 215 | <input> | ||
1871 | 216 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> | ||
1872 | 217 | </input> | ||
1873 | 218 | <output> | ||
1874 | 219 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> | ||
1875 | 220 | </output> | ||
1876 | 221 | </operation> | ||
1877 | 199 | </binding> | 222 | </binding> |
1878 | 200 | <service name="xmds"> | 223 | <service name="xmds"> |
1879 | 201 | <port name="xmdsPort" binding="tns:xmdsBinding"> | 224 | <port name="xmdsPort" binding="tns:xmdsBinding"> |
1880 | 202 | 225 | ||
1881 | === modified file 'server/lib/service/xmdssoap.class.php' | |||
1882 | --- server/lib/service/xmdssoap.class.php 2011-02-28 15:58:42 +0000 | |||
1883 | +++ server/lib/service/xmdssoap.class.php 2011-03-03 10:16:18 +0000 | |||
1884 | @@ -848,6 +848,66 @@ | |||
1885 | 848 | } | 848 | } |
1886 | 849 | 849 | ||
1887 | 850 | /** | 850 | /** |
1888 | 851 | * Store the media inventory for a client | ||
1889 | 852 | * @param <type> $hardwareKey | ||
1890 | 853 | * @param <type> $inventory | ||
1891 | 854 | */ | ||
1892 | 855 | public function MediaInventory($version, $serverKey, $hardwareKey, $inventory) | ||
1893 | 856 | { | ||
1894 | 857 | $db =& $this->db; | ||
1895 | 858 | |||
1896 | 859 | // Sanitize | ||
1897 | 860 | $serverKey = Kit::ValidateParam($serverKey, _STRING); | ||
1898 | 861 | $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING); | ||
1899 | 862 | $version = Kit::ValidateParam($version, _STRING); | ||
1900 | 863 | $inventory = Kit::ValidateParam($inventory, _HTMLSTRING); | ||
1901 | 864 | |||
1902 | 865 | // Make sure we are talking the same language | ||
1903 | 866 | if (!$this->CheckVersion($version)) | ||
1904 | 867 | throw new SoapFault('Receiver', "Your client is not of the correct version for communication with this server. You can get the latest from http://www.xibo.org.uk"); | ||
1905 | 868 | |||
1906 | 869 | // Auth this request... | ||
1907 | 870 | if (!$this->AuthDisplay($hardwareKey)) | ||
1908 | 871 | throw new SoapFault('Receiver', 'This display client is not licensed'); | ||
1909 | 872 | |||
1910 | 873 | if ($this->isAuditing == 1) Debug::LogEntry ($db, 'audit', $inventory, 'xmds', 'MediaInventory', '', $this->displayId); | ||
1911 | 874 | |||
1912 | 875 | // Check that the $inventory contains something | ||
1913 | 876 | if ($inventory == '') | ||
1914 | 877 | throw new SoapFault('Receiver', 'Inventory Cannot be Empty'); | ||
1915 | 878 | |||
1916 | 879 | // Load the XML into a DOMDocument | ||
1917 | 880 | $document = new DOMDocument("1.0"); | ||
1918 | 881 | $document->loadXML($inventory); | ||
1919 | 882 | |||
1920 | 883 | // Assume we are complete (but we are getting some) | ||
1921 | 884 | $mediaInventoryComplete = 1; | ||
1922 | 885 | |||
1923 | 886 | $xpath = new DOMXPath($document); | ||
1924 | 887 | $fileNodes = $xpath->query("//file"); | ||
1925 | 888 | |||
1926 | 889 | foreach ($fileNodes as $node) | ||
1927 | 890 | { | ||
1928 | 891 | $mediaId = $node->getAttribute('id'); | ||
1929 | 892 | $complete = $node->getAttribute('complete'); | ||
1930 | 893 | $md5 = $node->getAttribute('md5'); | ||
1931 | 894 | $lastChecked = $node->getAttribute('lastChecked'); | ||
1932 | 895 | |||
1933 | 896 | // TODO: Check the MD5? | ||
1934 | 897 | |||
1935 | 898 | // If this item is a 0 then set not complete | ||
1936 | 899 | if ($complete == 0) | ||
1937 | 900 | $mediaInventoryComplete = 2; | ||
1938 | 901 | } | ||
1939 | 902 | |||
1940 | 903 | // Touch the display record | ||
1941 | 904 | $displayObject = new Display($db); | ||
1942 | 905 | $displayObject->Touch($hardwareKey, '', $mediaInventoryComplete, $inventory); | ||
1943 | 906 | |||
1944 | 907 | return true; | ||
1945 | 908 | } | ||
1946 | 909 | |||
1947 | 910 | /** | ||
1948 | 851 | * Authenticates the display | 911 | * Authenticates the display |
1949 | 852 | * @param <type> $hardwareKey | 912 | * @param <type> $hardwareKey |
1950 | 853 | * @return <type> | 913 | * @return <type> |
1951 | 854 | 914 | ||
1952 | === modified file 'server/modules/module_db_mysql.php' | |||
1953 | --- server/modules/module_db_mysql.php 2010-09-22 20:11:36 +0000 | |||
1954 | +++ server/modules/module_db_mysql.php 2011-03-03 10:16:18 +0000 | |||
1955 | @@ -156,7 +156,7 @@ | |||
1956 | 156 | 156 | ||
1957 | 157 | if (!isset($row[$columnName])) | 157 | if (!isset($row[$columnName])) |
1958 | 158 | { | 158 | { |
1960 | 159 | $this->error_text = 'No such column'; | 159 | $this->error_text = 'No such column or column is null'; |
1961 | 160 | return false; | 160 | return false; |
1962 | 161 | } | 161 | } |
1963 | 162 | 162 |