Commit 1ae88498 authored by Łukasz Nowak's avatar Łukasz Nowak

Merge remote-tracking branch 'origin/master' into performance-hack

parents 6c9d9c1c 04bbc8e7
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getCoordinateText("") != ""</string> </value> <value> <string>python: object.getCoordinateText("") != "" and context.getValidationState() != \'cancelled\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -40,10 +40,22 @@ ...@@ -40,10 +40,22 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>aggregate_category_membership_arity_constraint</string> </value> <value> <string>aggregate_category_membership_arity_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>max_arity</string> </key> <key> <string>max_arity</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>message_arity_not_in_range</string> </key> <key> <string>message_arity_not_in_range</string> </key>
<value> <string>One Software Product must be defined</string> </value> <value> <string>One Software Product must be defined</string> </value>
...@@ -68,9 +80,21 @@ ...@@ -68,9 +80,21 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Category Membership Arity Constraint</string> </value> <value> <string>Category Membership Arity Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getValidationState() != \'draft\'</string> </value> <value> <string>python: object.getValidationState() not in (\'draft\' , \'cancelled\')</string> </value>
</item> </item>
<item> <item>
<key> <string>use_acquisition</string> </key> <key> <string>use_acquisition</string> </key>
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getValidationState() != \'draft\'</string> </value> <value> <string>python: object.getValidationState() not in (\'draft\', \'cancelled\')</string> </value>
</item> </item>
<item> <item>
<key> <string>workflow_state_list</string> </key> <key> <string>workflow_state_list</string> </key>
......
...@@ -32,6 +32,18 @@ ...@@ -32,6 +32,18 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>contributor_state_constraint</string> </value> <value> <string>contributor_state_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>membership_portal_type_list</string> </key> <key> <string>membership_portal_type_list</string> </key>
<value> <string>python: (\'Person\',)</string> </value> <value> <string>python: (\'Person\',)</string> </value>
...@@ -44,6 +56,22 @@ ...@@ -44,6 +56,22 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Category Membership State Constraint</string> </value> <value> <string>Category Membership State Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getValidationState() != \'cancelled\'</string> </value>
</item>
<item> <item>
<key> <string>workflow_state_list</string> </key> <key> <string>workflow_state_list</string> </key>
<value> <string>python: \'validated\'</string> </value> <value> <string>python: \'validated\'</string> </value>
......
...@@ -53,6 +53,18 @@ ...@@ -53,6 +53,18 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>language_not_empty_constraint</string> </value> <value> <string>language_not_empty_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>message_attribute_match</string> </key> <key> <string>message_attribute_match</string> </key>
<value> <string>Language should be defined</string> </value> <value> <string>Language should be defined</string> </value>
...@@ -69,6 +81,22 @@ ...@@ -69,6 +81,22 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value> <value> <string>String Attribute Match Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getValidationState() != \'cancelled\'</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -53,6 +53,18 @@ ...@@ -53,6 +53,18 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>reference_not_empty_constraint</string> </value> <value> <string>reference_not_empty_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>message_attribute_match</string> </key> <key> <string>message_attribute_match</string> </key>
<value> <string>Reference must be defined</string> </value> <value> <string>Reference must be defined</string> </value>
...@@ -69,6 +81,22 @@ ...@@ -69,6 +81,22 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value> <value> <string>String Attribute Match Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getValidationState() != \'cancelled\'</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -53,6 +53,18 @@ ...@@ -53,6 +53,18 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>url_not_empty_constraint</string> </value> <value> <string>url_not_empty_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>message_attribute_match</string> </key> <key> <string>message_attribute_match</string> </key>
<value> <string>URL must be defined</string> </value> <value> <string>URL must be defined</string> </value>
...@@ -69,6 +81,22 @@ ...@@ -69,6 +81,22 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value> <value> <string>String Attribute Match Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getValidationState() != \'cancelled\'</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getUrlString("") != ""</string> </value> <value> <string>python: object.getUrlString("") != "" and context.getValidationState() != \'cancelled\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -53,6 +53,18 @@ ...@@ -53,6 +53,18 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>version_not_empty_constraint</string> </value> <value> <string>version_not_empty_constraint</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>message_attribute_match</string> </key> <key> <string>message_attribute_match</string> </key>
<value> <string>Version should be defined</string> </value> <value> <string>Version should be defined</string> </value>
...@@ -69,6 +81,22 @@ ...@@ -69,6 +81,22 @@
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </value> <value> <string>String Attribute Match Constraint</string> </value>
</item> </item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getValidationState() != \'cancelled\'</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</item> </item>
<item> <item>
<key> <string>test_tales_expression</string> </key> <key> <string>test_tales_expression</string> </key>
<value> <string>python: object.getVersion("") != ""</string> </value> <value> <string>python: object.getVersion("") != "" and context.getValidationState() != \'cancelled\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
394 395
\ No newline at end of file \ No newline at end of file
...@@ -50,26 +50,17 @@ ...@@ -50,26 +50,17 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>subscription_item = context.getAggregateValue(portal_type="Hosting Subscription")\n <value> <string>portal = context.getPortalObject()\n
subscription_item = context.getAggregateValue(portal_type="Hosting Subscription")\n
\n \n
line_list = context.portal_catalog(\n line_list = context.portal_catalog(\n
portal_type="Sale Packing List Line",\n portal_type=["Sale Order Line", "Sale Packing List Line"],\n
resource_relative_url=context.portal_preferences.getPreferredInstanceSetupResource(),\n default_resource_uid=portal.restrictedTraverse(context.portal_preferences.getPreferredInstanceSetupResource()).getUid(),\n
aggregate_uid=subscription_item.getUid())\n default_aggregate_uid=subscription_item.getUid())\n
\n
order_line_list = context.portal_catalog( \n
portal_type="Sale Order Line",\n
resource_relative_url=context.portal_preferences.getPreferredInstanceSetupResource(),\n
aggregate_relative_url=subscription_item.getRelativeUrl(),\n
simulation_state="ordered")\n
\n
# XXX order line has to display (as order is under approval)\n
\n \n
portal_type_list = ["Software Instance", "Slave Instance"]\n portal_type_list = ["Software Instance", "Slave Instance"]\n
result = [x.getAggregateValue(portal_type=portal_type_list) for x in line_list]\n instance_dict = dict([(x.getAggregate(portal_type=portal_type_list), 0) for x in line_list])\n
result.extend([x.getAggregateValue(portal_type=portal_type_list) for x in order_line_list])\n return [portal.restrictedTraverse(x) for x in instance_dict.keys()]\n
# result.extend([x.getObject() for x in order_line_list])\n
return result\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
166 167
\ No newline at end of file \ No newline at end of file
...@@ -80,7 +80,7 @@ state_list.extend(portal.getPortalTransitInventoryStateList())\n ...@@ -80,7 +80,7 @@ state_list.extend(portal.getPortalTransitInventoryStateList())\n
state_list.extend(portal.getPortalCurrentInventoryStateList())\n state_list.extend(portal.getPortalCurrentInventoryStateList())\n
\n \n
packing_list_line = portal.portal_catalog.getResultValue(\n packing_list_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List Line\',\n portal_type=portal_type,\n
simulation_state=state_list,\n simulation_state=state_list,\n
aggregate_uid=software_instance.getUid(),\n aggregate_uid=software_instance.getUid(),\n
default_resource_uid=service_uid_list,\n default_resource_uid=service_uid_list,\n
...@@ -95,7 +95,7 @@ return packing_list_line\n ...@@ -95,7 +95,7 @@ return packing_list_line\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>service_relative_url=None</string> </value> <value> <string>service_relative_url=None, portal_type="Sale Packing List Line"</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -56,7 +56,11 @@ if context.getPortalType() == "Sale Order Line":\n ...@@ -56,7 +56,11 @@ if context.getPortalType() == "Sale Order Line":\n
\n \n
sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine()\n sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine()\n
if sale_packing_list_line is None:\n if sale_packing_list_line is None:\n
return \'Destroyed\'\n sale_packing_list_line = context.SoftwareInstance_getInstancePackingListLine(portal_type="Sale Order Line")\n
if sale_packing_list_line is None:\n
# Let\'s hope the sale order is not indexed yet\n
return \'Looking for a free partition\'\n
\n
service_url = sale_packing_list_line.getResource()\n service_url = sale_packing_list_line.getResource()\n
\n \n
portal_preferences = context.getPortalObject().portal_preferences\n portal_preferences = context.getPortalObject().portal_preferences\n
...@@ -64,8 +68,12 @@ simulation_state = sale_packing_list_line.getSimulationState()\n ...@@ -64,8 +68,12 @@ simulation_state = sale_packing_list_line.getSimulationState()\n
if service_url == portal_preferences.getPreferredInstanceSetupResource():\n if service_url == portal_preferences.getPreferredInstanceSetupResource():\n
if simulation_state == \'delivered\':\n if simulation_state == \'delivered\':\n
return \'Destroyed\'\n return \'Destroyed\'\n
elif simulation_state in (\'confirmed\', \'started\'):\n elif simulation_state in (\'confirmed\', ):\n
return \'Waiting for partition instanciation\'\n
elif simulation_state in (\'started\', ):\n
return \'Instanciation in progress\'\n return \'Instanciation in progress\'\n
elif simulation_state in (\'ordered\', ):\n
return \'Looking for a free partition\'\n
return \'Stopped\'\n return \'Stopped\'\n
elif service_url == portal_preferences.getPreferredInstanceCleanupResource():\n elif service_url == portal_preferences.getPreferredInstanceCleanupResource():\n
if simulation_state == \'delivered\':\n if simulation_state == \'delivered\':\n
...@@ -80,8 +88,8 @@ elif service_url == portal_preferences.getPreferredInstanceHostingResource():\n ...@@ -80,8 +88,8 @@ elif service_url == portal_preferences.getPreferredInstanceHostingResource():\n
return \'Stop in progress\'\n return \'Stop in progress\'\n
elif simulation_state == \'delivered\':\n elif simulation_state == \'delivered\':\n
return \'Stopped\'\n return \'Stopped\'\n
else:\n \n
return \'Unknown\'\n return \'Unable to calculate the status...\'\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
590 592
\ No newline at end of file \ No newline at end of file
<?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>v = context.getProperty(\'connection_key\')\n
\n
if v is not None and v.startswith(\'http:\') or v.startswith(\'https:\'):\n
return v\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kwargs</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstanceConnectionKey_renderURL</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>v = context.getProperty(\'connection_value\')\n
\n
if v is not None and v.startswith(\'http\'):\n
return v\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kwargs</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstanceConnectionValue_renderURL</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.ERP5Type.Document import newTempDocument\n
\n
return_list = []\n
try:\n
connection_dict = context.getConnectionXmlAsDict()\n
except:\n
return return_list\n
\n
if connection_dict is None:\n
return return_list\n
\n
portal = context.getPortalObject()\n
for k, v in connection_dict.iteritems():\n
d = newTempDocument(portal, \'temp\')\n
d.edit(connection_key=k, connection_value=v)\n
return_list.append(d)\n
return return_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kwargs</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getConnectionParameterList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<key> <string>normal bis</string> </key> <key> <string>normal bis</string> </key>
<value> <value>
<list> <list>
<string>your_connection_xml</string> <string>your_connection_listbox</string>
</list> </list>
</value> </value>
</item> </item>
......
328 330
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment