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

Fill table while catalogging computers.

parent d295ca9c
<?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>computer = context.getAggregateValue(portal_type=\'Computer\')\n
if computer.getAllocationScope() == \'open/public\':\n
return computer.getUid()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PurchasePackingListLine_getPublicComputerUid</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>return context.getAggregateValue(portal_type=\'Software Release\').getUid()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PurchasePackingListLine_getSoftwareReleaseUid</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>return context.getAggregateValue(portal_type=\'Software Release\').getUrlString()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PurchasePackingListLine_getSoftwareReleaseUrlString</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
484
\ No newline at end of file
485
\ 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() == 'Purchase Packing List Line' and context.getResource() == context.getPortalObject().portal_preferences.getPreferredSoftwareSetupResource()</value>
<value>python: context.getPortalType() == 'Computer'</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>potral_type</value>
......
......@@ -54,7 +54,7 @@
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
DELETE FROM software_release WHERE delivery_line_uid=<dtml-sqlvar uid type=int>\n
DELETE FROM software_release WHERE computer_uid=<dtml-sqlvar uid type=int>\n
]]></string> </value>
......
......@@ -6,7 +6,7 @@
<value>1</value>
</item>
<item key="_filter_expression_archive" type="str">
<value>python: context.getPortalType() == 'Purchase Packing List Line' and context.getResource() == context.getPortalObject().portal_preferences.getPreferredSoftwareSetupResource()</value>
<value>python: context.getPortalType() == 'Computer'</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>portal_type</value>
......
......@@ -15,10 +15,9 @@
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\r\n
PurchasePackingListLine_getPublicComputerUid\r\n
PurchasePackingListLine_getSoftwareReleaseUrlString\r\n
PurchasePackingListLine_getSoftwareReleaseUid\r\n
getSimulationState</string> </value>
getAllocationScope\r\n
getCapacityScope\r\n
Computer_getSoftwareReleaseUrlStringList</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
......@@ -62,36 +61,34 @@ DELETE FROM\n
software_release\n
WHERE\n
<dtml-in uid>\n
delivery_line_uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
computer_uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "PurchasePackingListLine_getPublicComputerUid[loop_item]">\n
<dtml-call expr="row_list.append(loop_item)">\n
</dtml-if>\n
</dtml-in>\n
\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-let row_list="[]">\n
<dtml-if expr="getAllocationScope[loop_item] == \'open/public\' and getCapacityScope[loop_item] == \'open\'">\n
<dtml-in prefix="release" expr="Computer_getSoftwareReleaseUrlStringList[loop_item]">\n
<dtml-call expr="row_list.append(release_item)">\n
</dtml-in> \n
</dtml-if>\n
<dtml-if "row_list">\n
INSERT INTO\n
software_release (delivery_line_uid, computer_uid, uid, url, state)\n
software_release (computer_uid, url)\n
VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\n
<dtml-sqlvar expr="uid[row_item]" type="int">,\n
<dtml-sqlvar expr="PurchasePackingListLine_getPublicComputerUid[row_item]" type="int">,\n
<dtml-sqlvar expr="PurchasePackingListLine_getSoftwareReleaseUid[row_item]" type="int">,\n
<dtml-sqlvar expr="PurchasePackingListLine_getSoftwareReleaseUrlString[row_item]" type="string">,\n
<dtml-sqlvar expr="getSimulationState[row_item]" type="string">\n
<dtml-sqlvar expr="uid[loop_item]" type="int">,\n
<dtml-sqlvar expr="row_item" type="string">\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n
</dtml-if>\n
</dtml-let>\n
</dtml-in>
]]></string> </value>
</item>
......
......@@ -59,12 +59,9 @@
<item>
<key> <string>src</string> </key>
<value> <string>CREATE TABLE `software_release` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`computer_uid` BIGINT UNSIGNED NOT NULL,\n
`delivery_line_uid` BIGINT UNSIGNED NOT NULL,\n
`url` varchar(255),\n
`state` varchar(255),\n
PRIMARY KEY (`uid`, `delivery_line_uid`)\n
PRIMARY KEY (`computer_uid`, `url`)\n
) ENGINE=InnoDB;\n
</string> </value>
</item>
......
41
\ No newline at end of file
42
\ 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