Merge lp:~dangarner/xibo/1.2.2-pre into lp:xibo/1.2
- 1.2.2-pre
- Merge into biela
Proposed by
Dan Garner
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 213 | ||||
Proposed branch: | lp:~dangarner/xibo/1.2.2-pre | ||||
Merge into: | lp:xibo/1.2 | ||||
Diff against target: |
1513 lines (+770/-99) 24 files modified
client/dotNET/CacheManager.cs (+75/-1) client/dotNET/FileCollector.cs (+50/-29) 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 (+6/-7) 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 (+4/-1) client/dotNET/bin/Release/XiboClient.vshost.exe.config (+4/-1) server/install/database/27.sql (+9/-0) server/lib/app/kit.class.php (+9/-13) server/lib/data/display.data.class.php (+60/-16) server/lib/data/schedule.data.class.php (+5/-0) server/lib/pages/display.class.php (+74/-4) 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) |
||||
To merge this branch: | bzr merge lp:~dangarner/xibo/1.2.2-pre | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xibo Maintainters | Pending | ||
Review via email: mp+51554@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-02-28 15:09:32 +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-02-28 15:09:32 +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,18 +237,24 @@ | |||
220 | 234 | } | 237 | } |
221 | 235 | } | 238 | } |
222 | 236 | 239 | ||
224 | 237 | Debug.WriteLine(String.Format("There are {0} files to get", files.Count.ToString())); | 240 | Debug.WriteLine(String.Format("There are {0} files to get", _files.Count.ToString())); |
225 | 238 | 241 | ||
226 | 239 | // Output a list of the files we need to get | 242 | // Output a list of the files we need to get |
227 | 240 | string debugMessage = ""; | 243 | string debugMessage = ""; |
228 | 241 | 244 | ||
230 | 242 | foreach (FileList fileToGet in files) | 245 | foreach (RequiredFile fileToGet in _files) |
231 | 243 | debugMessage += string.Format("File: {0}, Type: {1}, MD5: {2}. ", fileToGet.path, fileToGet.type, fileToGet.md5); | 246 | debugMessage += string.Format("File: {0}, Type: {1}, MD5: {2}. ", fileToGet.path, fileToGet.type, fileToGet.md5); |
232 | 244 | 247 | ||
233 | 245 | Debug.WriteLine(debugMessage); | 248 | Debug.WriteLine(debugMessage); |
234 | 246 | 249 | ||
235 | 250 | // Report the files files back to XMDS | ||
236 | 251 | _requiredFiles.ReportInventory(); | ||
237 | 252 | |||
238 | 253 | // Write Required Files | ||
239 | 254 | _requiredFiles.WriteRequiredFiles(); | ||
240 | 255 | |||
241 | 247 | // Is there anything to get? | 256 | // Is there anything to get? |
243 | 248 | if (files.Count == 0) | 257 | if (_files.Count == 0) |
244 | 249 | { | 258 | { |
245 | 250 | CollectionComplete(); | 259 | CollectionComplete(); |
246 | 251 | return; | 260 | return; |
247 | @@ -255,7 +264,7 @@ | |||
248 | 255 | _currentFile = 0; | 264 | _currentFile = 0; |
249 | 256 | 265 | ||
250 | 257 | // Preload the first filelist | 266 | // Preload the first filelist |
252 | 258 | _currentFileList = files[_currentFile]; | 267 | _currentFileList = _files[_currentFile]; |
253 | 259 | 268 | ||
254 | 260 | // Get the first file | 269 | // Get the first file |
255 | 261 | GetFile(); | 270 | GetFile(); |
256 | @@ -375,6 +384,10 @@ | |||
257 | 375 | { | 384 | { |
258 | 376 | // Add to the CacheManager | 385 | // Add to the CacheManager |
259 | 377 | _cacheManager.Add(_currentFileList.path + ".xlf", md5sum); | 386 | _cacheManager.Add(_currentFileList.path + ".xlf", md5sum); |
260 | 387 | |||
261 | 388 | // Report this completion back to XMDS | ||
262 | 389 | _requiredFiles.MarkComplete(int.Parse(_currentFileList.path), md5sum); | ||
263 | 390 | _requiredFiles.ReportInventory(); | ||
264 | 378 | } | 391 | } |
265 | 379 | 392 | ||
266 | 380 | // Fire a layout complete event | 393 | // Fire a layout complete event |
267 | @@ -445,6 +458,11 @@ | |||
268 | 445 | 458 | ||
269 | 446 | System.Diagnostics.Debug.WriteLine(string.Format("File downloaded: {0}", _currentFileList.path)); | 459 | System.Diagnostics.Debug.WriteLine(string.Format("File downloaded: {0}", _currentFileList.path)); |
270 | 447 | 460 | ||
271 | 461 | // Report this completion back to XMDS | ||
272 | 462 | string[] filePart = _currentFileList.path.Split('.'); | ||
273 | 463 | _requiredFiles.MarkComplete(int.Parse(filePart[0]), md5sum); | ||
274 | 464 | _requiredFiles.ReportInventory(); | ||
275 | 465 | |||
276 | 448 | // All the file has been recieved. Move on to the next file. | 466 | // All the file has been recieved. Move on to the next file. |
277 | 449 | _currentFile++; | 467 | _currentFile++; |
278 | 450 | } | 468 | } |
279 | @@ -475,13 +493,16 @@ | |||
280 | 475 | /// </summary> | 493 | /// </summary> |
281 | 476 | public void GetFile() | 494 | public void GetFile() |
282 | 477 | { | 495 | { |
284 | 478 | if (_currentFile > (files.Count - 1)) | 496 | if (_currentFile > (_files.Count - 1)) |
285 | 479 | { | 497 | { |
287 | 480 | System.Diagnostics.Debug.WriteLine(String.Format("Finished Recieving {0} files", files.Count)); | 498 | System.Diagnostics.Debug.WriteLine(String.Format("Finished Receiving {0} files", _files.Count)); |
288 | 481 | 499 | ||
289 | 482 | // Clean up | 500 | // Clean up |
292 | 483 | files.Clear(); | 501 | _files.Clear(); |
293 | 484 | xmdsFile.Dispose(); | 502 | xmdsFile.Dispose(); |
294 | 503 | |||
295 | 504 | // Write Required Files | ||
296 | 505 | _requiredFiles.WriteRequiredFiles(); | ||
297 | 485 | 506 | ||
298 | 486 | // Finished getting this file list | 507 | // Finished getting this file list |
299 | 487 | CollectionComplete(); | 508 | CollectionComplete(); |
300 | @@ -491,7 +512,7 @@ | |||
301 | 491 | // Get the current file into the currentfilelist if the current one is finished | 512 | // Get the current file into the currentfilelist if the current one is finished |
302 | 492 | if (_currentFileList.complete) | 513 | if (_currentFileList.complete) |
303 | 493 | { | 514 | { |
305 | 494 | _currentFileList = files[_currentFile]; | 515 | _currentFileList = _files[_currentFile]; |
306 | 495 | } | 516 | } |
307 | 496 | 517 | ||
308 | 497 | System.Diagnostics.Debug.WriteLine(String.Format("Getting the file : {0} chunk : {1}", _currentFileList.path, _currentFileList.chunkOffset.ToString())); | 518 | System.Diagnostics.Debug.WriteLine(String.Format("Getting the file : {0} chunk : {1}", _currentFileList.path, _currentFileList.chunkOffset.ToString())); |
309 | @@ -504,7 +525,7 @@ | |||
310 | 504 | } | 525 | } |
311 | 505 | 526 | ||
312 | 506 | [Serializable] | 527 | [Serializable] |
314 | 507 | private struct FileList | 528 | private struct RequiredFile |
315 | 508 | { | 529 | { |
316 | 509 | public string path; | 530 | public string path; |
317 | 510 | public string type; | 531 | public string type; |
318 | @@ -519,9 +540,9 @@ | |||
319 | 519 | 540 | ||
320 | 520 | private XmlDocument xml; | 541 | private XmlDocument xml; |
321 | 521 | private HardwareKey hardwareKey; | 542 | private HardwareKey hardwareKey; |
323 | 522 | private Collection<FileList> files; | 543 | private Collection<RequiredFile> _files; |
324 | 523 | private int _currentFile; | 544 | private int _currentFile; |
326 | 524 | private FileList _currentFileList; | 545 | private RequiredFile _currentFileList; |
327 | 525 | private xmds.xmds xmdsFile; | 546 | private xmds.xmds xmdsFile; |
328 | 526 | 547 | ||
329 | 527 | public event LayoutFileChangedDelegate LayoutFileChanged; | 548 | public event LayoutFileChangedDelegate LayoutFileChanged; |
330 | 528 | 549 | ||
331 | === modified file 'client/dotNET/MainForm.cs' | |||
332 | --- client/dotNET/MainForm.cs 2011-01-30 18:13:32 +0000 | |||
333 | +++ client/dotNET/MainForm.cs 2011-02-28 15:09:32 +0000 | |||
334 | @@ -72,14 +72,45 @@ | |||
335 | 72 | 72 | ||
336 | 73 | _statLog = new StatLog(); | 73 | _statLog = new StatLog(); |
337 | 74 | 74 | ||
338 | 75 | this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing); | ||
339 | 76 | this.Shown += new EventHandler(MainForm_Shown); | ||
340 | 77 | } | ||
341 | 78 | |||
342 | 79 | /// <summary> | ||
343 | 80 | /// Called after the form has been shown | ||
344 | 81 | /// </summary> | ||
345 | 82 | /// <param name="sender"></param> | ||
346 | 83 | /// <param name="e"></param> | ||
347 | 84 | void MainForm_Shown(object sender, EventArgs e) | ||
348 | 85 | { | ||
349 | 86 | // Process any stuff that has happened during the loading process | ||
350 | 87 | Application.DoEvents(); | ||
351 | 88 | |||
352 | 75 | // Create a cachemanager | 89 | // Create a cachemanager |
353 | 76 | SetCacheManager(); | 90 | SetCacheManager(); |
354 | 77 | 91 | ||
356 | 78 | this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing); | 92 | try |
357 | 93 | { | ||
358 | 94 | // Create the Schedule | ||
359 | 95 | _schedule = new Schedule(Application.UserAppDataPath + "\\" + Properties.Settings.Default.ScheduleFile, ref _cacheManager); | ||
360 | 96 | |||
361 | 97 | // Bind to the schedule change event - notifys of changes to the schedule | ||
362 | 98 | _schedule.ScheduleChangeEvent += new Schedule.ScheduleChangeDelegate(schedule_ScheduleChangeEvent); | ||
363 | 99 | |||
364 | 100 | // Initialize the other schedule components | ||
365 | 101 | _schedule.InitializeComponents(); | ||
366 | 102 | } | ||
367 | 103 | catch (Exception ex) | ||
368 | 104 | { | ||
369 | 105 | Debug.WriteLine(ex.Message, LogType.Error.ToString()); | ||
370 | 106 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); | ||
371 | 107 | Close(); | ||
372 | 108 | Dispose(); | ||
373 | 109 | } | ||
374 | 79 | } | 110 | } |
375 | 80 | 111 | ||
376 | 81 | /// <summary> | 112 | /// <summary> |
378 | 82 | /// Called when the form has finished loading | 113 | /// Called before the form has loaded for the first time |
379 | 83 | /// </summary> | 114 | /// </summary> |
380 | 84 | /// <param name="sender"></param> | 115 | /// <param name="sender"></param> |
381 | 85 | /// <param name="e"></param> | 116 | /// <param name="e"></param> |
382 | @@ -96,30 +127,13 @@ | |||
383 | 96 | Cursor.Position = new Point(_clientSize.Width, _clientSize.Height); | 127 | Cursor.Position = new Point(_clientSize.Width, _clientSize.Height); |
384 | 97 | Cursor.Hide(); | 128 | Cursor.Hide(); |
385 | 98 | 129 | ||
386 | 130 | ShowSplashScreen(); | ||
387 | 131 | |||
388 | 99 | // Change the default Proxy class | 132 | // Change the default Proxy class |
389 | 100 | OptionForm.SetGlobalProxy(); | 133 | OptionForm.SetGlobalProxy(); |
390 | 101 | 134 | ||
391 | 102 | // UserApp data | 135 | // UserApp data |
392 | 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()); |
393 | 104 | |||
394 | 105 | try | ||
395 | 106 | { | ||
396 | 107 | // Create the Schedule | ||
397 | 108 | _schedule = new Schedule(Application.UserAppDataPath + "\\" + Properties.Settings.Default.ScheduleFile, ref _cacheManager); | ||
398 | 109 | |||
399 | 110 | // Bind to the schedule change event - notifys of changes to the schedule | ||
400 | 111 | _schedule.ScheduleChangeEvent += new Schedule.ScheduleChangeDelegate(schedule_ScheduleChangeEvent); | ||
401 | 112 | |||
402 | 113 | // Initialize the other schedule components | ||
403 | 114 | _schedule.InitializeComponents(); | ||
404 | 115 | } | ||
405 | 116 | catch (Exception ex) | ||
406 | 117 | { | ||
407 | 118 | Debug.WriteLine(ex.Message, LogType.Error.ToString()); | ||
408 | 119 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); | ||
409 | 120 | Close(); | ||
410 | 121 | Dispose(); | ||
411 | 122 | } | ||
412 | 123 | } | 137 | } |
413 | 124 | 138 | ||
414 | 125 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) | 139 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) |
415 | @@ -152,11 +166,20 @@ | |||
416 | 152 | } | 166 | } |
417 | 153 | catch (Exception ex) | 167 | catch (Exception ex) |
418 | 154 | { | 168 | { |
420 | 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)); |
421 | 156 | 170 | ||
422 | 157 | // Create a new cache manager | 171 | // Create a new cache manager |
423 | 158 | _cacheManager = new CacheManager(); | 172 | _cacheManager = new CacheManager(); |
424 | 159 | } | 173 | } |
425 | 174 | |||
426 | 175 | try | ||
427 | 176 | { | ||
428 | 177 | _cacheManager.Regenerate(); | ||
429 | 178 | } | ||
430 | 179 | catch (Exception ex) | ||
431 | 180 | { | ||
432 | 181 | Trace.WriteLine(new LogMessage("MainForm - SetCacheManager", "Regenerate failed because: " + ex.Message)); | ||
433 | 182 | } | ||
434 | 160 | } | 183 | } |
435 | 161 | 184 | ||
436 | 162 | /// <summary> | 185 | /// <summary> |
437 | 163 | 186 | ||
438 | === modified file 'client/dotNET/Properties/Settings.Designer.cs' | |||
439 | --- client/dotNET/Properties/Settings.Designer.cs 2011-02-14 16:21:56 +0000 | |||
440 | +++ client/dotNET/Properties/Settings.Designer.cs 2011-02-28 15:09:32 +0000 | |||
441 | @@ -271,7 +271,7 @@ | |||
442 | 271 | 271 | ||
443 | 272 | [global::System.Configuration.ApplicationScopedSettingAttribute()] | 272 | [global::System.Configuration.ApplicationScopedSettingAttribute()] |
444 | 273 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | 273 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
446 | 274 | [global::System.Configuration.DefaultSettingValueAttribute("1.2.1")] | 274 | [global::System.Configuration.DefaultSettingValueAttribute("1.2.2")] |
447 | 275 | public string ClientVersion { | 275 | public string ClientVersion { |
448 | 276 | get { | 276 | get { |
449 | 277 | return ((string)(this["ClientVersion"])); | 277 | return ((string)(this["ClientVersion"])); |
450 | @@ -370,5 +370,17 @@ | |||
451 | 370 | this["emptyLayoutDuration"] = value; | 370 | this["emptyLayoutDuration"] = value; |
452 | 371 | } | 371 | } |
453 | 372 | } | 372 | } |
454 | 373 | |||
455 | 374 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
456 | 375 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
457 | 376 | [global::System.Configuration.DefaultSettingValueAttribute("requiredFiles.xml")] | ||
458 | 377 | public string RequiredFilesFile { | ||
459 | 378 | get { | ||
460 | 379 | return ((string)(this["RequiredFilesFile"])); | ||
461 | 380 | } | ||
462 | 381 | set { | ||
463 | 382 | this["RequiredFilesFile"] = value; | ||
464 | 383 | } | ||
465 | 384 | } | ||
466 | 373 | } | 385 | } |
467 | 374 | } | 386 | } |
468 | 375 | 387 | ||
469 | === modified file 'client/dotNET/Properties/Settings.settings' | |||
470 | --- client/dotNET/Properties/Settings.settings 2011-02-14 16:21:56 +0000 | |||
471 | +++ client/dotNET/Properties/Settings.settings 2011-02-28 15:09:32 +0000 | |||
472 | @@ -69,7 +69,7 @@ | |||
473 | 69 | <Value Profile="(Default)">cacheManager.xml</Value> | 69 | <Value Profile="(Default)">cacheManager.xml</Value> |
474 | 70 | </Setting> | 70 | </Setting> |
475 | 71 | <Setting Name="ClientVersion" Type="System.String" Scope="Application"> | 71 | <Setting Name="ClientVersion" Type="System.String" Scope="Application"> |
477 | 72 | <Value Profile="(Default)">1.2.1</Value> | 72 | <Value Profile="(Default)">1.2.2</Value> |
478 | 73 | </Setting> | 73 | </Setting> |
479 | 74 | <Setting Name="scrollStepAmount" Type="System.Decimal" Scope="User"> | 74 | <Setting Name="scrollStepAmount" Type="System.Decimal" Scope="User"> |
480 | 75 | <Value Profile="(Default)">1</Value> | 75 | <Value Profile="(Default)">1</Value> |
481 | @@ -95,5 +95,8 @@ | |||
482 | 95 | <Setting Name="emptyLayoutDuration" Type="System.Decimal" Scope="User"> | 95 | <Setting Name="emptyLayoutDuration" Type="System.Decimal" Scope="User"> |
483 | 96 | <Value Profile="(Default)">10</Value> | 96 | <Value Profile="(Default)">10</Value> |
484 | 97 | </Setting> | 97 | </Setting> |
485 | 98 | <Setting Name="RequiredFilesFile" Type="System.String" Scope="User"> | ||
486 | 99 | <Value Profile="(Default)">requiredFiles.xml</Value> | ||
487 | 100 | </Setting> | ||
488 | 98 | </Settings> | 101 | </Settings> |
489 | 99 | </SettingsFile> | 102 | </SettingsFile> |
490 | 100 | \ No newline at end of file | 103 | \ No newline at end of file |
491 | 101 | 104 | ||
492 | === modified file 'client/dotNET/Region.cs' | |||
493 | --- client/dotNET/Region.cs 2010-11-09 21:23:31 +0000 | |||
494 | +++ client/dotNET/Region.cs 2011-02-28 15:09:32 +0000 | |||
495 | @@ -310,12 +310,11 @@ | |||
496 | 310 | } | 310 | } |
497 | 311 | 311 | ||
498 | 312 | // We cannot have a 0 duration here... not sure why we would... but | 312 | // We cannot have a 0 duration here... not sure why we would... but |
505 | 313 | if (options.duration == 0) | 313 | if (options.duration == 0 && options.type != "video") |
506 | 314 | options.duration = int.Parse(Properties.Settings.Default.emptyLayoutDuration.ToString()); | 314 | { |
507 | 315 | 315 | int emptyLayoutDuration = int.Parse(Properties.Settings.Default.emptyLayoutDuration.ToString()); | |
508 | 316 | // Fail safe | 316 | options.duration = (emptyLayoutDuration == 0) ? 10 : emptyLayoutDuration; |
509 | 317 | if (options.duration == 0) | 317 | } |
504 | 318 | options.duration = 10; | ||
510 | 319 | 318 | ||
511 | 320 | // There will be some stuff on option nodes | 319 | // There will be some stuff on option nodes |
512 | 321 | XmlNode optionNode = mediaNode.FirstChild; | 320 | XmlNode optionNode = mediaNode.FirstChild; |
513 | @@ -386,7 +385,7 @@ | |||
514 | 386 | if (options.type == "video" || options.type == "flash" || options.type == "image" || options.type == "powerpoint") | 385 | if (options.type == "video" || options.type == "flash" || options.type == "image" || options.type == "powerpoint") |
515 | 387 | { | 386 | { |
516 | 388 | // Use the cache manager to determine if the file is valid | 387 | // Use the cache manager to determine if the file is valid |
518 | 389 | validNode = _cacheManager.IsValid(options.uri); | 388 | validNode = _cacheManager.IsValidPath(options.uri); |
519 | 390 | } | 389 | } |
520 | 391 | } | 390 | } |
521 | 392 | 391 | ||
522 | 393 | 392 | ||
523 | === added file 'client/dotNET/RequiredFiles.cs' | |||
524 | --- client/dotNET/RequiredFiles.cs 1970-01-01 00:00:00 +0000 | |||
525 | +++ client/dotNET/RequiredFiles.cs 2011-02-28 15:09:32 +0000 | |||
526 | @@ -0,0 +1,206 @@ | |||
527 | 1 | /* | ||
528 | 2 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
529 | 3 | * Copyright (C) 2011 Daniel Garner | ||
530 | 4 | * | ||
531 | 5 | * This file is part of Xibo. | ||
532 | 6 | * | ||
533 | 7 | * Xibo is free software: you can redistribute it and/or modify | ||
534 | 8 | * it under the terms of the GNU Affero General Public License as published by | ||
535 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
536 | 10 | * any later version. | ||
537 | 11 | * | ||
538 | 12 | * Xibo is distributed in the hope that it will be useful, | ||
539 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
540 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
541 | 15 | * GNU Affero General Public License for more details. | ||
542 | 16 | * | ||
543 | 17 | * You should have received a copy of the GNU Affero General Public License | ||
544 | 18 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
545 | 19 | */ | ||
546 | 20 | using System; | ||
547 | 21 | using System.Collections.Generic; | ||
548 | 22 | using System.Collections.ObjectModel; | ||
549 | 23 | using System.Text; | ||
550 | 24 | using System.IO; | ||
551 | 25 | using System.Security.Cryptography; | ||
552 | 26 | using System.Xml; | ||
553 | 27 | using System.Diagnostics; | ||
554 | 28 | using System.Windows.Forms; | ||
555 | 29 | using System.Xml.Serialization; | ||
556 | 30 | |||
557 | 31 | namespace XiboClient | ||
558 | 32 | { | ||
559 | 33 | public class RequiredFiles | ||
560 | 34 | { | ||
561 | 35 | private XmlDocument _requiredFilesXml; | ||
562 | 36 | public Collection<RequiredFile> _requiredFiles; | ||
563 | 37 | private xmds.xmds _report; | ||
564 | 38 | |||
565 | 39 | public RequiredFiles() | ||
566 | 40 | { | ||
567 | 41 | _requiredFiles = new Collection<RequiredFile>(); | ||
568 | 42 | |||
569 | 43 | // Create a webservice call | ||
570 | 44 | _report = new XiboClient.xmds.xmds(); | ||
571 | 45 | |||
572 | 46 | // Start up the Xmds Service Object | ||
573 | 47 | _report.Credentials = null; | ||
574 | 48 | _report.Url = Properties.Settings.Default.XiboClient_xmds_xmds; | ||
575 | 49 | _report.UseDefaultCredentials = false; | ||
576 | 50 | } | ||
577 | 51 | |||
578 | 52 | /// <summary> | ||
579 | 53 | /// Set required files from the XML document | ||
580 | 54 | /// </summary> | ||
581 | 55 | private void SetRequiredFiles() | ||
582 | 56 | { | ||
583 | 57 | // Itterate through the RF XML and populate the RF collection | ||
584 | 58 | XmlNodeList fileNodes = _requiredFilesXml.SelectNodes("/files/file"); | ||
585 | 59 | |||
586 | 60 | foreach (XmlNode file in fileNodes) | ||
587 | 61 | { | ||
588 | 62 | RequiredFile rf = new RequiredFile(); | ||
589 | 63 | |||
590 | 64 | XmlAttributeCollection attributes = file.Attributes; | ||
591 | 65 | |||
592 | 66 | rf.FileType = attributes["type"].Value; | ||
593 | 67 | rf.Complete = 0; | ||
594 | 68 | rf.Md5 = ""; | ||
595 | 69 | rf.LastChecked = DateTime.Now; | ||
596 | 70 | |||
597 | 71 | if (rf.FileType == "media") | ||
598 | 72 | { | ||
599 | 73 | string[] filePart = attributes["path"].Value.Split('.'); | ||
600 | 74 | rf.Id = int.Parse(filePart[0]); | ||
601 | 75 | rf.Path = attributes["path"].Value; | ||
602 | 76 | } | ||
603 | 77 | else if (rf.FileType == "layout") | ||
604 | 78 | { | ||
605 | 79 | rf.Id = int.Parse(attributes["path"].Value); | ||
606 | 80 | rf.Path = attributes["path"].Value + ".xlf"; | ||
607 | 81 | } | ||
608 | 82 | else | ||
609 | 83 | { | ||
610 | 84 | continue; | ||
611 | 85 | } | ||
612 | 86 | |||
613 | 87 | _requiredFiles.Add(rf); | ||
614 | 88 | } | ||
615 | 89 | } | ||
616 | 90 | |||
617 | 91 | /// <summary> | ||
618 | 92 | /// Required Files XML | ||
619 | 93 | /// </summary> | ||
620 | 94 | public XmlDocument RequiredFilesXml | ||
621 | 95 | { | ||
622 | 96 | set | ||
623 | 97 | { | ||
624 | 98 | _requiredFilesXml = value; | ||
625 | 99 | SetRequiredFiles(); | ||
626 | 100 | } | ||
627 | 101 | } | ||
628 | 102 | |||
629 | 103 | /// <summary> | ||
630 | 104 | /// Mark a RequiredFile as complete | ||
631 | 105 | /// </summary> | ||
632 | 106 | /// <param name="id"></param> | ||
633 | 107 | /// <param name="md5"></param> | ||
634 | 108 | public void MarkComplete(int id, string md5) | ||
635 | 109 | { | ||
636 | 110 | foreach (RequiredFile rf in _requiredFiles) | ||
637 | 111 | { | ||
638 | 112 | if (rf.Id == id) | ||
639 | 113 | { | ||
640 | 114 | RequiredFile newRf = rf; | ||
641 | 115 | |||
642 | 116 | newRf.Complete = 1; | ||
643 | 117 | newRf.Md5 = md5; | ||
644 | 118 | |||
645 | 119 | |||
646 | 120 | _requiredFiles.Add(newRf); | ||
647 | 121 | _requiredFiles.Remove(rf); | ||
648 | 122 | |||
649 | 123 | return; | ||
650 | 124 | } | ||
651 | 125 | } | ||
652 | 126 | } | ||
653 | 127 | |||
654 | 128 | /// <summary> | ||
655 | 129 | /// Mark a RequiredFile as incomplete | ||
656 | 130 | /// </summary> | ||
657 | 131 | /// <param name="id"></param> | ||
658 | 132 | /// <param name="md5"></param> | ||
659 | 133 | public void MarkIncomplete(int id, string md5) | ||
660 | 134 | { | ||
661 | 135 | foreach (RequiredFile rf in _requiredFiles) | ||
662 | 136 | { | ||
663 | 137 | if (rf.Id == id) | ||
664 | 138 | { | ||
665 | 139 | RequiredFile newRf = rf; | ||
666 | 140 | |||
667 | 141 | newRf.Complete = 0; | ||
668 | 142 | newRf.Md5 = md5; | ||
669 | 143 | |||
670 | 144 | _requiredFiles.Add(newRf); | ||
671 | 145 | _requiredFiles.Remove(rf); | ||
672 | 146 | |||
673 | 147 | return; | ||
674 | 148 | } | ||
675 | 149 | } | ||
676 | 150 | } | ||
677 | 151 | |||
678 | 152 | /// <summary> | ||
679 | 153 | /// Writes Required Files to disk | ||
680 | 154 | /// </summary> | ||
681 | 155 | public void WriteRequiredFiles() | ||
682 | 156 | { | ||
683 | 157 | Debug.WriteLine(new LogMessage("RequiredFiles - WriteRequiredFiles", "About to Write RequiredFiles"), LogType.Info.ToString()); | ||
684 | 158 | |||
685 | 159 | try | ||
686 | 160 | { | ||
687 | 161 | using (StreamWriter streamWriter = new StreamWriter(Application.UserAppDataPath + "\\" + Properties.Settings.Default.RequiredFilesFile)) | ||
688 | 162 | { | ||
689 | 163 | XmlSerializer xmlSerializer = new XmlSerializer(typeof(RequiredFiles)); | ||
690 | 164 | |||
691 | 165 | xmlSerializer.Serialize(streamWriter, this); | ||
692 | 166 | } | ||
693 | 167 | } | ||
694 | 168 | catch (Exception ex) | ||
695 | 169 | { | ||
696 | 170 | System.Diagnostics.Trace.WriteLine(new LogMessage("RequiredFiles - WriteRequiredFiles", "Unable to write RequiredFiles to disk because: " + ex.Message)); | ||
697 | 171 | } | ||
698 | 172 | } | ||
699 | 173 | |||
700 | 174 | /// <summary> | ||
701 | 175 | /// Report Required Files to XMDS | ||
702 | 176 | /// </summary> | ||
703 | 177 | public void ReportInventory() | ||
704 | 178 | { | ||
705 | 179 | HardwareKey hardwareKey = new HardwareKey(); | ||
706 | 180 | |||
707 | 181 | // Build the XML required by media file | ||
708 | 182 | string xml = ""; | ||
709 | 183 | |||
710 | 184 | foreach (RequiredFile rf in _requiredFiles) | ||
711 | 185 | { | ||
712 | 186 | xml += string.Format("<file type=\"{0}\" id=\"{1}\" complete=\"{2}\" lastChecked=\"{3}\" md5=\"{4}\" />", | ||
713 | 187 | rf.FileType, rf.Id.ToString(), rf.Complete.ToString(), rf.LastChecked.ToString(), rf.Md5); | ||
714 | 188 | } | ||
715 | 189 | |||
716 | 190 | xml = string.Format("<files>{0}</files>", xml); | ||
717 | 191 | |||
718 | 192 | _report.MediaInventoryAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, | ||
719 | 193 | hardwareKey.Key, xml); | ||
720 | 194 | } | ||
721 | 195 | } | ||
722 | 196 | |||
723 | 197 | public struct RequiredFile | ||
724 | 198 | { | ||
725 | 199 | public string FileType; | ||
726 | 200 | public int Id; | ||
727 | 201 | public int Complete; | ||
728 | 202 | public DateTime LastChecked; | ||
729 | 203 | public string Md5; | ||
730 | 204 | public string Path; | ||
731 | 205 | } | ||
732 | 206 | } | ||
733 | 0 | 207 | ||
734 | === modified file 'client/dotNET/Schedule.cs' | |||
735 | --- client/dotNET/Schedule.cs 2010-08-22 16:49:09 +0000 | |||
736 | +++ client/dotNET/Schedule.cs 2011-02-28 15:09:32 +0000 | |||
737 | @@ -74,7 +74,7 @@ | |||
738 | 74 | _cacheManager = cacheManager; | 74 | _cacheManager = cacheManager; |
739 | 75 | 75 | ||
740 | 76 | // Create a schedule manager | 76 | // Create a schedule manager |
742 | 77 | _scheduleManager = new ScheduleManager(scheduleLocation); | 77 | _scheduleManager = new ScheduleManager(_cacheManager, scheduleLocation); |
743 | 78 | 78 | ||
744 | 79 | // Create a new Xmds service object | 79 | // Create a new Xmds service object |
745 | 80 | _xmds2 = new XiboClient.xmds.xmds(); | 80 | _xmds2 = new XiboClient.xmds.xmds(); |
746 | 81 | 81 | ||
747 | === modified file 'client/dotNET/ScheduleManager.cs' | |||
748 | --- client/dotNET/ScheduleManager.cs 2010-08-25 21:39:53 +0000 | |||
749 | +++ client/dotNET/ScheduleManager.cs 2011-02-28 15:09:32 +0000 | |||
750 | @@ -42,13 +42,15 @@ | |||
751 | 42 | private Collection<LayoutSchedule> _layoutSchedule; | 42 | private Collection<LayoutSchedule> _layoutSchedule; |
752 | 43 | private Collection<LayoutSchedule> _currentSchedule; | 43 | private Collection<LayoutSchedule> _currentSchedule; |
753 | 44 | private bool _refreshSchedule; | 44 | private bool _refreshSchedule; |
754 | 45 | private CacheManager _cacheManager; | ||
755 | 45 | 46 | ||
756 | 46 | /// <summary> | 47 | /// <summary> |
757 | 47 | /// Creates a new schedule Manager | 48 | /// Creates a new schedule Manager |
758 | 48 | /// </summary> | 49 | /// </summary> |
759 | 49 | /// <param name="scheduleLocation"></param> | 50 | /// <param name="scheduleLocation"></param> |
761 | 50 | public ScheduleManager(string scheduleLocation) | 51 | public ScheduleManager(CacheManager cacheManager, string scheduleLocation) |
762 | 51 | { | 52 | { |
763 | 53 | _cacheManager = cacheManager; | ||
764 | 52 | _location = scheduleLocation; | 54 | _location = scheduleLocation; |
765 | 53 | 55 | ||
766 | 54 | // Create an empty layout schedule | 56 | // Create an empty layout schedule |
767 | @@ -178,6 +180,19 @@ | |||
768 | 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 |
769 | 179 | foreach (LayoutSchedule layout in _layoutSchedule) | 181 | foreach (LayoutSchedule layout in _layoutSchedule) |
770 | 180 | { | 182 | { |
771 | 183 | // Is the layout valid in the cachemanager? | ||
772 | 184 | try | ||
773 | 185 | { | ||
774 | 186 | if (!_cacheManager.IsValidLayout(layout.id + ".xlf")) | ||
775 | 187 | continue; | ||
776 | 188 | } | ||
777 | 189 | catch | ||
778 | 190 | { | ||
779 | 191 | // TODO: Ignore this layout.. raise an error? | ||
780 | 192 | Trace.WriteLine("Unable to determine if layout is valid or not"); | ||
781 | 193 | continue; | ||
782 | 194 | } | ||
783 | 195 | |||
784 | 181 | // If this is the default, skip it | 196 | // If this is the default, skip it |
785 | 182 | if (layout.NodeName == "default") | 197 | if (layout.NodeName == "default") |
786 | 183 | { | 198 | { |
787 | 184 | 199 | ||
788 | === modified file 'client/dotNET/Web References/xmds/Reference.cs' | |||
789 | --- client/dotNET/Web References/xmds/Reference.cs 2010-11-09 21:23:31 +0000 | |||
790 | +++ client/dotNET/Web References/xmds/Reference.cs 2011-02-28 15:09:32 +0000 | |||
791 | @@ -45,6 +45,8 @@ | |||
792 | 45 | 45 | ||
793 | 46 | private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted; | 46 | private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted; |
794 | 47 | 47 | ||
795 | 48 | private System.Threading.SendOrPostCallback MediaInventoryOperationCompleted; | ||
796 | 49 | |||
797 | 48 | private bool useDefaultCredentialsSetExplicitly; | 50 | private bool useDefaultCredentialsSetExplicitly; |
798 | 49 | 51 | ||
799 | 50 | /// <remarks/> | 52 | /// <remarks/> |
800 | @@ -108,6 +110,9 @@ | |||
801 | 108 | public event SubmitStatsCompletedEventHandler SubmitStatsCompleted; | 110 | public event SubmitStatsCompletedEventHandler SubmitStatsCompleted; |
802 | 109 | 111 | ||
803 | 110 | /// <remarks/> | 112 | /// <remarks/> |
804 | 113 | public event MediaInventoryCompletedEventHandler MediaInventoryCompleted; | ||
805 | 114 | |||
806 | 115 | /// <remarks/> | ||
807 | 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")] |
808 | 112 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] | 117 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] |
809 | 113 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { | 118 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { |
810 | @@ -402,6 +407,42 @@ | |||
811 | 402 | } | 407 | } |
812 | 403 | 408 | ||
813 | 404 | /// <remarks/> | 409 | /// <remarks/> |
814 | 410 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#MediaInventory", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | ||
815 | 411 | [return: System.Xml.Serialization.SoapElementAttribute("success")] | ||
816 | 412 | public bool MediaInventory(string version, string serverKey, string hardwareKey, [System.Xml.Serialization.SoapElementAttribute("mediaInventory")] string mediaInventory1) { | ||
817 | 413 | object[] results = this.Invoke("MediaInventory", new object[] { | ||
818 | 414 | version, | ||
819 | 415 | serverKey, | ||
820 | 416 | hardwareKey, | ||
821 | 417 | mediaInventory1}); | ||
822 | 418 | return ((bool)(results[0])); | ||
823 | 419 | } | ||
824 | 420 | |||
825 | 421 | /// <remarks/> | ||
826 | 422 | public void MediaInventoryAsync(string version, string serverKey, string hardwareKey, string mediaInventory1) { | ||
827 | 423 | this.MediaInventoryAsync(version, serverKey, hardwareKey, mediaInventory1, null); | ||
828 | 424 | } | ||
829 | 425 | |||
830 | 426 | /// <remarks/> | ||
831 | 427 | public void MediaInventoryAsync(string version, string serverKey, string hardwareKey, string mediaInventory1, object userState) { | ||
832 | 428 | if ((this.MediaInventoryOperationCompleted == null)) { | ||
833 | 429 | this.MediaInventoryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMediaInventoryOperationCompleted); | ||
834 | 430 | } | ||
835 | 431 | this.InvokeAsync("MediaInventory", new object[] { | ||
836 | 432 | version, | ||
837 | 433 | serverKey, | ||
838 | 434 | hardwareKey, | ||
839 | 435 | mediaInventory1}, this.MediaInventoryOperationCompleted, userState); | ||
840 | 436 | } | ||
841 | 437 | |||
842 | 438 | private void OnMediaInventoryOperationCompleted(object arg) { | ||
843 | 439 | if ((this.MediaInventoryCompleted != null)) { | ||
844 | 440 | System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); | ||
845 | 441 | this.MediaInventoryCompleted(this, new MediaInventoryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); | ||
846 | 442 | } | ||
847 | 443 | } | ||
848 | 444 | |||
849 | 445 | /// <remarks/> | ||
850 | 405 | public new void CancelAsync(object userState) { | 446 | public new void CancelAsync(object userState) { |
851 | 406 | base.CancelAsync(userState); | 447 | base.CancelAsync(userState); |
852 | 407 | } | 448 | } |
853 | @@ -627,6 +668,32 @@ | |||
854 | 627 | } | 668 | } |
855 | 628 | } | 669 | } |
856 | 629 | } | 670 | } |
857 | 671 | |||
858 | 672 | /// <remarks/> | ||
859 | 673 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")] | ||
860 | 674 | public delegate void MediaInventoryCompletedEventHandler(object sender, MediaInventoryCompletedEventArgs e); | ||
861 | 675 | |||
862 | 676 | /// <remarks/> | ||
863 | 677 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")] | ||
864 | 678 | [System.Diagnostics.DebuggerStepThroughAttribute()] | ||
865 | 679 | [System.ComponentModel.DesignerCategoryAttribute("code")] | ||
866 | 680 | public partial class MediaInventoryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { | ||
867 | 681 | |||
868 | 682 | private object[] results; | ||
869 | 683 | |||
870 | 684 | internal MediaInventoryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | ||
871 | 685 | base(exception, cancelled, userState) { | ||
872 | 686 | this.results = results; | ||
873 | 687 | } | ||
874 | 688 | |||
875 | 689 | /// <remarks/> | ||
876 | 690 | public bool Result { | ||
877 | 691 | get { | ||
878 | 692 | this.RaiseExceptionIfNecessary(); | ||
879 | 693 | return ((bool)(this.results[0])); | ||
880 | 694 | } | ||
881 | 695 | } | ||
882 | 696 | } | ||
883 | 630 | } | 697 | } |
884 | 631 | 698 | ||
885 | 632 | #pragma warning restore 1591 | 699 | #pragma warning restore 1591 |
886 | 633 | \ No newline at end of file | 700 | \ No newline at end of file |
887 | 634 | 701 | ||
888 | === modified file 'client/dotNET/Web References/xmds/xmds.wsdl' | |||
889 | --- client/dotNET/Web References/xmds/xmds.wsdl 2010-11-09 21:23:31 +0000 | |||
890 | +++ client/dotNET/Web References/xmds/xmds.wsdl 2011-02-28 15:09:32 +0000 | |||
891 | @@ -81,6 +81,15 @@ | |||
892 | 81 | <wsdl:message name="SubmitStatsResponse"> | 81 | <wsdl:message name="SubmitStatsResponse"> |
893 | 82 | <wsdl:part name="success" type="xsd:boolean" /> | 82 | <wsdl:part name="success" type="xsd:boolean" /> |
894 | 83 | </wsdl:message> | 83 | </wsdl:message> |
895 | 84 | <wsdl:message name="MediaInventoryRequest"> | ||
896 | 85 | <wsdl:part name="version" type="xsd:string" /> | ||
897 | 86 | <wsdl:part name="serverKey" type="xsd:string" /> | ||
898 | 87 | <wsdl:part name="hardwareKey" type="xsd:string" /> | ||
899 | 88 | <wsdl:part name="mediaInventory" type="xsd:string" /> | ||
900 | 89 | </wsdl:message> | ||
901 | 90 | <wsdl:message name="MediaInventoryResponse"> | ||
902 | 91 | <wsdl:part name="success" type="xsd:boolean" /> | ||
903 | 92 | </wsdl:message> | ||
904 | 84 | <wsdl:portType name="xmdsPortType"> | 93 | <wsdl:portType name="xmdsPortType"> |
905 | 85 | <wsdl:operation name="RegisterDisplay"> | 94 | <wsdl:operation name="RegisterDisplay"> |
906 | 86 | <documentation>Registered the Display on the Xibo Network</documentation> | 95 | <documentation>Registered the Display on the Xibo Network</documentation> |
907 | @@ -122,6 +131,11 @@ | |||
908 | 122 | <wsdl:input message="tns:SubmitStatsRequest" /> | 131 | <wsdl:input message="tns:SubmitStatsRequest" /> |
909 | 123 | <wsdl:output message="tns:SubmitStatsResponse" /> | 132 | <wsdl:output message="tns:SubmitStatsResponse" /> |
910 | 124 | </wsdl:operation> | 133 | </wsdl:operation> |
911 | 134 | <wsdl:operation name="MediaInventory"> | ||
912 | 135 | <documentation>Report back the clients MediaInventory</documentation> | ||
913 | 136 | <wsdl:input message="tns:MediaInventoryRequest" /> | ||
914 | 137 | <wsdl:output message="tns:MediaInventoryResponse" /> | ||
915 | 138 | </wsdl:operation> | ||
916 | 125 | </wsdl:portType> | 139 | </wsdl:portType> |
917 | 126 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> | 140 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> |
918 | 127 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> | 141 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> |
919 | @@ -197,6 +211,15 @@ | |||
920 | 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/" /> |
921 | 198 | </wsdl:output> | 212 | </wsdl:output> |
922 | 199 | </wsdl:operation> | 213 | </wsdl:operation> |
923 | 214 | <wsdl:operation name="MediaInventory"> | ||
924 | 215 | <soap:operation soapAction="urn:xmds#MediaInventory" style="rpc" /> | ||
925 | 216 | <wsdl:input> | ||
926 | 217 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
927 | 218 | </wsdl:input> | ||
928 | 219 | <wsdl:output> | ||
929 | 220 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
930 | 221 | </wsdl:output> | ||
931 | 222 | </wsdl:operation> | ||
932 | 200 | </wsdl:binding> | 223 | </wsdl:binding> |
933 | 201 | <wsdl:service name="xmds"> | 224 | <wsdl:service name="xmds"> |
934 | 202 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> | 225 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> |
935 | 203 | 226 | ||
936 | === modified file 'client/dotNET/XiboClient.csproj' | |||
937 | --- client/dotNET/XiboClient.csproj 2011-02-09 17:15:43 +0000 | |||
938 | +++ client/dotNET/XiboClient.csproj 2011-02-28 15:09:32 +0000 | |||
939 | @@ -161,6 +161,7 @@ | |||
940 | 161 | <Compile Include="Region.cs"> | 161 | <Compile Include="Region.cs"> |
941 | 162 | <SubType>Component</SubType> | 162 | <SubType>Component</SubType> |
942 | 163 | </Compile> | 163 | </Compile> |
943 | 164 | <Compile Include="RequiredFiles.cs" /> | ||
944 | 164 | <Compile Include="Rss.cs"> | 165 | <Compile Include="Rss.cs"> |
945 | 165 | <SubType>Form</SubType> | 166 | <SubType>Form</SubType> |
946 | 166 | </Compile> | 167 | </Compile> |
947 | 167 | 168 | ||
948 | === modified file 'client/dotNET/app.config' | |||
949 | --- client/dotNET/app.config 2011-02-14 16:21:56 +0000 | |||
950 | +++ client/dotNET/app.config 2011-02-28 15:09:32 +0000 | |||
951 | @@ -79,6 +79,9 @@ | |||
952 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> |
953 | 80 | <value>10</value> | 80 | <value>10</value> |
954 | 81 | </setting> | 81 | </setting> |
955 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
956 | 83 | <value>requiredFiles.xml</value> | ||
957 | 84 | </setting> | ||
958 | 82 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
959 | 83 | </userSettings> | 86 | </userSettings> |
960 | 84 | <applicationSettings> | 87 | <applicationSettings> |
961 | @@ -102,7 +105,7 @@ | |||
962 | 102 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
963 | 103 | </setting> | 106 | </setting> |
964 | 104 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
966 | 105 | <value>1.2.1</value> | 108 | <value>1.2.2</value> |
967 | 106 | </setting> | 109 | </setting> |
968 | 107 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
969 | 108 | <value>900</value> | 111 | <value>900</value> |
970 | 109 | 112 | ||
971 | === modified file 'client/dotNET/bin/Release/AxInterop.ShockwaveFlashObjects.dll' | |||
972 | 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-02-28 15:09:32 +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-02-28 15:09:32 +0000 differ |
973 | === modified file 'client/dotNET/bin/Release/AxInterop.WMPLib.dll' | |||
974 | 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-02-28 15:09:32 +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-02-28 15:09:32 +0000 differ |
975 | === modified file 'client/dotNET/bin/Release/Interop.ShockwaveFlashObjects.dll' | |||
976 | 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-02-28 15:09:32 +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-02-28 15:09:32 +0000 differ |
977 | === modified file 'client/dotNET/bin/Release/Interop.WMPLib.dll' | |||
978 | 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-02-28 15:09:32 +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-02-28 15:09:32 +0000 differ |
979 | === modified file 'client/dotNET/bin/Release/XiboClient.exe.config' | |||
980 | --- client/dotNET/bin/Release/XiboClient.exe.config 2011-02-14 16:21:56 +0000 | |||
981 | +++ client/dotNET/bin/Release/XiboClient.exe.config 2011-02-28 15:09:32 +0000 | |||
982 | @@ -79,6 +79,9 @@ | |||
983 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> |
984 | 80 | <value>10</value> | 80 | <value>10</value> |
985 | 81 | </setting> | 81 | </setting> |
986 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
987 | 83 | <value>requiredFiles.xml</value> | ||
988 | 84 | </setting> | ||
989 | 82 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
990 | 83 | </userSettings> | 86 | </userSettings> |
991 | 84 | <applicationSettings> | 87 | <applicationSettings> |
992 | @@ -102,7 +105,7 @@ | |||
993 | 102 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
994 | 103 | </setting> | 106 | </setting> |
995 | 104 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
997 | 105 | <value>1.2.1</value> | 108 | <value>1.2.2</value> |
998 | 106 | </setting> | 109 | </setting> |
999 | 107 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
1000 | 108 | <value>900</value> | 111 | <value>900</value> |
1001 | 109 | 112 | ||
1002 | === modified file 'client/dotNET/bin/Release/XiboClient.vshost.exe.config' | |||
1003 | --- client/dotNET/bin/Release/XiboClient.vshost.exe.config 2011-02-14 16:21:56 +0000 | |||
1004 | +++ client/dotNET/bin/Release/XiboClient.vshost.exe.config 2011-02-28 15:09:32 +0000 | |||
1005 | @@ -79,6 +79,9 @@ | |||
1006 | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> | 79 | <setting name="emptyLayoutDuration" serializeAs="String"> |
1007 | 80 | <value>10</value> | 80 | <value>10</value> |
1008 | 81 | </setting> | 81 | </setting> |
1009 | 82 | <setting name="RequiredFilesFile" serializeAs="String"> | ||
1010 | 83 | <value>requiredFiles.xml</value> | ||
1011 | 84 | </setting> | ||
1012 | 82 | </XiboClient.Properties.Settings> | 85 | </XiboClient.Properties.Settings> |
1013 | 83 | </userSettings> | 86 | </userSettings> |
1014 | 84 | <applicationSettings> | 87 | <applicationSettings> |
1015 | @@ -102,7 +105,7 @@ | |||
1016 | 102 | <value>cacheManager.xml</value> | 105 | <value>cacheManager.xml</value> |
1017 | 103 | </setting> | 106 | </setting> |
1018 | 104 | <setting name="ClientVersion" serializeAs="String"> | 107 | <setting name="ClientVersion" serializeAs="String"> |
1020 | 105 | <value>1.2.1</value> | 108 | <value>1.2.2</value> |
1021 | 106 | </setting> | 109 | </setting> |
1022 | 107 | <setting name="xmdsResetTimeout" serializeAs="String"> | 110 | <setting name="xmdsResetTimeout" serializeAs="String"> |
1023 | 108 | <value>900</value> | 111 | <value>900</value> |
1024 | 109 | 112 | ||
1025 | === added file 'server/install/database/27.sql' | |||
1026 | --- server/install/database/27.sql 1970-01-01 00:00:00 +0000 | |||
1027 | +++ server/install/database/27.sql 2011-02-28 15:09:32 +0000 | |||
1028 | @@ -0,0 +1,9 @@ | |||
1029 | 1 | |||
1030 | 2 | ALTER TABLE `display` ADD `MediaInventoryStatus` TINYINT NOT NULL , | ||
1031 | 3 | ADD `MediaInventoryXml` LONGTEXT NULL; | ||
1032 | 4 | |||
1033 | 5 | /* VERSION UPDATE */ | ||
1034 | 6 | /* Set the version table, etc */ | ||
1035 | 7 | UPDATE `version` SET `app_ver` = '1.2.2-pre', `XmdsVersion` = 2; | ||
1036 | 8 | UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE'; | ||
1037 | 9 | UPDATE `version` SET `DBVersion` = '27'; | ||
1038 | 0 | \ No newline at end of file | 10 | \ No newline at end of file |
1039 | 1 | 11 | ||
1040 | === modified file 'server/lib/app/kit.class.php' | |||
1041 | --- server/lib/app/kit.class.php 2010-12-01 14:49:39 +0000 | |||
1042 | +++ server/lib/app/kit.class.php 2011-02-28 15:09:32 +0000 | |||
1043 | @@ -376,9 +376,7 @@ | |||
1044 | 376 | static function ClassLoader($class) | 376 | static function ClassLoader($class) |
1045 | 377 | { | 377 | { |
1046 | 378 | if (class_exists($class)) | 378 | if (class_exists($class)) |
1050 | 379 | { | 379 | return; |
1048 | 380 | return true; | ||
1049 | 381 | } | ||
1051 | 382 | 380 | ||
1052 | 383 | $class = strtolower($class); | 381 | $class = strtolower($class); |
1053 | 384 | 382 | ||
1054 | @@ -387,28 +385,26 @@ | |||
1055 | 387 | { | 385 | { |
1056 | 388 | include_once('lib/pages/' . $class . '.class.php'); | 386 | include_once('lib/pages/' . $class . '.class.php'); |
1057 | 389 | } | 387 | } |
1059 | 390 | elseif (file_exists('lib/data/' . $class . '.data.class.php')) | 388 | |
1060 | 389 | if (file_exists('lib/data/' . $class . '.data.class.php')) | ||
1061 | 391 | { | 390 | { |
1062 | 392 | include_once('lib/data/' . $class . '.data.class.php'); | 391 | include_once('lib/data/' . $class . '.data.class.php'); |
1063 | 393 | } | 392 | } |
1065 | 394 | elseif (file_exists('modules/' . $class . '.module.php')) | 393 | |
1066 | 394 | if (file_exists('modules/' . $class . '.module.php')) | ||
1067 | 395 | { | 395 | { |
1068 | 396 | include_once('modules/' . $class . '.module.php'); | 396 | include_once('modules/' . $class . '.module.php'); |
1069 | 397 | } | 397 | } |
1071 | 398 | elseif (file_exists('modules/' . $class . '.php')) | 398 | |
1072 | 399 | if (file_exists('modules/' . $class . '.php')) | ||
1073 | 399 | { | 400 | { |
1074 | 400 | include_once('modules/' . $class . '.php'); | 401 | include_once('modules/' . $class . '.php'); |
1075 | 401 | } | 402 | } |
1077 | 402 | elseif (file_exists('lib/service/' . $class . '.class.php')) | 403 | |
1078 | 404 | if (file_exists('lib/service/' . $class . '.class.php')) | ||
1079 | 403 | { | 405 | { |
1080 | 404 | include_once('lib/service/' . $class . '.class.php'); | 406 | include_once('lib/service/' . $class . '.class.php'); |
1081 | 405 | } | 407 | } |
1082 | 406 | else | ||
1083 | 407 | { | ||
1084 | 408 | return false; | ||
1085 | 409 | } | ||
1086 | 410 | |||
1087 | 411 | return true; | ||
1088 | 412 | } | 408 | } |
1089 | 413 | 409 | ||
1090 | 414 | /** | 410 | /** |
1091 | 415 | 411 | ||
1092 | === modified file 'server/lib/data/display.data.class.php' | |||
1093 | --- server/lib/data/display.data.class.php 2011-02-10 20:42:24 +0000 | |||
1094 | +++ server/lib/data/display.data.class.php 2011-02-28 15:09:32 +0000 | |||
1095 | @@ -251,7 +251,7 @@ | |||
1096 | 251 | * @return | 251 | * @return |
1097 | 252 | * @param $license Object | 252 | * @param $license Object |
1098 | 253 | */ | 253 | */ |
1100 | 254 | public function Touch($license, $clientAddress = '') | 254 | public function Touch($license, $clientAddress = '', $mediaInventoryComplete = 0, $mediaInventoryXml = '') |
1101 | 255 | { | 255 | { |
1102 | 256 | $db =& $this->db; | 256 | $db =& $this->db; |
1103 | 257 | $time = time(); | 257 | $time = time(); |
1104 | @@ -266,6 +266,13 @@ | |||
1105 | 266 | if ($clientAddress != '') | 266 | if ($clientAddress != '') |
1106 | 267 | $SQL .= sprintf(" , ClientAddress = '%s' ", $db->escape_string($clientAddress)); | 267 | $SQL .= sprintf(" , ClientAddress = '%s' ", $db->escape_string($clientAddress)); |
1107 | 268 | 268 | ||
1108 | 269 | // Media Inventory Settings (if appropriate) | ||
1109 | 270 | if ($mediaInventoryComplete != 0) | ||
1110 | 271 | $SQL .= sprintf(" , MediaInventoryStatus = %d ", $mediaInventoryComplete); | ||
1111 | 272 | |||
1112 | 273 | if ($mediaInventoryXml != '') | ||
1113 | 274 | $SQL .= sprintf(" , MediaInventoryXml = '%s' ", $mediaInventoryXml); | ||
1114 | 275 | |||
1115 | 269 | // Restrict to the display license | 276 | // Restrict to the display license |
1116 | 270 | $SQL .= " WHERE license = '%s'"; | 277 | $SQL .= " WHERE license = '%s'"; |
1117 | 271 | $SQL = sprintf($SQL, $time, $license); | 278 | $SQL = sprintf($SQL, $time, $license); |
1118 | @@ -284,31 +291,68 @@ | |||
1119 | 284 | } | 291 | } |
1120 | 285 | 292 | ||
1121 | 286 | /** | 293 | /** |
1123 | 287 | * Edits the default layout for a display | 294 | * Flags a display as being incomplete |
1124 | 288 | * @param <type> $displayId | 295 | * @param <type> $displayId |
1125 | 289 | * @param <type> $defaultLayoutId | ||
1126 | 290 | * @return <type> | ||
1127 | 291 | */ | 296 | */ |
1129 | 292 | public function EditDefaultLayout($displayId, $defaultLayoutId) | 297 | private function FlagIncomplete($displayId) |
1130 | 293 | { | 298 | { |
1136 | 294 | $db =& $this->db; | 299 | $db =& $this->db; |
1137 | 295 | 300 | ||
1138 | 296 | Debug::LogEntry($db, 'audit', 'IN', 'Display', 'EditDefaultLayout'); | 301 | Debug::LogEntry($db, 'audit', sprintf('Flag DisplayID %d incomplete.', $displayId), 'display', 'NotifyDisplays'); |
1139 | 297 | 302 | ||
1140 | 298 | $SQL = sprintf('UPDATE display SET defaultLayoutId = %d WHERE displayID = %d ', $defaultLayoutId, $displayId); | 303 | $SQL = sprintf("UPDATE display SET MediaInventoryStatus = 3 WHERE displayID = %d", $displayId); |
1141 | 299 | 304 | ||
1142 | 300 | if (!$db->query($SQL)) | 305 | if (!$db->query($SQL)) |
1143 | 301 | { | 306 | { |
1144 | 302 | trigger_error($db->error()); | 307 | trigger_error($db->error()); |
1148 | 303 | $this->SetError(25012, __('Error updating this displays default layout.')); | 308 | return $this->SetError(25004, 'Unable to Flag Display as incomplete'); |
1146 | 304 | |||
1147 | 305 | return false; | ||
1149 | 306 | } | 309 | } |
1150 | 307 | 310 | ||
1151 | 308 | |||
1152 | 309 | Debug::LogEntry($db, 'audit', 'OUT', 'Display', 'EditDefaultLayout'); | ||
1153 | 310 | |||
1154 | 311 | return true; | 311 | return true; |
1155 | 312 | } | 312 | } |
1156 | 313 | |||
1157 | 314 | /** | ||
1158 | 315 | * Notify displays of this layout change | ||
1159 | 316 | * @param <type> $layoutId | ||
1160 | 317 | */ | ||
1161 | 318 | public function NotifyDisplays($layoutId) | ||
1162 | 319 | { | ||
1163 | 320 | $db =& $this->db; | ||
1164 | 321 | $currentdate = time(); | ||
1165 | 322 | $rfLookahead = Kit::ValidateParam(Config::GetSetting($db,'REQUIRED_FILES_LOOKAHEAD'), _INT); | ||
1166 | 323 | |||
1167 | 324 | $rfLookahead = $currentdate + $rfLookahead; | ||
1168 | 325 | |||
1169 | 326 | Debug::LogEntry($db, 'audit', sprintf('Checking for Displays to refresh on Layout %d', $layoutId), 'display', 'NotifyDisplays'); | ||
1170 | 327 | |||
1171 | 328 | // Which displays does a change to this layout effect? | ||
1172 | 329 | $SQL = " SELECT DISTINCT display.DisplayID "; | ||
1173 | 330 | $SQL .= " FROM schedule_detail "; | ||
1174 | 331 | $SQL .= " INNER JOIN lkdisplaydg "; | ||
1175 | 332 | $SQL .= " ON lkdisplaydg.DisplayGroupID = schedule_detail.DisplayGroupID "; | ||
1176 | 333 | $SQL .= " INNER JOIN display "; | ||
1177 | 334 | $SQL .= " ON lkdisplaydg.DisplayID = display.displayID "; | ||
1178 | 335 | $SQL .= " WHERE schedule_detail.layoutID = %d "; | ||
1179 | 336 | $SQL .= " AND schedule_detail.FromDT < %d AND schedule_detail.ToDT > %d "; | ||
1180 | 337 | $SQL .= " UNION "; | ||
1181 | 338 | $SQL .= " SELECT DisplayID FROM display WHERE DefaultLayoutID = %d"; | ||
1182 | 339 | |||
1183 | 340 | $SQL = sprintf($SQL, $layoutId, $rfLookahead, $currentdate - 3600, $layoutId); | ||
1184 | 341 | |||
1185 | 342 | Debug::LogEntry($db, 'audit', $SQL, 'display', 'NotifyDisplays'); | ||
1186 | 343 | |||
1187 | 344 | if (!$result = $db->query($SQL)) | ||
1188 | 345 | { | ||
1189 | 346 | trigger_error($db->error()); | ||
1190 | 347 | return $this->SetError(25037, __('Unable to get layouts for Notify')); | ||
1191 | 348 | } | ||
1192 | 349 | |||
1193 | 350 | while ($row = $db->get_assoc_row($result)) | ||
1194 | 351 | { | ||
1195 | 352 | // Notify each display in turn | ||
1196 | 353 | $displayId = Kit::ValidateParam($row['DisplayID'], _INT); | ||
1197 | 354 | $this->FlagIncomplete($displayId); | ||
1198 | 355 | } | ||
1199 | 356 | } | ||
1200 | 313 | } | 357 | } |
1201 | 314 | ?> | 358 | ?> |
1202 | 315 | 359 | ||
1203 | === modified file 'server/lib/data/schedule.data.class.php' | |||
1204 | --- server/lib/data/schedule.data.class.php 2011-02-10 19:46:44 +0000 | |||
1205 | +++ server/lib/data/schedule.data.class.php 2011-02-28 15:09:32 +0000 | |||
1206 | @@ -164,6 +164,11 @@ | |||
1207 | 164 | } | 164 | } |
1208 | 165 | } | 165 | } |
1209 | 166 | } | 166 | } |
1210 | 167 | |||
1211 | 168 | // Notify (dont error) | ||
1212 | 169 | Kit::ClassLoader('Display'); | ||
1213 | 170 | $displayObject = new Display($db); | ||
1214 | 171 | $displayObject->NotifyDisplays($layoutID); | ||
1215 | 167 | 172 | ||
1216 | 168 | Debug::LogEntry($db, 'audit', 'OUT', 'Schedule', 'Add'); | 173 | Debug::LogEntry($db, 'audit', 'OUT', 'Schedule', 'Add'); |
1217 | 169 | 174 | ||
1218 | 170 | 175 | ||
1219 | === modified file 'server/lib/pages/display.class.php' | |||
1220 | --- server/lib/pages/display.class.php 2011-02-13 17:16:01 +0000 | |||
1221 | +++ server/lib/pages/display.class.php 2011-02-28 15:09:32 +0000 | |||
1222 | @@ -37,6 +37,8 @@ | |||
1223 | 37 | private $email_alert; | 37 | private $email_alert; |
1224 | 38 | private $alert_timeout; | 38 | private $alert_timeout; |
1225 | 39 | private $ajax; | 39 | private $ajax; |
1226 | 40 | private $mediaInventoryStatus; | ||
1227 | 41 | private $mediaInventoryXml; | ||
1228 | 40 | 42 | ||
1229 | 41 | function __construct(database $db, user $user) | 43 | function __construct(database $db, user $user) |
1230 | 42 | { | 44 | { |
1231 | @@ -71,7 +73,9 @@ | |||
1232 | 71 | display.isAuditing, | 73 | display.isAuditing, |
1233 | 72 | display.email_alert, | 74 | display.email_alert, |
1234 | 73 | display.alert_timeout, | 75 | display.alert_timeout, |
1236 | 74 | display.ClientAddress | 76 | display.ClientAddress, |
1237 | 77 | display.MediaInventoryStatus, | ||
1238 | 78 | display.MediaInventoryXml | ||
1239 | 75 | FROM display | 79 | FROM display |
1240 | 76 | WHERE display.displayid = %d | 80 | WHERE display.displayid = %d |
1241 | 77 | SQL; | 81 | SQL; |
1242 | @@ -95,8 +99,10 @@ | |||
1243 | 95 | $this->licensed = Kit::ValidateParam($row[4], _INT); | 99 | $this->licensed = Kit::ValidateParam($row[4], _INT); |
1244 | 96 | $this->inc_schedule = Kit::ValidateParam($row[5], _INT); | 100 | $this->inc_schedule = Kit::ValidateParam($row[5], _INT); |
1245 | 97 | $this->auditing = Kit::ValidateParam($row[6], _INT); | 101 | $this->auditing = Kit::ValidateParam($row[6], _INT); |
1248 | 98 | $this->email_alert = Kit::ValidateParam($row[7], _INT); | 102 | $this->email_alert = Kit::ValidateParam($row[7], _INT); |
1249 | 99 | $this->alert_timeout = Kit::ValidateParam($row[8], _INT); | 103 | $this->alert_timeout = Kit::ValidateParam($row[8], _INT); |
1250 | 104 | $this->mediaInventoryStatus = Kit::ValidateParam($row[9], _INT); | ||
1251 | 105 | $this->mediaInventoryXml = Kit::ValidateParam($row[10], _HTMLSTRING); | ||
1252 | 100 | } | 106 | } |
1253 | 101 | } | 107 | } |
1254 | 102 | 108 | ||
1255 | @@ -309,7 +315,12 @@ | |||
1256 | 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, |
1257 | 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, |
1258 | 311 | displaygroup.DisplayGroupID, | 317 | displaygroup.DisplayGroupID, |
1260 | 312 | display.ClientAddress | 318 | display.ClientAddress, |
1261 | 319 | CASE WHEN display.MediaInventoryStatus = 1 THEN '<img src="img/act.gif">' | ||
1262 | 320 | WHEN display.MediaInventoryStatus = 2 THEN '<img src="img/warn.gif">' | ||
1263 | 321 | ELSE '<img src="img/disact.gif">' | ||
1264 | 322 | END AS MediaInventoryStatus, | ||
1265 | 323 | display.MediaInventoryXml | ||
1266 | 313 | FROM display | 324 | FROM display |
1267 | 314 | INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID | 325 | INNER JOIN lkdisplaydg ON lkdisplaydg.DisplayID = display.DisplayID |
1268 | 315 | INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID | 326 | INNER JOIN displaygroup ON displaygroup.DisplayGroupID = lkdisplaydg.DisplayGroupID |
1269 | @@ -341,6 +352,8 @@ | |||
1270 | 341 | $msgGroupSecurity = __('Group Security'); | 352 | $msgGroupSecurity = __('Group Security'); |
1271 | 342 | $msgClientAddress = __('IP Address'); | 353 | $msgClientAddress = __('IP Address'); |
1272 | 343 | $msgDefault = __('Default Layout'); | 354 | $msgDefault = __('Default Layout'); |
1273 | 355 | $msgStatus = __('Status'); | ||
1274 | 356 | $msgMediaInventory = __('Media Inventory'); | ||
1275 | 344 | 357 | ||
1276 | 345 | $output = <<<END | 358 | $output = <<<END |
1277 | 346 | <div class="info_table"> | 359 | <div class="info_table"> |
1278 | @@ -356,6 +369,7 @@ | |||
1279 | 356 | <th>$msgLogIn</th> | 369 | <th>$msgLogIn</th> |
1280 | 357 | <th>$msgLastA</th> | 370 | <th>$msgLastA</th> |
1281 | 358 | <th>$msgClientAddress</th> | 371 | <th>$msgClientAddress</th> |
1282 | 372 | <th>$msgStatus</th> | ||
1283 | 359 | <th>$msgAction</th> | 373 | <th>$msgAction</th> |
1284 | 360 | </tr> | 374 | </tr> |
1285 | 361 | </thead> | 375 | </thead> |
1286 | @@ -385,6 +399,7 @@ | |||
1287 | 385 | // Do we want to make a VNC link out of the display name? | 399 | // Do we want to make a VNC link out of the display name? |
1288 | 386 | $vncTemplate = Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNCLINK'); | 400 | $vncTemplate = Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNCLINK'); |
1289 | 387 | $linkTarget = Kit::ValidateParam(Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNC_TGT'), _STRING); | 401 | $linkTarget = Kit::ValidateParam(Config::GetSetting($db, 'SHOW_DISPLAY_AS_VNC_TGT'), _STRING); |
1290 | 402 | $mediaInventoryStatusLight = Kit::ValidateParam($aRow[10], _STRING); | ||
1291 | 388 | 403 | ||
1292 | 389 | if ($vncTemplate != '' && $clientAddress != '') | 404 | if ($vncTemplate != '' && $clientAddress != '') |
1293 | 390 | { | 405 | { |
1294 | @@ -424,6 +439,7 @@ | |||
1295 | 424 | <td>$loggedin</td> | 439 | <td>$loggedin</td> |
1296 | 425 | <td>$lastaccessed</td> | 440 | <td>$lastaccessed</td> |
1297 | 426 | <td>$clientAddress</td> | 441 | <td>$clientAddress</td> |
1298 | 442 | <td>$mediaInventoryStatusLight</td> | ||
1299 | 427 | <td>$buttons</td> | 443 | <td>$buttons</td> |
1300 | 428 | END; | 444 | END; |
1301 | 429 | } | 445 | } |
1302 | @@ -720,5 +736,59 @@ | |||
1303 | 720 | $response->SetFormSubmitResponse(__('Display Saved.')); | 736 | $response->SetFormSubmitResponse(__('Display Saved.')); |
1304 | 721 | $response->Respond(); | 737 | $response->Respond(); |
1305 | 722 | } | 738 | } |
1306 | 739 | |||
1307 | 740 | /** | ||
1308 | 741 | * Shows the inventory XML for the display | ||
1309 | 742 | */ | ||
1310 | 743 | public function MediaInventory() | ||
1311 | 744 | { | ||
1312 | 745 | $db =& $this->db; | ||
1313 | 746 | $response = new ResponseManager(); | ||
1314 | 747 | $displayId = Kit::GetParam('DisplayId', _GET, _INT); | ||
1315 | 748 | |||
1316 | 749 | if ($displayId == 0) | ||
1317 | 750 | trigger_error(__('No DisplayId Given')); | ||
1318 | 751 | |||
1319 | 752 | // Get the media inventory xml for this display | ||
1320 | 753 | $SQL = "SELECT MediaInventoryXml FROM display WHERE DisplayId = %d"; | ||
1321 | 754 | $SQL = sprintf($SQL, $displayId); | ||
1322 | 755 | |||
1323 | 756 | if (!$mediaInventoryXml = $db->GetSingleValue($SQL, 'MediaInventoryXml', _HTMLSTRING)) | ||
1324 | 757 | { | ||
1325 | 758 | trigger_error($db->error()); | ||
1326 | 759 | trigger_error(__('Unable to get the Inventory for this Display'), E_USER_ERROR); | ||
1327 | 760 | } | ||
1328 | 761 | |||
1329 | 762 | // Load the XML into a DOMDocument | ||
1330 | 763 | $document = new DOMDocument("1.0"); | ||
1331 | 764 | |||
1332 | 765 | if (!$document->loadXML($mediaInventoryXml)) | ||
1333 | 766 | trigger_error(__('Invalid Media Inventory'), E_USER_ERROR); | ||
1334 | 767 | |||
1335 | 768 | // Output a table | ||
1336 | 769 | $table = '<table><tr><th>Type</th><th>Id</th><th>Complete</th><th>Last Checked</th><th>MD5</th></tr>'; | ||
1337 | 770 | |||
1338 | 771 | foreach ($document->documentElement->childNodes as $node) | ||
1339 | 772 | { | ||
1340 | 773 | $type = $node->getAttribute('type'); | ||
1341 | 774 | $id = $node->getAttribute('id'); | ||
1342 | 775 | $complete = $node->getAttribute('complete'); | ||
1343 | 776 | $lastChecked = $node->getAttribute('lastChecked'); | ||
1344 | 777 | $md5 = $node->getAttribute('md5'); | ||
1345 | 778 | |||
1346 | 779 | if ($complete == 0) | ||
1347 | 780 | $complete = __('No'); | ||
1348 | 781 | else | ||
1349 | 782 | $complete = __('Yes'); | ||
1350 | 783 | |||
1351 | 784 | $table .= sprintf('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>', $type, $id, $complete, $lastChecked, $md5); | ||
1352 | 785 | } | ||
1353 | 786 | |||
1354 | 787 | $table .= '</table>'; | ||
1355 | 788 | |||
1356 | 789 | $response->SetFormRequestResponse($table, __('Media Inventory'), '550px', '350px'); | ||
1357 | 790 | $response->AddButton(__('Close'), 'XiboDialogClose()'); | ||
1358 | 791 | $response->Respond(); | ||
1359 | 792 | } | ||
1360 | 723 | } | 793 | } |
1361 | 724 | ?> | 794 | ?> |
1362 | 725 | 795 | ||
1363 | === modified file 'server/lib/pages/layout.class.php' | |||
1364 | --- server/lib/pages/layout.class.php 2011-02-10 21:01:27 +0000 | |||
1365 | +++ server/lib/pages/layout.class.php 2011-02-28 15:09:32 +0000 | |||
1366 | @@ -427,6 +427,12 @@ | |||
1367 | 427 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); | 427 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); |
1368 | 428 | } | 428 | } |
1369 | 429 | 429 | ||
1370 | 430 | // Notify (dont error) | ||
1371 | 431 | Kit::ClassLoader('display'); | ||
1372 | 432 | $displayObject = new Display($db); | ||
1373 | 433 | $displayObject->NotifyDisplays($this->layoutid); | ||
1374 | 434 | |||
1375 | 435 | |||
1376 | 430 | $response->SetFormSubmitResponse(__('Layout Details Changed.')); | 436 | $response->SetFormSubmitResponse(__('Layout Details Changed.')); |
1377 | 431 | $response->Respond(); | 437 | $response->Respond(); |
1378 | 432 | } | 438 | } |
1379 | 433 | 439 | ||
1380 | === modified file 'server/lib/pages/region.class.php' | |||
1381 | --- server/lib/pages/region.class.php 2010-05-29 11:16:24 +0000 | |||
1382 | +++ server/lib/pages/region.class.php 2011-02-28 15:09:32 +0000 | |||
1383 | @@ -76,6 +76,11 @@ | |||
1384 | 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"); |
1385 | 77 | return false; | 77 | return false; |
1386 | 78 | } | 78 | } |
1387 | 79 | |||
1388 | 80 | // Notify (dont error) | ||
1389 | 81 | Kit::ClassLoader('display'); | ||
1390 | 82 | $displayObject = new Display($db); | ||
1391 | 83 | $displayObject->NotifyDisplays($layoutid); | ||
1392 | 79 | 84 | ||
1393 | 80 | return true; | 85 | return true; |
1394 | 81 | } | 86 | } |
1395 | 82 | 87 | ||
1396 | === modified file 'server/lib/service/service.wsdl' | |||
1397 | --- server/lib/service/service.wsdl 2010-01-31 00:38:32 +0000 | |||
1398 | +++ server/lib/service/service.wsdl 2011-02-28 15:09:32 +0000 | |||
1399 | @@ -80,6 +80,15 @@ | |||
1400 | 80 | <message name="SubmitStatsResponse"> | 80 | <message name="SubmitStatsResponse"> |
1401 | 81 | <part name="success" type="xsd:boolean" /> | 81 | <part name="success" type="xsd:boolean" /> |
1402 | 82 | </message> | 82 | </message> |
1403 | 83 | <message name="MediaInventoryRequest"> | ||
1404 | 84 | <part name="version" type="xsd:string" /> | ||
1405 | 85 | <part name="serverKey" type="xsd:string" /> | ||
1406 | 86 | <part name="hardwareKey" type="xsd:string" /> | ||
1407 | 87 | <part name="mediaInventory" type="xsd:string" /> | ||
1408 | 88 | </message> | ||
1409 | 89 | <message name="MediaInventoryResponse"> | ||
1410 | 90 | <part name="success" type="xsd:boolean" /> | ||
1411 | 91 | </message> | ||
1412 | 83 | <portType name="xmdsPortType"> | 92 | <portType name="xmdsPortType"> |
1413 | 84 | <operation name="RegisterDisplay"> | 93 | <operation name="RegisterDisplay"> |
1414 | 85 | <documentation>Registered the Display on the Xibo Network</documentation> | 94 | <documentation>Registered the Display on the Xibo Network</documentation> |
1415 | @@ -121,6 +130,11 @@ | |||
1416 | 121 | <input message="tns:SubmitStatsRequest"/> | 130 | <input message="tns:SubmitStatsRequest"/> |
1417 | 122 | <output message="tns:SubmitStatsResponse"/> | 131 | <output message="tns:SubmitStatsResponse"/> |
1418 | 123 | </operation> | 132 | </operation> |
1419 | 133 | <operation name="MediaInventory"> | ||
1420 | 134 | <documentation>Report back the clients MediaInventory</documentation> | ||
1421 | 135 | <input message="tns:MediaInventoryRequest" /> | ||
1422 | 136 | <output message="tns:MediaInventoryResponse" /> | ||
1423 | 137 | </operation> | ||
1424 | 124 | </portType> | 138 | </portType> |
1425 | 125 | <binding name="xmdsBinding" type="tns:xmdsPortType"> | 139 | <binding name="xmdsBinding" type="tns:xmdsPortType"> |
1426 | 126 | <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> | 140 | <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> |
1427 | @@ -196,6 +210,15 @@ | |||
1428 | 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/"/> |
1429 | 197 | </output> | 211 | </output> |
1430 | 198 | </operation> | 212 | </operation> |
1431 | 213 | <operation name="MediaInventory"> | ||
1432 | 214 | <soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/> | ||
1433 | 215 | <input> | ||
1434 | 216 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> | ||
1435 | 217 | </input> | ||
1436 | 218 | <output> | ||
1437 | 219 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> | ||
1438 | 220 | </output> | ||
1439 | 221 | </operation> | ||
1440 | 199 | </binding> | 222 | </binding> |
1441 | 200 | <service name="xmds"> | 223 | <service name="xmds"> |
1442 | 201 | <port name="xmdsPort" binding="tns:xmdsBinding"> | 224 | <port name="xmdsPort" binding="tns:xmdsBinding"> |
1443 | 202 | 225 | ||
1444 | === modified file 'server/lib/service/xmdssoap.class.php' | |||
1445 | --- server/lib/service/xmdssoap.class.php 2011-02-07 16:46:09 +0000 | |||
1446 | +++ server/lib/service/xmdssoap.class.php 2011-02-28 15:09:32 +0000 | |||
1447 | @@ -848,6 +848,66 @@ | |||
1448 | 848 | } | 848 | } |
1449 | 849 | 849 | ||
1450 | 850 | /** | 850 | /** |
1451 | 851 | * Store the media inventory for a client | ||
1452 | 852 | * @param <type> $hardwareKey | ||
1453 | 853 | * @param <type> $inventory | ||
1454 | 854 | */ | ||
1455 | 855 | public function MediaInventory($version, $serverKey, $hardwareKey, $inventory) | ||
1456 | 856 | { | ||
1457 | 857 | $db =& $this->db; | ||
1458 | 858 | |||
1459 | 859 | // Sanitize | ||
1460 | 860 | $serverKey = Kit::ValidateParam($serverKey, _STRING); | ||
1461 | 861 | $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING); | ||
1462 | 862 | $version = Kit::ValidateParam($version, _STRING); | ||
1463 | 863 | $inventory = Kit::ValidateParam($inventory, _HTMLSTRING); | ||
1464 | 864 | |||
1465 | 865 | // Make sure we are talking the same language | ||
1466 | 866 | if (!$this->CheckVersion($version)) | ||
1467 | 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"); | ||
1468 | 868 | |||
1469 | 869 | // Auth this request... | ||
1470 | 870 | if (!$this->AuthDisplay($hardwareKey)) | ||
1471 | 871 | throw new SoapFault('Receiver', 'This display client is not licensed'); | ||
1472 | 872 | |||
1473 | 873 | if ($this->isAuditing == 1) Debug::LogEntry ($db, 'audit', $inventory, 'xmds', 'MediaInventory', '', $this->displayId); | ||
1474 | 874 | |||
1475 | 875 | // Check that the $inventory contains something | ||
1476 | 876 | if ($inventory == '') | ||
1477 | 877 | throw new SoapFault('Receiver', 'Inventory Cannot be Empty'); | ||
1478 | 878 | |||
1479 | 879 | // Load the XML into a DOMDocument | ||
1480 | 880 | $document = new DOMDocument("1.0"); | ||
1481 | 881 | $document->loadXML($inventory); | ||
1482 | 882 | |||
1483 | 883 | // Assume we are complete (but we are getting some) | ||
1484 | 884 | $mediaInventoryComplete = 1; | ||
1485 | 885 | |||
1486 | 886 | foreach ($document->documentElement->childNodes as $node) | ||
1487 | 887 | { | ||
1488 | 888 | // Make sure we dont consider any text nodes | ||
1489 | 889 | if ($node->nodeType == XML_TEXT_NODE) continue; | ||
1490 | 890 | |||
1491 | 891 | $mediaId = $node->getAttribute('id'); | ||
1492 | 892 | $complete = $node->getAttribute('complete'); | ||
1493 | 893 | $md5 = $node->getAttribute('md5'); | ||
1494 | 894 | $lastChecked = $node->getAttribute('lastChecked'); | ||
1495 | 895 | |||
1496 | 896 | // Check the MD5? | ||
1497 | 897 | |||
1498 | 898 | // If this item is a 0 then set not complete | ||
1499 | 899 | if ($complete == 0) | ||
1500 | 900 | $mediaInventoryComplete = 2; | ||
1501 | 901 | } | ||
1502 | 902 | |||
1503 | 903 | // Touch the display record | ||
1504 | 904 | $displayObject = new Display($db); | ||
1505 | 905 | $displayObject->Touch($hardwareKey, '', $mediaInventoryComplete, $inventory); | ||
1506 | 906 | |||
1507 | 907 | return true; | ||
1508 | 908 | } | ||
1509 | 909 | |||
1510 | 910 | /** | ||
1511 | 851 | * Authenticates the display | 911 | * Authenticates the display |
1512 | 852 | * @param <type> $hardwareKey | 912 | * @param <type> $hardwareKey |
1513 | 853 | * @return <type> | 913 | * @return <type> |