Commit aa14863c authored by Roque's avatar Roque

erp5_officejs: new approach to handle configuration hateoas urls

- there is a new mechanism to handle simple urls and call hateas script within a script instead
parent b92544cd
/*global window, window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate, console */
/*global window, window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate, atob, console */
/*jslint indent: 2, maxerr: 10, maxlen: 80 */
(function (window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate,
(function (window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate, atob,
console) {
"use strict";
......@@ -114,7 +114,8 @@
.declareMethod('createJio', function (jio_options) {
var appcache_storage,
origin_url = window.location.href,
hateoas_script = "hateoas_appcache/ERP5Document_getHateoas",
hateoas_section = "./hateoas_appcache/",
hateoas_section_and_view = hateoas_section + "definition_view/",
// TODO manifest should come from gadget.props.cache_file
// add script in html body
manifest = "gadget_officejs_text_editor.configuration",
......@@ -177,17 +178,18 @@
.push(function () {
return appcache_storage.allAttachments(origin_url)
.push(function (attachment_dict) {
var id, promise_list = [], i = 0;
var id, base64, promise_list = [], i = 0;
for (id in attachment_dict) {
if (attachment_dict.hasOwnProperty(id)) {
if (id.indexOf(hateoas_script) === -1) {
promise_list.push(appcache_storage
.getAttachment(origin_url, id));
} else {
if (id.startsWith(hateoas_section)) {
promise_list.push(
appcache_storage
.getAttachment(origin_url, id,
{"format": "json"}));
} else {
promise_list.push(
appcache_storage
.getAttachment(origin_url, id));
}
configuration_ids_list[i] = id;
i += 1;
......@@ -199,11 +201,16 @@
var i, id, parser, urlParams, content, promise_list = [];
for (i = 0; i < content_list.length; i += 1) {
id = configuration_ids_list[i];
parser = document.createElement('a');
parser.href = id;
urlParams = new URLSearchParams(parser.search);
id = urlParams.get("relative_url");
if (id.startsWith(hateoas_section)) {
id = id.replace(hateoas_section_and_view, "");
} else {
parser = document.createElement('a');
parser.href = id;
urlParams = new URLSearchParams(parser.search);
id = urlParams.get("relative_url");
}
if (id !== null) { // ignore non configuration elements
id = atob(id);
content = processHateoasDict(content_list[i]);
promise_list.push(appcache_storage.put(id, content));
}
......@@ -259,4 +266,5 @@
return wrapJioCall(this, 'repair', arguments);
});
}(window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate, console));
\ No newline at end of file
}(window, rJS, jIO, RSVP, document, URLSearchParams, UriTemplate, atob,
console));
\ No newline at end of file
......@@ -106,9 +106,7 @@
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
<value> <string>CACHE MANIFEST\n
# generated on Fri, 25 Jun 2016 11:45:33 +0000\n
# XXX + fonts\n
# images/ajax-loader.gif\n
......@@ -251,18 +249,29 @@ action_texteditor_clone.html\n
action_texteditor_clone.js\n
\n
#configuration resources\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_hal_json_style%2FBase_viewNewContentDialog&view=definition_view\n
\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%20Module&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%20Module%2Ftext_editor_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FWebPageModule_viewWebPageListAsJio&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Fjio_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Ftext_editor_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Ftext_editor_clone&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FWebPage_viewAsTextDocument&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FTextEditor_cloneDocument&view=definition_view\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/Base_viewNewContentDialog)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL0Jhc2Vfdmlld05ld0NvbnRlbnREaWFsb2c=\n
\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/WebPageModule_viewWebPageListAsJio)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1dlYlBhZ2VNb2R1bGVfdmlld1dlYlBhZ2VMaXN0QXNKaW8=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/WebPage_viewAsTextDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1dlYlBhZ2Vfdmlld0FzVGV4dERvY3VtZW50\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/TextEditor_cloneDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1RleHRFZGl0b3JfY2xvbmVEb2N1bWVudA==\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/jio_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL2ppb192aWV3\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
#Ckeditor\n
ckeditor.gadget.html\n
......@@ -603,9 +612,7 @@ ckeditor/ckeditor.js\n
ckeditor/adapters/jquery.js\n
\n
NETWORK:\n
*
]]></string> </value>
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -746,7 +753,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.17471.41864.29440</string> </value>
<value> <string>977.21668.9028.25924</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -764,7 +771,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1563896549.57</float>
<float>1564134256.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -109,28 +109,35 @@
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
<value> <string>CACHE MANIFEST\n
# generated on Thu, 14 Jan 2019 11:55:33 +0000\n
CACHE:\n
\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_hal_json_style%2FBase_viewNewContentDialog&view=definition_view\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/Base_viewNewContentDialog)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL0Jhc2Vfdmlld05ld0NvbnRlbnREaWFsb2c=\n
\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%20Module&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%20Module%2Ftext_editor_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FWebPageModule_viewWebPageListAsJio&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Fjio_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Ftext_editor_view&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FWeb%20Page%2Ftext_editor_clone&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FWebPage_viewAsTextDocument&view=definition_view\n
hateoas_appcache/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_web_officejs_ui%2FTextEditor_cloneDocument&view=definition_view\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/WebPageModule_viewWebPageListAsJio)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1dlYlBhZ2VNb2R1bGVfdmlld1dlYlBhZ2VMaXN0QXNKaW8=\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/WebPage_viewAsTextDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1dlYlBhZ2Vfdmlld0FzVGV4dERvY3VtZW50\n
#hateoas_appcache/definition_view/BASE64(portal_skins/erp5_web_officejs_ui/TextEditor_cloneDocument)\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX29mZmljZWpzX3VpL1RleHRFZGl0b3JfY2xvbmVEb2N1bWVudA==\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/jio_view)\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1dlYiBQYWdlL2ppb192aWV3\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
NETWORK:\n
*
]]></string> </value>
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -271,7 +278,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.17471.41864.29440</string> </value>
<value> <string>977.21668.3034.35225</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -289,7 +296,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1563896533.25</float>
<float>1564134252.09</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -23,7 +23,7 @@
<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_web_officejs_ui</script>
<!-- TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialog. For now it's in new_content_action -->
<script data-renderjs-configuration="new_content_action" type="text/x-renderjs-configuration">portal_skins/erp5_hal_json_style/Base_viewNewContentDialog</script>
<script data-renderjs-configuration="new_content_action" type="text/x-renderjs-configuration">portal_skins/erp5_web_officejs_ui/Base_viewNewContentDialog</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')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Web Page Module | Web Page',)</script>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Static Web Site" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>__before_publishing_traverse__</string> </key>
<value>
<object>
<klass>
<global name="MultiHook" module="ZPublisher.BeforeTraverse"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_defined_in_class</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_hookname</string> </key>
<value> <string>__before_publishing_traverse__</string> </value>
</item>
<item>
<key> <string>_list</string> </key>
<value>
<list>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</list>
</value>
</item>
<item>
<key> <string>_prior</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>__before_traverse__</string> </key>
<value>
<dictionary>
<item>
<key>
<tuple>
<int>99</int>
<string>ERP5 Static Web Site/hateoas_appcache</string>
</tuple>
</key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>redirect_domain</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>use_moved_temporarily</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>int</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>available_language</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>hateoas_appcache</string> </value>
</item>
<item>
<key> <string>layout_configuration_form_id</string> </key>
<value> <string>StaticWebSite_viewRedirectAssistConfiguration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Static Web Site</string> </value>
</item>
<item>
<key> <string>redirect_domain</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>AppCache</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Hateoas appcache</string> </value>
</item>
<item>
<key> <string>use_moved_temporarily</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="WebSectionTraversalHook" module="Products.ERP5.Document.WebSection"/>
</pickle>
<pickle>
<dictionary/>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -472,7 +472,7 @@
</item>
<item>
<key> <string>configuration_hateoas_url</string> </key>
<value> <string>../hateoas_appcache/</string> </value>
<value> <string>../hateoas_appcache_texteditor/</string> </value>
</item>
<item>
<key> <string>configuration_header_gadget_url</string> </key>
......@@ -787,7 +787,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.15998.30713.4488</string> </value>
<value> <string>977.21913.51373.65194</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -805,7 +805,7 @@
</tuple>
<state>
<tuple>
<float>1563801605.23</float>
<float>1564148846.11</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" module="erp5.portal_type"/>
<global name="Static Web Section" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -98,7 +98,7 @@
<key>
<tuple>
<int>99</int>
<string>ERP5 Web Section/hateoas_appcache</string>
<string>ERP5 Web Section/definition_section</string>
</tuple>
</key>
<value>
......@@ -120,21 +120,21 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>authorization_forced</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>container_layout</string> </key>
<value> <string>ERP5Document_getHateoas</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_layout</string> </key>
<value> <string>ERP5Document_getHateoas</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>ERP5Document_getHateoas</string> </value>
<value> <string>StaticWebSite_getRedirectSourceUrl</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -148,15 +148,15 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>hateoas_appcache</string> </value>
<value> <string>definition_section</string> </value>
</item>
<item>
<key> <string>layout_configuration_form_id</string> </key>
<value> <string>WebSection_viewHateoasPreference</string> </value>
<value> <string>StaticWebSite_viewRedirectAssistConfiguration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
<value> <string>Static Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
......@@ -166,15 +166,15 @@
</item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>Hal</string> </value>
<value> <string>RedirectAssist</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Hateoas appcache</string> </value>
<value> <string>definition section</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
......@@ -290,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>1563793675.89</float>
<float>1563980447.75</float>
<string>UTC</string>
</tuple>
</state>
......@@ -335,7 +335,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>977.16127.15783.5358</string> </value>
<value> <string>977.19112.15439.63300</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -353,7 +353,7 @@
</tuple>
<state>
<tuple>
<float>1563801586.91</float>
<float>1564139802.63</float>
<string>UTC</string>
</tuple>
</state>
......
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_web_officejs_ui</skin_folder>
<skin_selection>Hal,RJS,View</skin_selection>
<skin_selection>AppCache,Hal,RJS,View</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
"""
================================================================================
Redirect to domain specified as layout property on website
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
import binascii
import base64
name = context.REQUEST.other['source_path']
result_dict = {"error":"url path must start with definition_view"}
base_64 = False
try:
encoded = name.replace("definition_view/", "", 1)
name = base64.decodestring(encoded)
base_64 = True
except binascii.Error:
pass
if name.startswith("definition_view/") or name.startswith("portal_types/") or base_64:
relative_url = name.replace("%2F", "/").replace("%20", " ")
relative_url = relative_url.replace("definition_view/", "", 1)
context.REQUEST.set("view", "definition_view")
context.REQUEST.set("current_web_section", None)
log("GETTING HATEOAS RESULT DICT...")
try:
result_dict = context.getPortalObject().ERP5Document_getHateoas(mode="traverse", relative_url=relative_url, view="definition_view")
except Exception as e:
result_dict = {"error":"error while getting hateoas script for relative_url %s: %s" % (relative_url, str(e))}
return result_dict
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AppStaticWebSite_getRedirectSourceUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_doAction</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_select_action</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewNewContentDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_viewNewContentDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Document</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -18,6 +18,7 @@ web_page_module/officejs_audioplayer_*
web_page_module/officejs_todomvc_*
web_page_module/ojs_*
web_page_module/wallsearch_privacy_policy_html
web_site_module/hateoas_appcache
web_site_module/officejs_audioplayer
web_site_module/officejs_audioplayer/**
web_site_module/officejs_bookmark_manager
......
erp5_web_officejs_ui | AppCache
erp5_web_officejs_ui | Hal
erp5_web_officejs_ui | RJS
erp5_web_officejs_ui | View
\ No newline at end of file
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