Commit 9a1ae6f1 authored by Vincent Bechu's avatar Vincent Bechu

erp5_officejs: add afs export zip

/reviewed-on nexedi/erp5!287
parent f8ac3412
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
(window.location.pathname.endsWith('/') ? '' : '/') + (window.location.pathname.endsWith('/') ? '' : '/') +
((spec.version !== undefined) ? ((spec.version !== undefined) ?
(spec.version + (spec.version.endsWith('/') ? '' : '/')) : "")); (spec.version + (spec.version.endsWith('/') ? '' : '/')) : ""));
this._relative_url_list = [this._origin_url, spec.manifest]; this._relative_url_list = ["/", spec.manifest];
this._prefix = spec.prefix; this._prefix = spec.prefix;
if (this._take_installer) { if (this._take_installer) {
this._relative_url_list = [ this._relative_url_list = [
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>959.27850.19778.42888</string> </value> <value> <string>959.47786.31692.33024</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1495022155.16</float> <float>1497260492.27</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<option>Onlyoffice Presentation</option> <option>Onlyoffice Presentation</option>
<option>Web Table Editor</option> <option>Web Table Editor</option>
<option>Image Editor</option> <option>Image Editor</option>
<option>Awesome Free Software Publisher List</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>959.28004.53691.26077</string> </value> <value> <string>959.47786.31692.33024</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1495031755.24</float> <float>1497259706.13</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -63,6 +63,12 @@ ...@@ -63,6 +63,12 @@
"officejs_setting_gadget" "officejs_setting_gadget"
] ]
}, },
"Awesome Free Software Publisher List": {
"url": "afs/",
"cache": "gadget_erp5_afs.appcache",
"no_installer": true,
"sub_gadget": []
},
"officejs_ckeditor_gadget": { "officejs_ckeditor_gadget": {
"cache": "gadget_ckeditor.appcache" "cache": "gadget_ckeditor.appcache"
}, },
...@@ -101,7 +107,8 @@ ...@@ -101,7 +107,8 @@
i = 0, i = 0,
form_result = {}, form_result = {},
len = event.target.length, len = event.target.length,
app; app,
take_installer;
for (j = 0; j < len; j += 1) { for (j = 0; j < len; j += 1) {
form_result[event.target[j].name] = event.target[j].value; form_result[event.target[j].name] = event.target[j].value;
} }
...@@ -112,12 +119,13 @@ ...@@ -112,12 +119,13 @@
function fill(zip_file) { function fill(zip_file) {
if (i < len) { if (i < len) {
var sub_app = app.sub_gadget[i]; var sub_app = app.sub_gadget[i];
return gadget.fillZip( return gadget.fillZip({
application_dict[sub_app].cache, cache: application_dict[sub_app].cache,
origin_url + app.url, site_url: origin_url + app.url,
zip_file, zip_file: zip_file,
sub_app + "/" prefix: sub_app + "/",
) take_installer: application_dict[sub_app].no_installer ? false : true
})
.push(function (zip_file) { .push(function (zip_file) {
i += 1; i += 1;
return fill(zip_file); return fill(zip_file);
...@@ -126,7 +134,11 @@ ...@@ -126,7 +134,11 @@
return zip_file; return zip_file;
} }
return gadget.fillZip(app.cache, origin_url + app.url) return gadget.fillZip({
cache: app.cache,
site_url: origin_url + app.url,
take_installer: app.no_installer ? false : true
})
.push(function (zip_file) { .push(function (zip_file) {
return fill(zip_file); return fill(zip_file);
}) })
...@@ -152,8 +164,7 @@ ...@@ -152,8 +164,7 @@
g.props.element = element; g.props.element = element;
}); });
}) })
.declareMethod("fillZip", function (cache_file, site_url, zip_file, .declareMethod("fillZip", function (options) {
prefix) {
var gadget = this, var gadget = this,
file_storage = jIO.createJIO({ file_storage = jIO.createJIO({
type: "replicate", type: "replicate",
...@@ -166,13 +177,13 @@ ...@@ -166,13 +177,13 @@
check_remote_modification: false, check_remote_modification: false,
remote_sub_storage: { remote_sub_storage: {
type: "filesystem", type: "filesystem",
document: site_url, document: options.site_url,
sub_storage: { sub_storage: {
type: "appcache", type: "appcache",
take_installer: true, take_installer: options.take_installer,
manifest: cache_file, manifest: options.cache,
origin_url: site_url, origin_url: options.site_url,
prefix: prefix || "" prefix: options.prefix || ""
} }
}, },
signature_storage: { signature_storage: {
...@@ -180,7 +191,7 @@ ...@@ -180,7 +191,7 @@
}, },
local_sub_storage: { local_sub_storage: {
type: "zipfile", type: "zipfile",
file: zip_file file: options.zip_file
} }
}); });
return file_storage.repair() return file_storage.repair()
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>959.47786.31692.33024</string> </value> <value> <string>959.65151.59597.35276</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1496652073.28</float> <float>1497260154.62</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment