Commit b07a8646 authored by Ayush Tiwari's avatar Ayush Tiwari

Commit Tool: Update view, add similar category

parent cf487874
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>create_snapshot</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Snapshot</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="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/CommitTool_createSnapshot</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<base_category_list> <base_category_list>
<portal_type id="Business Commit"> <portal_type id="Business Commit">
<item>predecessor</item> <item>predecessor</item>
<item>similar</item>
<item>source_project</item>
</portal_type> </portal_type>
<portal_type id="Business Item"> <portal_type id="Business Item">
<item>follow_up</item> <item>follow_up</item>
</portal_type> </portal_type>
<portal_type id="Business Manager">
<item>follow_up</item>
</portal_type>
<portal_type id="Business Patch Item"> <portal_type id="Business Patch Item">
<item>follow_up</item> <item>follow_up</item>
</portal_type> </portal_type>
<portal_type id="Business Property Item"> <portal_type id="Business Property Item">
<item>follow_up</item> <item>follow_up</item>
</portal_type> </portal_type>
<portal_type id="Business Snapshot">
<item>similar</item>
</portal_type>
</base_category_list> </base_category_list>
\ No newline at end of file
...@@ -19,4 +19,8 @@ ...@@ -19,4 +19,8 @@
<type>Business Property Item</type> <type>Business Property Item</type>
<workflow>business_manager_interaction_workflow</workflow> <workflow>business_manager_interaction_workflow</workflow>
</chain> </chain>
<chain>
<type>Business Snapshot</type>
<workflow>business_snapshot_validation_workflow</workflow>
</chain>
</workflow_chain> </workflow_chain>
\ No newline at end of file
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<value> <value>
<list> <list>
<string>my_item_layer</string> <string>my_item_layer</string>
<string>my_follow_up_title</string> <string>my_follow_up</string>
</list> </list>
</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>catalog_index</string>
<string>description</string>
<string>first_item</string>
<string>portal_type</string>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_follow_up</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>catalog_index</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </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>catalog_index</string> </key>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Business Manager related to the Business Item</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_relation_field</string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Business Manager</string>
<string>Business Manager</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Business Manager</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
<list> <list>
<string>my_title</string> <string>my_title</string>
<string>my_id</string> <string>my_id</string>
<string>my_predecessor</string> <string>my_predecessor_title</string>
<string>my_source_project_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<value> <value>
<list> <list>
<string>catalog_index</string> <string>catalog_index</string>
<string>default</string>
<string>first_item</string> <string>first_item</string>
<string>portal_type</string> <string>portal_type</string>
<string>title</string> <string>title</string>
...@@ -20,7 +19,7 @@ ...@@ -20,7 +19,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_predecessor</string> </value> <value> <string>my_predecessor_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -56,12 +55,6 @@ ...@@ -56,12 +55,6 @@
<key> <string>catalog_index</string> </key> <key> <string>catalog_index</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<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>
...@@ -93,10 +86,6 @@ ...@@ -93,10 +86,6 @@
<key> <string>catalog_index</string> </key> <key> <string>catalog_index</string> </key>
<value> <string>title</string> </value> <value> <string>title</string> </value>
</item> </item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_relation_field</string> </value> <value> <string>my_relation_field</string> </value>
...@@ -130,17 +119,4 @@ ...@@ -130,17 +119,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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: context.BusinessCommit_getLastCommitTitle(here)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_project_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>
</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>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Source Project</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<list> <list>
<string>my_title</string> <string>my_title</string>
<string>my_id</string> <string>my_id</string>
<string>my_predecessor</string> <string>my_similar_title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<list> <list>
<string>my_creation_date</string> <string>my_creation_date</string>
<string>my_modification_date</string> <string>my_modification_date</string>
<string>my_translated_simulation_state_title</string> <string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>catalog_index</string> <string>catalog_index</string>
<string>description</string>
<string>first_item</string> <string>first_item</string>
<string>portal_type</string> <string>portal_type</string>
<string>title</string> <string>title</string>
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_predecessor</string> </value> <value> <string>my_similar_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -70,6 +71,10 @@ ...@@ -70,6 +71,10 @@
<key> <string>catalog_index</string> </key> <key> <string>catalog_index</string> </key>
<value> <string>title</string> </value> <value> <string>title</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value> <string>Commit on which this snapshot is based upon.</string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_relation_field</string> </value> <value> <string>my_relation_field</string> </value>
...@@ -95,7 +100,7 @@ ...@@ -95,7 +100,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Predecessor</string> </value> <value> <string>Equivalent Commit</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_translated_simulation_state_title</string> </value> <value> <string>my_translated_validation_state_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
# Check if the conext is Commit Tool
if context.getPortalType() != 'Commit Tool':
return 'context is not commit tool'
# Check if the last created sub-object in Commit Tool is a commit and is not
# raise an Error
last_obj = max(context.objectValues(), key=(lambda x: x.getCreationDate()))
if last_obj.getPortalType() != 'Business Commit':
return 'No commits added after last snapshot. Add a commit and try again'
# Create a new snapshot based on last commit
snapshot = last_obj.createEquivalentSnapshot()
return context.Base_redirect('view')
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CommitTool_createSnapshot</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>all_columns</string>
<string>anchor</string> <string>anchor</string>
<string>columns</string> <string>columns</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>lines</string>
<string>list_method</string> <string>list_method</string>
<string>search</string> <string>search</string>
<string>search_columns</string> <string>search_columns</string>
...@@ -72,6 +74,21 @@ ...@@ -72,6 +74,21 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>all_columns</string> </key>
<value>
<list>
<tuple>
<string>predecessor_title</string>
<string>Predecessor</string>
</tuple>
<tuple>
<string>similar_title</string>
<string>Similar</string>
</tuple>
</list>
</value>
</item>
<item> <item>
<key> <string>anchor</string> </key> <key> <string>anchor</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -117,6 +134,10 @@ ...@@ -117,6 +134,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>lines</string> </key>
<value> <int>50</int> </value>
</item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
......
...@@ -5,4 +5,5 @@ Business Patch Item | content_view ...@@ -5,4 +5,5 @@ Business Patch Item | content_view
Business Patch Item | diff_view Business Patch Item | diff_view
Business Property Item | content_view Business Property Item | content_view
Business Snapshot | content_view Business Snapshot | content_view
Commit Tool | create_snapshot
Commit Tool | view Commit Tool | view
\ No newline at end of file
Business Commit | predecessor Business Commit | predecessor
Business Commit | similar
Business Commit | source_project
Business Item | follow_up Business Item | follow_up
Business Manager | follow_up
Business Patch Item | follow_up Business Patch Item | follow_up
Business Property Item | follow_up Business Property Item | follow_up
Business Snapshot | similar
\ No newline at end of file
...@@ -4,3 +4,4 @@ Business Manager | business_manager_building_workflow ...@@ -4,3 +4,4 @@ Business Manager | business_manager_building_workflow
Business Manager | business_manager_installation_workflow Business Manager | business_manager_installation_workflow
Business Patch Item | business_manager_interaction_workflow Business Patch Item | business_manager_interaction_workflow
Business Property Item | business_manager_interaction_workflow Business Property Item | business_manager_interaction_workflow
Business Snapshot | business_snapshot_validation_workflow
\ No newline at end of file
...@@ -2,3 +2,4 @@ business_commit_validation_workflow ...@@ -2,3 +2,4 @@ business_commit_validation_workflow
business_manager_building_workflow business_manager_building_workflow
business_manager_installation_workflow business_manager_installation_workflow
business_manager_interaction_workflow business_manager_interaction_workflow
business_snapshot_validation_workflow
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment