Commit cc83ce7b authored by Hamza's avatar Hamza Committed by Klaus Wölfel

[erp5_officejs] port notebook to gadget_jsmd_eval and add pdf conversion

parent 021fb2f7
......@@ -208,65 +208,6 @@ gadget_erp5_configure_editor.js\n
gadget_officejs_setting.js\n
gadget_officejs_setting.html\n
\n
#new approach (storage hateoas requests)\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_ojs_local_jio.html\n
gadget_ojs_local_jio.js\n
gadget_erp5_page_action_officejs.html\n
gadget_erp5_page_action_officejs.js\n
gadget_erp5_page_ojs_local_controller.html\n
gadget_erp5_page_ojs_local_controller.js\n
gadget_officejs_form_view.html\n
gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_common_util.html\n
gadget_officejs_common_util.js\n
gadget_erp5_page_create_document.html\n
gadget_erp5_page_create_document.js\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_codemirror.configuration\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
jio_configuration_storage.js\n
\n
#configuration resources\n
\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module/codemirror_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS9jb2RlbWlycm9yX3ZpZXc=\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Script)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBTY3JpcHQ=\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Script/codemirror_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBTY3JpcHQvY29kZW1pcnJvcl92aWV3\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_codemirror/Base_viewNewContentDialogForCodemirror)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfY29kZW1pcnJvci9CYXNlX3ZpZXdOZXdDb250ZW50RGlhbG9nRm9yQ29kZW1pcnJvcg==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_codemirror/WebPageModule_viewWebPageListAsJioForCodemirror)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfY29kZW1pcnJvci9XZWJQYWdlTW9kdWxlX3ZpZXdXZWJQYWdlTGlzdEFzSmlvRm9yQ29kZW1pcnJvcg==\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_codemirror/WebPage_viewAsJioForCodemirror)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfY29kZW1pcnJvci9XZWJQYWdlX3ZpZXdBc0ppb0ZvckNvZGVtaXJyb3I=\n
\n
\n
\n
#code mirror\n
officejs_javascript_editor_icon.png\n
gadget_officejs_json_manifest_javascript_editor.json\n
......@@ -457,7 +398,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.57984.44848.64477</string> </value>
<value> <string>973.23494.2134.9352</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -475,7 +416,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1567773407.73</float>
<float>1549009933.21</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,17 +14,11 @@
</head>
<body>
<script data-renderjs-configuration="configuration_manifest" type="text/x-renderjs-configuration">gadget_officejs_codemirror.configuration</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Web Script</script>
<script data-renderjs-configuration="content_type" type="text/x-renderjs-configuration">application/javascript</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">JS script</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">JS scripts</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="parent_portal_type" type="text/x-renderjs-configuration">Web Page Module</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_officejs_codemirror</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Web Script | codemirror_view', 'Web Page Module | codemirror_view')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Web Page Module | Web Script',)</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">codemirror_view</script>
<script data-renderjs-configuration="web_page_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "JS Scripts", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="web_script_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "JS Script", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">xztne380tmhy7xu</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
......
......@@ -277,7 +277,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36799.29647.47735</string> </value>
<value> <string>970.26997.33546.6348</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -295,7 +295,7 @@
</tuple>
<state>
<tuple>
<float>1568974099.83</float>
<float>1537540898.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -91,30 +91,6 @@
}));
}
function getFormInfo(form_definition) {
var child_gadget_url,
form_type,
action_category = form_definition.action_type;
switch (action_category) {
case 'object_list':
form_type = 'list';
child_gadget_url = 'gadget_erp5_pt_form_list.html';
break;
case 'object_dialog':
form_type = 'dialog';
child_gadget_url = 'gadget_erp5_pt_form_dialog.html';
break;
case 'object_jio_js_script':
form_type = 'dialog';
child_gadget_url = 'gadget_erp5_pt_form_dialog.html';
break;
default:
form_type = 'page';
child_gadget_url = 'gadget_erp5_pt_form_view_editable.html';
}
return [form_type, child_gadget_url];
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
......@@ -199,72 +175,46 @@
});
})
.declareMethod("getDialogFormDefinition", function (form_name, category) {
var gadget = this,
form_definition,
form_info;
return gadget.getSetting('portal_skin_folder')
.push(function (portal_skin_folder) {
return gadget.jio_get("portal_skins/" + portal_skin_folder + "/" +
form_name);
})
.push(function (form_result) {
form_definition = form_result.raw_dict._embedded._view
._embedded.form_definition;
form_definition.fields_raw_properties = form_result.raw_dict._embedded
._view.my_fields_raw_properties["default"];
form_definition._actions = form_result.raw_dict._embedded
._view._actions;
form_definition.group_list = form_result.raw_dict.group_list;
form_definition.title = form_result.raw_dict.title;
form_definition.portal_type_dict = {};
form_definition.action_type = category;
form_info = getFormInfo(form_definition);
form_definition.form_type = form_info[0];
form_definition.child_gadget_url = form_info[1];
return form_definition;
});
.declareMethod("getFormInfo", function (form_definition) {
var child_gadget_url,
form_type,
action_category = form_definition.action_type;
switch (action_category) {
case 'object_list':
form_type = 'list';
child_gadget_url = 'gadget_erp5_pt_form_list.html';
break;
case 'object_dialog':
form_type = 'dialog';
child_gadget_url = 'gadget_erp5_pt_form_dialog.html';
break;
case 'object_jio_js_script':
form_type = 'dialog';
child_gadget_url = 'gadget_erp5_pt_form_dialog.html';
break;
default:
form_type = 'page';
child_gadget_url = 'gadget_erp5_pt_form_view_editable.html';
}
return [form_type, child_gadget_url];
})
.declareMethod("getFormDefinition", function (portal_type,
action_reference) {
var gadget = this,
query = buildSearchQuery(portal_type, action_reference),
portal_type_dict_setting = portal_type.replace(/ /g, '_')
.toLowerCase() + "_dict",
portal_type_dict = {},
action_type,
action_title,
form_definition,
portal_skin_folder,
app_allowed_sub_types,
form_info,
error;
return RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getSetting(portal_type_dict_setting),
gadget.getSetting("portal_skin_folder"),
gadget.getSetting("app_allowed_sub_types")
]);
})
.push(function (result_list) {
app_allowed_sub_types = result_list[2];
if (!result_list[1]) {
return gadget.getSetting("portal_skin_folder")
.push(function (result) {
if (!result) {
throw new Error("Missing site configuration 'portal_skin_folder'");
}
portal_skin_folder = "portal_skins/" + result_list[1];
if (result_list[0]) {
try {
portal_type_dict = window.JSON.parse(result_list[0]);
} catch (e) {
if (e instanceof SyntaxError) {
throw new Error("Bad JSON dict in configuration setting '" +
portal_type_dict_setting + "'");
}
throw e;
}
}
result = "portal_skins/" + result;
portal_skin_folder = result;
return gadget.jio_allDocs({query: query});
})
.push(function (data) {
......@@ -294,8 +244,7 @@
._view._actions;
//[PATCH] if custom action and anonymous
// get _actions field from fields_raw_properties
if (form_definition.fields_raw_properties
.hasOwnProperty("_actions")) {
if ("_actions" in form_definition.fields_raw_properties) {
if (!form_definition._actions &&
action_type === "object_jio_js_script") {
form_definition._actions = form_definition
......@@ -305,29 +254,28 @@
}
form_definition.group_list = form_result.raw_dict.group_list;
form_definition.action_type = action_type;
form_info = getFormInfo(form_definition);
form_definition.form_type = form_info[0];
form_definition.child_gadget_url = form_info[1];
form_definition.title = action_title;
form_definition.portal_type_dict = portal_type_dict;
return formatSettingList(app_allowed_sub_types, portal_type);
return gadget.getSetting("app_allowed_sub_types");
})
.push(function (allowed_sub_types_setting) {
return formatSettingList(allowed_sub_types_setting, portal_type);
})
.push(function (allowed_sub_types_pairs) {
var allowed_sub_types = allowed_sub_types_pairs.map(function (pair) {
return pair[1];
});
form_definition.allowed_sub_types_list = allowed_sub_types;
form_definition.new_content_dialog_form = portal_type_dict
.new_content_dialog_form;
form_definition.new_content_category = portal_type_dict
.new_content_category;
return gadget.getViewAndActionDict(portal_type);
})
.push(function (action_view_dict) {
form_definition.portal_type_dict.has_more_views =
form_definition.has_more_views =
Object.keys(action_view_dict.view_list).length > 1;
form_definition.portal_type_dict.has_more_actions =
form_definition.has_more_actions =
Object.keys(action_view_dict.action_list).length > 0;
return gadget.getSetting('hide_header_add_button');
})
.push(function (hide_add_button_setting) {
form_definition.hide_add_button = hide_add_button_setting === "1";
return form_definition;
});
});
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.26807.33358.5717</string> </value>
<value> <string>977.16294.5398.40106</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1568651276.38</float>
<float>1563811574.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -225,7 +225,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>967.6016.61211.59613</string> </value>
<value> <string>978.45547.44335.58777</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>1524754712.51</float>
<float>1569512717.01</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,7 +10,6 @@
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
......@@ -21,38 +20,28 @@
.declareMethod("render", function (options) {
var gadget = this,
default_view,
app_view,
form_definition,
gadget_util,
jio_document,
portal_type,
current_version,
index;
current_version = window.location.href.replace(window.location.hash, "");
index = current_version.indexOf(window.location.host) +
window.location.host.length;
current_version = current_version.substr(index);
return gadget.getSetting("migration_version")
.push(function (migration_version) {
if (migration_version !== current_version) {
//if app version has changed, force storage sync
return gadget.redirect({
'command': 'display',
'options': {
'page': 'ojs_sync',
'auto_repair': true
}
});
}
})
front_page;
return RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.declareGadget("gadget_officejs_common_util.html"),
gadget.getSetting('app_view_reference')
gadget.getSetting('app_view_reference'),
gadget.getSetting('default_view_reference'),
gadget.getSetting('documents_editable')
]);
})
.push(function (result_list) {
gadget_util = result_list[0];
app_view = options.action || result_list[1];
default_view = result_list[2];
options.editable = ((result_list[3] == "1") ?
true : options.editable);
return gadget.jio_get(options.jio_key);
})
.push(function (result) {
......@@ -75,47 +64,49 @@
} else {
portal_type = parent_portal_type;
}
front_page = portal_type === parent_portal_type;
return gadget_util.getFormDefinition(portal_type, app_view);
})
.push(function (result) {
return result;
}, function (error) {
if (error.status_code === 400) {
return gadget_util.getFormDefinition(portal_type, default_view);
}
throw error;
})
.push(function (form_definition) {
.push(function (result) {
form_definition = result;
return gadget_util.getFormInfo(form_definition);
})
.push(function (form_info) {
var form_type = form_info[0],
child_gadget_url = form_info[1];
return gadget.changeState({
jio_key: options.jio_key,
doc: jio_document,
portal_type: portal_type,
child_gadget_url: form_definition.child_gadget_url,
child_gadget_url: child_gadget_url,
form_definition: form_definition,
form_type: form_definition.form_type,
view: options.view || app_view
form_type: form_type,
editable: options.editable,
view: options.view || default_view,
front_page: front_page
});
});
})
.onStateChange(function () {
var fragment = document.createElement('div'),
gadget = this,
view_gadget_url = "gadget_officejs_form_view.html",
custom_gadget_url = gadget.state.form_definition.portal_type_dict
.custom_view_gadget;
gadget = this;
while (this.element.firstChild) {
this.element.removeChild(this.element.firstChild);
}
if (custom_gadget_url) {
view_gadget_url = custom_gadget_url;
}
gadget.element.appendChild(fragment);
return gadget.declareGadget(view_gadget_url,
this.element.appendChild(fragment);
return gadget.declareGadget("gadget_officejs_form_view.html",
{element: fragment, scope: 'form_view'})
.push(function (form_view_gadget) {
return form_view_gadget.render(gadget.state);
}, function (error) {
console.log(error);
return gadget.notifySubmitted({
message: "Error rendering view",
status: "error"
});
});
})
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36723.12245.1757</string> </value>
<value> <string>977.8828.48212.64904</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1568969561.34</float>
<float>1563366536.83</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.46851.17123.15906</string> </value>
<value> <string>977.6084.46638.22954</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1569577593.67</float>
<float>1563366620.2</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -216,47 +216,6 @@ gadget_officejs_jio_web_illustration_view.js\n
gadget_officejs_svg_editor.json\n
taskman-svg.png\n
\n
#new approach (storage hateoas requests)\n
gadget_ojs_local_jio.html\n
gadget_ojs_local_jio.js\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_erp5_page_action_officejs.html\n
gadget_erp5_page_action_officejs.js\n
gadget_erp5_page_ojs_local_controller.html\n
gadget_erp5_page_ojs_local_controller.js\n
gadget_officejs_form_view.html\n
gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_common_util.html\n
gadget_officejs_common_util.js\n
gadget_erp5_page_create_document.html\n
gadget_erp5_page_create_document.js\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_illustration.configuration\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
jio_configuration_storage.js\n
\n
#custom actions\n
\n
#svg editor\n
method-draw/browser-not-supported.html\n
method-draw/method-draw/css/font-files/Anivers-webfont.woff\n
......@@ -518,19 +477,8 @@ method-draw/src/units.js\n
method-draw/src/method-draw.js\n
method-draw/src/svgcanvas.js\n
\n
#app_configuration_resources\n
#CONFIGURATION ELEMENTS generated on Mon Sep 30 14:56:21 2019. Same as in configuration manifest\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBJbGx1c3RyYXRpb24=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBJbGx1c3RyYXRpb24vc3ZnX2VkaXRvcl92aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfc3ZnX2VkaXRvci9XZWJQYWdlX3ZpZXdBc1N2Z0RvY3VtZW50Rm9yU3ZnRWRpdG9y\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS9zdmdfZWRpdG9yX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfc3ZnX2VkaXRvci9XZWJQYWdlTW9kdWxlX3ZpZXdXZWJQYWdlTGlzdEFzSmlvRm9yU3ZnRWRpdG9y\n
#/app_configuration_resources\n
\n
NETWORK:\n
*\n
</string> </value>
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -671,7 +619,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.51488.23397.48588</string> </value>
<value> <string>973.23494.2134.9352</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -689,7 +637,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1569855661.06</float>
<float>1549009886.55</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint indent:2, maxlen: 80, nomen: true */
/*global jIO, RSVP, window, URL, atob, btoa, Rusha */
(function (window, jIO, RSVP, URL, atob, btoa, Rusha) {
"use strict";
var rusha = new Rusha();
function decodeDocumentId(id, hateoas_appcache) {
var hateoas_section,
hateoas_section_and_view;
hateoas_section = "./" + hateoas_appcache + "/";
hateoas_section_and_view = hateoas_section + "definition_view/";
id = id.replace(hateoas_section_and_view, "");
id = atob(id);
return id;
}
function encodeDocumentId(id, hateoas_appcache) {
var hateoas_section,
hateoas_section_and_view;
id = btoa(id);
hateoas_section = "./" + hateoas_appcache + "/";
hateoas_section_and_view = hateoas_section + "definition_view/";
id = hateoas_section_and_view + id;
return id;
}
function processHateoasDict(raw_dict) {
var raw_field_list, type, parent, field_key, field_id, return_dict = {};
return_dict.raw_dict = raw_dict;
/*jslint nomen: true*/
if (raw_dict.hasOwnProperty("_embedded") &&
raw_dict._embedded.hasOwnProperty("_view")) {
raw_field_list = raw_dict._embedded._view;
type = raw_dict._links.type.name;
parent = raw_dict._links.parent.name;
return_dict.parent_relative_url = "portal_types/" + parent;
return_dict.portal_type = type;
for (field_key in raw_field_list) {
if (raw_field_list.hasOwnProperty(field_key)) {
field_id = "";
if (raw_field_list[field_key]["default"] !== undefined &&
raw_field_list[field_key]["default"] !== "") {
if (field_key.startsWith("my_")) {
field_id = field_key.replace("my_", "");
} else if (field_key.startsWith("your_")) {
field_id = field_key.replace("your_", "");
} else {
field_id = field_key;
}
return_dict[field_id] = raw_field_list[field_key]["default"];
}
}
}
} else {
// ignore non configuration elements
return raw_dict;
}
return return_dict;
}
function ConfigurationStorage(spec) {
if (spec.sub_storage.type !== "appcache") {
throw new Error("appcache substorage is mandatory for configuration " +
"storage");
}
this._sub_storage = jIO.createJIO(spec.sub_storage);
this._hateoas_appcache = spec.hateoas_appcache;
this._manifest = spec.manifest;
this._origin_url = spec.origin_url !== undefined ?
spec.origin_url : window.location.href;
this._version = spec.version || "";
this._prefix = spec.prefix || "./";
this._version = this._prefix + this._version;
this._hash = "";
}
ConfigurationStorage.prototype.get = function (id) {
var storage = this;
id = encodeDocumentId(id, storage._hateoas_appcache);
return storage._sub_storage.getAttachment(storage._origin_url,
id,
{"format": "json"})
.push(function (content) {
content = processHateoasDict(content);
content.hash = storage._hash;
return content;
});
};
ConfigurationStorage.prototype.hasCapacity = function () {
return true;
};
ConfigurationStorage.prototype.getAttachment = function () {
return this._sub_storage.getAttachment.apply(this._sub_storage, arguments);
};
ConfigurationStorage.prototype.allAttachments = function () {
return this._sub_storage.allAttachments.apply(this._sub_storage, arguments);
};
ConfigurationStorage.prototype.buildQuery = function () {
var storage = this,
result = [],
decoded_id,
attachment_id;
return storage.allAttachments(storage._origin_url)
.push(function (all_attachments) {
for (attachment_id in all_attachments) {
if (all_attachments.hasOwnProperty(attachment_id)) {
if (attachment_id !== storage._version &&
attachment_id !== storage._version + "/" &&
attachment_id !== storage._version + storage._manifest) {
decoded_id = decodeDocumentId(attachment_id,
storage._hateoas_appcache);
result.push({
'id': decoded_id,
'value': {hash: storage._hash},
'doc': {hash: storage._hash}
});
}
}
}
return result;
});
};
ConfigurationStorage.prototype.repair = function (app_version) {
var storage = this,
url = new URL(storage._manifest, new URL(storage._version,
storage._origin_url));
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
type: "GET",
url: url
});
})
.push(function (response) {
var text = response.target.responseText;
//hash is attached to manifest text and app version
//if the app version has changed, then a cleanup was done in the storage
//documents must be updated to restore any potential missing document
storage._hash = rusha.digestFromString(text + app_version);
return storage._sub_storage.repair.apply(storage._sub_storage,
arguments);
});
};
jIO.addStorage('configuration', ConfigurationStorage);
}(window, jIO, RSVP, URL, atob, btoa, Rusha));
......@@ -91,7 +91,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_notebook_view.html</string> </value>
<value> <string>gadget_officejs_jio_notebook_view_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -248,7 +248,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.37889.56311.25753</string> </value>
<value> <string>978.51175.28075.44014</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1534254952.0</float>
<float>1569848367.78</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, jIO, rJS, RSVP, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, jIO, rJS, RSVP, Blob) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
......@@ -19,14 +23,19 @@
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.changeState({
jio_key: options.jio_key,
doc: options.doc
});
});
})
.onEvent('submit', function () {
var gadget = this;
var gadget = this, data;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
......@@ -35,7 +44,19 @@
return form_gadget.getContent();
})
.push(function (content) {
return gadget.updateDocument(content);
data = content.text_content;
delete content.text_content;
return RSVP.all([
gadget.getSetting("content_type"),
gadget.updateDocument(content)
]);
})
.push(function (result_list) {
return gadget.jio_putAttachment(
gadget.state.jio_key,
"data",
new Blob([data], {type: result_list[0]})
);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
......@@ -47,8 +68,21 @@
})
.onStateChange(function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
var gadget = this, data;
return gadget.jio_getAttachment(gadget.state.jio_key, "data")
.push(undefined, function (error) {
if (error instanceof jIO.util.jIOError && error.status_code === 404) {
return new Blob();
}
throw error;
})
.push(function (blob) {
return jIO.util.readBlobAsText(blob);
})
.push(function (evt) {
data = evt.target.result;
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
......@@ -109,7 +143,7 @@
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"default": data,
"css_class": "",
"required": 0,
"editable": 1,
......@@ -118,7 +152,7 @@
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public",
"renderjs_extra": '{"editor": "notebook_editor", "maximize": true}'
"renderjs_extra": '{"editor": "jsmd_editor", "maximize": true}'
}
}},
"_links": {
......@@ -152,7 +186,7 @@
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({
command: 'change',
options: {'page': "ojs_download"}
options: {'page': 'ojs_notebook_export'}
})
]);
})
......@@ -160,11 +194,11 @@
return gadget.updateHeader({
page_title: gadget.state.doc.title,
save_action: true,
export_url: url_list[3],
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2],
download_url: url_list[3]
next_url: url_list[2]
});
});
});
}(window, rJS, RSVP));
}(window, jIO, rJS, RSVP, Blob));
......@@ -87,7 +87,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_notebook_view.js</string> </value>
<value> <string>gadget_officejs_jio_notebook_view_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.42986.60138.7065</string> </value>
<value> <string>978.54387.27074.52445</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1538406432.04</float>
<float>1569943229.61</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,7 +12,6 @@
<script src="jiodev.js" type="text/javascript"></script>
<script src="jio_ojs_storage.js" type="text/javascript"></script>
<script src="jio_appcachestorage.js"></script>
<script src="jio_configuration_storage.js"></script>
<!-- custom script -->
<script src="gadget_ojs_local_jio.js" type="text/javascript"></script>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.15823.10779.36625</string> </value>
<value> <string>976.52707.23546.23773</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1567674891.35</float>
<float>1563367270.05</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.21248.62721.2184</string> </value>
<value> <string>976.64179.23426.41403</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1568041535.95</float>
<float>1563367274.51</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -111,7 +111,7 @@
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Fri, 01 Feb 2019 11:45:33 +0000\n
# generated on Fri, 31 Sep 2019 63:47:33 +0000\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
......@@ -122,42 +122,43 @@ nexedi_logo_officejs_iodide.svg\n
gadget_officejs_notebook_router.html\n
gadget_officejs_jio_notebook_view.html\n
gadget_officejs_jio_notebook_view.js\n
gadget_officejs_jio_notebook.js\n
gadget_erp5_page_ojs_upload.js\n
gadget_erp5_page_ojs_upload.html\n
gadget_erp5_page_ojs_download.js\n
gadget_erp5_page_ojs_download.html\n
gadget_erp5_page_ojs_notebook_list.js\n
gadget_erp5_page_ojs_notebook_list.html\n
gadget_notebook.html\n
iodide_master.js\n
iodide_master.css\n
pyodide.js\n
pyodide.asm.data.js\n
pyodide.asm.js\n
pyodide.asm.wasm\n
pyodide.asm.data\n
gadget_erp5_page_ojs_notebook_export.html\n
gadget_erp5_page_ojs_notebook_export.js\n
gadget_jsmd_viewer.css\n
gadget_jsmd_viewer.html\n
gadget_jsmd_viewer.js\n
gadget_jsmd_eval.html\n
gadget_jsmd_eval.js\n
gadget_jsmd_eval.css\n
iodide_utils.js\n
marked.js\n
cycler.data\n
cycler.js\n
kiwisolver.data\n
kiwisolver.js\n
matplotlib.data\n
matplotlib.js\n
numpy.data\n
matplotlib.data\n
numpy.js\n
numpy.data\n
packages.json\n
pandas.data\n
pandas.js\n
pyodide.asm.js\n
pyodide.asm.html\n
pyodide.py\n
pyodide.asm.data.js\n
pyodide.asm.data\n
pyodide.asm.wasm\n
pyparsing.data\n
pyparsing.js\n
python-dateutil.data\n
python-dateutil.js\n
python.html\n
pytz.data\n
pytz.js\n
renderedhtml.css\n
xlrd.data\n
xlrd.js\n
\n
......@@ -213,10 +214,18 @@ gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.js\n
gadget_erp5_page_ojs_document_list.html\n
gadget_erp5_page_ojs_document_list.js\n
gadget_erp5_page_ojs_download_convert.html\n
gadget_erp5_page_ojs_download_convert.js\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.js\n
gadget_cloudooo.html\n
gadget_cloudooo.js\n
gadget_ojs_cloudooo.html\n
gadget_ojs_cloudooo.js\n
gadget_html5_input.html\n
gadget_html5_input.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_erp5_field_multicheckbox.html\n
gadget_erp5_field_multicheckbox.js\n
gadget_erp5_searchfield.html\n
......@@ -229,6 +238,8 @@ gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_datetime.html\n
......@@ -408,7 +419,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.33482.4166.8669</string> </value>
<value> <string>978.55949.43799.1706</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -426,7 +437,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1549888313.28</float>
<float>1570036732.12</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,7 +18,10 @@
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Notebook</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Notebooks</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">notebook_module</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="content_type" type="text/x-renderjs-configuration">text/plain</script>
<script data-renderjs-configuration="file_extension" type="text/x-renderjs-configuration">txt</script>
<script data-renderjs-configuration="conversion_dict" type="text/x-renderjs-configuration">{"txt": ["html", "pdf"]}</script>
<script data-renderjs-configuration="upload_dict" type="text/x-renderjs-configuration">{"txt": "txt", "html": "html"}</script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">82g9eir551nhovs</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
......
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.52955.27100.34065</string> </value>
<value> <string>978.54044.24924.10990</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1539094329.81</float>
<float>1569942688.43</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,6 +8,7 @@
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post")
......@@ -15,13 +16,32 @@
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("createDocument", function (portal_type,
parent_portal_type) {
var gadget = this,
doc = {
title: "Untitled Document",
portal_type: portal_type,
parent_relative_url: parent_portal_type
};
return gadget.jio_post(doc)
.push(function (id) {
return gadget.redirect({
command: 'display',
options: {
jio_key: id,
editable: true
}
});
});
})
.declareMethod("render", function (options) {
var gadget = this,
allowed_sub_types_list = options.allowed_sub_types_list.split(","),
parent_portal_type = options.portal_type,
dialog_form = options.new_content_dialog_form,
dialog_category = options.new_content_category,
portal_type,
form_definition,
document_title;
return gadget.jio_get(options.jio_key)
.push(function (document) {
......@@ -33,32 +53,32 @@
})
.push(function (portal_type_result) {
portal_type = portal_type_result;
if (dialog_form) {
return gadget.declareGadget("gadget_officejs_common_util.html")
.push(function (gadget_util) {
return gadget_util.getDialogFormDefinition(dialog_form,
dialog_category);
})
.push(function (form_definition) {
return gadget.changeState({
doc: { header_title: form_definition.title || document_title,
portal_type: allowed_sub_types_list },
//TODO this should be a portal_dict setting and not global
parent_portal_type: parent_portal_type,
action_options: options,
child_gadget_url: form_definition.child_gadget_url,
form_type: form_definition.form_type,
form_definition: form_definition,
view: "view",
show_dialog: true
});
});
return gadget.getSetting("new_content_action");
})
.push(function (new_content_action) {
if (!new_content_action) {
throw new Error("Missing site configuration 'new_content_action'");
}
return gadget.jio_get(new_content_action);
})
.push(function (form_result) {
form_definition = form_result.raw_dict._embedded._view
._embedded.form_definition;
form_definition.fields_raw_properties = form_result.raw_dict._embedded
._view.my_fields_raw_properties["default"];
form_definition._actions = form_result.raw_dict._embedded
._view._actions;
form_definition.group_list = form_result.raw_dict.group_list;
form_definition.title = "Create Document";
return gadget.changeState({
doc: { header_title: document_title,
portal_type: allowed_sub_types_list },
doc: { title: document_title, portal_type: allowed_sub_types_list },
parent_portal_type: parent_portal_type,
show_dialog: false
action_options: options,
child_gadget_url: 'gadget_erp5_pt_form_dialog.html',
form_type: 'dialog',
form_definition: form_definition,
view: "view",
show_dialog: allowed_sub_types_list.length > 1
});
});
})
......@@ -76,57 +96,21 @@
.push(function (form_view_gadget) {
return form_view_gadget.render(gadget.state);
});
}
// if no form, skip dialog assuming there is only one portal type
return gadget.createDocument(gadget.state.doc.portal_type[0],
gadget.state.parent_portal_type
.replace(/ /g, '_').toLowerCase());
})
.declareMethod("createDocument", function (portal_type,
parent_portal_type,
content) {
var gadget = this,
doc = {};
if (!content) {
doc.portal_type = portal_type;
doc.parent_relative_url = parent_portal_type;
} else {
doc = content;
// if there is only one sub portal type
// skip create document dialog rendering
return gadget.createDocument(gadget.state.doc.portal_type[0],
gadget.state.parent_portal_type
.replace(/ /g, '_').toLowerCase());
}
if (!doc.title) {
doc.title = "Untitled document";
}
return gadget.jio_post(doc)
.push(function (id) {
return gadget.redirect({
command: 'display',
options: {
jio_key: id,
editable: true
}
});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.allowPublicAcquisition('submitContent', function (options) {
var gadget = this,
content_dict = options[2];
if (!content_dict.portal_type) {
content_dict.portal_type = gadget.state.doc.portal_type[0];
}
if (!content_dict.parent_relative_url) {
content_dict.parent_relative_url = gadget.state.parent_portal_type
.replace(/ /g, '_').toLowerCase();
}
return gadget.createDocument(gadget.state.doc.portal_type[0],
return gadget.createDocument(content_dict.portal_type,
gadget.state.parent_portal_type
.replace(/ /g, '_').toLowerCase(),
content_dict);
.replace(/ /g, '_').toLowerCase());
});
}(window, document, rJS));
\ No newline at end of file
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.12359.56087.21111</string> </value>
<value> <string>977.1486.37580.56729</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1567507688.29</float>
<float>1562923143.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -34,13 +34,14 @@
})
.declareMethod("render", function (options) {
var gadget = this, action_reference;
var gadget = this, action_reference, gadget_util, form_definition;
return RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getUrlParameter('portal_type'),
gadget.getUrlParameter('parent_relative_url'),
gadget.getUrlParameter("action")
gadget.getUrlParameter("action"),
gadget.declareGadget("gadget_officejs_common_util.html")
]);
})
.push(function (result) {
......@@ -49,13 +50,18 @@
options.parent_relative_url = result[1];
}
action_reference = result[2];
gadget_util = result[3];
return gadget.getActionFormDefinition(action_reference);
})
.push(function (form_definition) {
.push(function (result) {
form_definition = result;
return gadget_util.getFormInfo(form_definition);
})
.push(function (form_info) {
var fragment = document.createElement('div'),
action_gadget_url,
form_type = form_definition.form_type,
child_gadget_url = form_definition.child_gadget_url,
form_type = form_info[0],
child_gadget_url = form_info[1],
//an action form must have a GadgetField called
//"gadget_field_new_action_js_script"
//this gadget will point the custom action gadget
......@@ -84,24 +90,16 @@
element: fragment
})
.push(function (action_gadget) {
options.form_definition = form_definition;
return action_gadget.preRenderDocument(options);
})
.push(function (doc) {
state_options.doc = doc;
state_options.action_gadget_url = action_gadget_url;
return gadget.changeState(state_options);
}, function (error) {
if (error.status === 404) {
return gadget.notifySubmitted({
message: "Error in action",
status: "error"
});
}
throw error;
});
} else {
return gadget.changeState(state_options);
}
return gadget.changeState(state_options);
});
})
......@@ -131,41 +129,38 @@
//target_url = options[1],
content_dict = options[2],
fragment = document.createElement('div'),
submit_dict;
jio_key;
if (gadget.state.valid_action) {
return gadget.notifySubmitting()
.push(function () {
gadget.element.appendChild(fragment);
return gadget.declareGadget(gadget.state.action_gadget_url, {
scope: "action_field",
element: fragment
});
})
gadget.element.appendChild(fragment);
return gadget.declareGadget(gadget.state.action_gadget_url, {
scope: "action_field",
element: fragment
})
.push(function (action_gadget) {
return action_gadget.handleSubmit(content_dict, gadget.state);
})
.push(function (submit_result) {
submit_dict = submit_result;
//submit_dict must contain:
//notify: options_dict for notifySubmitted
//redirect: options_dict for redirect
return gadget.notifySubmitted(submit_dict.notify);
.push(function (id) {
jio_key = id;
return gadget.notifySubmitting();
})
.push(function () {
return gadget.redirect(submit_dict.redirect);
}, function (error) {
if (!(error instanceof RSVP.CancellationError)) {
return gadget.notifySubmitted({
message: "Action Failed",
status: "error"
});
}
throw error;
return gadget.notifySubmitted({message: 'Data Updated',
status: 'success'});
})
.push(function () {
return gadget.redirect({
command: 'display',
options: {
jio_key: jio_key,
editable: gadget.state.view === "edit"
}
});
});
} else {
return gadget.notifySubmitted(
{message: 'Could not perform this action: configuration error',
status: 'fail'});
}
return gadget.notifySubmitted(
{message: 'Could not perform this action: configuration error',
status: 'fail'});
});
}(window, document, rJS, RSVP));
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.31411.12952.38502</string> </value>
<value> <string>977.6150.49752.57668</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1568651040.61</float>
<float>1563205637.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -209,63 +209,6 @@ gadget_button_maximize.js\n
gadget_officejs_setting.js\n
gadget_officejs_setting.html\n
\n
#new approach (storage hateoas requests)\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_ojs_local_jio.html\n
gadget_ojs_local_jio.js\n
gadget_erp5_page_action_officejs.html\n
gadget_erp5_page_action_officejs.js\n
gadget_erp5_page_ojs_local_controller.html\n
gadget_erp5_page_ojs_local_controller.js\n
gadget_officejs_form_view.html\n
gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_common_util.html\n
gadget_officejs_common_util.js\n
gadget_erp5_page_create_document.html\n
gadget_erp5_page_create_document.js\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_pdf_viewer.configuration\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
jio_configuration_storage.js\n
\n
#configuration resources\n
\n
#hateoas_appcache/definition_view/BASE64(portal_types/Document Module)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0RvY3VtZW50IE1vZHVsZQ==\n
#hateoas_appcache/definition_view/BASE64(portal_types/Document Module/pdf_viewer_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0RvY3VtZW50IE1vZHVsZS9wZGZfdmlld2VyX3ZpZXc=\n
#hateoas_appcache/definition_view/BASE64(portal_types/PDF)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1BERg==\n
#hateoas_appcache/definition_view/BASE64(portal_types/PDF/pdf_viewer_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1BERi9wZGZfdmlld2VyX3ZpZXc=\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_pdf_viewer/Base_viewNewContentDialogForPdfViewer)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfcGRmX3ZpZXdlci9CYXNlX3ZpZXdOZXdDb250ZW50RGlhbG9nRm9yUGRmVmlld2Vy\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_pdf_viewer/DocumentModule_viewDocumentListAsJioForPdfViewer)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfcGRmX3ZpZXdlci9Eb2N1bWVudE1vZHVsZV92aWV3RG9jdW1lbnRMaXN0QXNKaW9Gb3JQZGZWaWV3ZXI=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_officejs_pdf_viewer/Document_viewAsPdfDocumentForPdfViewer)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfcGRmX3ZpZXdlci9Eb2N1bWVudF92aWV3QXNQZGZEb2N1bWVudEZvclBkZlZpZXdlcg==\n
\n
#pdf viewer\n
gadget_officejs_pdf_viewer_router.html\n
gadget_officejs_jio_pdf_view.html\n
......@@ -648,7 +591,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.59351.27865.44851</string> </value>
<value> <string>973.23494.2134.9352</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -666,7 +609,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1567773436.57</float>
<float>1549009793.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,16 +14,10 @@
</head>
<body>
<script data-renderjs-configuration="configuration_manifest" type="text/x-renderjs-configuration">gadget_officejs_pdf_viewer.configuration</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">PDF</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">document_module</script>
<script data-renderjs-configuration="parent_portal_type" type="text/x-renderjs-configuration">Document Module</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_officejs_pdf_viewer</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('PDF | pdf_viewer_view', 'Document Module | pdf_viewer_view')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Document Module | PDF',)</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">pdf_viewer_view</script>
<script data-renderjs-configuration="document_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "PDFs", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="pdf_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "PDF", "hide_listbox_buttons": 1, "blob_type": "application/pdf", "blob_create_object_url": 1}</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">PDF</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">PDFs</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration">/{+id}/Base_downloadWithCors</script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">9g8nrxvhjgd5c6c</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
......
......@@ -221,7 +221,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36795.39696.27238</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1568973833.9</float>
<float>1515684302.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,16 +14,10 @@
</head>
<body>
<script data-renderjs-configuration="configuration_manifest" type="text/x-renderjs-configuration">gadget_officejs_illustration.configuration</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Web Illustration</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="parent_portal_type" type="text/x-renderjs-configuration">Web Page Module</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_officejs_svg_editor</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">svg_editor_view</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Web Page Module | svg_editor_view', 'Web Illustration | svg_editor_view')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Web Page Module | Web Illustration',)</script>
<script data-renderjs-configuration="web_page_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "Illustrations", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="web_illustration_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "Illustration", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Illustration</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Illustrations</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">28fxd7m6ogxh6b5</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
......
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>vincent</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.62238.19609.14984</string> </value>
<value> <string>964.45561.47559.9591</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1568973476.25</float>
<float>1515684310.75</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -145,6 +145,8 @@ gadget_erp5_ojs_panel.html\n
gadget_erp5_ojs_panel.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_ojs_local_jio.html\n
gadget_ojs_local_jio.js\n
\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.js\n
......@@ -209,6 +211,68 @@ gadget_officejs_text_editor.json\n
officejs_logo_text_editor.png\n
gadget_officejs_text_editor_router.html\n
\n
#new approach (storage hateoas requests)\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_erp5_page_action_officejs.html\n
gadget_erp5_page_action_officejs.js\n
gadget_erp5_page_ojs_local_controller.html\n
gadget_erp5_page_ojs_local_controller.js\n
gadget_officejs_form_view.html\n
gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_common_util.html\n
gadget_officejs_common_util.js\n
gadget_erp5_page_create_document.html\n
gadget_erp5_page_create_document.js\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_text_editor.configuration\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
\n
action_texteditor_clone.html\n
action_texteditor_clone.js\n
\n
#configuration resources\n
\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module/text_editor_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS90ZXh0X2VkaXRvcl92aWV3\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdl\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX3ZpZXc=\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_clone)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX2Nsb25l\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV92aWV3TmV3Q29udGVudERpYWxvZ0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPageModule_viewWebPageListAsJioForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPage_viewAsTextDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_cloneDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV9jbG9uZURvY3VtZW50Rm9yVGV4dEVkaXRvcg==\n
\n
\n
#Ckeditor\n
ckeditor.gadget.html\n
ckeditor.gadget.js\n
......@@ -547,71 +611,8 @@ ckeditor/config.js\n
ckeditor/ckeditor.js\n
ckeditor/adapters/jquery.js\n
\n
\n
#new officejs approach\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_pt_form_dialog.html\n
gadget_erp5_pt_form_dialog.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_ojs_local_jio.html\n
gadget_ojs_local_jio.js\n
gadget_erp5_page_action_officejs.html\n
gadget_erp5_page_action_officejs.js\n
gadget_erp5_page_ojs_local_controller.html\n
gadget_erp5_page_ojs_local_controller.js\n
gadget_officejs_form_view.html\n
gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_common_util.html\n
gadget_officejs_common_util.js\n
gadget_erp5_page_create_document.html\n
gadget_erp5_page_create_document.js\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_text_editor.configuration\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
jio_configuration_storage.js\n
\n
#app custom actions\n
action_texteditor_clone.html\n
action_texteditor_clone.js\n
\n
#app_configuration_resources\n
#CONFIGURATION ELEMENTS generated on Fri Sep 20 09:45:43 2019. Same as in configuration manifest\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS90ZXh0X2VkaXRvcl92aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdl\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX2Nsb25l\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV9jbG9uZURvY3VtZW50Rm9yVGV4dEVkaXRvcg==\n
#/app_configuration_resources\n
\n
\n
\n
NETWORK:\n
*\n
\n
\n
\n
\n
</string> </value>
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -752,7 +753,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.31397.31451.12492</string> </value>
<value> <string>977.40995.25945.24064</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -770,7 +771,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1568707377.29</float>
<float>1565341519.15</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -109,19 +109,31 @@
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CONFIGURATION MANIFEST\n
# generated on Fri Sep 20 09:45:43 2019\n
<value> <string>CACHE MANIFEST\n
# generated on Thu, 14 Jan 2019 11:55:33 +0000\n
CACHE:\n
\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page Module/text_editor_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS90ZXh0X2VkaXRvcl92aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdl\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
#hateoas_appcache/definition_view/BASE64(portal_types/Web Page/text_editor_clone)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL3RleHRfZWRpdG9yX2Nsb25l\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV92aWV3TmV3Q29udGVudERpYWxvZ0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPageModule_viewWebPageListAsJioForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZU1vZHVsZV92aWV3V2ViUGFnZUxpc3RBc0ppb0ZvclRleHRFZGl0b3I=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/WebPage_viewAsTextDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvV2ViUGFnZV92aWV3QXNUZXh0RG9jdW1lbnRGb3JUZXh0RWRpdG9y\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_text_editor/Base_cloneDocumentForTextEditor)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfdGV4dF9lZGl0b3IvQmFzZV9jbG9uZURvY3VtZW50Rm9yVGV4dEVkaXRvcg==\n
\n
\n
NETWORK:\n
*</string> </value>
</item>
......@@ -264,7 +276,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.56362.16233.35328</string> </value>
<value> <string>977.41790.42136.10513</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -282,7 +294,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1566219739.99</float>
<float>1565341511.13</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,16 +14,21 @@
</head>
<body>
<script data-renderjs-configuration="configuration_manifest" type="text/x-renderjs-configuration">gadget_officejs_text_editor.configuration</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Web Page</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Text Document</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Text Documents</script>
<script data-renderjs-configuration="parent_portal_type" type="text/x-renderjs-configuration">Web Page Module</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">web_page_module</script>
<script data-renderjs-configuration="hide_listbox_buttons" type="text/x-renderjs-configuration">1</script>
<script data-renderjs-configuration="documents_editable" type="text/x-renderjs-configuration">1</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_text_editor</script>
<!-- TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialogForTextEditor. For now it's in new_content_action -->
<script data-renderjs-configuration="new_content_action" type="text/x-renderjs-configuration">portal_skins/erp5_text_editor/Base_viewNewContentDialogForTextEditor</script>
<script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">text_editor_view</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Web Page | text_editor_view', 'Web Page | text_editor_clone', 'Web Page Module | text_editor_view')</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Web Page | text_editor_view', 'Web Page | text_editor_clone')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Web Page Module | Web Page',)</script>
<script data-renderjs-configuration="web_page_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "upload_button": 0, "download_button": 0, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "Text Documents", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="web_page_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "upload_button": 0, "download_button": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "Text Document", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
<script data-renderjs-configuration="hide_header_add_button" type="text/x-renderjs-configuration">0</script>
<script data-renderjs-configuration="header_jump_button" type="text/x-renderjs-configuration">0</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">n692ixxhyg9zhqs</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
......
......@@ -277,7 +277,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.36776.33713.12509</string> </value>
<value> <string>977.8695.30374.7765</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -295,7 +295,7 @@
</tuple>
<state>
<tuple>
<float>1568972733.17</float>
<float>1563367353.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -117,7 +117,7 @@
]);
})
.push(function (result) {
return jio_gadget.putAttachment(options.id, options.name, result[0]);
return jio_gadget.putAttachment(options.id, options.name, result[0], options.conversion_kw);
})
.push(function () {
return jio_gadget.getAttachment(options.id, options.name);
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.46608.54855.3123</string> </value>
<value> <string>977.28694.830.42120</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1534778298.94</float>
<float>1567086325.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -3,15 +3,11 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Gadget OfficeJS Upload</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojs_download.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.43008.48748.51541</string> </value>
<value> <string>978.51400.35654.25412</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1538576879.18</float>
<float>1569850140.48</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -2,7 +2,6 @@
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, Blob) {
"use strict";
function downloadFromTextContent(gadget, text_content, title) {
var element = gadget.element,
a = window.document.createElement("a"),
......@@ -16,7 +15,6 @@
element.removeChild(a);
window.URL.revokeObjectURL(url);
}
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
......@@ -27,8 +25,6 @@
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this;
return gadget.jio_get(options.jio_key)
......@@ -44,5 +40,4 @@
});
});
});
}(window, rJS, Blob));
\ No newline at end of file
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.45827.27759.62020</string> </value>
<value> <string>978.45864.8991.47786</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1539074452.96</float>
<float>1569850062.25</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Jio Notebook View</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojs_notebook_export.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
<div data-gadget-url="gadget_ojs_cloudooo.html"
data-gadget-scope="ojs_cloudooo"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Manifest" module="erp5.portal_type"/>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_illustration.configuration</string> </value>
<value> <string>gadget_erp5_page_ojs_notebook_export.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -89,15 +89,17 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_illustration_configuration</string> </value>
<value> <string>ojs_gadget_erp5_page_ojs_notebook_export_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Manifest</string> </value>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
......@@ -105,25 +107,9 @@
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CONFIGURATION MANIFEST\n
# generated on Mon Sep 30 14:56:21 2019\n
CACHE:\n
\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBJbGx1c3RyYXRpb24=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBJbGx1c3RyYXRpb24vc3ZnX2VkaXRvcl92aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfc3ZnX2VkaXRvci9XZWJQYWdlX3ZpZXdBc1N2Z0RvY3VtZW50Rm9yU3ZnRWRpdG9y\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZQ==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlIE1vZHVsZS9zdmdfZWRpdG9yX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfc3ZnX2VkaXRvci9XZWJQYWdlTW9kdWxlX3ZpZXdXZWJQYWdlTGlzdEFzSmlvRm9yU3ZnRWRpdG9y\n
\n
NETWORK:\n
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS Svg Editor Configuration</string> </value>
<value> <string>OfficeJS Notebook Export</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
......@@ -215,7 +201,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1566289834.75</float>
<float>1569506819.84</float>
<string>UTC</string>
</tuple>
</state>
......@@ -260,7 +246,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.57609.54358.40055</string> </value>
<value> <string>978.51415.10.49937</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +264,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1566290532.06</float>
<float>1569854517.54</float>
<string>UTC</string>
</tuple>
</state>
......@@ -335,7 +321,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1566289766.34</float>
<float>1569506369.26</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, document, jIO, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, document, jIO, rJS, RSVP, Blob) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("redirect", 'redirect')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this;
return gadget.jio_get(options.jio_key)
.push(function (result) {
return gadget.changeState({
jio_key: options.jio_key,
doc: result
});
});
})
.onEvent('submit', function (event) {
var gadget = this, html, content, cloudooo;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return RSVP.all([
form_gadget.getContent(),
gadget.getDeclaredGadget("ojs_cloudooo"),
form_gadget.getDeclaredGadget("text_content")
]);
})
.push(function (result_list) {
content = result_list[0];
cloudooo = result_list[1];
html = result_list[2].element
.querySelector('[data-gadget-scope="editor"]').firstChild
.contentDocument.body.firstChild.contentDocument.firstChild;
html.firstChild.innerHTML = "";
return RSVP.all([
cloudooo.putCloudoooConvertOperation({
"status": "converted",
"from": "txt",
"to": "html",
"id": gadget.state.jio_key,
"name": "data"
}),
cloudooo.putCloudoooConvertOperation({
"status": "convert",
"from": "html",
"to": "pdf",
"id": gadget.state.jio_key,
"name": "html",
"to_name": "pdf",
"conversion_kw": {
"encoding": ["utf8", "string"],
"page_size": ["A4", "string"],
"zoom" : [1, "double"],
"dpi" : ["300", "string"],
"header_center" : ["document Title", "string"]
}
})
]);
})
.push(function () {
return gadget.jio_putAttachment(
gadget.state.jio_key,
'html',
new Blob([html.outerHTML], {type: 'text/html'})
);
})
.push(function () {
return gadget.notifySubmitted();
})
.push(function () {
return gadget.redirect({
'command': 'display',
'options': {
'page': 'ojs_download_convert',
'jio_key': gadget.state.jio_key
}
});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.onStateChange(function () {
var gadget = this, data;
return gadget.jio_getAttachment(gadget.state.jio_key, "data")
.push(undefined, function (error) {
if (error instanceof jIO.util.jIOError && error.status_code === 404) {
return new Blob();
}
throw error;
})
.push(function (blob) {
return jIO.util.readBlobAsText(blob);
})
.push(function (evt) {
data = evt.target.result;
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_content": {
"default": data,
"css_class": "",
"required": 0,
"editable": 0,
"key": "text_content",
"hidden": 0,
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public",
"renderjs_extra": '{"editor": "jsmd_editor", "maximize": true}'
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[]
], [
"right",
[]
], [
"center",
[]
], [
"bottom",
[["my_content"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({
command: 'display',
options: {'jio_key': gadget.state.jio_key}
}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: "Export",
submit_action: true,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2]
});
});
});
}(window, document, jIO, rJS, RSVP, Blob));
......@@ -64,7 +64,9 @@
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
......@@ -75,7 +77,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>jio_configuration_storage.js</string> </value>
<value> <string>gadget_erp5_page_ojs_notebook_export.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -85,11 +87,13 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_configurationstorage_js</string> </value>
<value> <string>ojs_gadget_erp5_page_ojs_notebook_export_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -103,7 +107,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>jio_configuration_storage.js</string> </value>
<value> <string>OfficeJS Notebook Export JS</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
......@@ -195,7 +199,7 @@
</tuple>
<state>
<tuple>
<float>1567674328.66</float>
<float>1569506237.11</float>
<string>UTC</string>
</tuple>
</state>
......@@ -240,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.21127.28630.40174</string> </value>
<value> <string>978.54405.62557.30208</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1568037934.07</float>
<float>1569944120.54</float>
<string>UTC</string>
</tuple>
</state>
......@@ -315,7 +319,7 @@
</tuple>
<state>
<tuple>
<float>1567674187.84</float>
<float>1569506161.73</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, DOMParser */
/*global window, rJS, RSVP, jIO, DOMParser, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, jIO, DOMParser) {
(function (window, rJS, RSVP, jIO, DOMParser, Blob) {
"use strict";
rJS(window)
......@@ -13,6 +13,7 @@
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
......@@ -35,7 +36,7 @@
]);
})
.push(function (result) {
var file_name_list, data, filename, queue, filetype;
var file_name_list, data, filename, queue, filetype, jio_key;
if (result[0].file !== undefined) {
file_name_list = result[0].file.file_name.split('.');
filetype = file_name_list.pop();
......@@ -58,16 +59,26 @@
parser = new DOMParser();
htmlDoc = parser.parseFromString(data_content, "text/html");
data_content = htmlDoc.getElementById('jsmd').textContent;
filetype = "txt";
}
return gadget.jio_post({
title: filename,
portal_type: result[1],
content_type: result[2],
parent_relative_url: result[4],
text_content: data_content
text_content: data_content,
filename: "default." + filetype
})
.push(function (result) {
jio_key = result;
return gadget.jio_putAttachment(
jio_key,
"data",
new Blob([data_content], {type: result[2]})
);
});
})
.push(function (jio_key) {
.push(function () {
return gadget.redirect({
'command': 'display',
'options': {
......@@ -164,4 +175,4 @@
});
});
});
}(window, rJS, RSVP, jIO, DOMParser));
\ No newline at end of file
}(window, rJS, RSVP, jIO, DOMParser, Blob));
\ No newline at end of file
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.54532.18415.44100</string> </value>
<value> <string>978.54161.1627.40738</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1539165482.38</float>
<float>1569942707.05</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -100,6 +100,7 @@
from: options.format,
to: format_list[i],
id: options.jio_key,
conversion_kw: options.conversion_kw ? options.conversion_kw : {},
name: options.format === result[1] ? ATT_NAME : options.format
}));
}
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.46486.51629.28689</string> </value>
<value> <string>978.51162.48907.39389</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1534770737.04</float>
<float>1569853702.83</float>
<string>UTC</string>
</tuple>
</state>
......
erp5_web_renderjs_ui
erp5_code_mirror
erp5_multimedia
erp5_notebook
erp5_smart_assistant
\ No newline at end of file
......@@ -77,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewAsJio</string> </value>
<value> <string>string:${object_url}/string:${object_url}/OOoDocument_viewAsJio</string> </value>
</item>
</dictionary>
</pickle>
......
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