Commit 6f0216ba authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs_appstore_base: Improve upload process and move to zip

erp5_officejs_appstore_base: Fix Improve Publication process.

* Only one submit alarm is run at a time
* Move creation dialog to Software Publication for consistency
* Person is a contributor for the web document of its application

erp5_officejs_appstore_base: Update to use Static Web Section, remove RJS versionning

erp5_officejs_appstore_base: Various improvment for ERP5JS compatibility

erp5_officejs_appstore_base: Add Action to attach Software Product to Software Publication

erp5_officejs_appstore_base: Update to use version in reference

erp5_officejs_appstore_base: Update upload dialog to have all in one place + use product line category
parent 7beb07ee
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -42,7 +40,7 @@ ...@@ -42,7 +40,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>add_web_document</string> </value> <value> <string>create_sofware_publication_dialog</string> </value>
</item> </item>
<item> <item>
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
...@@ -58,11 +56,11 @@ ...@@ -58,11 +56,11 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>22.0</float> </value> <value> <float>1.0</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Add Web Document</string> </value> <value> <string>Upload OfficeJS Application or Gadget</string> </value>
</item> </item>
<item> <item>
<key> <string>visible</string> </key> <key> <string>visible</string> </key>
...@@ -79,20 +77,7 @@ ...@@ -79,20 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareProduct_addWebDocumentDialog</string> </value> <value> <string>string:${object_url}/ERP5Site_createNewSoftwarePublicationDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: portal.Base_checkPermission(\'web_page_module\', \'Add portal_content\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,99 +2,128 @@ ...@@ -2,99 +2,128 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> <global name="Category" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>action</string> </key> <key> <string>_Add_portal_content_Permission</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>categories</string> </key> <key> <string>_Add_portal_folders_Permission</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_action</string> <string>Assignor</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>_Copy_or_Move_Permission</string> </key>
<value> <string>object_action</string> </value> <value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>_Delete_objects_Permission</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>_Modify_portal_content_Permission</string> </key>
<value> <value>
<none/> <tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>icon</string> </key> <key> <string>_count</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>_mt_index</string> </key>
<value> <string>create_software_publication</string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>permissions</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>View</string> <string>product_line/software</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>codification</string> </key>
<value> <string>Action Information</string> </value> <value> <string>SOFT</string> </value>
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>description</string> </key>
<value> <float>22.0</float> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>id</string> </key>
<value> <string>Create Software Publication</string> </value> <value> <string>software</string> </value>
</item> </item>
<item> <item>
<key> <string>visible</string> </key> <key> <string>portal_type</string> </key>
<value> <int>1</int> </value> <value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Software</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<global name="Expression" module="Products.CMFCore.Expression"/> <global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <none/>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareProduct_createSoftwarePublicationDialog</string> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="Expression" module="Products.CMFCore.Expression"/> <global name="OOBTree" module="BTrees.OOBTree"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <none/>
<item>
<key> <string>text</string> </key>
<value> <string>python: portal.Base_checkPermission(\'software_publication_module\', \'Add portal_content\')</string> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" 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>categories</string> </key>
<value>
<tuple>
<string>product_line/software/application</string>
<string>product_line/software/application</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<value> <string>APP</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>HTML5 Application</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>application</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value> <string>WebApp</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Application HTML5</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" 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>categories</string> </key>
<value>
<tuple>
<string>product_line/software/gadget</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<value> <string>GDT</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>HTML5 Application</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value> <string>Gadget</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget HTML5</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -79,16 +79,26 @@ ...@@ -79,16 +79,26 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>codification</string> </key>
<value> <string>APP</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>APP</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value> <string>Application materila</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>application</string> </value> <value> <string>application</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Category</string> </value> <value> <string>Category</string> </value>
......
...@@ -61,16 +61,26 @@ ...@@ -61,16 +61,26 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>codification</string> </key>
<value> <string>LAND</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>LAND</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value> <string>Landing page of an application</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>landing_page</string> </value> <value> <string>landing_page</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Category</string> </value> <value> <string>Category</string> </value>
......
...@@ -62,16 +62,26 @@ ...@@ -62,16 +62,26 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>codification</string> </key>
<value> <string>LOGO</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>LOGO</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value> <string>Logo of an application</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>logo</string> </value> <value> <string>logo</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Category</string> </value> <value> <string>Category</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" 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>categories</string> </key>
<value>
<tuple>
<string>publication_section/application/package</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<value> <string>PKG</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Original Package contributed to make the application</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>package</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Package</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -144,6 +144,16 @@ ...@@ -144,6 +144,16 @@
<value> <string>string</string> </value> <value> <string>string</string> </value>
</item> </item>
</dictionary> </dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_x_frame_options</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -184,12 +194,16 @@ ...@@ -184,12 +194,16 @@
</item> </item>
<item> <item>
<key> <string>configuration_content_security_policy</string> </key> <key> <string>configuration_content_security_policy</string> </key>
<value> <string>default-src \'none\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://localhost:5000 mail.tiolive.com data:; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src netdna.bootstrapcdn.com; style-src \'self\' netdna.bootstrapcdn.com \'unsafe-inline\' data:; frame-src \'self\' data:</string> </value> <value> <string>default-src * \'self\' \'unsafe-inline\' \'unsafe-eval\'</string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_latest_version</string> </key> <key> <string>configuration_latest_version</string> </key>
<value> <string>development</string> </value> <value> <string>development</string> </value>
</item> </item>
<item>
<key> <string>configuration_x_frame_options</string> </key>
<value> <string>ALLOW-FROM-ALL</string> </value>
</item>
<item> <item>
<key> <string>container_layout</string> </key> <key> <string>container_layout</string> </key>
<value> <string>WebSection_renderOfficeJSApplicationPage</string> </value> <value> <string>WebSection_renderOfficeJSApplicationPage</string> </value>
...@@ -226,7 +240,7 @@ ...@@ -226,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>skin_selection_name</string> </key> <key> <string>skin_selection_name</string> </key>
<value> <string>RJSVersioning</string> </value> <value> <string>RJS</string> </value>
</item> </item>
<item> <item>
<key> <string>static_language_selection</string> </key> <key> <string>static_language_selection</string> </key>
...@@ -407,7 +421,7 @@ ...@@ -407,7 +421,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>supercedriclen</string> </value> <value> <string>cedric.le.ninivin</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -421,7 +435,7 @@ ...@@ -421,7 +435,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>950.60590.3867.31761</string> </value> <value> <string>958.24467.40344.6724</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -439,7 +453,7 @@ ...@@ -439,7 +453,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1462897520.95</float> <float>1490973425.66</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="Web Section" module="erp5.portal_type"/> <global name="Static Web Section" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<key> <key>
<tuple> <tuple>
<int>99</int> <int>99</int>
<string>ERP5 Web Section/connection</string> <string>ERP5 Web Section/template</string>
</tuple> </tuple>
</key> </key>
<value> <value>
...@@ -109,15 +109,36 @@ ...@@ -109,15 +109,36 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>__translation_dict</string> </key> <key> <string>_identity_criterion</string> </key>
<value> <value>
<dictionary/> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>_identity_criterion</string> </key> <key> <string>_local_properties</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_x_frame_options</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>configuration_content_security_policy</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -127,12 +148,12 @@ ...@@ -127,12 +148,12 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>categories</string> </key> <key> <string>configuration_content_security_policy</string> </key>
<value> <value> <string>default-src * \'self\' \'unsafe-inline\' \'unsafe-eval\' data: blob:</string> </value>
<tuple> </item>
<string>caching_policy/no-cache</string> <item>
</tuple> <key> <string>configuration_x_frame_options</string> </key>
</value> <value> <string>ALLOW-FROM-ALL</string> </value>
</item> </item>
<item> <item>
<key> <string>container_layout</string> </key> <key> <string>container_layout</string> </key>
...@@ -158,15 +179,11 @@ ...@@ -158,15 +179,11 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>connection</string> </value> <value> <string>template</string> </value>
</item>
<item>
<key> <string>layout_configuration_form_id</string> </key>
<value> <string>WebSection_viewRenderJSPreference</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value> <value> <string>Static Web Section</string> </value>
</item> </item>
<item> <item>
<key> <string>short_title</string> </key> <key> <string>short_title</string> </key>
...@@ -174,13 +191,9 @@ ...@@ -174,13 +191,9 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>skin_selection_name</string> </key>
<value> <string>RJS</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Connection</string> </value> <value> <string>Template Section</string> </value>
</item> </item>
<item> <item>
<key> <string>visible</string> </key> <key> <string>visible</string> </key>
...@@ -300,7 +313,7 @@ ...@@ -300,7 +313,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1458146716.03</float> <float>1490973336.84</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -336,7 +349,7 @@ ...@@ -336,7 +349,7 @@
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent> <none/>
</value> </value>
</item> </item>
<item> <item>
...@@ -345,7 +358,7 @@ ...@@ -345,7 +358,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value> <value> <string>958.24468.20075.50363</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -363,7 +376,7 @@ ...@@ -363,7 +376,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1458146716.04</float> <float>1490973460.32</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -375,36 +388,4 @@ ...@@ -375,36 +388,4 @@
</tuple> </tuple>
</pickle> </pickle>
</record> </record>
<record id="8" aka="AAAAAAAAAAg=">
<pickle>
<global name="Message" module="Products.ERP5Type.Message"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>Object copied from ${source_item}</string> </value>
</item>
<item>
<key> <string>domain</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>mapping</string> </key>
<value>
<dictionary>
<item>
<key> <string>source_item</string> </key>
<value> <string>/erp5/web_site_module/officejs_appstore/hateoas/connection</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>message</string> </key>
<value> <string>Object copied from ${source_item}</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -3,8 +3,4 @@ ...@@ -3,8 +3,4 @@
<type>Software Publication</type> <type>Software Publication</type>
<workflow>-ticket_workflow, officejs_appstore_interaction_workflow, officejs_software_publication_workflow</workflow> <workflow>-ticket_workflow, officejs_appstore_interaction_workflow, officejs_software_publication_workflow</workflow>
</chain> </chain>
<chain>
<type>Web Page</type>
<workflow>officejs_web_document_interaction_workflow</workflow>
</chain>
</workflow_chain> </workflow_chain>
\ No newline at end of file
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_web_renderjs_ui</skin_folder>
<skin_selection>RJSVersioning</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_web_versioning</skin_folder>
<skin_selection>RJSVersioning</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
context.getPortalObject().portal_catalog.searchAndActivate(
portal_type="Software Publication",
simulation_state=["draft"],
method_id='SoftwarePublication_submitSoftwarePublication',
activate_kw={'tag': tag}
)
context.activate(after_tag=tag).getId()
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>name, portal=None, language=None, validation_state=None, effective_date=None, now=None, **kw</string> </value> <value> <string>tag, fixit, params</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_getDocumentValue</string> </value> <value> <string>Alarm_submitSoftwarePublication</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
portal = context.getPortalObject()
person = context.ERP5Site_getAuthenticatedMemberPersonValue()
# Generate Version Number
# XXX Should Check that version of this software doesn't already exists
import hashlib
version = hashlib.sha224("%s-%s" % (version_title, DateTime())).hexdigest()[:10]
# Create Software Publication
# It carries the software publication process
software_publication = portal.software_publication_module.newContent(
portal_type="Software Publication",
description=changelog,
source=person.getRelativeUrl(),
# We should probably use a more simple reference using an incremental id generator
reference="SP-" + version,
title='publication ' + version_title,
start_date=DateTime(),
)
# Create Software Release
# This is the result of the publication process. It is an aggregate of the line
software_release = portal.software_release_module.newContent(
portal_type="Software Release",
reference=version,
title='release ' + version_title + '-' + version,
version=version_title,
)
# Create Software Publication Line
software_publication_line = software_publication.newContent(
portal_type="Software Publication Line",
title=software_publication.getTitle() + " Publication",
aggregate=[
software_release.getRelativeUrl(),
]
)
zip_file = software_publication.Base_contribute(
file=file,
attach_document_to_context=True,
portal_type="File",
publication_section="publication_section/application/package",
redirect_to_document=False,
version=version,
)
return software_publication.SoftwarePublication_attachSoftwareProduct(
relative_url=software_product,
title=title,
description=description,
product_line=product_line,
)
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>language=None, validation_state=None, all_languages=None, all_versions=None, effective_date=None, now=None, src__=0, **kw</string> </value> <value> <string>file, product_line, title, version_title, changelog="", description="", software_product="", **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_getDocumentValueListBase</string> </value> <value> <string>ERP5Site_createNewSoftwarePublication</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>SoftwareProduct_addWebDocument</string> </value> <value> <string>ERP5Site_createNewSoftwarePublication</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -72,9 +72,13 @@ ...@@ -72,9 +72,13 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>your_portal_type</string> <string>your_file</string>
<string>your_reference</string> <string>your_product_line</string>
<string>your_software_product</string>
<string>your_title</string> <string>your_title</string>
<string>your_description</string>
<string>your_version_title</string>
<string>your_changelog</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -89,7 +93,7 @@ ...@@ -89,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SoftwareProduct_addWebDocumentDialog</string> </value> <value> <string>ERP5Site_createNewSoftwarePublicationDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -97,7 +101,7 @@ ...@@ -97,7 +101,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>SoftwareProduct_addWebDocumentDialog</string> </value> <value> <string>ERP5Site_createNewSoftwarePublicationDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
...@@ -113,7 +117,7 @@ ...@@ -113,7 +117,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Add Web Document</string> </value> <value> <string>Create Software Publication</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>required</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_reference</string> </value> <value> <string>your_changelog</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -73,20 +73,20 @@ ...@@ -73,20 +73,20 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value> <value> <string>my_description</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Document_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Changelog</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Set Or update Software Product Title</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Description</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_file</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_file_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Application Zip</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_product_line</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Type</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(here.portal_categories.product_line.software, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id="int_index")</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_software_product</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Software Product</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/ERP5Site_getAvailableSoftwareProductList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>Set Or update Software Product Title</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Title</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
<value> <value>
<list> <list>
<string>required</string> <string>required</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_title</string> </value> <value> <string>your_version_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -73,11 +74,11 @@ ...@@ -73,11 +74,11 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_title</string> </value> <value> <string>my_version</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Document_viewFieldLibrary</string> </value> <value> <string>WebPage_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -87,6 +88,10 @@ ...@@ -87,6 +88,10 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Version Title</string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
return [('', '')] + [(x.getTitle(), x.relative_url) for x in context.getPortalObject().portal_catalog(
portal_type="Software Product",
# Is validation state necessary here?
# validation_state="validated",
select_list=("relative_url")
)]
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getAvailableSoftwareProductList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
module = portal.getDefaultModule(portal_type)
document = module.newContent(
portal_type=portal_type,
reference=reference,
title=title,
follow_up=context.getRelativeUrl(),
)
return document.Base_redirect(
'',
keep_items={
'portal_status_message': portal.Base_translateString("Web Document Created"),
}
)
...@@ -17,51 +17,8 @@ if not web_site: ...@@ -17,51 +17,8 @@ if not web_site:
if not web_site.getId() == context.getReference().lower(): if not web_site.getId() == context.getReference().lower():
web_site.setId(context.getReference().lower()) web_site.setId(context.getReference().lower())
if portal.portal_workflow.isTransitionPossible(web_site, 'publish'):
web_site.publish()
# Update version on development document if batch_mode:
# XX Do we need version??? return web_site
document_list = portal.portal_catalog(
portal_type= portal.getPortalDocumentTypeList(),
validation_state="draft",
strict_follow_up_uid=context.getUid(),
)
# XX Doesn't seem to be unique enough
version = context.getReference()[:6] + "-dev"
for document_brain in document_list:
document = document_brain.getObject()
document.setVersion(version)
development_section = web_site["development"]
# Update development section to use version and follow_up
development_section.setCriterionPropertyList([
"version",
"validation_state",
])
development_section.setCriterion('version', version)
development_section.setCriterion('validation_state', 'draft')
development_section.setMembershipCriterionBaseCategoryList(['follow_up'])
development_section.setMembershipCriterionCategoryList(['follow_up/' + context.getRelativeUrl()])
# Update default page for development version.
landing_publication_uid = portal.portal_categories.publication_section.application.landing_page.getUid()
aggregate_list = portal.portal_catalog(
portal_type="Web Page",
strict_follow_up_uid=context.getUid(),
strict_publication_section_uid=landing_publication_uid,
validation_state="draft",
#XXX Hackish
sort_on=[("modification_date", "descending")],
limit=1,
select_list=["relative_url"],
)
if aggregate_list:
development_section.setAggregate(aggregate_list[0].relative_url)
development_section.setTitle(context.getTitle() + " Development")
development_section.setShortTitle(context.getShortTitle())
development_section.setDescription(context.getDescription())
return web_site
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>batch_mode=True</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
<?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_doSelect</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </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>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_delivery_start_date</string>
<string>listbox_delivery_stop_date</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>listbox_modification_date</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwarePublicationModule_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SaleOpportunityModule_viewSaleOpportunityList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</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>Tickets</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>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>date_only</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_start_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>date_only</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_ticket_start_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>date_only</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_stop_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>date_only</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_stop_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>date_only</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_modification_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>date_only</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
if not relative_url:
software_product = portal.software_product_module.newContent(
portal_type="Software Product",
)
else:
software_product = portal.restrictedTraverse(relative_url)
edit_kw = {
"product_line": product_line,
}
if title:
edit_kw['title'] = title
else:
title = software_product.getTitle()
if description:
edit_kw['description'] = description
context.log(edit_kw)
software_product.edit(**edit_kw)
software_product_url = software_product.getRelativeUrl()
software_publication = context
software_publication.edit(
title=title + " " + software_publication.getTitle(),
)
software_publication_line = software_publication.objectValues(
portal_type="Software Publication Line",
)[0]
software_release = software_publication_line.getAggregateValue(portal_type="Software Release")
software_release.edit(
title=title + " " + software_release.getTitle(),
follow_up=software_product_url,
)
software_publication_line.edit(
resource=software_product_url,
aggregate=[
software_release.getRelativeUrl(),
software_product.getSaleSupplyLineAggregate(),
]
)
return software_publication.Base_redirect(
"",
keep_items={
'portal_status_message': portal.Base_translateString("Your demand is being processed, please wait status to move to 'Submitted' to review your application before final submission")
}
)
<?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>title="", description="", relative_url="", product_line="", **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwarePublication_attachSoftwareProduct</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
software_publication_line_list = context.objectValues(portal_type="Software Publication Line")
if len(software_publication_line_list) == 0:
return
software_publication_line = software_publication_line_list[0]
software_release = software_publication_line.getAggregateValue(portal_type="Software Release")
software_product = software_publication_line.getResourceValue(portal_type="Software Product")
if not software_product or not software_release:
return
software_release_version = software_release.getReference()
#if as_link:
# return '<a href="%(link)s">%(link)s</a>' % {"link": (software_product.getFollowUpValue(portal_type="Web Site")[software_release_version].absolute_url() + "/")}
return software_product.getFollowUpValue(portal_type="Web Site")[software_release_version].absolute_url() + "/"
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>portal_type, reference, title, **kw</string> </value> <value> <string>as_link=True</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SoftwareProduct_addWebDocument</string> </value> <value> <string>SoftwarePublication_getTestUrl</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
software_release = context.SoftwarePublication_getRelatedSoftwareRelease() software_release = context.SoftwarePublication_getRelatedSoftwareRelease()
software_release.publish() tag = "publish_" + software_release.getRelativeUrl()
software_release.SoftwareRelease_publishRelatedWebDocument() software_release.activate(tag=tag).SoftwareRelease_publishRelatedWebDocument()
software_release.activate(after_tag=tag).publish()
software_publication = context
if software_publication.getSimulationState() != "draft":
return
software_publication_line = software_publication.objectValues(
portal_type="Software Publication Line",
)[0]
software_product = software_publication_line.getResourceValue(portal_type="Software Product")
if not software_product:
return
portal = context.getPortalObject()
application_publication_section = portal.portal_categories.publication_section.application
zip_file = portal.portal_catalog.getResultValue(
portal_type="File",
strict_publication_section_uid=application_publication_section.package.getUid(),
strict_follow_up_uid=software_publication.getUid(),
)
if not zip_file:
# XXX Do something?
return
software_release = software_publication_line.getAggregateValue(portal_type="Software Release")
from cStringIO import StringIO
import zipfile
zipbuffer = StringIO()
zipbuffer.write(str(zip_file.getData()))
zip_reader = zipfile.ZipFile(zipbuffer)
user_login = software_publication.getSourceReference()
version = software_release.getReference()
# look for Base Directory
base = ""
for name in zip_reader.namelist():
if "/" in name:
temp_base = name.split("/")[0]
if base and base != temp_base:
base = ""
break
else:
base = temp_base
else:
base = ""
break
if base:
base += "/"
base_length = len(base)
software_release_url = software_release.getRelativeUrl()
tag = "preparing_sr_%s" % software_release_url
for name in zip_reader.namelist():
if zip_reader.getinfo(name).file_size == 0:
continue
temp_file = StringIO(zip_reader.read(name))
url = name[base_length:]
if url in ("index.html", "index.htm"):
publication_section = application_publication_section.landing_page.getRelativeUrl()
else:
publication_section = application_publication_section.getRelativeUrl()
document = portal.portal_contributions.newContent(
file=temp_file,
filename=url,
redirect_to_document=False,
user_login=user_login,
reference=version + "/" + url,
title=url,
version=version,
publication_section_value=publication_section,
follow_up=software_release_url,
portal_type="File",
)
# XX Hackish
document.setCategoryList(
document.getCategoryList() + ["contributor/" + software_publication.getSource()])
document.activate(tag=tag).submit()
software_release.activate(after_tag=tag, tag=tag + "_2").SoftwareRelease_fixRelatedWebSection()
if portal.portal_workflow.isTransitionPossible(zip_file, 'submit'):
zip_file.submit()
if portal.portal_workflow.isTransitionPossible(software_release, 'submit'):
software_release.submit()
software_publication.activate(after_tag=tag + "_2").submit()
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwarePublication_submitSoftwarePublication</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
software_release = context
software_product = software_release.getFollowUpValue(portal_type="Software Product")
web_site = software_product.SoftwareProduct_fixRelatedWebSite(batch_mode=True)
version = software_release.getReference()
try:
web_section = web_site.restrictedTraverse(version)
except KeyError:
source = portal.web_site_module.officejs_app_template
clipboard = source.manage_copyObjects(ids=["template"])
context.REQUEST.set('__cp', clipboard) # CopySupport is using this to set
# tracebility information in edit_workflow history
paste_result = web_site.manage_pasteObjects(cb_copy_data=clipboard)
web_section = web_site[paste_result[0]['new_id']]
web_section.edit(
id=version,
title=software_release.getVersion(),
configuration_base_reference=version + "/",
)
# Update development section to use version and follow_up
web_section.setCriterionPropertyList([
"version",
"validation_state",
])
web_section.setCriterion('version', version[:10])
web_section.setCriterion('validation_state', 'submitted')
web_section.setMembershipCriterionBaseCategoryList(['follow_up'])
web_section.setMembershipCriterionCategoryList(['follow_up/' + context.getRelativeUrl()])
if portal.portal_workflow.isTransitionPossible(web_section, 'publish'):
web_section.publish()
# Update default page for development version.
landing_publication_uid = portal.portal_categories.publication_section.application.landing_page.getUid()
aggregate_list = portal.portal_catalog(
portal_type="File",
strict_follow_up_uid=context.getUid(),
strict_publication_section_uid=landing_publication_uid,
validation_state="submitted",
#XXX Hackish
sort_on=[("modification_date", "descending")],
limit=1,
select_list=["relative_url"],
)
if aggregate_list:
web_section.setAggregate(aggregate_list[0].relative_url)
return "Done"
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareRelease_fixRelatedWebSection</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -22,9 +22,10 @@ if web_site.getValidationState() != 'published': ...@@ -22,9 +22,10 @@ if web_site.getValidationState() != 'published':
web_site.setEffectiveDate(today) web_site.setEffectiveDate(today)
web_site.publish() web_site.publish()
version_web_section = web_site[software_release.getVersion()] version_web_section = web_site[software_release.getReference()]
version_web_section.setCriterion('validation_state', 'published') version_web_section.setCriterion('validation_state', 'published')
version_web_section.publish() if portal.portal_workflow.isTransitionPossible(version_web_section, 'publish'):
version_web_section.publish()
def webSectionUpdatePredicate(current_section): def webSectionUpdatePredicate(current_section):
current_section.setCriterion('validation_state', 'published') current_section.setCriterion('validation_state', 'published')
...@@ -58,16 +59,3 @@ web_manifest.setData("""CACHE MANIFEST ...@@ -58,16 +59,3 @@ web_manifest.setData("""CACHE MANIFEST
CACHE: CACHE:
NETWORK: NETWORK:
*""" % (DateTime().rfc822())) *""" % (DateTime().rfc822()))
# Is latest Websection what we want?
if "latest" not in web_site.objectIds():
latest_web_section = version_web_section.Base_createCloneDocument(batch_mode=True)
latest_web_section.setId("latest")
latest_web_section.publish()
else:
latest_web_section = web_site['latest']
# Update Aggregate, Version and Title
latest_web_section.setCriterion('version', software_release.getVersion())
latest_web_section.setTitle(version_web_section.getTitle())
latest_web_section.setAggregate(version_web_section.getAggregate())
...@@ -8,6 +8,6 @@ web_section = REQUEST.get("current_web_section") ...@@ -8,6 +8,6 @@ web_section = REQUEST.get("current_web_section")
#raise ValueError(web_section.getLayoutProperty("configuration_latest_version", default="development")) #raise ValueError(web_section.getLayoutProperty("configuration_latest_version", default="development"))
return default_web_page.WebPage_viewAsWeb(mapping_dict={ return default_web_page.WebPage_viewAsWeb(mapping_dict={
"latest_version": web_section.getLayoutProperty("configuration_latest_version", default="development"), #"latest_version": web_section.getLayoutProperty("configuration_latest_version", default="development"),
"application_appcache": web_section.getId() + ".appcache", #"application_appcache": web_section.getId() + ".appcache",
}) })
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<string>my_configuration_content_security_policy</string> <string>my_configuration_content_security_policy</string>
<string>my_configuration_resource_base_url</string> <string>my_configuration_resource_base_url</string>
<string>my_configuration_x_frame_options</string> <string>my_configuration_x_frame_options</string>
<string>my_configuration_base_reference</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>items</string> <string>default</string>
<string>required</string> <string>description</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_portal_type</string> </value> <value> <string>my_configuration_base_reference</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -62,12 +68,6 @@ ...@@ -62,12 +68,6 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -84,22 +84,20 @@ ...@@ -84,22 +84,20 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>default</string> </key>
<value> <string>my_list_field</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>description</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Will be added at the beginning of the reference on getDocumentValue</string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>field_id</string> </key>
<value> <value> <string>my_view_mode_reference</string> </value>
<list/>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>form_id</string> </key>
<value> <int>1</int> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
...@@ -107,7 +105,7 @@ ...@@ -107,7 +105,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Portal Type</string> </value> <value> <string>Base Reference</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -123,7 +121,7 @@ ...@@ -123,7 +121,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in here.getPortalDocumentTypeList()]</string> </value> <value> <string>python: here.getLayoutProperty(field.getId().replace(\'my_\', \'\', 1), \'\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
"""
This script is part of ERP5 Web
ERP5 Web is a business template of ERP5 which provides a way
to create web sites which can display selected
ERP5 contents through multiple custom web layouts.
The default implementation searches for
documents which are in the user language if any
and which reference is equal to the name parameter.
Other implementations are possible: ex. display the last
version in the closest language rather than
the latest version in the user language.
NOTE:
- the portal parameter was introduced to
fix acquisition issues within the _aq_dynamic
lookup from WebSection class.
"""
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
if portal is None: portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
# The list of portal types here should be large enough to include
# all portal_types defined in the various sections so that
# href tags which point to a document by reference can still work.
valid_portal_type_list = portal.getPortalDocumentTypeList()
# Find the applicable language
if language is None:
language = portal.Localizer.get_selected_language()
if validation_state is None:
validation_state = ('released', 'released_alive', 'published', 'published_alive',
'shared', 'shared_alive', 'public', 'validated')
if effective_date is None:
if now is None:
now = DateTime()
effective_date = ComplexQuery(
SimpleQuery(effective_date=None),
SimpleQuery(effective_date=now, comparison_operator='<='),
logical_operator='or',
)
# Note: In sorts, NULL is considered lesser than non-NULL. So in descending
# sort, NULLs will be listed after non-NULLs, which is perfect for
# effective_date, which defines the date at which content becomes effective.
# None (NULL) effective date hence means "effective since infinite in te past".
base_sort = (('effective_date', 'descending'), )
# Portal Type and validation state should be handled by predicate
# By default
web_page_list = context.searchResults(
reference=name,
effective_date=effective_date,
language=(language, ''),
sort_on=(('language', 'descending'), ) + base_sort,
limit=1,
**kw)
if len(web_page_list) == 0:
# Default returns None
web_page = None
else:
# Try to get the first page on the list
web_page = web_page_list[0]
web_page = web_page.getObject()
# return the web page
return web_page
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>accept</string> <string>open</string>
<string>accept_action</string> <string>open_action</string>
<string>reject</string> <string>reject</string>
<string>reject_action</string> <string>reject_action</string>
<string>suspend</string>
<string>suspend_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
<value> <value>
<tuple> <tuple>
<string>submit</string> <string>open</string>
<string>submit_action</string> <string>open_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
portal_categories/product_line/software
portal_categories/product_line/software/**
portal_categories/publication_section/** portal_categories/publication_section/**
web_page_module/gadget_ojs_* web_page_module/gadget_ojs_*
web_site_module/officejs_app_template web_site_module/officejs_app_template
......
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