What's new? | Help | Directory | Sign in
Google
gears
Improving Your Web Browser
  
  
  
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

<!--
Copyright 2007, Google Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of Google Inc. nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<html>
<head>
<title>LocalServer API</title>
<link rel="stylesheet" type="text/css" href="gears.css" />
</head>

<body>

<h1>LocalServer API</h1>

<div id="pagecontent">

<p>The LocalServer module allows a web application to cache and serve its HTTP
resources locally, without a network connection.</p>
<h3>Contents</h3>
<ol class="toc">
<li><a href="#overview">Overview</a></li>
<li><a href="#example">Example</a>
<li><a href="#classes">Classes
</a>
<ol>
<li><a href="#LocalServer" >LocalServer</a></li>
<li><a href="#ManagedResourceStore">ManagedResourceStore</a></li>
<li><a href="#ResourceStore">ResourceStore</a></li>
<li><a href="#FileSubmitter">FileSubmitter</a></li>
</ol>
</li>
<li><a href="#manifest_file">Manifest file</a></li>
<li><a href="#required_cookie">Cookies and the LocalServer</a></li>
<li><a href="#filesystem_location">Location of cached files</a></li>
</ol>


<h2 id="overview">Overview</h2>

<p>The LocalServer module is a specialized URL cache that the web application
controls. Requests for URLs in the LocalServer's cache are intercepted and
served locally from the user's disk.</p>

<p>Applications manage the cache using two classes:</p>

<ul>
<li><a href="#ResourceStore">ResourceStore</a> - for capturing ad-hoc URLs
using JavaScript. The ResourceStore allows an application to capture user data
files that need to be addressed with a URL, such as a PDF file or an
image.</li>
<li><a href="#ManagedResourceStore">ManagedResourceStore</a> - for capturing a
related set of URLs that are declared in a <em>manifest file</em>, and are
updated automatically. The ManagedResourceStore allows the set of resources
needed to run a web application to be captured.</li>
</ul>

<p>For both types of stores, the set of URLs captured is explicitly controlled by the web application.</p>

<h3>Serving and updating cached resources</h3>
<p>The LocalServer intercepts HTTP/HTTPS requests and serves them from the cache when all of these conditions are met:</p>
<ul>
<li>The URL is cached in a ResourceStore or ManagedResourceStore,</li>
<li>The store's <code>enabled</code> attribute is set to true, and </li>
<li>If the store has a <code>requiredCookie</code> attribute,
the request must have a cookie that matches. For further details read <a href="#required_cookie">Cookies and the LocalServer</a>.</li>
</ul>

<p>The LocalServer <em>always</em> serves a cached resource when the conditions are met, regardless of the network connection. The URLs contained in a store
are eligible for local serving without requiring the application to open the store.</p>

<p>To disable local serving of stored resources and force URLs to be served using the regular network connection, the application can set
the store's <code>enabled</code> attribute to false.</p>

<p>A key difference between the two types of stores is how resources are
updated. The contents of a ManagedResourceStore are automatically updated
periodically by Gears, even if the web developer never calls
<a href="#checkforupdate">checkForUpdate()</a>. For more information, see
<a href="#ManagedResourceStoreUpdates">ManagedResourceStore Updates</a>.
The ResourceStore's contents are never automatically updated, and are only
updated when the developer explicitly calls <code>capture()</code>.</p>

<h3>Permission</h3>

<p>This API requires user permission. If you would like to customize the
default dialog, you can explicitly call
<code>google.gears.factory.getPermission()</code> - <a
href="api_factory.html">see how.</a></p>

<p>&nbsp;</p>


<h2 id="example">Example</h2>

<pre><code>&lt;script type="text/javascript" src="<a href='tools.html#gears_init'>gears_init.js</a>"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
var localServer = google.gears.factory.create('beta.localserver');
var store = localServer.createManagedStore('test-store');
store.manifestUrl = 'site-manifest.txt';
store.checkForUpdate();
&lt;/script&gt;</code></pre>
<pre><code>// site-manifest.txt
{
"betaManifestVersion": 1,
"version": "site_version_string",
"entries": [
{ "url": "site.html" },
{ "url": "gears_init.js" }
]
}</code></pre>

