Commit 09281f9e authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_web: Simplify implementation approach to request the instance

Instead use portal_sessions and selection, use links on listbox and forms rendered by context. This provides more flexibility on provide links on others locations and sites.
parent 448cd2e4
......@@ -210,7 +210,7 @@
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_viewNextStep</string> </value>
<value> <string>WebSection_viewServiceChoiceDialog</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" 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 Web Section/service</string>
</tuple>
</key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<string>Software Product</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>criterion_property</string> </key>
<value>
<tuple>
<string>portal_type</string>
</tuple>
</value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_viewServiceChoiceDialog</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Please choose the service that you need.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>service</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>product_line</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple>
<string>product_line/vifib</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Service</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</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>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" 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 Web Section/software_release</string>
</tuple>
</key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<string>Software Product</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>criterion_property</string> </key>
<value>
<tuple>
<string>portal_type</string>
</tuple>
</value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_viewSoftwareReleaseChoiceDialog</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Please choose the software release that you need.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>software_release</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple>
<string>product_line</string>
</tuple>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple>
<string>product_line/vifib</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Software Release</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</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>
</ZopeData>
......@@ -2,10 +2,14 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<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>
......@@ -20,6 +24,18 @@
<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>
......@@ -33,46 +49,22 @@
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="resource here/getObject ;\n
came_from request/came_from | nothing" i18n:domain="ui">\n
<div tal:attributes="onclick python:\'javascript:selectCell(\\\'%s\\\',\\\'resource-selected\\\',\\\'resource-summary\\\',\\\'release_listbox\\\')\' % (resource.getUid());\n
class string:resource-summary;\n
id string:release_listbox_cell_${resource/getUid}">\n
<h3 tal:content="resource/getTitle"></h3> \n
<p> \n
<span i18n:translate="">Version</span>\n
<span tal:content="resource/getVersion" />\n
</p>\n
<!--a tal:attributes="href string:./${resource/getRelativeUrl}?came_from=${came_from}"\n
i18n:translate="" >View details</a-->\n
\n
</div>\n
</tal:block>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
<key> <string>_body</string> </key>
<value> <string>return context.portal_catalog(\n
portal_type="Software Release",\n
default_aggregate_uid=context.getUid(),\n
validation_state=["shared", "shared_alive", "released", \n
"released_alive", "published", "published_alive"]\n
)\n
</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareRelease_viewSummaryWidget</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
<value> <string>SoftwareProduct_getPublicSoftwareReleaseList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -35,7 +35,7 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>WebSection_addSelectedSoftwareReleaseToShoppingCart</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -88,7 +88,9 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_orderLink</string>
</list>
</value>
</item>
<item>
......@@ -110,7 +112,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_viewSoftwareReleaseChoiceDialog</string> </value>
<value> <string>SoftwareProduct_viewSoftwareReleaseOrderDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......@@ -118,11 +120,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SaleOrder_viewSoftwareReleaseChoiceDialog</string> </value>
<value> <string>SoftwareProduct_viewSoftwareReleaseOrderDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......
......@@ -13,8 +13,9 @@
<string>columns</string>
<string>css_class</string>
<string>default_display_style</string>
<string>default_params</string>
<string>list_method</string>
<string>search</string>
<string>select</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
......@@ -94,6 +95,10 @@
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>orderLink</string>
<string></string>
</tuple>
</list>
</value>
</item>
......@@ -105,17 +110,6 @@
<key> <string>default_display_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list>
<tuple>
<string>portal_type</string>
<string>Software Release</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
......@@ -130,6 +124,14 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>search</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>vifib_software_release_selection</string> </value>
......@@ -158,6 +160,10 @@
<string>description</string>
<string></string>
</tuple>
<tuple>
<string>orderLink</string>
<string></string>
</tuple>
</list>
</value>
</item>
......@@ -175,7 +181,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>WebSection_getSelectableSoftwareReleaseList</string> </value>
<value> <string>SoftwareProduct_getPublicSoftwareReleaseList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_getSummaryAsHTML</string> </value>
<value> <string>listbox_orderLink</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -79,7 +79,11 @@
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value> <string encoding="cdata"><![CDATA[
Order Now >
]]></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
......@@ -101,16 +105,17 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>cell/SoftwareProduct_viewSummaryWidget</string> </value>
<value> <string encoding="cdata"><![CDATA[
python: "<a href=%s/SoftwareRelease_viewRequestDialog> Order Now </a>" % cell.absolute_url()
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -35,7 +35,7 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>WebSection_addSelectedSoftwareProductToShoppingCart</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -89,7 +89,7 @@
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_getSummaryAsHTML</string>
<string>listbox_orderLink</string>
<string>listbox_getDefaultImageAbsoluteUrl</string>
</list>
</value>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......
......@@ -14,7 +14,7 @@
<string>css_class</string>
<string>default_params</string>
<string>list_method</string>
<string>search</string>
<string>select</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
......@@ -90,6 +90,10 @@
<string>getDefaultImageAbsoluteUrl</string>
<string></string>
</tuple>
<tuple>
<string>orderLink</string>
<string></string>
</tuple>
</list>
</value>
</item>
......@@ -127,7 +131,7 @@
</value>
</item>
<item>
<key> <string>search</string> </key>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
</item>
<item>
......@@ -154,6 +158,10 @@
<string>getDefaultImageAbsoluteUrl</string>
<string></string>
</tuple>
<tuple>
<string>orderLink</string>
<string></string>
</tuple>
</list>
</value>
</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>default</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_orderLink</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>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<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>default</string> </key>
<value> <string encoding="cdata"><![CDATA[
Order Now >
]]></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_editor_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</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>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: "<a href=%s/SoftwareProduct_viewSoftwareReleaseOrderDialog> Order Now </a>" % cell.absolute_url()
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</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>
<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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="resource here/getObject;\n
came_from request/current_web_section/getRelativeUrl;">\n
<div tal:attributes="onclick python:\'javascript:selectSoftwareProduct(\\\'%s\\\',\\\'resource-selected\\\',\\\'resource-summary\\\',\\\'listbox\\\', \\\'%s\\\', \\\'%s\\\')\' % (resource.getUid(),resource.getAbsoluteUrl(),came_from);\n
class string:resource-summary;\n
id string:listbox_cell_${resource/getUid}">\n
<h3 tal:condition="python: not bool(here.getDefaultImageAbsoluteUrl())" tal:content="resource/getTitle"></h3> \n
<p> \n
<tal:comment tal:replace="nothing">\n
<span i18n:translate="" i18n:domain="ui">Price</span>\n
<span tal:content="python:\'%.2f %s\' % (resource.getPrice(),\'Eur\')#context.WebSite_getShoppingCartDefaultCurrencySymbol())"/> \n
</tal:comment>\n
<img tal:condition="here/getDefaultImageAbsoluteUrl" tal:attributes="src string:${resource/getDefaultImageAbsoluteUrl}?resolution=75&display=thumbnail">\n
<!--a tal:attributes="href string:${resource/getAbsoluteUrl}?came_from=${came_from}">View details</a-->\n
</p>\n
\n
</div>\n
</tal:block>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareProduct_viewSummaryWidget</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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