Commit c65269ff authored by Łukasz Nowak's avatar Łukasz Nowak

Merge branch 'master' into networkcache_signature

parents 8d0ae96c b194e337
<?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_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</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>unfiltered_tracking_list</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>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Item Tracking</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}/Item_viewTrackingList?current:int=0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</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>computer_usage</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>50.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Computer Usage</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}/Computer_viewCurrentUsage</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -40,7 +40,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jump_to_related_usage_report_list</string> </value>
<value> <string>jump_to_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
......@@ -56,11 +56,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>21.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Related Usage Reports</string> </value>
<value> <string>Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -79,7 +79,7 @@
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Base_jumpToRelatedObject?base_category=causality&portal_type=Usage+Report
string:${object_url}/Base_jumpToRelatedObject?base_category=predecessor&portal_type=Software+Instance
]]></string> </value>
</item>
......
......@@ -50,6 +50,10 @@
</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>
......@@ -73,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Computer_view</string> </value>
<value> <string>string:${object_url}/SlaveInstance_view</string> </value>
</item>
</dictionary>
</pickle>
......
<?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_web_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_web_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>web_view</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>0.5</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Web View</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}/SoftwareInstance_viewAsWeb</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: object is not None and object.isWebMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -40,7 +40,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slave_partition</string> </value>
<value> <string>unfiltered_tracking_list</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
......@@ -50,13 +50,17 @@
</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>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Slave Partitions</string> </value>
<value> <string>Item Tracking</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -73,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ComputerPartition_viewSlavePartitionList</string> </value>
<value> <string>string:${object_url}/Item_viewTrackingList?current:int=0</string> </value>
</item>
</dictionary>
</pickle>
......
<?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_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</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>usable_computer</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>30.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Usable Computer</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}/SoftwareRelease_viewUsableComputerList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<allowed_content_type_list>
<portal_type id="Software Instance Module">
<item>Slave Instance</item>
<item>Software Instance</item>
</portal_type>
</allowed_content_type_list>
\ No newline at end of file
<base_category_list>
<portal_type id="Slave Instance">
<item>predecessor</item>
</portal_type>
<portal_type id="Software Instance">
<item>predecessor</item>
</portal_type>
......
......@@ -2,6 +2,12 @@
<portal_type id="Sale Packing List Line">
<item>VifibSalePackingListLineConstraint</item>
</portal_type>
<portal_type id="Slave Instance">
<item>Reference</item>
<item>SlaveInstanceContraint</item>
<item>SoftwareInstance</item>
<item>TextDocument</item>
</portal_type>
<portal_type id="Software Instance">
<item>Reference</item>
<item>SoftwareInstance</item>
......
......@@ -25,29 +25,17 @@
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>document_icon.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Computer</string> </value>
<value> <string>document.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Slave Partition represents a virtual machine on a real computer.</string> </value>
<value> <string>ERP5 default document. Supports synchronisation and XML.</string> </value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addComputerPartition</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value>
<value> <string>addSoftwareInstance</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
......@@ -57,29 +45,45 @@
</tuple>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string>document_icon.gif</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Slave Partition</string> </value>
<value> <string>Slave Instance</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>SlavePartition_generateReference</string> </value>
<key> <string>immediate_view</string> </key>
<value> <string>XMLObject_view</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>meta_type</string> </key>
<value> <string>ERP5 XML Object</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
</item>
<item>
<key> <string>product</string> </key>
<value> <string>ERP5Type</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>ComputerPartition</string> </value>
<value> <string>SoftwareInstance</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
......@@ -98,10 +102,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
......@@ -118,10 +119,7 @@
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -31,8 +31,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>\n
A Folder is a subclass of Base but not of XMLObject.\n
<value> <string> A Folder is a subclass of Base but not of XMLObject.\n
Folders are not considered as documents and are therefore\n
not synchronisable.\n
\n
......@@ -81,10 +80,22 @@
<key> <string>immediate_view</string> </key>
<value> <string>Folder_view</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>meta_type</string> </key>
<value> <string>ERP5 Folder</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
......@@ -97,6 +108,18 @@
<key> <string>type_class</string> </key>
<value> <string>Folder</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
<workflow_chain>
<chain>
<type>Slave Instance</type>
<workflow>edit_workflow, item_workflow, software_instance_slap_interface_workflow</workflow>
</chain>
<chain>
<type>Software Instance</type>
<workflow>edit_workflow, item_workflow, software_instance_slap_interface_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
</workflow_chain>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<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>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlaveInstanceConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<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>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>destination_reference</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Property destination reference must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destination_reference_property_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Destination Reference must be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>source_reference</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Property source reference must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>property_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Source Reference must be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>reference</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Property reference must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>reference_property_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Reference must be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>constraint_property</string> </key>
<value>
<tuple>
<string>text_content</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Property text content must be defined</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>text_content_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>XML must be set</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,17 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>slave_partition = state_change[\'object\']\n
slave_partition.getParentValue().reindexObject()\n
<value> <string>return context.absolute_url() + \'/Item_viewTrackingList?current:int=0\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlavePartition_reindexComputerPartition</string> </value>
<value> <string>ComputerPartition_getUsageReportUrl</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,28 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
capacity = context.getQuantity()\n
for slave_partition in context.contentValues(portal_type=\'Slave Partition\'):\n
if slave_partition.getSlapState() == \'busy\':\n
capacity -= 1\n
if capacity <= 0:\n
return 0\n
if capacity > 0:\n
return 1\n
return 0\n
]]></string> </value>
<value> <string>return [x for x in context.contentValues(**kw) if x.getSlapState() == \'busy\']\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_isSlaveAvailable</string> </value>
<value> <string>Computer_getBusyComputerPartitionList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,23 +50,26 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>software_instance = state_change[\'object\']\n
slave_partition_count = state_change.kwargs[\'slave_partition_count\']\n
<value> <string>"""Fetch computer to find witch software is installed"""\n
portal = context.getPortalObject()\n
portal_type = "Software Release"\n
\n
packing_list_line = context.SoftwareInstance_getInstanceHostingPackingListLine(state_change)\n
computer_partition = packing_list_line.getAggregateValue(portal_type="Computer Partition")\n
\n
# Update number of slave partitions\n
computer_partition.edit(quantity=slave_partition_count)\n
url_string_list = context.Computer_getSoftwareReleaseUrlStringList([\'confirmed\', \'started\', \'stopped\', \'delivered\'])\n
if url_string_list:\n
return context.portal_catalog(\n
portal_type=portal_type,\n
url_string=url_string_list)\n
else:\n
return []\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_updateSlavePartitionList</string> </value>
<value> <string>Computer_getSoftwareReleaseList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,17 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.setReference(None)\n
context.SlavePartition_generateReference()\n
<value> <string>return context.absolute_url() + \'/Computer_viewCurrentUsage\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlavePartition_afterClone</string> </value>
<value> <string>Computer_getUsageReportUrl</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</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></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<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>your_busy_computer_partition_list</string>
<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>your_busy_computer_partition_list_image</string>
<string>listbox_image</string>
<string>listbox_parent_state</string>
<string>listbox_software_release</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_reference</string>
<string>your_free_partition_count</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>Computer_viewCurrentUsage</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Computer_viewCurrentUsage</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>report_view</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>Usage</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>columns</string>
<string>list_method</string>
<string>select</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</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>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</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>columns</string> </key>
<value>
<list>
<tuple>
<string>image</string>
<string>Image</string>
</tuple>
<tuple>
<string>aggregate_title</string>
<string>Title</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>url_string</string>
<string>URL</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>computer_software_release_selection</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>Software Release</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>aggregate_title</string>
<string></string>
</tuple>
<tuple>
<string>version</string>
<string></string>
</tuple>
<tuple>
<string>image</string>
<string></string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>Computer_getSoftwareReleaseList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ImageField" module="Products.ERP5Form.ImageField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_image</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string>thumbnail</string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <int>75</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>listbox_image</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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: cell.getAggregateValue().getDefaultImageAbsoluteUrl()</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>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_parent_state</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>
<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>default</string> </key>
<value> <string></string> </value>
</item>
<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_viewWebFieldLibrary</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>String Field</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</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>python: cell.getParentValue().PurchasePackingList_getSimulationStateAsWeb()</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>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_software_release</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>
<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>default</string> </key>
<value> <string></string> </value>
</item>
<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_viewWebFieldLibrary</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>String Field</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</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>python: cell.getAggregateValue(portal_type="Software Release").getTitle()</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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</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>field_id</string> </key>
<value> <string>my_reference</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>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ListBox" module="Products.ERP5Form.ListBox"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_busy_computer_partition_list</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>all_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>anchor</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>global_attributes</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>meta_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>report_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>report_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>select</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>all_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>anchor</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>global_attributes</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>meta_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>report_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>report_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>select</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>all_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Title</string>
</tuple>
<tuple>
<string>image</string>
<string>Image</string>
</tuple>
<tuple>
<string>SoftwareInstance_getStatus</string>
<string>Status</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list>
<tuple>
<string>slap_state</string>
<string>busy</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>image</string>
<string>Image</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>global_attributes</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>meta_types</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list>
<tuple>
<string>Computer Partition</string>
<string>Computer Partition</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>report_root_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>report_tree</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>computer_busy_computer_partition_list</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>stat_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Computer Partition State</string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>ComputerPartition_getUsageReportUrl</string>
</tuple>
<tuple>
<string>image</string>
<string>ComputerPartition_getUsageReportUrl</string>
</tuple>
<tuple>
<string>SoftwareInstance_getStatus</string>
<string>ComputerPartition_getUsageReportUrl</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>Computer_getBusyComputerPartitionList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ImageField" module="Products.ERP5Form.ImageField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_busy_computer_partition_list_image</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>image_display</string> </key>
<value> <string>thumbnail</string> </value>
</item>
<item>
<key> <string>image_format</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>image_resolution</string> </key>
<value> <int>75</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</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/SoftwareInstance_getDefaultImageAbsoluteUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="IntegerField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_free_partition_count</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>
<item>
<key> <string>integer_out_of_range</string> </key>
<value> <string>The integer you entered was out of range.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Free Partition Count</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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: here.portal_catalog.countResults(parent_uid=here.getUid(), free_for_request=1)[0][0]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</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_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<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/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_text_content</string>
<string>my_connection_xml</string>
<string>my_description</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_reference</string>
<string>my_destination_reference</string>
<string>my_source_reference</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_predecessor_title_list</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlaveInstance_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SlaveInstance_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</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>Slave Instance</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>editable</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_connection_xml</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>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_text_area_field</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>Connection XML</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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_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>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>
</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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_reference</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>field_id</string> </key>
<value> <string>my_view_mode_read_only_reference</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>Authorisation Identity</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>base_category</string>
<string>catalog_index</string>
<string>portal_type</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_predecessor_title_list</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>base_category</string> </key>
<value> <string>predecessor</string> </value>
</item>
<item>
<key> <string>catalog_index</string> </key>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_relation_field</string> </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>Software Instance</string>
<string>Software Instance</string>
</tuple>
</list>
</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>Predecessors</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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</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>field_id</string> </key>
<value> <string>my_view_mode_read_only_reference</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>
</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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_reference</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>field_id</string> </key>
<value> <string>my_view_mode_read_only_reference</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>Software Type</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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_content</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>field_id</string> </key>
<value> <string>my_text_area_field</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>XML</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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_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>field_id</string> </key>
<value> <string>my_view_mode_title</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>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,7 +54,7 @@
while (predecessor_software_instance is not None):\n
root_software_instance = predecessor_software_instance\n
predecessor_software_instance = predecessor_software_instance.getPredecessorRelatedValue(\n
portal_type="Software Instance")\n
portal_type=["Software Instance", "Slave Instance"])\n
return root_software_instance.getUid()\n
</string> </value>
</item>
......
......@@ -50,26 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.getReference():\n
return\n
\n
object_type = context.getPortalType().replace(\' \', \'_\')\n
parent_reference = context.getParentValue().getReference(\'\')\n
\n
id_group = \'-\'.join((parent_reference, object_type))\n
\n
reference = \'_\'.join([parent_reference, str(context.generateNewId(id_group=id_group, default=1))])\n
\n
context.setReference(reference)\n
<value> <string>return [x.getParentValue() for x in context.portal_catalog(software_release_url=context.getUrlString(), group_by="parent_uid")]\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlavePartition_generateReference</string> </value>
<value> <string>SoftwareRelease_getUsableComputerList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -35,7 +35,7 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -88,13 +88,18 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
<list>
<string>listbox_free_partition</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
<list>
<string>my_url_string</string>
<string>your_free_partition_count</string>
</list>
</value>
</item>
<item>
......@@ -108,7 +113,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_viewSlavePartitionList</string> </value>
<value> <string>SoftwareRelease_viewUsableComputerList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......@@ -116,11 +121,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ComputerPartition_viewSlavePartitionList</string> </value>
<value> <string>Computer_viewCurrentUsage</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
<value> <string>report_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......@@ -132,7 +137,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Slave Partitions</string> </value>
<value> <string>Usage</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......
......@@ -10,14 +10,12 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>anchor</string>
<string>columns</string>
<string>default_params</string>
<string>portal_types</string>
<string>search_columns</string>
<string>list_method</string>
<string>select</string>
<string>selection_name</string>
<string>sort_columns</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
......@@ -67,10 +65,22 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -78,100 +88,91 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>translated_slap_state_title</string>
<string>State</string>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>free_partition</string>
<string>Free Partition Count</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox</string> </value>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<key> <string>list_method</string> </key>
<value>
<list>
<tuple>
<string>Slave Partition</string>
<string>Slave Partition</string>
</tuple>
</list>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
</list>
</value>
<key> <string>select</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>computer_slave_partition_list_selection</string> </value>
<value> <string>software_release_usable_computer_selection</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>Computer</string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>reference</string>
<string>Computer_getUsageReportUrl</string>
</tuple>
<tuple>
<string>title</string>
<string>Title</string>
<string>Computer_getUsageReportUrl</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
<string>free_partition</string>
<string>Computer_getUsageReportUrl</string>
</tuple>
</list>
</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>Slave Partitions</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>SoftwareRelease_getUsableComputerList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="IntegerField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_free_partition</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>
<item>
<key> <string>integer_out_of_range</string> </key>
<value> <string>The integer you entered was out of range.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Free Partition Count</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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: here.portal_catalog.countResults(parent_uid=cell.getUid(), free_for_request=1)[0][0]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_url_string</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</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>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>40</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>URL</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="IntegerField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_free_partition_count</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>
<item>
<key> <string>integer_out_of_range</string> </key>
<value> <string>The integer you entered was out of range.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Free Partition Count</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </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: here.portal_catalog.countResults(software_release_url=here.getUrlString(), free_for_request=1)[0][0]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,8 +50,18 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># revoke certificate\n
software_instance = state_change[\'object\']\n
<value> <string>software_instance = state_change[\'object\']\n
# mark destroy is requested\n
software_instance.destroyRequested()\n
# deliver proper packing list\n
packing_list_line = context.SoftwareInstance_getInstanceDestroyPackingListLine(state_change)\n
packing_list = packing_list_line.getParentValue()\n
if packing_list.getPortalObject().portal_workflow.isTransitionPossible(packing_list, \'start\'):\n
packing_list.start()\n
if packing_list.getPortalObject().portal_workflow.isTransitionPossible(packing_list, \'deliver\'):\n
packing_list.deliver()\n
\n
# revoke certificate\n
try:\n
context.getPortalObject().portal_certificate_authority\\\n
.revokeCertificate(software_instance.getDestinationReference())\n
......@@ -66,14 +76,6 @@ software_instance.edit(\n
ssl_key=None,\n
ssl_certificate=None,\n
)\n
\n
# deliver proper packing list\n
packing_list_line = context.SoftwareInstance_getInstanceDestroyPackingListLine(state_change)\n
packing_list = packing_list_line.getParentValue()\n
if packing_list.getPortalObject().portal_workflow.isTransitionPossible(packing_list, \'start\'):\n
packing_list.start()\n
if packing_list.getPortalObject().portal_workflow.isTransitionPossible(packing_list, \'deliver\'):\n
packing_list.deliver()\n
</string> </value>
</item>
<item>
......
......@@ -55,10 +55,40 @@
from DateTime import DateTime\n
import random\n
\n
def checkSoftwareInstanceIsInstalledOnComputerPartition(software_release,\n
computer_partition):\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceSetupResource(),\n
portal.portal_preferences.getPreferredInstanceHostingResource(),\n
)\n
query = ComplexQuery(Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
operator="AND",\n
)\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\',\n
query=query,\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
\n
if len(sale_packing_list_line_list) == 1:\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceCleanupResource(),\n
)\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\',\n
query=query,\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
if len(sale_packing_list_line_list) == 0:\n
return True\n
return False\n
\n
portal = context.getPortalObject()\n
software_instance = state_change[\'object\']\n
software_release_url_string = state_change.kwargs[\'software_release\']\n
hosting_subscription_uid = state_change.kwargs[\'hosting_subscription_uid\']\n
shared = state_change.kwargs[\'shared\']\n
software_type = state_change.kwargs["software_type"]\n
tag = state_change.kwargs[\'tag\']\n
filter_kw = software_instance.getSlaXmlAsDict()\n
......@@ -76,73 +106,49 @@ SQL_WINDOW_SIZE = 50\n
computer_partition = None\n
query_kw = {\n
\'software_release_url\': software_release_url_string,\n
\'portal_type\': \'Computer Partition\'\n
\'portal_type\': \'Computer Partition\',\n
\'free_for_request\': 1,\n
}\n
\n
if software_instance.getPortalType() == "Slave Instance":\n
query_kw[\'free_for_request\'] = 0\n
\n
# support SLA\n
if "computer_guid" in filter_kw:\n
query_kw["parent_reference"] = filter_kw["computer_guid"]\n
\n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n
isTransitionPossible = software_instance.getPortalObject().portal_workflow.isTransitionPossible\n
if shared:\n
query_kw.update(\n
software_type=software_type,\n
available_slave=1, # has slave\n
free_for_request=0, # is not available for normal request\n
)\n
result_count = software_instance.portal_catalog.countResults(**query_kw)[0][0]\n
\n
offset = max(0, result_count-1)\n
if offset >= SQL_WINDOW_SIZE:\n
limit = (random.randint(0, offset), SQL_WINDOW_SIZE)\n
else:\n
limit = (0, SQL_WINDOW_SIZE)\n
for computer_partition_candidate in software_instance.portal_catalog(\n
limit=limit, **query_kw):\n
computer_partition_candidate = computer_partition_candidate.getObject()\n
# Check if the computer partition can be marked as busy (done by an interaction workflow on sale packing list level)\n
if computer_partition_candidate.getSlapState() == \'busy\' and computer_partition_candidate.ComputerPartition_isSlaveAvailable():\n
computer_partition = computer_partition_candidate\n
break\n
\n
if computer_partition is None:\n
raise ValueError(\'It was not possible to find Computer Partition with free slave\')\n
\n
# find free slave\n
slave_partition = None\n
for slave_partition_candidate in computer_partition.contentValues(portal_type=\'Slave Partition\'):\n
if isTransitionPossible(slave_partition_candidate, \'mark_busy\'):\n
slave_partition = slave_partition_candidate\n
slave_partition.serialize()\n
break\n
\n
if slave_partition is None:\n
slave_partition = computer_partition.newContent(portal_type=\'Slave Partition\')\n
slave_partition.markFree()\n
computer_partition = slave_partition\n
result_count = software_instance.portal_catalog.countResults(**query_kw)[0][0]\n
offset = max(0, result_count-1)\n
if offset >= SQL_WINDOW_SIZE:\n
limit = (random.randint(0, offset), SQL_WINDOW_SIZE)\n
else:\n
query_kw.update(free_for_request=1) # is free\n
result_count = software_instance.portal_catalog.countResults(**query_kw)[0][0]\n
\n
offset = max(0, result_count-1)\n
if offset >= SQL_WINDOW_SIZE:\n
limit = (random.randint(0, offset), SQL_WINDOW_SIZE)\n
else:\n
limit = (0, SQL_WINDOW_SIZE)\n
\n
for computer_partition_candidate in software_instance.portal_catalog(\n
limit=limit, **query_kw):\n
computer_partition_candidate = computer_partition_candidate.getObject()\n
# Check if the computer partition can be marked as busy (done by an interaction workflow on sale packing list level)\n
if isTransitionPossible(computer_partition_candidate, \'mark_busy\'):\n
computer_partition = computer_partition_candidate\n
break\n
\n
if computer_partition is None:\n
raise ValueError(\'It was not possible to find free Computer Partition\')\n
\n
# lock computer partition\n
computer_partition.serialize()\n
limit = (0, SQL_WINDOW_SIZE)\n
\n
software_release = context.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
url_string=software_release_url_string)\n
\n
for computer_partition_candidate in software_instance.portal_catalog(\n
limit=limit, **query_kw):\n
computer_partition_candidate = computer_partition_candidate.getObject()\n
# Check if the computer partition can be marked as busy (done by an interaction workflow on sale packing list level)\n
software_instance_portal_type = software_instance.getPortalType()\n
if isTransitionPossible(computer_partition_candidate, \'mark_busy\') and \\\n
software_instance_portal_type == "Software Instance":\n
computer_partition = computer_partition_candidate\n
break\n
elif software_instance_portal_type == "Slave Instance" and \\\n
checkSoftwareInstanceIsInstalledOnComputerPartition(software_release, computer_partition_candidate):\n
computer_partition = computer_partition_candidate\n
break\n
\n
if computer_partition is None:\n
raise ValueError(\'It was not possible to find free Computer Partition\')\n
\n
# lock computer partition\n
computer_partition.serialize()\n
\n
software_release_document = context.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
......
......@@ -58,12 +58,17 @@ portal = software_instance.getPortalObject()\n
kwargs = state_change.kwargs\n
software_release_url_string = state_change.kwargs[\'software_release\']\n
requested_partition_reference = kwargs["partition_reference"]\n
shared = kwargs["shared"]\n
software_type = kwargs["software_type"]\n
instance_xml = kwargs["instance_xml"]\n
is_slave = kwargs.get("shared", False)\n
sla_xml = kwargs["sla_xml"]\n
state = kwargs["state"]\n
\n
if is_slave == True:\n
software_instance_portal_type = "Slave Instance"\n
else:\n
software_instance_portal_type = "Software Instance"\n
\n
# graph allows to "simulate" tree change after requested operation\n
graph = {}\n
# Get root software instance and create initial graph\n
......@@ -85,7 +90,7 @@ tag = "%s_%s_%s_inProgress" % (root_software_instance.getUid(), software_type,\n
\n
# Check if it already exists\n
request_software_instance = software_instance.portal_catalog.getResultValue(\n
portal_type=\'Software Instance\',\n
portal_type=software_instance_portal_type,\n
# XXX: User based property is used in non manual operation\n
# XXX-2: Do we really need to use root_uid?\n
title=requested_partition_reference,\n
......@@ -108,7 +113,7 @@ if (request_software_instance is None):\n
# Create a new one\n
module = software_instance.getDefaultModule(portal_type="Software Instance")\n
request_software_instance = module.newContent(\n
portal_type="Software Instance",\n
portal_type=software_instance_portal_type,\n
title=requested_partition_reference,\n
source_reference=software_type,\n
text_content=instance_xml,\n
......@@ -122,7 +127,6 @@ if (request_software_instance is None):\n
request_software_instance.requestComputerPartition(\n
software_release=software_release_url_string,\n
hosting_subscription_uid=hosting_subscription_uid,\n
shared=shared,\n
software_type=software_type,\n
tag=tag)\n
else:\n
......
......@@ -50,9 +50,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>packing_list_line = context.SoftwareInstance_getInstanceHostingPackingListLine(state_change)\n
packing_list = packing_list_line.getParentValue()\n
packing_list.start()\n
<value> <string>from Products.ERP5Type.Log import log\n
packing_list_line = context.SoftwareInstance_getInstanceHostingPackingListLine(state_change)\n
if packing_list_line.getSimulationState() != "started":\n
packing_list_line.getParentValue().start()\n
else:\n
software_instance = state_change["object"].getRelativeUrl()\n
log("The Sale Packing List %s for Software Instance %s is already started" % \\\n
(packing_list_line.getRelativeUrl(), software_instance))\n
</string> </value>
</item>
<item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destroy_requested</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>report_computer_partition_error</string>
<string>request_computer_partition</string>
<string>request_destroy_computer_partition</string>
<string>request_destroy_computer_partition_action</string>
<string>request_software_instance</string>
<string>request_start_computer_partition</string>
<string>request_start_computer_partition_action</string>
<string>request_stop_computer_partition</string>
<string>request_stop_computer_partition_action</string>
<string>start_computer_partition</string>
<string>start_computer_partition_installation</string>
<string>start_requested</string>
<string>stop_computer_partition</string>
<string>stop_computer_partition_installation</string>
<string>stop_requested</string>
<string>update_slave_partition_list</string>
</tuple>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -23,6 +23,7 @@
<value>
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>report_computer_partition_error</string>
<string>request_computer_partition</string>
<string>request_destroy_computer_partition</string>
......
......@@ -23,6 +23,7 @@
<value>
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>report_computer_partition_error</string>
<string>request_computer_partition</string>
<string>request_destroy_computer_partition</string>
......
......@@ -23,6 +23,7 @@
<value>
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>report_computer_partition_error</string>
<string>request_computer_partition</string>
<string>request_destroy_computer_partition</string>
......
......@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
......@@ -20,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>SoftwareInstance_updateSlavePartitionList</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -34,19 +38,19 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>update_slave_partition_list</string> </value>
<value> <string>destroy_requested</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
<value> <string>destroy_requested</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>SoftwareInstance_checkConsistency</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Slave Partition</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
2011/06/15 Gabriel Monnerat
* Start Implementation of Slave Instances
2010/06/23 Lukasz Nowak
* initial release
\ No newline at end of file
Computer Partition | unfiltered_tracking_list
Computer | computer_usage
Person | get_certificate
Person | revoke_certificate
Slave Instance | jump_to_software_instance
Slave Instance | view
Slave Instance | web_view
Software Instance Module | view
Software Instance | jump_to_software_instance
Software Instance | view
\ No newline at end of file
Software Instance | unfiltered_tracking_list
Software Instance | view
Software Release | usable_computer
SoftwareInstance
Person
\ No newline at end of file
SoftwareInstance
\ No newline at end of file
Software Instance Module | Slave Instance
Software Instance Module | Software Instance
\ No newline at end of file
Slave Instance | predecessor
Software Instance Module | business_application
Software Instance | predecessor
\ No newline at end of file
Slave Instance
Software Instance
Software Instance Module
\ No newline at end of file
Sale Packing List Line | VifibSalePackingListLineConstraint
Slave Instance | Reference
Slave Instance | SlaveInstanceContraint
Slave Instance | SoftwareInstance
Slave Instance | TextDocument
Software Instance | Reference
Software Instance | SoftwareInstance
Software Instance | SoftwareInstanceConstraint
......
Slave Instance | edit_workflow
Slave Instance | item_workflow
Slave Instance | local_permission_vifib_interaction_workflow
Slave Instance | slap_interaction_workflow
Slave Instance | software_instance_slap_interface_workflow
Software Instance | edit_workflow
Software Instance | item_workflow
Software Instance | local_permission_vifib_interaction_workflow
Software Instance | slap_interaction_workflow
Software Instance | software_instance_slap_interface_workflow
\ No newline at end of file
SoftwareInstanceConstraint
SlaveInstanceConstraint
SoftwareInstance
VifibSalePackingListLineConstraint
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='HR-AGNT_my_group'>
<item>Assignor</item>
<item>Auditor</item>
</role>
<role id='supergabriel'>
<item>Owner</item>
</role>
<role id='test_vifib_customer_a'>
<item>Associate</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Person" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<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>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>role/client</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>test_vifib_customer_a</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>first_name</string> </key>
<value> <string>Test</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_vifib_customer_a</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>last_name</string> </key>
<value> <string>Vifib Customer A</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Person</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<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>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Assignment" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</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>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>function/customer</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Assignment</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Career" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</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>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>role/client</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_career</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Career</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Email" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>default_email</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Email</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>url_string</string> </key>
<value> <string>test_customer@example.org</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,4 +9,9 @@
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromSelf</property>
<multi_property id='base_category'>aggregate</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Software Instance become Auditor of Hosting Subscription related by Slave Instance</property>
<property id='base_category_script'>ERP5Type_getCategorySecurityFromSoftwareInstanceByHostingSubscription</property>
<multi_property id='base_category'>source</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -12,8 +12,14 @@
<multi_property id='base_category'>destination_decision</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Software Instance related by Hosting Subscription</property>
<property id='title'>Slave Instance related by Software Instance</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemBySoftwareInstance</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Software Instance User become Auditor of Sale Order related to Slave Instance</property>
<property id='description'>The software instances become auditor of sale orders related to Slave Instances if the Software Instance and Slave instance use the same software release and is installed in the same computer partition.</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemByHostingSubscription</property>
<multi_property id='base_category'>aggregate</multi_property>
</role>
......
......@@ -11,6 +11,12 @@
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_decision</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Software Instance User become Auditor of Sale Packing List related to Slave Instance</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromMovementItemBySoftwareInstance</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Software Instance related by Hosting Subscription</property>
<property id='description'>Monovalued role</property>
......
<type_roles>
<role id='Assignor'>
<property id='title'>Computer</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAggregateMovementItemByComputerPartition</property>
<multi_property id='base_category'>aggregate</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Owner become Assignee</property>
<property id='base_category_script'>ERP5Type_acquireSecurityFromOwner</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Slave Instance related by Software Instance</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromSoftwareInstance</property>
<multi_property id='base_category'>source</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -47,6 +47,10 @@
<type>Sale Trade Condition</type>
<workflow>local_permission_vifib_interaction_workflow</workflow>
</chain>
<chain>
<type>Slave Instance</type>
<workflow>local_permission_vifib_interaction_workflow</workflow>
</chain>
<chain>
<type>Software Instance</type>
<workflow>local_permission_vifib_interaction_workflow</workflow>
......
<?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>_body</string> </key>
<value> <string># XXX For now, this script requires proxy manager\n
\n
# base_category_list : list of category values we need to retrieve\n
# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n
# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n
# object : object which we want to assign roles to.\n
# portal_type : portal type of object\n
\n
# must always return a list of dicts\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
category_list = []\n
\n
if obj is None:\n
return []\n
\n
portal = obj.getPortalObject()\n
\n
state_list = portal.getPortalCurrentInventoryStateList() + \\\n
portal.getPortalReservedInventoryStateList() + \\\n
portal.getPortalTransitInventoryStateList()\n
\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
aggregate_uid=obj.getUid(),\n
portal_type="Sale Packing List Line",\n
simulation_state=state_list)\n
\n
if sale_packing_list_line is None:\n
return []\n
\n
computer_partition = sale_packing_list_line.getAggregateValue(\n
portal_type="Computer Partition")\n
software_release = sale_packing_list_line.getAggregateValue(\n
portal_type="Software Release")\n
\n
query = ComplexQuery(\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
operator="AND",\n
)\n
catalog_result = portal.portal_catalog(portal_type="Sale Packing List Line",\n
simulation_state=state_list,\n
aggregate_relative_url=query,\n
)\n
for sale_packing_list_line in catalog_result:\n
software_instance = sale_packing_list_line.getAggregateValue(\n
portal_type="Software Instance")\n
if software_instance is not None:\n
return {"Auditor": [software_instance.getReference(),]}\n
\n
return category_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, obj, portal_type</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Type_getCategorySecurityFromSoftwareInstanceByHostingSubscription</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,7 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX For now, this script requires proxy manager\n
<value> <string encoding="cdata"><![CDATA[
# XXX For now, this script requires proxy manager\n
\n
# base_category_list : list of category values we need to retrieve\n
# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n
......@@ -70,19 +72,27 @@ movement_portal_type = "Sale Packing List Line"\n
\n
portal = obj.getPortalObject()\n
\n
movement = portal.portal_catalog.getResultValue(\n
security_dict = {}\n
\n
parent_url_list = []\n
for movement in portal.portal_catalog(\n
portal_type=movement_portal_type,\n
aggregate_uid=obj.getUid(),\n
simulation_state=portal.getPortalCurrentInventoryStateList() + portal.getPortalReservedInventoryStateList() + portal.getPortalTransitInventoryStateList(),\n
)\n
\n
if movement is not None:\n
):\n
item = movement.getAggregateValue(portal_type=item_portal_type)\n
if item is not None:\n
category_list.append({"aggregate": [item.getParentValue().getRelativeUrl()]})\n
parent_url = item.getParentValue().getRelativeUrl()\n
if parent_url not in parent_url_list:\n
parent_url_list.append(parent_url)\n
\n
if len(parent_url_list) > 0:\n
parent_url_list.sort()\n
category_list.append({"aggregate": parent_url_list})\n
return category_list\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
<?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>_body</string> </key>
<value> <string># XXX For now, this script requires proxy manager\n
# must always return a list of dicts\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
category_list = []\n
\n
if obj is None:\n
return []\n
\n
portal = obj.getPortalObject()\n
state_list = portal.getPortalCurrentInventoryStateList() + \\\n
portal.getPortalReservedInventoryStateList() + \\\n
portal.getPortalTransitInventoryStateList()\n
\n
if obj.getPortalType() == "Sale Packing List":\n
movement_portal_type = "Sale Packing List Line"\n
elif obj.getPortalType() == "Sale Order":\n
movement_portal_type = "Sale Order Line"\n
\n
item_portal_type = "Slave Instance"\n
\n
for movement in obj.getMovementList():\n
item = movement.getAggregateValue(portal_type=item_portal_type)\n
if item is not None:\n
software_release = movement.getAggregateValue(portal_type="Software Release")\n
computer_partition = movement.getAggregateValue(portal_type="Computer Partition")\n
if computer_partition is None:\n
continue\n
query = ComplexQuery(\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
operator="AND",\n
)\n
catalog_result = portal.portal_catalog(portal_type=movement_portal_type,\n
simulation_state=state_list,\n
aggregate_relative_url=query,\n
)\n
for sale_packing_list_line in catalog_result:\n
software_instance = sale_packing_list_line.getAggregateValue(\n
portal_type="Software Instance")\n
if software_instance is not None:\n
return {"Auditor": [software_instance.getReference(),]}\n
\n
return category_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, obj, portal_type</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Type_getSecurityCategoryFromMovementItemBySoftwareInstance</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string># XXX For now, this script requires proxy manager\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
if obj is None:\n
return []\n
\n
movement_portal_type = "Sale Packing List Line"\n
portal = obj.getPortalObject()\n
\n
state_list = portal.getPortalCurrentInventoryStateList() + \\\n
portal.getPortalReservedInventoryStateList() + \\\n
portal.getPortalTransitInventoryStateList()\n
\n
movement = portal.portal_catalog.getResultValue(\n
portal_type=movement_portal_type,\n
aggregate_uid=obj.getUid(),\n
simulation_state=state_list,\n
)\n
\n
if movement is None:\n
return []\n
\n
computer_partition = movement.getAggregateValue(portal_type="Computer Partition")\n
software_release = movement.getAggregateValue(portal_type="Software Release")\n
\n
query = ComplexQuery(\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
operator="AND",\n
)\n
\n
catalog_result = portal.portal_catalog(portal_type=movement_portal_type,\n
simulation_state=state_list,\n
aggregate_relative_url=query)\n
\n
for item in catalog_result:\n
software_instance = item.getAggregateValue(portal_type="Software Instance")\n
if software_instance is not None:\n
return {"Assignee": [software_instance.getReference(),]}\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, obj, portal_type</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Type_getSecurityCategoryFromSoftwareInstance</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -71,6 +71,7 @@
<string>Computer</string>
<string>Hosting Subscription</string>
<string>Person</string>
<string>Slave Instance</string>
<string>Software Instance</string>
</list>
</value>
......
......@@ -54,10 +54,11 @@
This script updates all local roles on the object. It requires Assignor\n
proxy role since it may be called by owner in draft state.\n
"""\n
portal_type_list = ["Software Instance", "Slave Instance", "Hosting Subscription"]\n
for movement in state_change[\'object\'].getMovementList():\n
tag = "softinssec_%s" % movement.getUid()\n
movement.activate(tag=tag).immediateReindexObject()\n
for software_instance in movement.getAggregateValueList(portal_type=["Software Instance", "Hosting Subscription"]):\n
for software_instance in movement.getAggregateValueList(portal_type=portal_type_list):\n
software_instance.activate(after_tag=tag).updateLocalRolesOnSecurityGroups()\n
</string> </value>
</item>
......
......@@ -13,6 +13,7 @@ person_module/test_hr_admin
person_module/test_updated_vifib_user
person_module/test_vifib_admin
person_module/test_vifib_customer
person_module/test_vifib_customer_a
person_module/test_vifib_developer
person_module/test_vifib_member
person_module/test_vifib_user_admin
......
......@@ -12,6 +12,7 @@ person_module/test_hr_admin
person_module/test_updated_vifib_user
person_module/test_vifib_admin
person_module/test_vifib_customer
person_module/test_vifib_customer_a
person_module/test_vifib_developer
person_module/test_vifib_member
person_module/test_vifib_user_admin
......@@ -28,4 +29,4 @@ software_product_module
software_product_module/test_software_product
software_release_module
software_release_module/test_software_release
credential_update_module
\ No newline at end of file
credential_update_module
......@@ -5,6 +5,8 @@ person_module/test_vifib_admin
person_module/test_vifib_admin/**
person_module/test_vifib_customer
person_module/test_vifib_customer/**
person_module/test_vifib_customer_a
person_module/test_vifib_customer_a/**
person_module/test_vifib_developer
person_module/test_vifib_developer/**
person_module/test_vifib_member
......
......@@ -24,6 +24,7 @@ Sale Trade Condition
Sale Trade Condition Module
Service
Service Module
Slave Instance
Software Instance
Software Instance Module
Software Product
......
......@@ -24,6 +24,7 @@ Sale Trade Condition
Sale Trade Condition Module
Service
Service Module
Slave Instance
Software Instance
Software Instance Module
Software Product
......
......@@ -10,4 +10,5 @@ Sale Order | local_permission_vifib_interaction_workflow
Sale Packing List Line | local_permission_vifib_interaction_workflow
Sale Packing List | local_permission_vifib_interaction_workflow
Sale Trade Condition | local_permission_vifib_interaction_workflow
Slave Instance | local_permission_vifib_interaction_workflow
Software Instance | local_permission_vifib_interaction_workflow
\ No newline at end of file
......@@ -6,7 +6,7 @@
<value>1</value>
</item>
<item key="_filter_expression_archive" type="str">
<value>python: context.getPortalType() == 'Software Instance'</value>
<value>python: context.getPortalType() in ['Software Instance', 'Slave Instance']</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>portal_type</value>
......
......@@ -17,7 +17,6 @@
<value> <string>uid\r\n
ComputerPartition_getAvailableSoftwareReleaseUrlStringList\r\n
ComputerPartition_isFreeForRequest\r\n
ComputerPartition_isSlaveAvailable\r\n
ComputerPartition_getSoftwareType</string> </value>
</item>
<item>
......@@ -71,19 +70,16 @@ WHERE\n
<dtml-let row_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-let free_for_request="ComputerPartition_isFreeForRequest[loop_item]">\n
<dtml-let available_slave="ComputerPartition_isSlaveAvailable[loop_item]">\n
<dtml-let software_type="ComputerPartition_getSoftwareType[loop_item]">\n
<dtml-in prefix="url" expr="ComputerPartition_getAvailableSoftwareReleaseUrlStringList[loop_item]" no_push_item>\n
<dtml-call expr="row_list.append([\n
uid[loop_item],\n
url_item,\n
free_for_request,\n
available_slave,\n
software_type])">\n
</dtml-in>\n
</dtml-let>\n
</dtml-let>\n
</dtml-let>\n
</dtml-in>\n
\n
<dtml-if "row_list">\n
......@@ -95,8 +91,7 @@ VALUES\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="string">,\n
<dtml-sqlvar expr="row_item[2]" type="int">,\n
<dtml-sqlvar expr="row_item[3]" type="int">,\n
<dtml-sqlvar expr="row_item[4]" type="string">\n
<dtml-sqlvar expr="row_item[3]" type="string">\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
......
......@@ -6,7 +6,7 @@
<value>1</value>
</item>
<item key="_filter_expression_archive" type="str">
<value>python: context.getPortalType() == 'Software Instance'</value>
<value>python: context.getPortalType() in ['Software Instance', 'Slave Instance']</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>portal_type</value>
......
......@@ -66,7 +66,6 @@ CREATE TABLE `computer_partition` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`software_release_url` varchar(255),\n
`free_for_request` INT(1),\n
`available_slave` INT(1),\n
`software_type` VARCHAR(255),\n
PRIMARY KEY (`uid`, `software_release_url`)\n
) TYPE=InnoDB;\n
......
24
\ No newline at end of file
27
\ No newline at end of file
<?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_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</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>unfiltered_tracking_list</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>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Item Tracking</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}/Item_viewTrackingList?current:int=0</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -65,8 +65,9 @@ order_line_list = context.portal_catalog( \n
\n
# XXX order line has to display (as order is under approval)\n
\n
result = [x.getAggregateValue(portal_type="Software Instance") for x in line_list]\n
result.extend([x.getAggregateValue(portal_type="Software Instance") for x in order_line_list])\n
portal_type_list = ["Software Instance", "Slave Instance"]\n
result = [x.getAggregateValue(portal_type=portal_type_list) for x in line_list]\n
result.extend([x.getAggregateValue(portal_type=portal_type_list) for x in order_line_list])\n
# result.extend([x.getObject() for x in order_line_list])\n
return result\n
</string> </value>
......
......@@ -50,28 +50,61 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n
portal = order.getPortalObject()\n
<value> <string>portal = context.getPortalObject()\n
\n
def checkSoftwareInstanceIsInstalledOnComputerPartition(software_release,\n
computer_partition):\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceSetupResource(),\n
portal.portal_preferences.getPreferredInstanceHostingResource(),\n
)\n
query = ComplexQuery(Query(aggregate_relative_url=software_release.getRelativeUrl()),\n
Query(aggregate_relative_url=computer_partition.getRelativeUrl()),\n
operator="AND",\n
)\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\',\n
query=query,\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
\n
if len(sale_packing_list_line_list) == 1:\n
resource_relative_url = (\n
portal.portal_preferences.getPreferredInstanceCleanupResource(),\n
)\n
sale_packing_list_line_list = portal.portal_catalog(\n
portal_type=\'Sale Packing List Line\',\n
query=query,\n
resource_relative_url=resource_relative_url,\n
limit=1)\n
if len(sale_packing_list_line_list) == 0:\n
return True\n
return False\n
\n
order = state_change[\'object\']\n
\n
setup_service_relative_url = order.portal_preferences.getPreferredInstanceSetupResource()\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
instance_portal_type_list = ["Software Instance","Slave Instance"]\n
for order_line in order.getMovementList():\n
if order_line.getResource() == setup_service_relative_url:\n
computer_partition = order_line.getAggregateValue(portal_type="Computer Partition")\n
if computer_partition is None:\n
software_release = order_line.getAggregateValue(portal_type="Software Release")\n
software_instance = order_line.getAggregateValue(portal_type="Software Instance")\n
software_instance = order_line.getAggregateValue(portal_type=instance_portal_type_list)\n
\n
computer_partition = None\n
\n
# XXX Duplicated from request method...\n
query_kw = {\n
\'software_release_url\': software_release.getUrlString(),\n
\'portal_type\': \'Computer Partition\',\n
# \'relative_url\': \'computer_module/20110126-E2AE/%\',\n
\'free_for_request\': 1,\n
}\n
if software_instance.getPortalType() == "Slave Instance":\n
query_kw[\'free_for_request\'] = 0\n
\n
# support SLA\n
filter_kw = software_instance.getSlaXmlAsDict()\n
if "computer_guid" in filter_kw:\n
......@@ -79,12 +112,17 @@ for order_line in order.getMovementList():\n
\n
result_count = software_instance.portal_catalog.countResults(**query_kw)[0][0]\n
offset = max(0, result_count-1)\n
\n
for computer_partition_candidate in portal.portal_catalog(\n
limit=(random.randint(0, offset), 50), **query_kw):\n
computer_partition_candidate = computer_partition_candidate.getObject()\n
computer_partition_candidate = computer_partition_candidate.getObject() \n
# Check if the computer partition can be marked as busy (done by an interaction workflow on sale packing list level)\n
if isTransitionPossible(computer_partition_candidate, \'mark_busy\'):\n
software_instance_portal_type = software_instance.getPortalType()\n
if isTransitionPossible(computer_partition_candidate, \'mark_busy\') and \\\n
software_instance_portal_type == "Software Instance":\n
computer_partition = computer_partition_candidate\n
break\n
elif software_instance_portal_type == "Slave Instance" and \\\n
checkSoftwareInstanceIsInstalledOnComputerPartition(software_release, computer_partition_candidate):\n
computer_partition = computer_partition_candidate\n
break\n
\n
......@@ -93,7 +131,8 @@ for order_line in order.getMovementList():\n
\n
# lock computer partition\n
computer_partition.serialize()\n
computer_partition.markBusy()\n
if isTransitionPossible(computer_partition_candidate, \'mark_busy\'):\n
computer_partition.markBusy()\n
\n
order_line.edit(\n
aggregate_list=order_line.getAggregateList()+[computer_partition.getRelativeUrl()])\n
......
Hosting Subscription Module | view
Hosting Subscription | unfiltered_tracking_list
Hosting Subscription | view
\ No newline at end of file
......@@ -2,7 +2,4 @@
<portal_type id="Computer">
<item>Virtio Partition</item>
</portal_type>
<portal_type id="Computer Partition">
<item>Slave Partition</item>
</portal_type>
</allowed_content_type_list>
\ No newline at end of file
......@@ -2,9 +2,6 @@
<portal_type id="Computer Partition">
<item>ComputerPartition</item>
</portal_type>
<portal_type id="Slave Partition">
<item>ComputerPartition</item>
</portal_type>
<portal_type id="System Preference">
<item>VifibSystemPreference</item>
</portal_type>
......
......@@ -59,7 +59,19 @@
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>Products.Vifib.Tool.SlapTool.SlapTool</string> </value>
<value> <string>SlapTool</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
......
......@@ -28,8 +28,8 @@
<workflow>slap_interaction_workflow</workflow>
</chain>
<chain>
<type>Slave Partition</type>
<workflow>computer_partition_slap_interface_workflow, edit_workflow, slap_interaction_workflow, validation_workflow</workflow>
<type>Slave Instance</type>
<workflow>slap_interaction_workflow</workflow>
</chain>
<chain>
<type>Software Instance</type>
......
......@@ -51,18 +51,46 @@
<item>
<key> <string>_body</string> </key>
<value> <string>sale_packing_list_line = context\n
software_instance = sale_packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type=[\'Computer Partition\', \'Slave Partition\'])\n
software_release = sale_packing_list_line.getAggregateValue(portal_type=\'Software Release\')\n
slave_id_list = []\n
instance_type_list = [\'Software Instance\', \'Slave Instance\']\n
\n
hosting_service = context.restrictedTraverse(\n
context.portal_preferences.getPreferredInstanceHostingResource())\n
setup_service = context.restrictedTraverse(\n
context.portal_preferences.getPreferredInstanceSetupResource())\n
\n
service_uid_list = [hosting_service.getUid(), setup_service.getUid()]\n
\n
state_list = ("confirmed", "started")\n
\n
software_instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type=\'Computer Partition\')\n
software_release = sale_packing_list_line.getAggregateValue(portal_type="Software Release")\n
\n
ip_list = []\n
if computer_partition.getPortalType() == \'Computer Partition\':\n
slave_id_list = [slave_partition.getReference() for slave_partition in \\\n
computer_partition.contentValues(portal_type=\'Slave Partition\') \\\n
if slave_partition.getSlapState() == \'busy\']\n
for internet_protocol_address in computer_partition.contentValues(portal_type=\'Internet Protocol Address\'):\n
ip_list.append((internet_protocol_address.getNetworkInterface(\'\'), internet_protocol_address.getIpAddress()))\n
if software_instance is not None and computer_partition is not None and software_release is not None:\n
slave_instance_list = []\n
sale_packing_list_line_list = computer_partition.getAggregateRelatedValueList(\n
portal_type="Sale Packing List Line",\n
default_resource_uid=service_uid_list)\n
for sale_packing_list_line in sale_packing_list_line_list:\n
if sale_packing_list_line.getParent().getSimulationState() not in state_list:\n
continue\n
instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n
if instance is None:\n
continue\n
elif instance.getPortalType() == "Slave Instance":\n
slave_instance = dict(slap_software_type=instance.getSourceReference(),\n
slave_reference=instance.getReference(),\n
xml=instance.getTextContent(),\n
connection_xml=instance.getConnectionXml(),\n
)\n
if slave_instance not in slave_instance_list:\n
slave_instance_list.append(slave_instance)\n
elif instance.getPortalType() == "Software Instance":\n
software_instance = instance\n
return {\n
\'xml\':software_instance.getTextContent(),\n
\'connection_xml\':software_instance.getConnectionXml(),\n
......@@ -71,9 +99,10 @@ if software_instance is not None and computer_partition is not None and software
\'slap_software_type\': software_instance.getSourceReference(),\n
\'slap_software_release_url\':software_release.getUrlString(),\n
\'slap_server_url\':context.getPortalObject().portal_slap.absolute_url(),\n
\'slave_id_list\':slave_id_list, # XXX: Is it really ok to send non string in instance xml dict?\n
\'slave_instance_list\': slave_instance_list,\n
\'ip_list\':ip_list,\n
}\n
\n
return None\n
</string> </value>
</item>
......
......@@ -50,8 +50,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>software_instance = state_change[\'object\']\n
software_instance.Base_checkConsistency()\n
<value> <string>person = state_change[\'object\']\n
person.Base_checkConsistency()\n
</string> </value>
</item>
<item>
......
......@@ -62,13 +62,18 @@ software_title = kwargs["software_title"]\n
software_type = kwargs.get("software_type") or "RootSoftwareInstance"\n
instance_xml = kwargs["instance_xml"]\n
sla_xml = kwargs.get("sla_xml") or ""\n
is_slave = kwargs.get("shared", False)\n
state = kwargs.get(\'state\') or \'started\'\n
\n
sale_order_portal_type = "Sale Order"\n
sale_order_line_portal_type = "Sale Order Line"\n
software_instance_portal_type = "Software Instance"\n
hosting_subscription_portal_type = "Hosting Subscription"\n
\n
if is_slave == True:\n
software_instance_portal_type = "Slave Instance"\n
else:\n
software_instance_portal_type = "Software Instance"\n
\n
# XXX Hardcoded values\n
seller = portal.restrictedTraverse("organisation_module/vifib_internet")\n
currency = portal.restrictedTraverse("currency_module/EUR")\n
......
......@@ -27,9 +27,7 @@
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SlavePartition_reindexComputerPartition</string>
</list>
<tuple/>
</value>
</item>
<item>
......@@ -50,13 +48,13 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlavePartition_immediateReindexObject</string> </value>
<value> <string>SlaveInstance_deliver</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>immediateReindexObject</string>
<string>startComputerPartition</string>
</list>
</value>
</item>
......@@ -68,16 +66,22 @@
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Slave Partition</string>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
<list>
<string>SoftwareInstance_deliverSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
......
......@@ -28,7 +28,7 @@
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>ComputerPartition_freeSlavePartition</string>
<string>SoftwareInstance_requestStopSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
......@@ -50,25 +50,25 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_markFree</string> </value>
<value> <string>SoftwareInstance_destroy</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>markFree</string>
<string>destroyComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Computer Partition</string>
<string>Software Instance</string>
</list>
</value>
</item>
......@@ -78,6 +78,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_requestStopSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestDestroy</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>requestDestroyComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -27,15 +27,15 @@
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
<list>
<string>SoftwareInstance_requestStartSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<list>
<string>ComputerPartition_checkBusySlavePartitionList</string>
</list>
<tuple/>
</value>
</item>
<item>
......@@ -50,13 +50,13 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_setQuantity</string> </value>
<value> <string>SoftwareInstance_requestStart</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_setQuantity</string>
<string>requestStartComputerPartition</string>
</list>
</value>
</item>
......@@ -68,7 +68,7 @@
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Computer Partition</string>
<string>Software Instance</string>
</list>
</value>
</item>
......@@ -78,6 +78,10 @@
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_requestStopSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestStop</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>requestStopComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_startSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Start all Slave Instance installed in the computer partition of a Software Instance</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_start</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>startComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Start Software Instance and Slave Instance</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_startComputerPartitionInstallationOfSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_startComputerPartitionInstallation</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>startComputerPartitionInstallation</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_stopSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Stop all Slave Instance installed in the computer partition of a Software Instance</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_stop</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>stopComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Stop Software Instance and Slave Instance</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>SoftwareInstance_stopComputerPartitionInstallationOfSlaveInstanceListFromComputerPartition</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_stopComputerPartitionInstallation</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>stopComputerPartitionInstallation</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Software Instance</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
computer_partition = state_change[\'object\']\n
computer_partition_capacity = computer_partition.getQuantity()\n
computer_partition_usage = 0\n
for slave_partition in computer_partition.contentValues(portal_type=\'Slave Partition\'):\n
if slave_partition.getSlapState() == \'busy\':\n
computer_partition_usage += 1\n
if computer_partition_usage > computer_partition_capacity:\n
raise ValueError(\'Computer Partition quantity is lower then amount of busy Slave Partitions\')\n
available_capacity = computer_partition_capacity - computer_partition_usage\n
for slave_partition in computer_partition.contentValues(portal_type=\'Slave Partition\'):\n
if slave_partition.getSlapState() == \'free\':\n
# Deactivate free slave partition if needed\n
if available_capacity > 0:\n
available_capacity -= 1\n
else:\n
slave_partition.markInactive()\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_checkBusySlavePartitionList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
portal = context.getPortalObject()\n
\n
service = portal.restrictedTraverse(service_relative_url)\n
service_uid_list = [service.getUid()]\n
\n
sale_packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type="Sale Packing List Line",\n
aggregate_relative_url=relative_url)\n
\n
computer_partition = sale_packing_list_line.getAggregateValue(\n
portal_type="Computer Partition")\n
\n
slave_instance_query = Query(aggregate_portal_type="Slave Instance")\n
\n
computer_partition_query = Query(\n
aggregate_relative_url=computer_partition.getRelativeUrl())\n
\n
query = ComplexQuery(computer_partition_query, \n
slave_instance_query, operator="AND")\n
\n
return portal.portal_catalog(portal_type=\'Sale Packing List Line\',\n
default_resource_uid=service_uid_list,\n
sort_on=((\'movement.start_date\', \'DESC\'),),\n
query=query, **kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>relative_url, service_relative_url, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -59,13 +59,15 @@ if sale_order is None:\n
for sale_packing_list_line in sale_packing_list.contentValues(\n
portal_type="Sale Packing List Line"):\n
if sale_packing_list_line.getResource() == setup_service_relative_url:\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type=["Computer Partition", "Slave Partition"])\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type=["Computer Partition"])\n
if computer_partition is None:\n
raise ValueError("Sale Packing List Line \'%s\' should have a computer partition aggregated" % sale_packing_list_line.getRelativeUrl())\n
else:\n
# Mark computer partition as busy\n
# This method should be always callable in this step to prevent having 2 packing list related to the same computer partition\n
computer_partition.markBusy()\n
# Slave instance do not change state of computer partitions.\n
if sale_packing_list_line.getAggregateValue(portal_type=["Slave Instance"]) is None:\n
# Mark computer partition as busy\n
# This method should be always callable in this step to prevent having 2 packing list related to the same computer partition\n
computer_partition.markBusy()\n
</string> </value>
</item>
<item>
......
......@@ -63,27 +63,30 @@ current_delivery_line = sale_packing_list_line_list[0]\n
if current_delivery_line.getResource() != destroy_service_relative_url:\n
return\n
\n
computer_partition = current_delivery_line.getAggregateValue(portal_type=["Computer Partition", "Slave Partition"])\n
computer_partition = current_delivery_line.getAggregateValue(portal_type=["Computer Partition"])\n
if computer_partition is None:\n
raise ValueError("Sale Packing List Line \'%s\' should have a computer partition aggregated" % current_delivery_line.getRelativeUrl())\n
else:\n
# Mark computer partition as free\n
# This method should be always callable in this step to prevent having 2 packing list related to the same computer partition\n
computer_partition.markFree()\n
# Slave instance do not change state of computer partitions.\n
if current_delivery_line.getAggregateValue(portal_type=["Slave Instance"]) is None:\n
# Mark computer partition as free\n
# This method should be always callable in this step to prevent having 2 packing list related to the same computer partition\n
computer_partition.markFree()\n
\n
# Deliver all SPL related to this software instance\n
isTransitionPossible = context.portal_workflow.isTransitionPossible\n
software_instance = current_delivery_line.getAggregateValue(portal_type="Software Instance")\n
for sale_packing_list_line in portal.portal_catalog(\n
portal_type="Sale Packing List Line", \n
default_aggregate_uid=software_instance.getUid(),\n
simulation_state=NegatedQuery(Query(simulation_state="delivered")),\n
simulation_state=NegatedQuery(Query(simulation_state=["delivered", "cancelled"])),\n
):\n
sale_packing_list = sale_packing_list_line.getParentValue()\n
if sale_packing_list.getPortalObject().portal_workflow.isTransitionPossible(sale_packing_list, \'start\'):\n
if isTransitionPossible(sale_packing_list, \'start\'):\n
sale_packing_list.start()\n
if sale_packing_list.getPortalObject().portal_workflow.isTransitionPossible(sale_packing_list, \'stop\'):\n
if isTransitionPossible(sale_packing_list, \'stop\'):\n
sale_packing_list.stop()\n
if sale_packing_list.getPortalObject().portal_workflow.isTransitionPossible(sale_packing_list, \'deliver\'):\n
if isTransitionPossible(sale_packing_list, \'deliver\'):\n
sale_packing_list.deliver()\n
if sale_packing_list.getSimulationState() != \'delivered\':\n
raise ValueError(\'It was not possible to deliver %r during destruction of %r\' % (sale_packing_list.getRelativeUrl(), software_instance.getRelativeUrl()))\n
......
......@@ -58,7 +58,7 @@ assert len(sale_packing_list_line_list) == 1\n
sale_packing_list_line = sale_packing_list_line_list[0]\n
resource = sale_packing_list_line.getResource()\n
if resource == preference_tool.getPreferredInstanceSetupResource():\n
software_instance = sale_packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n
software_instance = sale_packing_list_line.getAggregateValue(portal_type=[\'Software Instance\', \'Slave Instance\'])\n
if software_instance.getSlapState() == \'start_requested\':\n
software_instance.requestStartComputerPartition()\n
elif software_instance.getSlapState() == \'stop_requested\':\n
......
......@@ -50,18 +50,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>computer_partition = state_change[\'object\']\n
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
isTransitionPossible = computer_partition.getPortalObject().portal_workflow.isTransitionPossible\n
for slave_partition in computer_partition.contentValues(portal_type="Slave Partition"):\n
if slave_partition.getSlapState() == \'busy\':\n
# XXX Busy slave partition has to be free by delivering related Sale Packing List\n
raise NotImplementedError("Free Slave Partition")\n
if isTransitionPossible(slave_partition, \'mark_inactive\'):\n
slave_partition.markInactive()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url, simulation_state=["stopped"])\n
\n
computer_partition.edit(quantity=None)\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.stopComputerPartition()\n
</string> </value>
</item>
<item>
......@@ -70,7 +68,7 @@ computer_partition.edit(quantity=None)\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerPartition_freeSlavePartition</string> </value>
<value> <string>SoftwareInstance_deliverSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url)\n
\n
slave_instance_uid_list = []\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
if slave_instance.getUid() not in slave_instance_uid_list:\n
slave_instance.requestStartComputerPartition()\n
slave_instance_uid_list.append(slave_instance.getUid())\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestStartSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url,\n
simulation_state=["confirmed", "started"])\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.requestStopComputerPartition()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestStopSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url)\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.startComputerPartitionInstallation()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_startComputerPartitionInstallationOfSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),\n
service_relative_url,\n
simulation_state=["confirmed"])\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.startComputerPartition()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_startSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceSetupResource()\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(), service_relative_url)\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.stopComputerPartitionInstallation()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_stopComputerPartitionInstallationOfSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>software_instance = state_change["object"]\n
service_relative_url = software_instance.portal_preferences.\\\n
getPreferredInstanceHostingResource()\n
\n
sale_packing_list_line_list = context.ERP5Site_getSlaveInstanceListFromComputerPartition(\n
software_instance.getRelativeUrl(),\n
service_relative_url,\n
simulation_state=["started", "stopped"])\n
\n
for sale_packing_list_line in sale_packing_list_line_list:\n
slave_instance = sale_packing_list_line.getAggregateValue(portal_type="Slave Instance")\n
slave_instance.stopComputerPartition()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_stopSlaveInstanceListFromComputerPartition</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
381
\ No newline at end of file
416
\ No newline at end of file
Computer Partition | jump_to_related_usage_report_list
Computer Partition | slave_partition
Slave Partition | jump_to_related_usage_report_list
Slave Partition | view
System Preference | vifib_preference
Virtio Partition | jump_to_related_usage_report_list
Virtio Partition | view
\ No newline at end of file
Computer Partition | Slave Partition
Computer | Virtio Partition
\ No newline at end of file
Slap Tool
Slave Partition
Virtio Partition
\ No newline at end of file
Computer Partition | ComputerPartition
Slave Partition | ComputerPartition
System Preference | VifibSystemPreference
Virtio Partition | ComputerPartition
\ No newline at end of file
......@@ -7,11 +7,7 @@ Purchase Packing List Line | slap_interaction_workflow
Purchase Packing List | slap_interaction_workflow
Sale Packing List Line | slap_interaction_workflow
Sale Packing List | slap_interaction_workflow
Slave Partition | computer_partition_slap_interface_workflow
Slave Partition | edit_workflow
Slave Partition | slap_interaction_workflow
Slave Partition | validation_workflow
Software Instance | slap_interaction_workflow
Slave Instance | slap_interaction_workflow
Software Instance | slap_interaction_workflow
Software Release | slap_interaction_workflow
Virtio Partition | computer_partition_slap_interface_workflow
......
......@@ -64,7 +64,7 @@ if not service_title:\n
keep_items={\'portal_status_message\':context.Base_translateString("You have to provide Service Title.")})\n
\n
software_instance_list = context.portal_catalog(\n
portal_type=\'Software Instance\',\n
portal_type=[\'Software Instance\', \'Slave Instance\'],\n
select_expression=\'title\',\n
title={\'query\': service_title, \'key\': \'ExactMatch\'}\n
)\n
......@@ -79,6 +79,7 @@ params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
params["instance_software_product_uid"] = uids[0]\n
params["service_title"] = service_title\n
params["instance_xml"] = instance_xml\n
params["shared"] = shared\n
params["computer"] = computer\n
portal.portal_selections.setSelectionParamsFor(\'vifib_session_id\', params)\n
\n
......@@ -93,7 +94,7 @@ context.WebSection_viewNextStep()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id, service_title, instance_xml, computer=\'\', uids=[], quantity = 1, reset_shopping_cart=True, **kw</string> </value>
<value> <string>dialog_id, service_title, instance_xml, computer=\'\', uids=[], shared=0, quantity=1, reset_shopping_cart=True, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -73,6 +73,7 @@ params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
instance_software_release_uid = params[\'instance_software_release_uid\']\n
service_title = params[\'service_title\']\n
instance_xml = params[\'instance_xml\']\n
shared = params.get(\'shared\', False)\n
computer = params[\'computer\']\n
software_release = portal.portal_catalog.getResultValue(uid=instance_software_release_uid)\n
\n
......@@ -81,6 +82,7 @@ request_kw.update(\n
software_release=software_release.getUrlString(),\n
software_title=service_title,\n
instance_xml=instance_xml,\n
shared=shared,\n
)\n
\n
if computer:\n
......
......@@ -102,6 +102,7 @@
<string>your_service_title</string>
<string>your_instance_xml</string>
<string>your_computer</string>
<string>your_shared</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_slave</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>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</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>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Slave</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
299
\ No newline at end of file
302
\ No newline at end of file
......@@ -34,6 +34,7 @@ from OFS.Traversable import NotFound
from Products.DCWorkflow.DCWorkflow import ValidationFailed
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from Products.ERP5Type import Permissions
from lxml import etree
try:
......@@ -91,6 +92,8 @@ def convertToREST(function):
wrapper.__doc__ = function.__doc__
return wrapper
_MARKER = []
class SlapTool(BaseTool):
"""SlapTool"""
......@@ -144,11 +147,7 @@ class SlapTool(BaseTool):
for computer_partition_document in computer_document.contentValues(
portal_type="Computer Partition"):
slap_computer._computer_partition_list.append(
self._convertToSlapPartition(computer_partition_document, computer_id))
for slave_partition_document in computer_partition_document\
.contentValues(portal_type='Slave Partition'):
slap_computer._computer_partition_list.append(
self._convertToSlapPartition(slave_partition_document, computer_id))
self._getSlapPartitionByPackingList(computer_partition_document))
return xml_marshaller.xml_marshaller.dumps(slap_computer)
security.declareProtected(Permissions.AccessContentsInformation,
......@@ -172,13 +171,17 @@ class SlapTool(BaseTool):
'setComputerPartitionConnectionXml')
def setComputerPartitionConnectionXml(self, computer_id,
computer_partition_id,
connection_xml):
connection_xml, slave_reference=None):
"""
Set instance parameter informations on the slagrid server
"""
# When None is passed in POST, it is converted to string
if slave_reference is not None and slave_reference.lower() == "none":
slave_reference = None
return self._setComputerPartitionConnectionXml(computer_id,
computer_partition_id,
connection_xml)
connection_xml,
slave_reference)
security.declareProtected(Permissions.AccessContentsInformation,
'buildingSoftwareRelease')
......@@ -258,8 +261,8 @@ class SlapTool(BaseTool):
'requestComputerPartition')
def requestComputerPartition(self, computer_id=None,
computer_partition_id=None, software_release=None, software_type=None,
partition_reference=None, shared_xml=None, partition_parameter_xml=None,
filter_xml=None, state=None):
partition_reference=None, partition_parameter_xml=None,
filter_xml=None, state=None, shared_xml=_MARKER):
"""
Asynchronously requests creation of computer partition for assigned
parameters
......@@ -356,15 +359,6 @@ class SlapTool(BaseTool):
result_dict[key] = value
return result_dict
def _getModificationStatusForSlave(self, computer_partition_document):
for slave in computer_partition_document.contentValues(
portal_type='Slave Partition'):
if slave.getSlapState() == 'busy':
slap_partition = self._getSlapPartitionByPackingList(slave)
if slap_partition._need_modification == 1:
return 1
return 0
def _getSlapPartitionByPackingList(self, computer_partition_document):
computer = computer_partition_document
portal = self.getPortalObject()
......@@ -387,15 +381,20 @@ class SlapTool(BaseTool):
slap_partition._software_release_document = SoftwareRelease(
software_release=software_release_document.getUrlString(),
computer_guid=computer_id)
parameter_dict = self._getSalePackingListLineAsSoftwareInstance(
movement)
# software instance has to define an xml parameter
slap_partition._parameter_dict = self._instanceXmlToDict(
parameter_dict.pop('xml'))
slap_partition._connection_dict = self._instanceXmlToDict(
parameter_dict.pop('connection_xml'))
for slave_instance_dict in parameter_dict.get("slave_instance_list", []):
if slave_instance_dict.has_key("connection_xml"):
slave_instance_dict.update(self._instanceXmlToDict(
slave_instance_dict.pop("connection_xml")))
if slave_instance_dict.has_key("xml"):
slave_instance_dict.update(self._instanceXmlToDict(
slave_instance_dict.pop("xml")))
slap_partition._parameter_dict.update(parameter_dict)
# Apply state and buildout run conditions
......@@ -415,12 +414,13 @@ class SlapTool(BaseTool):
elif movement.getResource() == \
portal_preferences.getPreferredInstanceHostingResource():
if movement.getSimulationState() == 'confirmed':
slap_partition._requested_state = 'started'
slap_partition._need_modification = 1
elif movement.getSimulationState() == 'started':
slap_partition._requested_state = 'started'
slap_partition._need_modification = \
self._hasSlaveInstanceNeedModification(computer_partition_document)
elif movement.getSimulationState() == 'stopped':
slap_partition._requested_state = 'stopped'
slap_partition._need_modification = 1
......@@ -442,17 +442,43 @@ class SlapTool(BaseTool):
movement.getResource()
return slap_partition
def _convertToSlapPartition(self, computer_partition_document, computer_id):
def _hasSlaveInstanceNeedModification(self, computer_partition_document):
"""
Check if modification is needed for...
"""
portal = self.getPortalObject()
portal_preferences = portal.portal_preferences
hosting_service = portal.restrictedTraverse(
portal_preferences.getPreferredInstanceHostingResource())
slap_partition = self._getSlapPartitionByPackingList(
computer_partition_document)
if computer_partition_document.getPortalType() == 'Slave Partition':
slap_partition._need_modification = 0
elif computer_partition_document.getQuantity() > 0 and \
slap_partition._need_modification == 0:
slap_partition._need_modification = self._getModificationStatusForSlave(
computer_partition_document)
return slap_partition
setup_service = portal.restrictedTraverse(
portal_preferences.getPreferredInstanceSetupResource())
hosting_query = ComplexQuery(Query(aggregate_portal_type="Slave Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
# Search only for Confirmed and Stopped, the only one states that require
# buildout be re-updated.
Query(simulation_state=["confirmed", "stopped"]),
Query(default_resource_uid=hosting_service.getUid()),
operator="AND")
setup_query = ComplexQuery(Query(aggregate_portal_type="Slave Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
Query(simulation_state=["confirmed", "started"]),
Query(default_resource_uid=setup_service.getUid()),
operator="AND")
query = ComplexQuery(hosting_query, setup_query, operator="OR")
# Use getTrackingList
catalog_result = portal.portal_catalog(
portal_type='Sale Packing List Line',
sort_on=(('movement.start_date', 'DESC'),),
limit=1,
query=query)
return len(catalog_result)
@convertToREST
def _buildingSoftwareRelease(self, url, computer_id):
......@@ -541,13 +567,15 @@ class SlapTool(BaseTool):
@convertToREST
def _setComputerPartitionConnectionXml(self, computer_id,
computer_partition_id,
connection_xml):
connection_xml,
slave_reference=None):
"""
Sets Computer Partition connection Xml
"""
software_instance = self._getSoftwareInstanceForComputerPartition(
computer_id,
computer_partition_id)
computer_partition_id,
slave_reference)
partition_parameter_kw = xml_marshaller.xml_marshaller.loads(
connection_xml)
instance = etree.Element('instance')
......@@ -582,7 +610,7 @@ class SlapTool(BaseTool):
state = xml_marshaller.xml_marshaller.loads(state)
if state is None:
state = 'started'
if shared_xml:
if shared_xml is not _MARKER:
shared = xml_marshaller.xml_marshaller.loads(shared_xml)
else:
shared = False
......@@ -614,6 +642,11 @@ class SlapTool(BaseTool):
sla_xml = etree.tostring(instance, pretty_print=True,
xml_declaration=True, encoding='utf-8')
if shared:
instance_portal_type = "Slave Instance"
else:
instance_portal_type = "Software Instance"
if computer_id and computer_partition_id:
# requested by Software Instance, there is already top part of tree
software_instance_document = self.\
......@@ -623,15 +656,15 @@ class SlapTool(BaseTool):
software_release=software_release,
software_type=software_type,
partition_reference=partition_reference,
shared=shared,
instance_xml=instance_xml,
shared=shared,
sla_xml=sla_xml,
state=state)
# Get requested software instance
requested_software_instance = software_instance_document.portal_catalog.\
getResultValue(
portal_type="Software Instance",
portal_type=instance_portal_type,
source_reference=software_type,
# predecessor_related_uid is inconsistent with
# SoftwareInstancae.requestSoftwareInstance but in this case it
......@@ -652,7 +685,7 @@ class SlapTool(BaseTool):
state=state)
requested_software_instance = person.portal_catalog.\
getResultValue(
portal_type="Software Instance",
portal_type=instance_portal_type,
# In order be in sync with defaults of person.
# requestSoftwareInstance it is required to default here
# too
......@@ -663,13 +696,17 @@ class SlapTool(BaseTool):
if requested_software_instance is None:
raise SoftwareInstanceNotReady
else:
query_kw = {}
if shared:
# Provide precise reference when search for a slave.
query_kw['slave_reference'] = requested_software_instance.getReference()
movement = self._getSalePackingListLineForComputerPartition(
requested_software_instance)
requested_software_instance, **query_kw)
if movement is None:
raise SoftwareInstanceNotReady
software_instance = SoftwareInstance(
**self._getSalePackingListLineAsSoftwareInstance(
movement))
**self._getSalePackingListLineAsSoftwareInstance(movement))
return xml_marshaller.xml_marshaller.dumps(software_instance)
####################################################
......@@ -702,14 +739,9 @@ class SlapTool(BaseTool):
"""
# Related key might be nice
computer = self._getComputerDocument(computer_reference)
try:
return self._getDocument(portal_type='Computer Partition',
return self._getDocument(portal_type='Computer Partition',
reference=computer_partition_reference,
parent_uid=computer.getUid())
except NotFound:
return self._getDocument(portal_type='Slave Partition',
reference=computer_partition_reference,
grand_parent_uid=computer.getUid())
def _getUsageReportServiceDocument(self):
service_document = self.Base_getUsageReportServiceDocument()
......@@ -718,7 +750,7 @@ class SlapTool(BaseTool):
raise Unauthorized
def _getSoftwareInstanceForComputerPartition(self, computer_id,
computer_partition_id):
computer_partition_id, slave_reference=None):
computer_partition_document = self._getComputerPartitionDocument(
computer_id, computer_partition_id)
if computer_partition_document.getSlapState() != 'busy':
......@@ -728,13 +760,15 @@ class SlapTool(BaseTool):
raise NotFound, "No software instance found for: %s - %s" % (computer_id,
computer_partition_id)
packing_list_line = self._getSalePackingListLineForComputerPartition(
computer_partition_document)
computer_partition_document,
slave_reference)
if packing_list_line is None:
raise NotFound, "No software instance found for: %s - %s" % (computer_id,
computer_partition_id)
else:
portal_type_list = ["Software Instance", "Slave Instance"]
software_instance = packing_list_line.getAggregateValue(
portal_type="Software Instance")
portal_type=portal_type_list)
if software_instance is None:
raise NotFound, "No software instance found for: %s - %s" % (
computer_id, computer_partition_id)
......@@ -769,7 +803,8 @@ class SlapTool(BaseTool):
return software_release_list
def _getSalePackingListLineForComputerPartition(self,
computer_partition_document):
computer_partition_document,
slave_reference=None):
"""
Return latest meaningfull sale packing list related to a computer partition
document
......@@ -790,15 +825,23 @@ class SlapTool(BaseTool):
state_list.extend(portal.getPortalCurrentInventoryStateList())
state_list.extend(portal.getPortalReservedInventoryStateList())
state_list.extend(portal.getPortalTransitInventoryStateList())
if slave_reference is not None:
query = ComplexQuery(Query(aggregate_reference=slave_reference),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
operator="AND")
else:
query = ComplexQuery(Query(aggregate_portal_type="Software Instance"),
Query(aggregate_relative_url=computer_partition_document.getRelativeUrl()),
operator="AND")
# Use getTrackingList
catalog_result = portal.portal_catalog(
portal_type='Sale Packing List Line',
simulation_state=state_list,
aggregate_relative_url=computer_partition_document.getRelativeUrl(),
default_resource_uid=service_uid_list,
sort_on=(('movement.start_date', 'DESC'),),
limit=1,
query=query
)
if len(catalog_result):
return catalog_result[0].getObject()
......
......@@ -28,10 +28,15 @@
#
##############################################################################
from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod
from Products.ERP5Type import Permissions
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from VifibMixin import testVifibMixin
from random import random
from slapos import slap
......@@ -54,7 +59,7 @@ DEFAULT_INSTANCE_DICT_PARAMETER_LIST = [
'slap_server_url',
'slap_software_release_url',
'slap_software_type',
'slave_id_list',
"slave_instance_list"
]
......@@ -92,7 +97,7 @@ class TestVifibSlapWebService(testVifibMixin):
sale_order_line_portal_type = "Sale Order Line"
sale_packing_list_portal_type = "Sale Packing List"
service_portal_type = "Service"
slave_partition_portal_type = "Slave Partition"
slave_instance_portal_type = "Slave Instance"
software_instance_portal_type = "Software Instance"
software_release_portal_type = "Software Release"
software_product_portal_type = "Software Product"
......@@ -100,6 +105,14 @@ class TestVifibSlapWebService(testVifibMixin):
minimal_correct_xml = '<?xml version="1.0" encoding="utf-8"?><instance/>'
computer_partition_amount = 1
failIfUserCanViewDocument = AssertNoPermissionMethod(Permissions.View)
failIfUserCanAccessDocument = AssertNoPermissionMethod(
Permissions.AccessContentsInformation)
failIfUserCanModifyDocument = AssertNoPermissionMethod(
Permissions.ModifyPortalContent)
assertUserCanViewDocument = AssertPermissionMethod(Permissions.View)
assertUserCanAccessDocument =\
AssertPermissionMethod(Permissions.AccessContentsInformation)
def afterSetUp(self):
fakeSlapAuth()
......@@ -110,6 +123,13 @@ class TestVifibSlapWebService(testVifibMixin):
unfakeSlapAuth()
super(testVifibMixin, self).beforeTearDown()
def _loginAsUser(self, username):
"""Login as a given username. The user must exist."""
uf = self.getPortal().acl_users
user = uf.getUserById(username)
self.assertNotEquals(user, None, 'No user %s' % username)
newSecurityManager(None, user.__of__(uf))
########################################
# Assertions
########################################
......@@ -197,6 +217,7 @@ class TestVifibSlapWebService(testVifibMixin):
def _checkComputerPartitionSalePackingListState(self, state,
resource, sequence):
delivery_line_amount = sequence.get("delivery_line_amount", 1)
computer_partition = self.portal.portal_catalog.getResultValue(
uid=sequence['computer_partition_uid'])
delivery_line_list = [q for q in computer_partition
......@@ -204,7 +225,7 @@ class TestVifibSlapWebService(testVifibMixin):
portal_type=self.sale_packing_list_line_portal_type)
if q.getResource() == resource
and q.getSimulationState() == state]
self.assertEqual(1, len(delivery_line_list))
self.assertEqual(delivery_line_amount, len(delivery_line_list))
def _checkComputerPartitionNoSalePackingList(self, resource, sequence):
computer_partition = self.portal.portal_catalog.getResultValue(
......@@ -293,6 +314,17 @@ class TestVifibSlapWebService(testVifibMixin):
self.portal.portal_preferences.getPreferredInstanceHostingResource(),
sequence)
def stepCheckComputerPartitionNoInstanceHostingSalePackingList(self,
sequence, **kw):
computer_partition = self.portal.portal_catalog.getResultValue(
uid=sequence['computer_partition_uid'])
delivery_line_list = [q for q in computer_partition
.getAggregateRelatedValueList(
portal_type=self.sale_packing_list_line_portal_type)
if q.getResource() == self.\
portal.portal_preferences.getPreferredInstanceHostingResource()]
self.assertEqual(0, len(delivery_line_list))
def stepCheckComputerPartitionInstanceHostingSalePackingListDelivered(self,
sequence, **kw):
self._checkComputerPartitionSalePackingListState('delivered',
......@@ -340,6 +372,12 @@ class TestVifibSlapWebService(testVifibMixin):
uid=sequence['service_uid']).getRelativeUrl(),
sequence)
def stepPersonRequestSlaveInstance(self, sequence, **kw):
kw = dict(instance_portal_type=self.slave_instance_portal_type,
shared=True,
software_type="SlaveInstance")
self.stepPersonRequestSoftwareInstance(sequence, **kw)
def stepPersonRequestSoftwareInstance(self, sequence, **kw):
person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue()
software_release = self.portal.portal_catalog.getResultValue(
......@@ -348,15 +386,18 @@ class TestVifibSlapWebService(testVifibMixin):
person.requestSoftwareInstance(
software_release=software_release.getUrlString(),
software_title=software_title,
instance_xml=self.minimal_correct_xml)
instance_xml=self.minimal_correct_xml,
**kw)
transaction.commit()
self.tic()
# Note: This is tricky part. Workflow methods does not return nothing
# so the only way is to find again the computer partition.
# But only title can be passed, that is why random is used to avoid
# duplication
software_instance_portal_type = kw.get("instance_portal_type",
self.software_instance_portal_type)
software_instance_list = self.portal.portal_catalog(
portal_type=self.software_instance_portal_type,
portal_type=software_instance_portal_type,
title=software_title)
self.assertEqual(1, len(software_instance_list))
software_instance = software_instance_list[0]
......@@ -369,7 +410,8 @@ class TestVifibSlapWebService(testVifibMixin):
portal_type='Hosting Subscription').getUid())
def stepSetSelectedComputerPartition(self, sequence, **kw):
"""Sets in sequence computer partition parameters related to current software instance"""
"""Sets in sequence computer partition parameters related to current
software instance"""
software_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
delivery_line = [q for q in software_instance
......@@ -442,6 +484,38 @@ class TestVifibSlapWebService(testVifibMixin):
self.portal.portal_workflow.doActionFor(packing_list, "confirm_action")
def stepCheckComputerPartitionSaleOrderAggregatedList(self, sequence):
portal_catalog = self.portal.portal_catalog
sale_packing_list = portal_catalog.getResultValue(
uid=sequence['sale_packing_list_uid'])
sale_packing_list_line = sale_packing_list.objectValues()[0]
computer_partition = sale_packing_list_line.getAggregateValue(
portal_type=self.computer_partition_portal_type)
sale_order_line_list = computer_partition.getAggregateRelatedValueList(
portal_type="Sale Order Line")
sale_order_line_1, sale_order_line_2 = sale_order_line_list
self.assertEquals(sale_order_line_1.getAggregateValue(
portal_type=self.computer_partition_portal_type),
sale_order_line_2.getAggregateValue(
portal_type=self.computer_partition_portal_type))
self.assertEquals(2, len(sale_order_line_list))
sale_packing_line_list = computer_partition.getAggregateRelatedValueList(
portal_type="Sale Packing List Line")
self.assertEquals(2, len(sale_packing_line_list))
sale_packing_list_line_1, sale_packing_list_line_2 = sale_packing_line_list
self.assertEquals(sale_packing_list_line_1.getAggregateValue(
portal_type=self.software_release_portal_type),
sale_packing_list_line_2.getAggregateValue(
portal_type=self.software_release_portal_type))
self.assertEquals(sale_packing_list_line_1.getAggregateValue(
portal_type=self.computer_partition_portal_type),
sale_packing_list_line_2.getAggregateValue(
portal_type=self.computer_partition_portal_type))
hosting_1, hosting_2 = [hosting.getAggregateValue(
portal_type=self.hosting_subscription_portal_type) \
for hosting in sale_packing_line_list]
self.assertNotEquals(hosting_1, hosting_2)
def _createComputer(self):
# Mimics WebSection_registerNewComputer
computer_reference = "COMP-%s" % self.portal.portal_ids.generateNewId(
......@@ -484,6 +558,10 @@ class TestVifibSlapWebService(testVifibMixin):
def stepSetRandomComputerReference(self, sequence, **kw):
sequence['computer_reference'] = str(random())
def stepSetRandomComputerPartition(self, sequence, **kw):
sequence.edit(computer_partition_reference=\
sequence["computer_partition_reference_list"][0])
def stepFormatComputer(self, sequence, **kw):
computer_partition_reference_list = []
computer_guid = sequence["computer_reference"]
......@@ -686,7 +764,6 @@ class TestVifibSlapWebService(testVifibMixin):
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
Logout
......@@ -698,7 +775,6 @@ class TestVifibSlapWebService(testVifibMixin):
SoftwareInstanceBuilding \
Tic \
SlapLogout \
\
LoginDefaultUser \
CheckComputerPartitionInstanceSetupSalePackingListStarted \
Logout \
......@@ -710,7 +786,6 @@ class TestVifibSlapWebService(testVifibMixin):
SoftwareInstanceAvailable
Tic
SlapLogout
LoginDefaultUser
SetSelectedComputerPartition
CheckComputerPartitionInstanceSetupSalePackingListStopped
......@@ -762,7 +837,6 @@ class TestVifibSlapWebService(testVifibMixin):
RequestSoftwareInstanceStart \
Tic \
Logout \
\
LoginDefaultUser \
CheckComputerPartitionInstanceHostingSalePackingListConfirmed \
Logout \
......@@ -938,25 +1012,6 @@ class TestVifibSlapWebService(testVifibMixin):
self.assertRaises(slap.NotFoundError,
self.slap.registerComputerPartition, computer_guid, partition_id)
def stepMarkSlavePartitionBusy(self, sequence, **kw):
slave_partition_uid = sequence['slave_partition_uid']
slave_partition = self.portal.portal_catalog.getResultValue(
uid=slave_partition_uid)
slave_partition.markBusy()
def stepCreateSlavePartition(self, sequence, **kw):
"""
Create a Slave Partition document.
"""
computer_partition_uid = sequence["computer_partition_uid"]
computer_partition = self.portal.portal_catalog.getResultValue(
uid=computer_partition_uid)
slave_partition = computer_partition.newContent(
portal_type=self.slave_partition_portal_type)
slave_partition.markFree()
# Mark newly created computer partition as free by default
sequence.edit(slave_partition_uid=slave_partition.getUid())
def stepSelect0QuantityComputerPartition(self, sequence, **kw):
sequence.edit(computer_partition_quantity=0)
......@@ -1018,6 +1073,30 @@ class TestVifibSlapWebService(testVifibMixin):
url = random_url
sequence.edit(software_release_uri=url)
def stepSelectDifferentSoftwareReleaseUri(self, sequence, **kw):
"""
Change the software release uri
"""
software_release_uri_list = sequence.get("software_release_uri_list", [])
software_release_uri = sequence.get("software_release_uri")
old_software_release_uri = software_release_uri
for uri in software_release_uri_list:
if uri != software_release_uri:
sequence.edit(software_release_uri=uri)
break
self.assertNotEquals(sequence["software_release_uri"],
old_software_release_uri)
def stepStoreSoftwareReleaseUri(self, sequence, **kw):
"""
Store the current software release uri in one list
"""
software_release_uri = sequence["software_release_uri"]
software_release_uri_list = sequence.get("software_release_uri_list", [])
if software_release_uri not in software_release_uri_list:
software_release_uri_list.append(software_release_uri)
sequence.edit(software_release_uri_list=software_release_uri_list)
def stepCheckSuccessSlapRegisterSoftwareReleaseCall(self, sequence, **kw):
"""
Check that slap.registerSoftwareRelease is successfully called.
......@@ -1242,89 +1321,75 @@ class TestVifibSlapWebService(testVifibMixin):
self.assertEqual('value',
slap_computer_partition.getConnectionParameter('parameter'))
def stepRequestSharedComputerPartition(self, sequence, **kw):
def stepRequestSlaveInstanceFromComputerPartition(self, sequence, **kw):
software_release_uri = sequence['software_release_uri']
requested_reference = sequence['requested_reference']
requested_parameter_dict = sequence['requested_parameter_dict']
software_instance_uid = sequence['software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
computer_partition = software_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type).getAggregateValue(
portal_type=self.computer_partition_portal_type)
computer = computer_partition
while computer.getPortalType() != self.computer_portal_type:
computer = computer.getParentValue()
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
slap_computer_partition = self.slap.registerComputerPartition(
computer.getReference(), computer_partition.getReference())
sequence['computer_reference'],
sequence['computer_partition_reference'])
software_type = None
raise NotImplementedError('software_type not propagated')
requested_slap_computer_partition = slap_computer_partition.request(
software_release=software_release_uri, software_type=software_type,
software_release=software_release_uri,
software_type="SlaveInstance",
partition_reference=requested_reference,
partition_parameter_kw=requested_parameter_dict, shared=True)
partition_parameter_kw=requested_parameter_dict,
# XXX The follow API should be slave, but shared was kept for
# Backward compatibility with older versions of slap
shared=True,
filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
sequence.edit(
requested_slap_computer_partition=requested_slap_computer_partition,
requested_computer_partition_reference=\
requested_slap_computer_partition.getId())
def stepRequestSharedComputerPartitionNotReadyResponse(self, sequence, **kw):
def stepRequestSlaveInstanceFromComputerPartitionNotReadyResponse(self, sequence, **kw):
software_release_uri = sequence['software_release_uri']
requested_reference = sequence['requested_reference']
requested_parameter_dict = sequence['requested_parameter_dict']
software_instance_uid = sequence['software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
computer_partition = software_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type).getAggregateValue(
portal_type=self.computer_partition_portal_type)
computer = computer_partition
while computer.getPortalType() != self.computer_portal_type:
computer = computer.getParentValue()
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
slap_computer_partition = self.slap.registerComputerPartition(
computer.getReference(), computer_partition.getReference())
software_type = None
raise NotImplementedError('software_type not propagated')
sequence['computer_reference'],
sequence['computer_partition_reference'])
# first try will raise slap.ResourceNotReady
self.assertRaises(slap.ResourceNotReady, slap_computer_partition.request,
software_release=software_release_uri, software_type=software_type,
self.assertRaises(slap.ResourceNotReady,
slap_computer_partition.request,
software_release=software_release_uri,
software_type="SlaveInstance",
partition_reference=requested_reference,
partition_parameter_kw=requested_parameter_dict, shared=True)
partition_parameter_kw=requested_parameter_dict,
shared=True,
filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
def stepRequestSharedComputerPartitionNotFoundResponse(self, sequence, **kw):
def stepRequestSlaveInstanceFromComputerPartitionNotFoundError(self, sequence, **kw):
software_release_uri = sequence['software_release_uri']
requested_reference = sequence['requested_reference']
requested_parameter_dict = sequence['requested_parameter_dict']
software_instance_uid = sequence['software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
computer_partition = software_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type).getAggregateValue(
portal_type=self.computer_partition_portal_type)
computer = computer_partition
while computer.getPortalType() != self.computer_portal_type:
computer = computer.getParentValue()
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
slap_computer_partition = self.slap.registerComputerPartition(
computer.getReference(), computer_partition.getReference())
software_type = None
raise NotImplementedError('software_type not propagated')
self.assertRaises(slap.NotFoundError, slap_computer_partition.request,
software_release=software_release_uri, sofware_type=software_type,
sequence['computer_reference'],
sequence['computer_partition_reference'])
self.assertRaises(slap.NotFoundError,
slap_computer_partition.request,
software_release=software_release_uri,
software_type="SlaveInstance",
partition_reference=requested_reference,
partition_parameter_kw=requested_parameter_dict, shared=True)
partition_parameter_kw=requested_parameter_dict,
shared=True,
filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
def stepRequestTwoAndCheckDifferentResult(self, sequence, **kw):
self.slap = slap.slap()
......@@ -1366,6 +1431,11 @@ class TestVifibSlapWebService(testVifibMixin):
requested_computer_partition_reference=\
requested_slap_computer_partition.getId())
def stepDirectRequestComputerPartitionNotReadyResponseWithoutStateAndSharedTrue(
self, sequence, **kw):
kw["shared"] = True
self.stepDirectRequestComputerPartitionNotReadyResponseWithoutState(
sequence, **kw)
def stepDirectRequestComputerPartitionNotReadyResponseWithoutState(self,
sequence, **kw):
......@@ -1374,15 +1444,16 @@ class TestVifibSlapWebService(testVifibMixin):
'software_release': sequence['software_release_uri'],
'software_type': sequence.get('requested_reference', 'requested_reference'),
'partition_reference': sequence.get('requested_reference', 'requested_reference'),
'shared_xml': xml_marshaller.dumps(False),
'shared_xml': xml_marshaller.dumps(kw.get("shared", False)),
'partition_parameter_xml': xml_marshaller.dumps({}),
'filter_xml': xml_marshaller.dumps({}),
#'state': Note: State is omitted
}
scheme, netloc, path, query, fragment = urlparse.urlsplit(self.server_url)
connection = httplib.HTTPConnection(host=netloc)
connection.request("POST", path + '/requestComputerPartition', urllib.urlencode(request_dict), {'Content-type': "application/x-www-form-urlencoded"})
connection.request("POST", path + '/requestComputerPartition',
urllib.urlencode(request_dict),
{'Content-type': "application/x-www-form-urlencoded"})
response = connection.getresponse()
self.assertEqual(httplib.REQUEST_TIMEOUT, response.status)
......@@ -1514,7 +1585,7 @@ class TestVifibSlapWebService(testVifibMixin):
computer_guid,
children_partition.getReference())
self.assertRaises(slap.ResourceNotReady, slap_computer_partition.request,
sofware_release=software_release_uri, software_type=requested_reference,
software_release=software_release_uri, software_type=requested_reference,
partition_reference=requested_reference,
partition_parameter_kw=requested_parameter_dict)
......@@ -2736,7 +2807,7 @@ class TestVifibSlapWebService(testVifibMixin):
'slap_server_url': self.server_url,
'slap_software_release_url': software_release_uri,
'slap_software_type': 'RootSoftwareInstance',
'slave_id_list': [],
'slave_instance_list': [],
'ip_list': [],
}
self.assertSameDict(expected, result)
......@@ -2831,7 +2902,7 @@ class TestVifibSlapWebService(testVifibMixin):
'slap_software_release_url': software_release_uri,
'slap_software_type': 'RootSoftwareInstance',
'test_parameter': 'lala',
'slave_id_list': [],
'slave_instance_list': [],
'ip_list': [],
}
self.assertSameDict(expected, result)
......@@ -3019,33 +3090,6 @@ class TestVifibSlapWebService(testVifibMixin):
portal_type=self.sale_packing_list_line_portal_type)
self.assertEqual(1, len(software_instance_sale_packing_list_line_list))
def stepCheckSoftwareInstanceAndRelatedSlavePartition(self,
sequence, **kw):
software_instance_uid = sequence['software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
# There should be only one predecessor
self.assertEqual(1, len(software_instance.getPredecessorList()))
self._checkSoftwareInstanceAndRelatedPartition(software_instance,
self.computer_partition_portal_type)
def stepCheckRequestedSoftwareInstanceAndRelatedSlavePartition(self,
sequence, **kw):
software_instance_uid = sequence['software_instance_uid']
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
# There should be only one predecessor
predecessor_list = software_instance.getPredecessorValueList()
self.assertEqual(1, len(predecessor_list))
predecessor = predecessor_list[0]
# This predecessor shall have only one related predecessor
self.assertEqual(1, len(predecessor.getPredecessorRelatedList()))
self._checkSoftwareInstanceAndRelatedPartition(predecessor,
self.slave_partition_portal_type)
def _checkSoftwareInstanceAndRelatedPartition(self, software_instance,
partition_portal_type=computer_partition_portal_type):
# There should be only one Sale Packing List Line
......@@ -3537,7 +3581,6 @@ class TestVifibSlapWebService(testVifibMixin):
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
Logout
LoginTestVifibCustomer
PersonRequestSoftwareInstance
......@@ -4425,246 +4468,1059 @@ class TestVifibSlapWebService(testVifibMixin):
RequestComputerPartitionNotFoundResponse \
Tic \
SlapLogout \
\
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
########################################
# ComputerPartition.request - shared
# ComputerPartition.request - slave
########################################
computer_with_software_release = """
CreateComputer
Tic
CreatePurchasePackingList
Tic
CreatePurchasePackingListLine
Tic
SelectNewSoftwareReleaseUri
CreateSoftwareRelease
Tic \
SubmitSoftwareRelease \
Tic \
CreateSoftwareProduct \
Tic \
ValidateSoftwareProduct \
Tic \
SetSoftwareProductToSoftwareRelease \
PublishByActionSoftwareRelease \
Tic
SetPurchasePackingListLineSetupResource
SetPurchasePackingListLineAggregate
ConfirmPurchasePackingList
StopPurchasePackingList
Tic
"""
requesting_computer_partition_with_software_instance = """
SelectNewComputerPartitionReference
CreateComputerPartition
CreateSalePackingList
Tic
CreateSalePackingListLine
Tic
SetSalePackingListLineSetupResource
SetSalePackingListLineAggregate
ConfirmSalePackingList
Tic
"""
slave_owner_computer_partition_with_software_instance = """
SelectNewComputerPartitionReference
CreateComputerPartition
SetSoftwareInstanceTitle
CreateSalePackingList
Tic
CreateSalePackingListLine
Tic
SetSalePackingListLineSetupResource
SetSalePackingListLineAggregate
ConfirmSalePackingList
Tic
SetComputerPartitionQuantity
Tic
SelectCurrentComputerPartitionAsSlaveOwner
"""
check_positive_request_shared = """
RequestSharedComputerPartitionNotReadyResponse
Tic
RequestSharedComputerPartition
CheckSoftwareInstanceAndRelatedSlavePartition
CheckRequestedSoftwareInstanceAndRelatedSlavePartition
"""
@skip('Not implemented')
def test_ComputerPartition_request_shared_simpleCase(self):
def test_ComputerPartition_request_slave_firstNotReady(self):
"""
Check that requesting shared partition works in system capable to fulfill
such request, with existing slave partition
Check that first call to request raises NotReadyResponse
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = \
self.computer_with_software_release +\
self.slave_owner_computer_partition_with_software_instance +\
"""
CreateSlavePartition
Tic
""" +\
self.requesting_computer_partition_with_software_instance +\
self.check_positive_request_shared
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
SelectEmptyRequestedParameterDict \
SetRandomRequestedReference \
RequestSlaveInstanceFromComputerPartitionNotReadyResponse \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
@skip('Not implemented')
def test_ComputerPartition_request_shared_simpleCase_noSlave(self):
def test_ComputerPartition_request_slave_simpleCase(self):
"""
Check that requesting shared partition works in system capable to fulfill
such request, with Slave Partition does not exist yet.
Check the most simple case of request. The behaviour should
keep the same as Software Instance.
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = \
self.computer_with_software_release +\
self.slave_owner_computer_partition_with_software_instance +\
self.requesting_computer_partition_with_software_instance +\
self.check_positive_request_shared
self.prepare_install_requested_computer_partition_sequence_string +\
"""
SlapLoginCurrentSoftwareInstance
SelectEmptyRequestedParameterDict \
SetRandomRequestedReference \
RequestSlaveInstanceFromComputerPartitionNotReadyResponse \
Tic \
SlapLogout \
\
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartition \
Tic \
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
check_notfound_request_shared = """
RequestSharedComputerPartitionNotFoundResponse
"""
@skip('Not implemented')
def test_ComputerPartition_request_shared_noAvailability(self):
def test_ComputerPartition_request_slave_instantiate(self):
"""
Check that requesting shared partition raises in case if there is no
free Slave Partition, with Slave Partition existing.
Check that one Slave Instance is instantiate correctly and the validate
the Sale Packing List states
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = \
self.computer_with_software_release +\
self.slave_owner_computer_partition_with_software_instance +\
"""
CreateSlavePartition
Tic
MarkSlavePartitionBusy
Tic
""" +\
self.requesting_computer_partition_with_software_instance +\
self.check_notfound_request_shared
self.prepare_install_requested_computer_partition_sequence_string +\
"""
SlapLoginCurrentSoftwareInstance
SelectEmptyRequestedParameterDict
SetRandomRequestedReference
RequestSlaveInstanceFromComputerPartitionNotReadyResponse
Tic
SlapLogout
SlapLoginCurrentSoftwareInstance
RequestSlaveInstanceFromComputerPartition
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentSoftwareInstance
CheckSlaveInstanceListFromOneComputerPartition
SelectSlaveInstanceFromOneComputerPartition
SlapLogout
LoginDefaultUser
SetDeliveryLineAmountEqualTwo
CheckComputerPartitionInstanceSetupSalePackingListConfirmed
SlapLogout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
SlapLogout
LoginDefaultUser \
CheckComputerPartitionInstanceSetupSalePackingListStopped
CheckComputerPartitionInstanceHostingSalePackingListConfirmed
Logout
SlapLoginCurrentComputer \
SoftwareInstanceStarted \
Tic \
SlapLogout \
\
LoginDefaultUser \
CheckComputerPartitionInstanceHostingSalePackingListStarted \
Logout \
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
@skip('Not implemented')
def test_ComputerPartition_request_shared_noAvailability_noSlave(self):
def test_ComputerPartition_request_slave_same_twice_SR(self):
"""
Check that requesting shared partition raises in case if there is no
free Slave Partition, with Slave Partition does not exist yet.
Check that requesting the same slave instance twice, only one is created
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = \
self.computer_with_software_release +\
self.slave_owner_computer_partition_with_software_instance +\
self.prepare_install_requested_computer_partition_sequence_string +\
"""
SlapLoginCurrentSoftwareInstance
SelectEmptyRequestedParameterDict
SelectRequestedReference
RequestSlaveInstanceFromComputerPartitionNotReadyResponse
Tic
SlapLogout
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartition \
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLogout
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartition \
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLogout
"""
Select0QuantityComputerPartition
SetComputerPartitionQuantity
Tic
""" +\
self.requesting_computer_partition_with_software_instance +\
self.check_notfound_request_shared
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
########################################
# Computer.getComputerPartitionList
########################################
def test_Computer_getComputerPartitionList_validatedComputer(self):
def test_ComputerPartition_request_slave_after_destroy_SlaveInstance(self):
"""
Check that getComputerPartitionList returns an empty result if the
validated computer is not related to any packing list.
Check that a Slave Instance will not be allocated when a Software
Instance is destroyed
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_string = \
self.prepare_installed_computer_partition_sequence_string + """
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
SlapLogout
SlapLoginCurrentSoftwareInstance
SelectEmptyRequestedParameterDict
SelectRequestedReference
RequestSlaveInstanceFromComputerPartitionNotFoundError
Tic
RequestSlaveInstanceFromComputerPartitionNotFoundError
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_emptyPartition(self):
def test_ComputerPartition_request_slave_twice_different(self):
"""
Check that getComputerPartitionList returns nothing if Computer Partition
is not related with proper Sale Packing List Line
Check request 2 different slave instances on same Software
Instance.
"""
simple_request_with_random = """
SlapLoginCurrentSoftwareInstance
SelectEmptyRequestedParameterDict \
SetRandomRequestedReference \
RequestSlaveInstanceFromComputerPartitionNotReadyResponse \
Tic \
SlapLogout \
\
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartition \
Tic \
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_string = \
self.prepare_install_requested_computer_partition_sequence_string +\
simple_request_with_random + """
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLogout
""" + \
simple_request_with_random + \
"""
SlapLoginCurrentComputer
CheckTwoSlaveInstanceListFromOneComputerPartition
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_twoEmptyPartition(self):
def test_ComputerPartition_request_slave_NotFound(self):
"""
Check that getComputerPartitionList returns nothing if Computer Partitions
are not related with proper Sale Packing List Lines
Check that requesting a Slave Instance works in system capable to fulfill
such request, when Software Instance is not installed yet.
"""
self.computer_partition_amount = 2
self.test_Computer_getComputerPartitionList_emptyPartition()
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_Computer_getComputerPartitionList_unknowComputerUid(self):
sequence_list = SequenceList()
sequence_string = '\
SlapLoginRandomComputer \
CheckUnauthorizedSlapGetComputerPartitionListCall \
SlapLogout \
'
sequence_string = self.prepare_formated_computer + """
LoginDefaultUser
SetRandomComputerPartition
SlapLoginCurrentComputer
SelectEmptyRequestedParameterDict
SetRandomRequestedReference
SelectNewSoftwareReleaseUri
RequestSlaveInstanceFromComputerPartitionNotFoundError
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_Computer_getComputerPartitionList_draftComputer(self):
def test_ComputerPartition_request_slave_state_is_optional(self):
"""Checks that state is optional parameter on Slap Tool This ensures
backward compatibility with old libraries."""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
sequence_string = \
self.prepare_install_requested_computer_partition_sequence_string + '\
SlapLoginCurrentSoftwareInstance \
DirectRequestComputerPartitionNotReadyResponseWithoutStateAndSharedTrue \
Tic \
Logout \
\
SlapLoginRandomComputer \
CheckUnauthorizedSlapGetComputerPartitionListCall \
SlapLogout \
'
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_validatedAndDraftComputer(self):
"""
Check that getComputerPartitionList returns an empty result if there are
one draft and one validated computer.
"""
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
Tic \
Logout \
' + self.prepare_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def stepSetRequestedWrongFilterParameterDict(self, sequence):
sequence['requested_filter_dict'] = dict(
computer_guid="COMP-99999999999999999999999")
def test_ComputerPartition_request_filter_slave_computer_guid(self):
"""Check that requesting with filter computer_guid key works as expected.
This include tests for slave instance case."""
self.computer_partition_amount = 2
sequence_list = SequenceList()
# There are two partitions on another computer
# so request shall be processed twice correctly, 3rd time it shall
# fail
sequence_string = \
self.prepare_install_requested_computer_partition_sequence_string + \
self.prepare_another_computer_sequence_string + '\
SelectAnotherRequestedReference \
SelectEmptyRequestedParameterDict \
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartitionNotFoundError \
Tic \
SlapLogout \
\
SlapLoginCurrentSoftwareInstance \
SetRequestedFilterParameterDict \
RequestSlaveInstanceFromComputerPartitionNotReadyResponse \
Tic \
SlapLogout \
\
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartition \
Tic \
SlapLogout \
\
SetRequestedWrongFilterParameterDict \
SelectYetAnotherRequestedReference \
SlapLoginCurrentSoftwareInstance \
RequestSlaveInstanceFromComputerPartitionNotFoundError \
Tic \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
#########################################
# SlaveInstance.request
#########################################
def stepLoginAsCustomerA(self, sequence):
global REMOTE_USER
REMOTE_USER = "test_vifib_customer_a"
self.login("test_vifib_customer_a")
def test_SlaveInstance_Person_request_with_Different_User(self):
"""
Check that user B can declare a slot of slave instance in computer
partition used by user A
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
SlapLogout
LoginAsCustomerA
PersonRequestSlaveInstance
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
CheckComputerPartitionSaleOrderAggregatedList
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_request_after_destroy_SlaveInstance(self):
"""
Check that a Slave Instance will not be allocated when a Software
Instance is destroyed
"""
sequence_list = SequenceList()
sequence_string = \
self.prepare_installed_computer_partition_sequence_string + """
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
SlapLogout
LoginTestVifibCustomer
PersonRequestSlaveInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
CheckSlaveInstanceNotReady
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Person_request_SlaveInstance(self):
"""
Check that one Slave Instance is created correctly
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
LoginTestVifibCustomer
PersonRequestSlaveInstance
Tic
Logout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SetSelectedComputerPartition
SelectCurrentlyUsedSalePackingListUid
Logout
LoginDefaultUser
CheckComputerPartitionSaleOrderAggregatedList
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_getInstanceParameterDict_with_SlaveInstance_stopped(self):
"""
Check that the Slave Instance is ignored when the state of Sale Packing
List in stopped.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_started_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLogout
LoginTestVifibCustomer
SlaveInstanceStopComputerPartitionInstallation
Tic
SlaveInstanceStarted
Tic
SlaveInstanceStopped
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListDelivered
SlapLoginCurrentComputer
CheckEmptySlaveInstanceListFromOneComputerPartition
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_getInstanceParameterDict_with_two_SlaveInstance(self):
"""
Check that with two Slave Instance installed in different computers, the
method getInstanceParameterDict returns correctly the slave instance list
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
LoginTestVifibCustomer
PersonRequestSlaveInstance
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic """ + self.prepare_formated_computer + """
Tic
LoginTestVifibDeveloper \
SelectNewSoftwareReleaseUri \
CreateSoftwareRelease \
Tic \
SubmitSoftwareRelease \
Tic \
CreateSoftwareProduct \
Tic \
ValidateSoftwareProduct \
Tic \
SetSoftwareProductToSoftwareRelease \
PublishByActionSoftwareRelease \
Tic
Logout \
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
Tic
LoginTestVifibCustomer
PersonRequestSoftwareInstance
ConfirmOrderedSaleOrderActiveSense
Tic
LoginTestVifibCustomer
PersonRequestSlaveInstance
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
CheckSlaveInstanceListFromOneComputerPartition
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Person_request_without_SoftwareInstance(self):
"""
Check that one Slave Instance will wait allocation correctly when no
exists Software Instance installed
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + \
self.prepare_published_software_release + """
Tic
LoginTestVifibCustomer
PersonRequestSlaveInstance
Tic
ConfirmOrderedSaleOrderActiveSense
Tic
CheckSlaveInstanceNotReady
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Person_request_with_Two_Different_ComputerPartition(self):
"""
Check that one Slave Instance is allocated correctly when exists two different
Software Instances and Computer Partition. The slave instance must be
allocated in Computer Partition that exists one Software Instance with
the same Software Release.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
StoreSoftwareReleaseUri
SetRandomComputerReference
""" + self.prepare_install_requested_computer_partition_sequence_string + """
Tic
LoginTestVifibCustomer
PersonRequestSlaveInstance
Tic
ConfirmOrderedSaleOrderActiveSense
Tic
CheckSlaveInstanceReady
CheckSlaveInstanceAllocationWithTwoDifferentSoftwareInstance
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Person_request_with_Two_Different_SoftwareInstance(self):
"""
Check that one Slave Instance is allocated correctly when exists two different
Software Instances. The slave instance must be allocated in the same
Computer Partition that exists one Software Instance installed.
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
StoreSoftwareReleaseUri
LoginTestVifibCustomer
PersonRequestSlaveInstance
ConfirmOrderedSaleOrderActiveSense
Tic
""" + self.prepare_published_software_release + """
Tic
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
LoginTestVifibCustomer
PersonRequestSoftwareInstance
ConfirmOrderedSaleOrderActiveSense
Tic
SelectDifferentSoftwareReleaseUri
LoginTestVifibCustomer
PersonRequestSlaveInstance
ConfirmOrderedSaleOrderActiveSense
Tic
CheckSlaveInstanceAssociationWithSoftwareInstance
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Person_request_twice(self):
"""
Check that request a Slave Instance twice, the instances are created
correctly
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
LoginAsCustomerA
PersonRequestSlaveInstance
SlapLogout
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
CheckTwoSlaveInstanceRequest
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
@skip("Not Implemented yet")
def test_request_SlaveInstance_without_enough_slots(self):
"""
Check the behaviour when one Slave Instance is requested and not exist one
available slot
"""
raise NotImplementedError
def test_SlaveInstance_request_start_when_SoftwareInstance_is_started(self):
"""
Check that the Slave Instance will be started correctly
XXX - Review the sequence of steps to verify that the scenario is
validating the feature of start a Instance Slave
"""
sequence_list = SequenceList()
sequence_string = self.prepare_started_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
SoftwareInstanceStarted
Tic
SetDeliveryLineAmountEqualTwo
CheckComputerPartitionInstanceHostingSalePackingListStarted
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_request_stop_from_SoftwareInstance(self):
"""
Check that the Slave Instance will be stopped correctly when
a Software Instance is stopped
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
LoginTestVifibCustomer
StartSoftwareInstanceFromCurrentComputerPartition
Tic
SoftwareInstanceStarted
Tic
SoftwareInstanceStopped
Tic
SetDeliveryLineAmountEqualTwo
CheckComputerPartitionInstanceHostingSalePackingListDelivered
CheckComputerPartitionInstanceSetupSalePackingListStopped
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_request_start_from_SoftwareInstance(self):
"""
Check that the Slave Instance will be started correctly when
a Software Instance is started
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLogout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
LoginTestVifibCustomer
StartSoftwareInstanceFromCurrentComputerPartition
Tic
Logout
SlapLoginCurrentComputer
SoftwareInstanceStarted
Tic
SlapLogout
LoginDefaultUser
SetDeliveryLineAmountEqualTwo
CheckComputerPartitionInstanceHostingSalePackingListStarted
CheckComputerPartitionInstanceSetupSalePackingListStopped
LoginTestVifibCustomer
RequestStopSoftwareInstanceFromCurrentComputerPartition
Tic
SlapLoginCurrentComputer
SoftwareInstanceStopped
Tic
CheckComputerPartitionInstanceHostingSalePackingListDelivered
StartSoftwareInstanceFromCurrentComputerPartition
Tic
SoftwareInstanceStarted
Tic
RequestStopSoftwareInstanceFromCurrentComputerPartition
Tic
SlapLoginCurrentComputer
SoftwareInstanceStopped
Tic
StartSoftwareInstanceFromCurrentComputerPartition
Tic
SoftwareInstanceStarted
Tic
CheckComputerPartitionInstanceHostingSalePackingListStarted
SetDeliveryLineAmountEqualZero
CheckComputerPartitionInstanceHostingSalePackingListConfirmed
Logout
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLogout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
LoginTestVifibCustomer
RequestSoftwareInstanceStart
Tic
Logout
SlapLoginCurrentComputer
SoftwareInstanceStarted
Tic
SetDeliveryLineAmountEqualThree
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListStarted
RequestStopSoftwareInstanceFromCurrentComputerPartition
Tic
SlapLoginCurrentComputer
SoftwareInstanceStopped
Tic
LoginTestVifibCustomer
StartSoftwareInstanceFromCurrentComputerPartition
Tic
SlapLoginCurrentComputer
SoftwareInstanceStarted
Tic
CheckComputerPartitionInstanceHostingSalePackingListStarted
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
prepare_started_slave_instance_sequence_string = \
prepare_started_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLogout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
LoginTestVifibCustomer
RequestStopSoftwareInstanceFromCurrentComputerPartition
Tic
SoftwareInstanceStopped
Tic
StartSoftwareInstanceFromCurrentComputerPartition
Tic
SoftwareInstanceStarted
Tic
Logout
LoginDefaultUser
SetDeliveryLineAmountEqualTwo
CheckComputerPartitionInstanceHostingSalePackingListStarted
CheckComputerPartitionInstanceSetupSalePackingListStopped
Logout
"""
def test_SlaveInstance_call_destroy_from_SoftwareInstance(self):
"""
Check that the Slave Instance will be stopped correctly when
a Software Instance is destroyed
"""
sequence_list = SequenceList()
sequence_string = self.prepare_started_slave_instance_sequence_string + """
LoginTestVifibCustomer
RequestDestroySoftwareInstanceFromCurrentComputerPartition
Tic
SetDeliveryLineAmountEqualOne
CheckComputerPartitionInstanceHostingSalePackingListStopped
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
SlapLoginSoftwareInstanceFromCurrentSoftwareInstance
SoftwareInstanceDestroyed
Tic
CheckComputerPartitionInstanceHostingSalePackingListStopped
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_request_stop(self):
"""
Check that the Slave Instance will be stopped correctly
XXX - Review the sequence of steps to verify that the scenario is
validating the feature of stop a Instance Slave
"""
sequence_list = SequenceList()
sequence_string = self.prepare_started_computer_partition_sequence_string + """
SlapLoginCurrentComputer
CheckEmptyComputerGetComputerPartitionCall
SlapLogout
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
CheckSuccessComputerGetComputerPartitionCall
SoftwareInstanceStarted
Tic
SlapLogout
LoginTestVifibCustomer
RequestSlaveInstanceStop
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListStopped
Logout
SlapLoginCurrentComputer
SoftwareInstanceAvailable
Tic
SoftwareInstanceStarted
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListDelivered
Logout
LoginTestVifibCustomer
RequestStopSoftwareInstanceFromCurrentComputerPartition
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceHostingSalePackingListStopped
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_request_destroy(self):
"""
Check that the Slave Instance will be destroyed correctly
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_check_permission_with_different_customer(self):
"""
Check that one Customer A can not view the Slave Instance of a Customer B
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
LoginTestVifibCustomer
PersonRequestSlaveInstance
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLogout
LoginAsCustomerA
CheckSlaveInstanceSecurityWithDifferentCustomer
PersonRequestSlaveInstance
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
SlapLogout
LoginTestVifibCustomer
CheckSlaveInstanceSecurityWithDifferentCustomer
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_Information_with_getInstanceParameterDict(self):
"""
Check that Computer Partition of user A is reinstanciated with new
parameters provided by user B. User B and Aget the right connection
parameter
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
SlapLoginCurrentComputer
CheckEmptySlaveInstanceListFromOneComputerPartition
LoginAsCustomerA
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_security_with_SoftwareInstance_user(self):
"""
Check that the software instance user can access a Slave Instance
installed in the same computer partition than your software instance
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
SlapLoginCurrentComputer
CheckEmptySlaveInstanceListFromOneComputerPartition
LoginTestVifibCustomer
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
StoreSalePackingListLineFromSlaveInstance
StoreSaleOrderFromSlaveInstance
SlapLoginCurrentComputer
CheckSlaveInstanceListFromOneComputerPartition
SlapLoginSoftwareInstanceFromCurrentSoftwareInstance
CheckSlaveInstanceAccessUsingCurrentSoftwareInstanceUser
CheckSalePackingListFromSlaveInstanceAccessUsingSoftwareInstanceUser
CheckSaleOrderFromSlaveInstanceAccessUsingSoftwareInstanceUser
CheckHostingSubscriptionFromSlaveInstanceAccessUsingSoftwareInstanceUser
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_SlaveInstance_update_connection_xml(self):
"""
Check that the connection_xml will be update correctly using portal_slap
"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
Tic
SlapLoginCurrentComputer
CheckEmptySlaveInstanceListFromOneComputerPartition
LoginAsCustomerA
PersonRequestSlaveInstance
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
SlapLoginSoftwareInstanceFromCurrentSoftwareInstance
SetConnectionXmlToSlaveInstance
CheckConnectionXmlFromSlaveInstance
CheckConnectionXmlFromSoftwareInstance
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
########################################
# Computer.getComputerPartitionList
########################################
def test_Computer_getComputerPartitionList_validatedComputer(self):
"""
Check that getComputerPartitionList returns an empty result if the
validated computer is not related to any packing list.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_emptyPartition(self):
"""
Check that getComputerPartitionList returns nothing if Computer Partition
is not related with proper Sale Packing List Line
"""
sequence_list = SequenceList()
sequence_string = self.prepare_formated_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_twoEmptyPartition(self):
"""
Check that getComputerPartitionList returns nothing if Computer Partitions
are not related with proper Sale Packing List Lines
"""
self.computer_partition_amount = 2
self.test_Computer_getComputerPartitionList_emptyPartition()
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_Computer_getComputerPartitionList_unknowComputerUid(self):
sequence_list = SequenceList()
sequence_string = '\
SlapLoginRandomComputer \
CheckUnauthorizedSlapGetComputerPartitionListCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
@expectedFailure
def test_Computer_getComputerPartitionList_draftComputer(self):
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
Tic \
Logout \
\
SlapLoginRandomComputer \
CheckUnauthorizedSlapGetComputerPartitionListCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_validatedAndDraftComputer(self):
"""
Check that getComputerPartitionList returns an empty result if there are
one draft and one validated computer.
"""
sequence_list = SequenceList()
sequence_string = '\
LoginTestVifibAdmin \
CreateDraftComputer \
Tic \
Logout \
' + self.prepare_computer + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# ERP5/Zope does not follow REST API beacuse it is not possible to configure
# Cookie Crumbler to ignore portal_slap
......@@ -4842,6 +5698,97 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_HostingResource_StartedState_with_slave(self):
"""
Check that calling Computer.getComputerPartitionList works in
started state with the hosting resource when a Slave Partition is present.
We validate checking more them one Slave Instance allocation.
"""
sequence_list = SequenceList()
sequence_string = self.prepare_started_computer_partition_sequence_string + '\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
\
LoginTestVifibCustomer \
PersonRequestSlaveInstance \
SlapLogout \
\
LoginDefaultUser \
ConfirmOrderedSaleOrderActiveSense \
Tic \
CheckComputerPartitionInstanceSetupSalePackingListConfirmed \
Logout \
\
SlapLoginCurrentComputer \
CheckSuccessComputerGetComputerPartitionCall \
SoftwareInstanceAvailable \
Tic \
CheckSuccessComputerGetComputerPartitionCall \
SoftwareInstanceStarted \
Tic \
SlapLogout \
\
LoginDefaultUser \
SetDeliveryLineAmountEqualTwo \
CheckComputerPartitionInstanceHostingSalePackingListStarted \
Logout \
\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
\
LoginTestVifibCustomer \
PersonRequestSlaveInstance \
SlapLogout \
\
LoginDefaultUser \
ConfirmOrderedSaleOrderActiveSense \
Tic \
Logout \
\
SlapLoginCurrentComputer \
SoftwareInstanceAvailable \
Tic \
CheckSuccessComputerGetComputerPartitionCall \
SoftwareInstanceStarted \
Tic \
SlapLogout \
\
LoginDefaultUser \
SetDeliveryLineAmountEqualThree \
CheckComputerPartitionInstanceHostingSalePackingListStarted \
Logout \
\
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
\
LoginTestVifibCustomer \
RequestSlaveInstanceStop \
Tic \
Logout \
\
SlapLoginCurrentComputer \
CheckSuccessComputerGetComputerPartitionCall \
SoftwareInstanceStarted \
Tic \
SlapLogout \
\
LoginDefaultUser \
SetDeliveryLineAmountEqualTwo \
CheckComputerPartitionInstanceHostingSalePackingListStarted \
SetDeliveryLineAmountEqualOne \
CheckComputerPartitionInstanceHostingSalePackingListDelivered \
Logout \
SlapLoginCurrentComputer \
CheckEmptyComputerGetComputerPartitionCall \
SlapLogout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_Computer_getComputerPartitionList_HostingResource_StoppedState(self):
"""
Check that calling Computer.getComputerPartitionList works in
......@@ -5398,6 +6345,303 @@ class TestVifibSlapWebService(testVifibMixin):
self.portal.portal_catalog.getResultValue(uid=sequence[
'purchase_packing_list_b_uid']).getSimulationState())
def stepCheckSlaveInstanceSecurityWithDifferentCustomer(self, sequence):
software_instance_uid = sequence["software_instance_uid"]
portal_membership = self.portal.portal_membership
username = portal_membership.getAuthenticatedMember().getUserName()
self.login()
software_instance = self.portal.portal_catalog.getResultValue(
uid=software_instance_uid)
self.failIfUserCanViewDocument(username, software_instance)
self.failIfUserCanAccessDocument(username, software_instance)
self.login(username)
def stepCheckTwoSlaveInstanceRequest(self, sequence):
computer_partition = self.portal.portal_catalog.getResultValue(
uid=sequence["computer_partition_uid"])
sale_packing_list_line_list = computer_partition.getAggregateRelatedValueList(
portal_type=self.sale_packing_list_line_portal_type)
portal_type_list = [self.software_instance_portal_type,
self.slave_instance_portal_type]
instance_list = filter(None, [obj.getAggregateValue(portal_type=portal_type_list) \
for obj in sale_packing_list_line_list])
portal_type_list = [instance.getPortalType() for instance in instance_list]
expected_portal_type_list = [self.slave_instance_portal_type,
self.slave_instance_portal_type,
self.software_instance_portal_type]
self.assertEquals(expected_portal_type_list, sorted(portal_type_list))
computer_partition_list = [obj.getAggregateValue(
portal_type=self.computer_partition_portal_type) \
for obj in sale_packing_list_line_list]
uid_list = [computer_partition.getUid() \
for computer_partition in computer_partition_list]
self.assertEquals(1, len(set(uid_list)))
def stepCheckSlaveInstanceReady(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
self.assertEquals(self.slave_instance_portal_type,
slave_instance.getPortalType())
sale_order_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_order_line_portal_type)
self.assertEquals("confirmed", sale_order_line.getSimulationState())
sale_packing_list_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type)
self.assertNotEquals(sale_packing_list_line.getAggregateValue(
portal_type=self.computer_partition_portal_type), None)
def stepCheckSlaveInstanceAssociationWithSoftwareInstance(self, sequence):
portal_catalog = self.portal.portal_catalog
computer_partition_reference_list = \
sequence['computer_partition_reference_list']
for reference in computer_partition_reference_list:
computer_partition = portal_catalog.getResultValue(
portal_type="Computer Partition", reference=reference)
sale_packing_list_line_list = portal_catalog(
portal_type="Sale Packing List Line",
aggregate_relative_url=computer_partition.getRelativeUrl())
software_release_uri_list = []
for sale_packing_list_line in sale_packing_list_line_list:
software_release_uri = sale_packing_list_line.getResultValue(
portal_type="Software Release")
software_release_uri_list.append(software_release_uri.getUrlString())
self.assertEquals(1, len(set(software_release_uri_list)))
def stepCheckSlaveInstanceAllocationWithTwoDifferentSoftwareInstance(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
self.assertEquals(self.slave_instance_portal_type,
slave_instance.getPortalType())
sale_packing_list_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type)
software_release = sale_packing_list_line.getAggregateValue(
portal_type=self.software_release_portal_type)
sale_packing_list_line_list = software_release.aggregateRelatedValues(
portal_type=self.sale_packing_list_line_portal_type)
computer_partition_list = [obj.getAggregateValue(
portal_type=self.computer_partition_portal_type)\
for obj in sale_packing_list_line_list]
self.assertEquals(computer_partition_list[0],
computer_partition_list[1])
self.assertEquals(computer_partition_list[0].getReference(),
computer_partition_list[1].getReference())
self.assertEquals(2, len(computer_partition_list))
def stepCheckSlaveInstanceNotReady(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
self.assertEquals(self.slave_instance_portal_type,
slave_instance.getPortalType())
sale_order_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_order_line_portal_type)
self.assertEquals("ordered", sale_order_line.getSimulationState())
self.assertRaises(ValueError, sale_order_line.confirm)
sale_packing_list_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type)
self.assertEquals(sale_packing_list_line, None)
def stepSelectSlaveInstanceFromOneComputerPartition(self, sequence):
slave_instance = self._getSlaveInstanceFromCurrentComputerPartition(sequence)
sequence.edit(software_instance_uid=slave_instance.getUid())
def stepCheckEmptySlaveInstanceListFromOneComputerPartition(self, sequence):
computer_guid = sequence["computer_reference"]
partition_id = sequence["computer_partition_reference"]
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
computer_partition = self.slap.registerComputerPartition(computer_guid,
partition_id)
parameter_dict = computer_partition.getInstanceParameterDict()
slave_instance_list = parameter_dict["slave_instance_list"]
self.assertEquals([], slave_instance_list)
def stepCheckSlaveInstanceListFromOneComputerPartition(self, sequence,
expected_amount=1):
computer_guid = sequence["computer_reference"]
partition_id = sequence["computer_partition_reference"]
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
computer_partition = self.slap.registerComputerPartition(computer_guid,
partition_id)
parameter_dict = computer_partition.getInstanceParameterDict()
self.assertEquals("RootSoftwareInstance",
parameter_dict["slap_software_type"])
slave_instance_list = parameter_dict["slave_instance_list"]
self.assertEquals(expected_amount, len(slave_instance_list))
for slave_instance in slave_instance_list:
self.assertEquals("SlaveInstance", slave_instance["slap_software_type"])
def stepCheckTwoSlaveInstanceListFromOneComputerPartition(self, sequence):
self.stepCheckSlaveInstanceListFromOneComputerPartition(sequence,
expected_amount=2)
def stepCheckSlaveInstanceAccessUsingCurrentSoftwareInstanceUser(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
portal_membership = self.portal.portal_membership
username = portal_membership.getAuthenticatedMember().getUserName()
self.assertUserCanViewDocument(username, slave_instance)
self.assertUserCanAccessDocument(username, slave_instance)
def stepSlapLoginSoftwareInstanceFromCurrentSoftwareInstance(self, sequence):
software_instance = self._getSoftwareInstanceFromCurrentComputerPartition(
sequence)
self.assertNotEquals(None, software_instance)
self.stepSlapLogout()
global REMOTE_USER
REMOTE_USER = software_instance.getReference()
self.login(software_instance.getReference())
def _getSoftwareInstanceFromCurrentComputerPartition(self, sequence):
query = ComplexQuery(
Query(aggregate_uid=sequence['computer_partition_uid']),
Query(aggregate_portal_type=self.software_instance_portal_type),
operator="AND")
software_instance = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line",
sort_on=(('movement.start_date', 'DESC'),),
query=query).getAggregateValue(portal_type="Software Instance")
return software_instance
def _getSlaveInstanceFromCurrentComputerPartition(self, sequence):
query = ComplexQuery(
Query(aggregate_uid=sequence['computer_partition_uid']),
Query(aggregate_portal_type=self.slave_instance_portal_type),
operator="AND")
slave_instance = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line",
query=query).getAggregateValue(portal_type=self.slave_instance_portal_type)
return slave_instance
def stepRequestDestroySoftwareInstanceFromCurrentComputerPartition(self, sequence):
software_instance = self._getSoftwareInstanceFromCurrentComputerPartition(
sequence)
software_instance.requestDestroyComputerPartition()
def stepStartSoftwareInstanceFromCurrentComputerPartition(self, sequence):
software_instance = self._getSoftwareInstanceFromCurrentComputerPartition(
sequence)
software_instance.requestStartComputerPartition()
def stepRequestStopSoftwareInstanceFromCurrentComputerPartition(self,
sequence):
software_instance = self._getSoftwareInstanceFromCurrentComputerPartition(
sequence)
software_instance.requestStopComputerPartition()
def stepCheckSalePackingListFromSlaveInstanceAccessUsingSoftwareInstanceUser(self,
sequence):
portal_membership = self.portal.portal_membership
sale_packing_list_line = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line",
uid=sequence["sale_packing_list_line_uid"])
username = portal_membership.getAuthenticatedMember().getUserName()
self.assertUserCanViewDocument(username, sale_packing_list_line)
self.failIfUserCanModifyDocument(username, sale_packing_list_line)
def stepCheckSaleOrderFromSlaveInstanceAccessUsingSoftwareInstanceUser(self,
sequence):
portal_membership = self.portal.portal_membership
sale_order = self.portal.portal_catalog.getResultValue(
portal_type="Sale Order",
uid=sequence["sale_order_uid"])
username = portal_membership.getAuthenticatedMember().getUserName()
self.assertUserCanViewDocument(username, sale_order)
self.failIfUserCanModifyDocument(username, sale_order)
def stepCheckHostingSubscriptionFromSlaveInstanceAccessUsingSoftwareInstanceUser(self,
sequence):
portal_membership = self.portal.portal_membership
sale_packing_list_line = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line",
uid=sequence["sale_packing_list_line_uid"])
hosting_subscription = sale_packing_list_line.getAggregateValue(
portal_type="Hosting Subscription")
username = portal_membership.getAuthenticatedMember().getUserName()
self.assertUserCanViewDocument(username, hosting_subscription)
self.failIfUserCanModifyDocument(username, hosting_subscription)
def stepStoreSaleOrderFromSlaveInstance(self, sequence):
sale_order_line = self.portal.portal_catalog.getResultValue(
portal_type="Sale Order Line",
aggregate_reference=sequence["software_instance_reference"])
sequence.edit(sale_order_line_uid=sale_order_line.getUid(),
sale_order_uid=sale_order_line.getParent().getUid())
def stepStoreSalePackingListLineFromSlaveInstance(self, sequence):
sale_packing_list_line = self.portal.portal_catalog.getResultValue(
portal_type="Sale Packing List Line",
aggregate_uid=sequence["software_instance_uid"])
sequence.edit(sale_packing_list_line_uid=sale_packing_list_line.getUid(),
sale_packing_list_uid=sale_packing_list_line.getParent().getUid())
def stepSetConnectionXmlToSlaveInstance(self, sequence):
computer_reference = sequence["computer_reference"]
computer_partition_reference = sequence["computer_partition_reference"]
site_url = "https://www.example.com:8080/"
connection_dict = dict(site_url=site_url)
slave_reference = sequence["software_instance_reference"]
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
computer_partition = self.slap.registerComputerPartition(
computer_reference, computer_partition_reference)
computer_partition.setConnectionDict(connection_dict)
sequence.edit(site_url=site_url)
connection_dict["site_url"] += "DeF45uef"
computer_partition.setConnectionDict(connection_dict,
slave_reference)
sequence.edit(slave_instance_site_url=site_url)
def stepCheckConnectionXmlFromSlaveInstance(self, sequence):
portal_catalog = self.portal.portal_catalog
slave_instance = portal_catalog.getResultValue(
reference=sequence["software_instance_reference"])
self.assertTrue(sequence["slave_instance_site_url"] in \
slave_instance.getConnectionXml())
def stepCheckConnectionXmlFromSoftwareInstance(self, sequence):
software_instance = self.portal.portal_catalog.getResultValue(
portal_type="Software Instance")
self.assertTrue("%s</parameter>" % sequence["site_url"] in \
software_instance.getConnectionXml())
def stepSlaveInstanceStarted(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence["software_instance_uid"])
slave_instance.startComputerPartition()
def stepRequestSlaveInstanceStart(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence["software_instance_uid"])
slave_instance.requestStartComputerPartition()
def stepRequestSlaveInstanceStop(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence["software_instance_uid"])
slave_instance.requestStopComputerPartition()
def stepSlaveInstanceStopped(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence["software_instance_uid"])
slave_instance.stopComputerPartition()
def stepSlaveInstanceStopComputerPartitionInstallation(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence["software_instance_uid"])
slave_instance.stopComputerPartitionInstallation()
def stepSetDeliveryLineAmountEqualZero(self, sequence):
sequence.edit(delivery_line_amount=0)
def stepSetDeliveryLineAmountEqualTwo(self, sequence):
sequence.edit(delivery_line_amount=2)
def stepSetDeliveryLineAmountEqualThree(self, sequence):
sequence.edit(delivery_line_amount=3)
def stepSetDeliveryLineAmountEqualOne(self, sequence):
sequence.edit(delivery_line_amount=1)
prepare_two_purchase_packing_list = \
prepare_software_release_purchase_packing_list + '\
LoginDefaultUser \
......@@ -7405,11 +8649,6 @@ class TestVifibSlapWebService(testVifibMixin):
Tic
SlapLogout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstanceNotReadyResponse
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
......@@ -7491,11 +8730,6 @@ class TestVifibSlapWebService(testVifibMixin):
Tic
SlapLogout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstanceNotReadyResponse
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
......@@ -7702,6 +8936,20 @@ class TestVifibSlapWebService(testVifibMixin):
def stepRestoreComputerPartitionReferenceFromBufferB(self, sequence, **kw):
sequence['computer_partition_reference'] = sequence['buffer_b_computer_partition_reference']
def stepCheckHostingSubscriptionMultipleComputerAuditor(self, sequence, **kw):
hosting_subscription = self.portal.portal_catalog.getResultValue(
uid=sequence['hosting_subscription_uid'])
role_list = hosting_subscription.get_local_roles()
setup_packing_list_line_list = [q for q in
hosting_subscription.getAggregateRelatedValueList(
portal_type='Sale Packing List Line') if q.getResource() ==
self.portal.portal_preferences.getPreferredInstanceSetupResource()]
computer_list = [q.getAggregateValue(
portal_type='Computer Partition').getParentValue() for q in
setup_packing_list_line_list]
for computer in computer_list:
self.assertTrue((computer.getReference(), ('Auditor',))) in role_list
def test_bug_destruction_of_partition_originated_from_another_computer(self):
"""Checks that computer is capable to destroy own Software Instance
......@@ -7963,16 +9211,104 @@ class TestVifibSlapWebService(testVifibMixin):
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
CheckComputerPartitionIsFree
Logout
LoginDefaultUser
CheckHostingSubscriptionMultipleComputerAuditor
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_bug_hosting_subscription_assignor_role_instability(self):
"""Show instability issue of Assignor role on Hosting Subscription
def test_bug_destruction_confirmed_instance_setup(self):
"""Proves that all is correctly handled in case of confirmed instance
setup packing list existence"""
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + \
"""
LoginTestVifibCustomer
RequestSoftwareInstanceDestroy
Tic
Logout
Related to fact when Hosting Subscription is associated to
Software Instances deployed on many computers"""
raise NotImplementedError
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
# Now there are two packing lists in confirmed state:
# * one for instance setup
# * one for instance destruction
# Simulate typical scenario:
# * stopped
# * commit
# * destroyed
# * commit
# * tic
SlapLoginCurrentComputer
SoftwareInstanceStopped
SoftwareInstanceDestroyed
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceSetupSalePackingListDelivered
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
CheckComputerPartitionIsFree
CheckComputerPartitionNoInstanceHostingSalePackingList
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_bug_destruction_with_cancelled_packing_list(self):
"""Proves that even if some packing lists are in cancelled state
it is possible to destroy software instance"""
sequence_list = SequenceList()
sequence_string = self.prepare_stopped_computer_partition_sequence_string + """
# Request destruction...
LoginDefaultUser
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
# and cancel current destruction.
LoginDefaultUser
SelectCurrentlyUsedSalePackingListUid
CancelSalePackingList
Tic
CheckComputerPartitionInstanceCleanupSalePackingListCancelled
Logout
# So all packing lists are finished, but one is cancelled,
# time to request destruction...
LoginDefaultUser
RequestSoftwareInstanceDestroy
Tic
Logout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
Logout
# ...and destroy it
SlapLoginCurrentComputer
SoftwareInstanceDestroyed
Tic
SlapLogout
LoginDefaultUser
CheckComputerPartitionInstanceCleanupSalePackingListDelivered
CheckComputerPartitionIsFree
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_bug_destruction_with_unfinished_packing_list(self):
"""Proves that even if some packing lists are not fully delivered
......@@ -8353,7 +9689,20 @@ class TestVifibSlapWebService(testVifibMixin):
DirectRequestComputerPartitionRaisesCyclicSoftwareTree
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
import erp5.document.SoftwareInstance
def makeTrue(*args, **kwargs):
return True
# Disable temporialy checkConnected in order to have only
# checkCyclic called
erp5.document.SoftwareInstance.original_checkConnected = \
erp5.document.SoftwareInstance.checkConnected
erp5.document.SoftwareInstance.checkConnected = makeTrue
try:
sequence_list.play(self)
finally:
erp5.document.SoftwareInstance.checkConnected = \
erp5.document.SoftwareInstance.original_checkConnected
del(erp5.document.SoftwareInstance.original_checkConnected)
def stepDirectRequestComputerPartitionRaisesValueError(self,
sequence, **kw):
......
......@@ -150,7 +150,7 @@ class OpenOrder(SlapDocument):
def request(self, software_release, partition_reference,
partition_parameter_kw=None, software_type=None, filter_kw=None,
state=None):
state=None, shared=False):
if partition_parameter_kw is None:
partition_parameter_kw = {}
if filter_kw is None:
......@@ -161,6 +161,7 @@ class OpenOrder(SlapDocument):
'partition_parameter_xml': xml_marshaller.dumps(partition_parameter_kw),
'filter_xml': xml_marshaller.dumps(filter_kw),
'state': xml_marshaller.dumps(state),
'shared_xml': xml_marshaller.dumps(shared),
}
if software_type is not None:
request_dict['software_type'] = software_type
......@@ -376,11 +377,12 @@ class ComputerPartition(SlapDocument):
else:
return self._software_release_document
def setConnectionDict(self, connection_dict):
def setConnectionDict(self, connection_dict, slave_reference=None):
self._connection_helper.POST('/setComputerPartitionConnectionXml', {
'computer_id': self._computer_id,
'computer_partition_id': self._partition_id,
'connection_xml': xml_marshaller.dumps(connection_dict)})
'connection_xml': xml_marshaller.dumps(connection_dict),
'slave_reference': slave_reference})
@_syncComputerPartitionInformation
def getConnectionParameter(self, key):
......
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