<h3 id="classes">Classes</h3>
<pre><code><a href="#LocalServer" class="section">LocalServer class</a>
boolean <b>canServeLocally</b>(string url)
ResourceStore <b>createStore</b>(string name, [string requiredCookie])
ResourceStore <b>openStore</b>(string name, [string requiredCookie])
void <b>removeStore</b>(string name, [string requiredCookie])
ManagedResourceStore <b>createManagedStore</b>(string name, [string requiredCookie])
ManagedResourceStore <b>openManagedStore</b>(string name, [string requiredCookie])
void <b>removeManagedStore</b>(string name, [string requiredCookie])</code></pre>


<pre><code><a href="#ManagedResourceStore">ManagedResourceStore class</a>
readonly attribute string <b>name</b>
readonly attribute string <b>requiredCookie</b>
readwrite attribute boolean <b>enabled</b>
readwrite attribute string <b>manifestUrl</b>
readonly attribute int <b>lastUpdateCheckTime</b>
readonly attribute int <b>updateStatus</b>
readonly attribute string <b>lastErrorMessage</b>
readonly attribute string <b>currentVersion</b>
event void <b>oncomplete</b>(Object details)
event void <b>onerror</b>(Error error)
event void <b>onprogress</b>(Object details)
void <b>checkForUpdate</b>()</code></pre>

<pre><code><a href="#ResourceStore">ResourceStore class</a>
readonly attribute string <b>name</b>
readonly attribute string <b>requiredCookie</b>
readwrite attribute boolean <b>enabled</b>
int <b>capture</b>(string urlOrUrlArray, completionCallback)
void <b>abortCapture</b>(int captureId)
void <b>remove</b>(string url)
void <b>rename</b>(string srcUrl, string destUrl)
void <b>copy</b>(string srcUrl, string destUrl)
boolean <b>isCaptured</b>(string url)
void <b>captureFile</b>(fileInputElement, url)
string <b>getCapturedFileName</b>(url)
string <b>getHeader</b>(string url, string name)
string <b>getAllHeaders</b>(string url)
FileSubmitter <b>createFileSubmitter</b>()</code></pre>

<pre><code><a href="api_localserver.html#FileSubmitter">FileSubmitter class</a>
void <b>setFileInputElement</b>(htmlElement el, string url)</code></pre>

<p>
<!------------------------------------------------------------->
<!-- LocalServer -->
<!------------------------------------------------------------->

<br>
<a name="LocalServer"></a> </p>
<h2>LocalServer class</h2>


<p>The LocalServer is a factory and container for the set of
ResourceStores and ManagedResourceStores your application creates and uses. Use resource stores to enable your JavaScript application to execute without a network connection. </p>

<p>To create a LocalServer object, use the Gears Factory as follows:</p>

<pre><code>&lt;script type="text/javascript" src="<a href='tools.html#gears_init'>gears_init.js</a>"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
var localServer = google.gears.factory.create('beta.localserver');
&lt;/script&gt;</code></pre>

<h4>Methods</h4>
<table width="696">
<tr class="odd">
<th colspan="2"><div align="left"><code><strong>canServeLocally(string url)</strong></code></div></th>
</tr>
<tr class="odd">
<td width="105">Return Value </td>
<td width="579" >boolean</td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td class="odd"><strong><code>url</code></strong> - relative or absolute URL that is from the same origin as the current page </td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" >Throws an exception if the URL is not from the same origin
as the current page. </td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">
Returns true if a request for the URL can be satisfied from any of the resource stores available,
taking into account whether the containing store is enabled and if its requiredCookie matches.
Relative URLs are interpreted according to the current page location.</td>
</tr>
</table>
<table width="699">
<tr class="odd">
<th colspan="2"><div align="left"><code><strong>createStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="108">Return Value </td>
<td width="579"><code>ResourceStore </code></td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code>
- string identifying the store. <br />
<code>requiredCookie</code> - optional.<br />
The combination of name and requiredCookie (along with the domain) identify a unique store. <br />
Expected cookie format is &quot;name=value&quot;. </td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" >Throws a JavaScript exception if an errors occurs.</td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Opens an existing ResourceStore or creates a new one if
no such store exists.<br />
<br />
If a requiredCookie is given, creates a ResourceStore that requires the cookie to be present in the client in order to serve the contents from the store.
</tr>
</table>
<table width="695">
<tr class="odd">
<th colspan="2"><div align="left"><code><strong>openStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="137">Return Value </td>
<td width="546"><code>ResourceStore </code><br />
<code>null</code> - if no such store exists</td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code> - string identifying the store. <br />
<code>requiredCookie</code> - optional.<br />
The combination of name and requiredCookie (along with the domain) identify a unique store. <br />
Expected cookie format is &quot;name=value&quot;.</td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" > Throws a JavaScript exception if an errors occurs. </td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Opens an existing ResourceStore or returns null if no such store exists. If the store was originally created with a requiredCookie, the same value must be provided in order to open this ResourceStore.
</tr>
</table>
<table>
<tr class="odd">
<th colspan="2" width="100%"><div align="left"><code><strong> removeStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="113">Return Value </td>
<td width="489" >void</td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code> - string identifying the store. <br>
<code>requiredCookie</code> - optional.<br />
The combination of name and requiredCookie (along with the domain) identify a unique store. <br />
Expected cookie format is &quot;name=value&quot;.</td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" >Throws a JavaScript exception if an errors occurs.</td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Removes a ResourceStore and deletes all of its contents. </td>
</tr>
</table>
<table width="699">
<tr class="odd">
<th colspan="2"><div align="left"><code><strong>createManagedStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="125">Return Value </td>
<td width="562"><code>ManagedResourceStore </code></td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code> - string identifying the store.<br />
<code>requiredCookie</code> - optional.<br />
The combination of name and requiredCookie (along with the domain) identify a unique store. <br />
Expected cookie format is &quot;name=value&quot;.</td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" >Throws a JavaScript exception if an errors occurs.</td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Opens an existing ManagedResourceStore or creates a new one if
no such store exists. </tr>
</table>
<table>
<tr class="odd">
<th colspan="2" width="100%"><div align="left"><code><strong>openManagedStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="113">Return Value </td>
<td width="489"><code>ManagedResourceStore</code></td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code> - string identifying the store.<br />
<code>requiredCookie</code> - optional.<br />
The combination of name and requiredCookie (along with the domain) identify a unique store. <br />
Expected cookie format is &quot;name=value&quot;.</td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" > Throws a JavaScript exception if an errors occurs. </td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Opens an existing ManagedResourceStore or returns null if no such store exists. </tr>
</table>
<table width="699">
<tr class="odd">
<th colspan="2"><div align="left"><code><strong> removeManagedStore(string name, [string requiredCookie])</strong></code></div></th>
</tr>
<tr class="odd">
<td width="129">Return Value </td>
<td width="558" >void</td>
</tr>
<tr class="odd">
<td>Parameters</td>
<td><code>name</code> - string identifying the store.<br>
<code>[requiredCookie]</code></td>
</tr>
<tr class="odd">
<td>Exceptions</td>
<td class="" >Throws a JavaScript exception if an errors occurs.</td>
</tr>
<tr class="odd">
<td>Description</td>
<td class="odd">Removes a ManagedResourceStore and all of its contained URLs
from the local cache. </td>
</tr>
</table>
</ul>

<!------------------------------------------------------------->
<!-- ManagedResourceStore -->
<!------------------------------------------------------------->
<p><br>
<a name="ManagedResourceStore"></a> </p>


<h2>ManagedResourceStore class </h2>


<p>The ManagedResourceStore class is designed to cache a set of
inter-dependent resources. For example, it can cache the set of resources required
to bootstrap an application. The contents of a ManagedResourceStore are
determined by the URLs listed in a <a href="#manifest_file">manifest file</a>. When all resources listed
in the manifest have been captured, the LocalServer makes the set eligible
for use. Periodically, the LocalServer checks for an updated manifest file. If the manifest file has been updated, LocalServer automatically downloads the updated set of resources.</p>


<p>A ManagedResourceStore is a container of cached URLs. Each distinct ManagedResourceStore is uniquely identified by these attributes: </p>

