Commit 8b34ae1b authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify Software Catalog management.

Show only published Software Products which have preselected the best possible
Software Release and reneder link to directly order this one.

Instead of using cryptic table and Software Product unrealted interactions run
alarm few times per day, which will select the best possible (if available)
Software Release for each Software Product.
parent e7a76c0c
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</item> </item>
<item> <item>
<key> <string>custom_render_method_id</string> </key> <key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_viewPublicSoftwareReleaseList</string> </value> <value> <string>WebSection_viewPublicSoftwareProductList</string> </value>
</item> </item>
<item> <item>
<key> <string>default_page_displayed</string> </key> <key> <string>default_page_displayed</string> </key>
......
108 109
\ No newline at end of file \ No newline at end of file
<catalog_method>
<item key="sql_clear_catalog" type="int">
<value>1</value>
</item>
</catalog_method>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z0_drop_software_release</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string>DROP TABLE IF EXISTS software_release</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<catalog_method>
<item key="sql_uncatalog_object" type="int">
<value>1</value>
</item>
<item key="_is_filtered_archive" type="int">
<value>1</value>
</item>
<item key="_filter_expression_archive" type="str">
<value>python: context.getPortalType() == 'Computer'</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>potral_type</value>
</item>
</catalog_method>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z0_uncatalog_software_release</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
DELETE FROM software_release WHERE computer_uid=<dtml-sqlvar uid type=int>\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<catalog_method>
<item key="sql_catalog_object_list" type="int">
<value>1</value>
</item>
<item key="_is_filtered_archive" type="int">
<value>1</value>
</item>
<item key="_filter_expression_archive" type="str">
<value>python: context.getPortalType() == 'Computer'</value>
</item>
<item key="_filter_expression_cache_key_archive" type="tuple">
<value>portal_type</value>
</item>
</catalog_method>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid\r\n
getAllocationScope\r\n
getCapacityScope\r\n
Computer_getSoftwareReleaseUrlStringList</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_catalog_software_release_list</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
DELETE FROM\n
software_release\n
WHERE\n
<dtml-in uid>\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
\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 (computer_uid, url)\n
VALUES\n
<dtml-in prefix="row" expr="row_list">\n
(\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>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<catalog_method>
<item key="sql_clear_catalog" type="int">
<value>1</value>
</item>
</catalog_method>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_create_software_release</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string>CREATE TABLE `software_release` (\n
`computer_uid` BIGINT UNSIGNED NOT NULL,\n
`url` varchar(255),\n
PRIMARY KEY (`computer_uid`, `url`)\n
) ENGINE=InnoDB;\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<key_list> <key_list>
<key>computer_partition</key> <key>computer_partition</key>
<key>software_instance_tree</key> <key>software_instance_tree</key>
<key>software_release</key>
</key_list> </key_list>
\ No newline at end of file
42 43
\ No newline at end of file \ No newline at end of file
erp5_mysql_innodb/z0_drop_computer_partition erp5_mysql_innodb/z0_drop_computer_partition
erp5_mysql_innodb/z0_drop_software_instance_tree erp5_mysql_innodb/z0_drop_software_instance_tree
erp5_mysql_innodb/z0_drop_software_release
erp5_mysql_innodb/z0_uncatalog_computer_partition erp5_mysql_innodb/z0_uncatalog_computer_partition
erp5_mysql_innodb/z0_uncatalog_software_instance erp5_mysql_innodb/z0_uncatalog_software_instance
erp5_mysql_innodb/z0_uncatalog_software_release
erp5_mysql_innodb/z_catalog_computer_partition_list erp5_mysql_innodb/z_catalog_computer_partition_list
erp5_mysql_innodb/z_catalog_email_list erp5_mysql_innodb/z_catalog_email_list
erp5_mysql_innodb/z_catalog_no_workflow_date_object_list erp5_mysql_innodb/z_catalog_no_workflow_date_object_list
erp5_mysql_innodb/z_catalog_object_list erp5_mysql_innodb/z_catalog_object_list
erp5_mysql_innodb/z_catalog_software_instance_list erp5_mysql_innodb/z_catalog_software_instance_list
erp5_mysql_innodb/z_catalog_software_release_list
erp5_mysql_innodb/z_create_computer_partition erp5_mysql_innodb/z_create_computer_partition
erp5_mysql_innodb/z_create_software_instance_tree erp5_mysql_innodb/z_create_software_instance_tree
erp5_mysql_innodb/z_create_software_release
erp5_mysql_innodb/z_create_versioning erp5_mysql_innodb/z_create_versioning
\ No newline at end of file
computer_partition computer_partition
software_instance_tree software_instance_tree
software_release \ No newline at end of file
\ No newline at end of file
...@@ -51,10 +51,6 @@ ...@@ -51,10 +51,6 @@
<type>Slave Instance</type> <type>Slave Instance</type>
<workflow>slap_interaction_workflow</workflow> <workflow>slap_interaction_workflow</workflow>
</chain> </chain>
<chain>
<type>Software Installation</type>
<workflow>slap_interaction_workflow</workflow>
</chain>
<chain> <chain>
<type>Software Instance</type> <type>Software Instance</type>
<workflow>slap_interaction_workflow</workflow> <workflow>slap_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>software_installation = state_change[\'object\']\n
\n
computer = software_installation.getAggregateValue(portal_type="Computer")\n
if computer is None:\n
raise ValueError("Software Installation \'%s\' should have a computer aggregated" % software_installation.getRelativeUrl())\n
else:\n
tag = "%s_reindex" % software_installation.getRelativeUrl()\n
# As software is installed, reindex the computer to mark the computer partition as installable\n
software_installation.reindexObject(activate_kw={\'tag\': tag})\n
computer.activate(after_tag=tag).recursiveReindexObject()\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>SoftwareInstallation_reindexAggregatedComputer</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
811 812
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,6 @@ Sale Invoice Transaction | slap_interaction_workflow ...@@ -14,7 +14,6 @@ Sale Invoice Transaction | slap_interaction_workflow
Sale Packing List Line | slap_interaction_workflow Sale Packing List Line | slap_interaction_workflow
Sale Packing List | slap_interaction_workflow Sale Packing List | slap_interaction_workflow
Slave Instance | slap_interaction_workflow Slave Instance | slap_interaction_workflow
Software Installation | slap_interaction_workflow
Software Instance | slap_interaction_workflow Software Instance | slap_interaction_workflow
Software Release | slap_interaction_workflow Software Release | slap_interaction_workflow
Virtio Partition | computer_partition_slap_interface_workflow Virtio Partition | computer_partition_slap_interface_workflow
......
...@@ -2,94 +2,100 @@ ...@@ -2,94 +2,100 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/> <global name="Alarm" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>actbox_category</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>workflow</string> </value> <value> <string>Alarm_manageSoftwareCatalog</string> </value>
</item> </item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>activate_script_name</string> </key> <key> <string>id</string> </key>
<value> <value> <string>manage_software_catalog</string> </value>
<tuple/>
</value>
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>periodicity_day_frequency</string> </key>
<value> <value>
<list> <none/>
<string>SoftwareInstallation_reindexAggregatedComputer</string>
</list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>before_commit_script_name</string> </key> <key> <string>periodicity_hour</string> </key>
<value> <value>
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>periodicity_hour_frequency</string> </key>
<value> <string></string> </value> <value> <int>8</int> </value>
</item> </item>
<item> <item>
<key> <string>guard</string> </key> <key> <string>periodicity_minute</string> </key>
<value> <value>
<none/> <tuple/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>periodicity_minute_frequency</string> </key>
<value> <string>SoftwareInstallation_start_destroy</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>method_id</string> </key> <key> <string>periodicity_month</string> </key>
<value> <value>
<list> <tuple/>
<string>requestStart</string>
<string>requestDestroy</string>
</list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>once_per_transaction</string> </key> <key> <string>periodicity_month_day</string> </key>
<value> <int>1</int> </value> <value>
<tuple/>
</value>
</item> </item>
<item> <item>
<key> <string>portal_type_filter</string> </key> <key> <string>periodicity_start_date</string> </key>
<value> <value>
<list> <object>
<string>Software Installation</string> <klass>
</list> <global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>3660.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value> </value>
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>periodicity_week</string> </key>
<value> <value>
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>temporary_document_disallowed</string> </key> <key> <string>portal_type</string> </key>
<value> <int>1</int> </value> <value> <string>Alarm</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string>Manages entires in Software Catalog</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </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>from Products.ERP5Type.Cache import CachingMethod\n
\n
def getSoftwareReleaseList(**kw):\n
software_product_list = []\n
for sr in context.Base_getAvailableSoftwareReleaseList(**kw):\n
sp = sr.getAggregateValue()\n
if sp not in software_product_list:\n
software_product_list.append(sp)\n
return software_product_list\n
\n
return CachingMethod(getSoftwareReleaseList, id=\'getSoftwareReleaseList\', cache_factory=\'erp5_content_short\')(**kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getAvailableSoftwareProductList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -50,17 +50,9 @@ ...@@ -50,17 +50,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>software_release = context.getAggregateValue(portal_type=\'Software Release\')\n
\n if software_release is not None:\n
software_release = portal.portal_catalog.getResultValue(\n return software_release.absolute_url() + "/SoftwareRelease_viewRequestDialog"\n
portal_type="Software Release",\n
default_aggregate_uid=context.getUid(),\n
validation_state="published",\n
sort_on=((\'indexation_timestamp\', \'DESC\')),\n
**{\'software_release.state\': [\'delivered\', \'stopped\']}\n
)\n
\n
return software_release.absolute_url() + "/SoftwareRelease_viewRequestDialog"\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -43,7 +43,11 @@ ...@@ -43,7 +43,11 @@
</item> </item>
<item> <item>
<key> <string>edit_order</string> </key> <key> <string>edit_order</string> </key>
<value> <string>[]</string> </value> <value>
<list>
<string>[]</string>
</list>
</value>
</item> </item>
<item> <item>
<key> <string>encoding</string> </key> <key> <string>encoding</string> </key>
...@@ -110,7 +114,7 @@ ...@@ -110,7 +114,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSection_viewPublicSoftwareReleaseList</string> </value> <value> <string>WebSection_viewPublicSoftwareProductList</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -118,7 +122,7 @@ ...@@ -118,7 +122,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>WebSection_viewPublicSoftwareReleaseList</string> </value> <value> <string>WebSection_viewPublicSoftwareProductList</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
...@@ -134,7 +138,7 @@ ...@@ -134,7 +138,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Software Releases</string> </value> <value> <string>Software Products</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<value> <value>
<list> <list>
<string>columns</string> <string>columns</string>
<string>default_params</string>
<string>hide_rows_on_no_search_criterion</string> <string>hide_rows_on_no_search_criterion</string>
<string>list_method</string> <string>list_method</string>
<string>portal_types</string> <string>portal_types</string>
...@@ -63,6 +64,16 @@ ...@@ -63,6 +64,16 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -71,10 +82,38 @@ ...@@ -71,10 +82,38 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</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> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -101,6 +140,21 @@ ...@@ -101,6 +140,21 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>default_params</string> </key>
<value>
<list>
<tuple>
<string>checked_permission</string>
<string>View</string>
</tuple>
<tuple>
<string>default_aggregate_uid</string>
<string>!= -1</string>
</tuple>
</list>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value> <value> <string>my_list_mode_listbox</string> </value>
...@@ -116,13 +170,18 @@ ...@@ -116,13 +170,18 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>Software Product</string>
<string>Software Product</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -131,7 +190,7 @@ ...@@ -131,7 +190,7 @@
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>vifib_public_software_release_selection4</string> </value> <value> <string>public_software_product_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
...@@ -139,7 +198,7 @@ ...@@ -139,7 +198,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Software Releases</string> </value> <value> <string>Software Products</string> </value>
</item> </item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
...@@ -167,6 +226,19 @@ ...@@ -167,6 +226,19 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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: [(\'default_aggregate_uid\', "!= -1")]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
</pickle> </pickle>
...@@ -174,7 +246,7 @@ ...@@ -174,7 +246,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>Base_getAvailableSoftwareProductList</string> </value> <value> <string>portal_catalog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,19 +50,24 @@ ...@@ -50,19 +50,24 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>kw[\'software_release.state\'] = [\'stopped\']\n <value> <string>portal = context.getPortalObject()\n
return context.portal_catalog(\n portal.portal_catalog.searchAndActivate(\n
**kw\n portal_type=\'Software Product\',\n
validation_state=\'published\',\n
method_id=\'SoftwareProduct_manageSoftwareCatalog\',\n
activate_kw={\'tag\': tag}\n
)\n )\n
\n
context.activate(after_tag=tag).getId()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>tag, fixit, params</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_getAvailableSoftwareReleaseList</string> </value> <value> <string>Alarm_manageSoftwareCatalog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,26 +50,41 @@ ...@@ -50,26 +50,41 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Fetch computer to find witch software is installed"""\n <value> <string encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_type = "Software Release"\n
\n \n
url_string_list = context.Computer_getSoftwareReleaseUrlStringList()\n software_release_url = None\n
if url_string_list:\n \n
return context.portal_catalog(\n for software_release in portal.portal_catalog(\n
portal_type=portal_type,\n portal_type=\'Software Release\',\n
url_string=url_string_list)\n validation_state=\'published\',\n
else:\n default_aggregate_uid=context.getUid(),\n
return []\n sort_on=((\'indexation_timestamp\', \'DESC\'),)):\n
</string> </value> installed_count = portal.portal_catalog.countResults(\n
software_release_url=software_release.getUrlString(),\n
allocation_scope_uid=portal.portal_categories.allocation_scope.open.public.getUid(),\n
capacity_scope_uid=portal.portal_categories.capacity_scope.open.getUid(),\n
portal_type=\'Computer Partition\',\n
free_for_request=1\n
)[0][0]\n
if installed_count > 0:\n
software_release_url = software_release.getRelativeUrl()\n
break\n
\n
if context.getAggregate() != software_release_url:\n
context.setAggregate(software_release_url)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Computer_getSoftwareReleaseList</string> </value> <value> <string>SoftwareProduct_manageSoftwareCatalog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
465 466
\ No newline at end of file \ No newline at end of file
portal_alarms/manage_software_catalog
\ 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