<ul>
<li><code>name</code> - a string identifying the store.<br>
<i>Currently the name must consist only of visible ASCII characters excluding the following:</i>
<br><kbr>/ \ : * ? " &lt; &gt; | ; , </kbr><br>
<i>Before finalization of the API we expect to remove this restriction.</i></li>
<li><code>requiredCookie</code> - a cookie of the format &quot;name=value&quot; or null </li>
<li><code>origin</code> - the scheme, domain, and port of the current page.</li>
</ul>


<p> An application can have many <code>ManagedResourceStores</code>.</p>
<p>The ManagedResourceStores class requires a <em>manifest file</em> to define the URLs to store. The <a href="#manifest_file">manifest file</a> is described in detail, below. </p>

<h3>Attributes</h3>
<table>
<tr class="odd">
<th width="158">Attribute</th>
<th >Type</th>
<th >Description</th>
</tr>
<tr class="odd">
<td width="158"><strong>name</strong></td>
<td width="109" >readonly attribute string</td>
<td width="432" >The name of this managed resource store. </td>
</tr>
<tr class="odd">
<td><strong><a name="MRScookie" id="MRScookie"></a>requiredCookie</strong></td>
<td class="" >readonly attribute string </td>
<td class="" >The cookie requirements of the store.<br>
For further details see <a href="#required_cookie">Cookies and the LocalServer</a>.
If empty, resources within this store are always served locally, provided the store is <code>enabled</code>.</td>
</tr>
<tr class="odd">
<td><strong>enabled</strong></td>
<td class="odd">readwrite attribute boolean </td>
<td class="odd">Enables local serving of URLs from this store when <code>enabled=true</code>. Disables local serving otherwise. </td>
</tr>
<tr class="odd">
<td><strong>manifestUrl</strong></td>
<td class="odd">readwrite attribute string </td>
<td class="odd">The location of the manifest file.</td>
</tr>
<tr class="odd">
<td><strong>lastUpdateCheckTime</strong></td>
<td class="odd">readonly attribute int</td>
<td class="odd">Time in second when the last update check
occurred.</td>
</tr>
<tr class="odd">
<td><strong>updateStatus</strong></td>
<td class="odd">readonly attribute int</td>
<td class="odd">
Can be one of four values:
<table class="noborders">
<tr>
<td><strong>0</strong>
<td>Update OK. An update is not running. The last update to run succeeded.
<tr>
<td><strong>1</strong>
<td>Update checking. Gears is checking for a new manifest file.
<tr>
<td><strong>2</strong>
<td>Update downloading. Gears is found a new manifest and is downloading the new resources.
<tr>
<td><strong>3</strong>
<td>Update failed. An update is not running. The last update to run failed, and the error message is in the <code>lastErrorMessage</code> property.
</table>
</td>
</tr>
<tr class="odd">
<td><strong> lastErrorMessage</strong> </td>
<td class="odd">readonly attribute string</td>
<td class="odd">When updateStatus is <strong>3</strong> (update failed), this property contains details about the error.</td>
</tr>
<tr class="odd">
<td><strong>currentVersion</strong></td>
<td class="odd">readonly attribute string </td>
<td class="odd">The version of the set of resources that is currently being served locally, or empty string if no version is
currently in use. This value reflects the <code>version</code> attribute from the manifest file only after all resources listed in the
manifest file have been cached locally.</td>
</tr>
</table>


<a name="events"></a>
<h3>Events</h3>
<table>
<tr class="odd">
<th colspan="2"><code><strong>event void oncomplete(Object
details)</strong></code></th>
</tr>
<tr class="odd">
<td>Parameters</td>
<td>
<code>details</code> An object containing information about the update.
Contains one property:
<br>&nbsp; &nbsp; &bull; <code>String newVersion</code> - The new
version of the ManagedResourceStore if the version changed. Otherwise,
an empty string.
</td>
</tr>
<tr class="odd">
<td>Description</td>
<td>
<p>This event is fired when a ManagedResourceStore completes an
update. Note that updates can be either started explicitly, by calling
<code>checkForUpdate()</code>, or implicitly, when resources are
served from the store.
<p>An update may or may not result in a new version of the store. If
a new version results, the <code>newVersion</code> property of the
<code>details</code> object will cont