Commit b5c37dcb authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py3

parents bd89a77e 85375206
Pipeline #39068 failed with stage
in 0 seconds
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>_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>default_reference</string> </key>
<value> <string>201</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>201</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais d\'établissement</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="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>2011</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2011</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais de constitution</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>_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>default_reference</string> </key>
<value> <string>2012</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2012</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais de premier établissement</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="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>20121</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>20121</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais de prospection</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>20122</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>20122</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais de publicité</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>2013</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2013</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Frais d\'augmentation de capital et d\'opérations diverses - fusions, scissions, transformations</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>2611</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2611</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Actions</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>à 473 Comptes d\'attente</string> </value> <value> <string>Comptes d\'attente</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>472</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>472</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Comptes d\'attente</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>473</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>473</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Comptes d\'attente</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</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>default_reference</string> </key>
<value> <string>669</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>669</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Dans les comptes à trois chiffres et plus, la terminaison 9 permet d\'identifier les opérations de sens contraire</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_checkSiteDailyModification</string> </value>
</item>
<item>
<key> <string>alarm_notification_mode</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>automatic_solve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>check_site_daily_modification</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple>
<int>1</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1603152000.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>report_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Check Site Daily Modification</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
active_process = context.newActiveProcess().getRelativeUrl()
context.activate(tag=tag).Base_checkSiteDailyModification(active_process=active_process)
context.activate(after_tag=tag).getId()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>tag, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_checkSiteDailyModification</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from DateTime import DateTime
from Products.CMFActivity.ActiveResult import ActiveResult
from Products.ZSQLCatalog.SQLCatalog import Query
portal = context.getPortalObject()
if not check_date:
check_date = DateTime().earliestTime() - 1
active_process = context.restrictedTraverse(active_process)
for workflow_object in portal.portal_catalog(
portal_type=(
'Workflow',
'Workflow Script',
'Workflow State',
'Workflow Transition',
'Workflow Variable',
'Worklist',
'Interaction Workflow'
),
modification_date=Query(modification_date=check_date, range="min"),
select_list = ['relative_url']
):
active_process.postResult(ActiveResult(
severity=100,
detail='%s is modified' % workflow_object.relative_url))
for sub_path, sub_obj in portal.portal_skins.ZopeFind(portal.portal_skins, search_sub=1):
modified_date = DateTime(container.last_modified(sub_obj))
if modified_date >= check_date:
active_process.postResult(ActiveResult(
severity=100,
detail='%s is modified' % sub_path))
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>active_process, check_date = None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_checkSiteDailyModification</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
import unittest import unittest
import time import time
from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase from Products.ERP5.tests.testInventoryAPI import InventoryAPITestCase
from DateTime import DateTime
class TestERP5Administration(InventoryAPITestCase): class TestERP5Administration(InventoryAPITestCase):
"""Test for erp5_administration business template. """Test for erp5_administration business template.
...@@ -231,6 +232,51 @@ component_error() ...@@ -231,6 +232,51 @@ component_error()
location_and_message_list) location_and_message_list)
def test_check_site_modification(self):
# remove second, obj's modification in erp5 don't have seconds
check_date = DateTime(DateTime().strftime('%Y-%m-%d %H:%M'))
active_process = self.portal.portal_activities.newActiveProcess()
self.portal.Base_checkSiteDailyModification(
active_process=active_process.getRelativeUrl(),
check_date = check_date
)
result_list = [x.detail for x in active_process.getResultList()]
message_list = [
'erp5_administration/Base_checkSiteDailyModification is modified',
'erp5_administration/BusinessTemplate_viewCheckPythonCodeDialog is modified',
'portal_workflow/edit_workflow is modified',
'portal_workflow/edit_workflow/state_current is modified',
'portal_workflow/preference_interaction_workflow is modified'
]
for message in message_list:
self.assertNotIn(message, result_list)
self.portal.portal_skins.erp5_administration.Base_checkSiteDailyModification.ZPythonScript_setTitle('%s' % check_date)
self.portal.portal_skins.erp5_administration.Base_checkSiteDailyModification.ZPythonScript_setTitle('')
self.portal.portal_skins.erp5_administration.BusinessTemplate_viewCheckPythonCodeDialog.manage_addProduct['Formulator'].manage_addField('my_title', 'Title', 'StringField')
self.portal.portal_skins.erp5_administration.BusinessTemplate_viewCheckPythonCodeDialog.manage_delObjects('my_title')
new_comment = 'Test %s' % check_date
self.portal.portal_workflow.preference_interaction_workflow.edit(
comment = new_comment
)
self.portal.portal_workflow.edit_workflow.edit(
comment = new_comment
)
self.portal.portal_workflow.edit_workflow.state_current.edit(
comment = new_comment
)
self.tic()
self.portal.Base_checkSiteDailyModification(
active_process=active_process.getRelativeUrl(),
check_date = check_date
)
result_list = [x.detail for x in active_process.getResultList()]
for message in message_list:
self.assertIn(message, result_list)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Administration)) suite.addTest(unittest.makeSuite(TestERP5Administration))
......
...@@ -4,5 +4,6 @@ portal_alarms/check_conversion_tool_availability ...@@ -4,5 +4,6 @@ portal_alarms/check_conversion_tool_availability
portal_alarms/check_folder_handler portal_alarms/check_folder_handler
portal_alarms/check_item_tracking portal_alarms/check_item_tracking
portal_alarms/check_localizer portal_alarms/check_localizer
portal_alarms/check_site_daily_modification
portal_alarms/check_skin_cache portal_alarms/check_skin_cache
portal_alarms/check_stock portal_alarms/check_stock
\ No newline at end of file
<catalog_method> <catalog_method>
<item key="sql_uncatalog_object" type="int"> <item key="sql_deferred_uncatalog_object" type="int">
<value>1</value> <value>1</value>
</item> </item>
</catalog_method> </catalog_method>
DELETE FROM content_translation WHERE <dtml-sqltest uid op=eq type=int> DELETE FROM content_translation WHERE <dtml-sqltest uid op=eq type=int multiple>
\ No newline at end of file \ No newline at end of file
<catalog_method> <catalog_method>
<item key="sql_catalog_object_list" type="int"> <item key="sql_deferred_catalog_object_list" type="int">
<value>1</value> <value>1</value>
</item> </item>
</catalog_method> </catalog_method>
...@@ -134,8 +134,11 @@ class TestCopySupport(ERP5TypeTestCase): ...@@ -134,8 +134,11 @@ class TestCopySupport(ERP5TypeTestCase):
self.tic() self.tic()
finally: finally:
ActivityTool.invokeGroup = ActivityTool_invokeGroup ActivityTool.invokeGroup = ActivityTool_invokeGroup
self.assertEqual(invokeGroup_list, catalog_relative_url = self.portal.portal_catalog.getSQLCatalog().getRelativeUrl()
['portal_catalog/uncatalogObjectList', uid_list, 'SQLQueue', False]) self.assertEqual(invokeGroup_list, [
'portal_catalog/uncatalogObjectList', uid_list, 'SQLQueue', False,
catalog_relative_url + '/SQLCatalog_deferUncatalogObjectActivity', uid_list, 'SQLQueue', False,
])
self.assertEqual(len(search_catalog(uid=uid_list)), 0) self.assertEqual(len(search_catalog(uid=uid_list)), 0)
......
# This script is called to defer fulltext indexing. # This script is called to defer fulltext indexing.
METHOD_ID = script.id + 'Activity' METHOD_ID = script.id + 'Activity'
GROUP_METHOD_ID = context.getPath() + '/' + METHOD_ID GROUP_METHOD_ID = context.getRelativeUrl() + '/' + METHOD_ID
activateObject = context.getPortalObject().portal_activities.activateObject activateObject = context.getPortalObject().portal_activities.activateObject
try: try:
priority = context.getActivityRuntimeEnvironment().getPriority() priority = context.getActivityRuntimeEnvironment().getPriority()
......
...@@ -3,10 +3,11 @@ from ZODB.POSException import ConflictError ...@@ -3,10 +3,11 @@ from ZODB.POSException import ConflictError
from zExceptions import Unauthorized from zExceptions import Unauthorized
import six import six
method = context.z_catalog_fulltext_list for method_id in context.getSqlDeferredCatalogObjectListList():
property_list = method.arguments_src.split() method = getattr(context, method_id)
parameter_dict = {x: [] for x in property_list} property_list = method.arguments_src.split()
for group_object in object_list: parameter_dict = {x: [] for x in property_list}
for group_object in object_list:
tmp_dict = {} tmp_dict = {}
try: try:
obj = group_object.object obj = group_object.object
...@@ -28,6 +29,5 @@ for group_object in object_list: ...@@ -28,6 +29,5 @@ for group_object in object_list:
for property, value in six.iteritems(tmp_dict): for property, value in six.iteritems(tmp_dict):
parameter_dict[property].append(value) parameter_dict[property].append(value)
group_object.result = None group_object.result = None
if parameter_dict:
if parameter_dict: method(**parameter_dict)
return method(**parameter_dict)
<catalog_method>
<item key="sql_uncatalog_object" type="int">
<value>1</value>
</item>
</catalog_method>
# This script is called to defer fulltext unindexing.
METHOD_ID = script.id + 'Activity'
GROUP_METHOD_ID = context.getRelativeUrl() + '/' + METHOD_ID
try:
priority = context.getActivityRuntimeEnvironment().getPriority()
except KeyError:
# called outside of an activity, could be an immediate reindexation
# XXX: duplicates default priority for sake of simplicity and speed.
# Strictly, this could also look-up default activate parameters, but on
# which document ? Traversing is expensive. So keep things fast by default.
priority = 1
# Optimise cache usage by reducing the likelyhood of a processing node
# including activities spawned by others into its activity group.
# Use unindexObject as dummy method id for compatibility with
# after_method_id=('unindexObject', ...)
context.activate(
activity='SQLQueue',
priority=priority,
node='same',
group_method_id=GROUP_METHOD_ID,
).unindexObject(uid=uid)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Python Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SQLCatalog_deferUncatalogObject</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Python Script</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
uid_list = []
for grouped_message in grouped_message_list:
assert not grouped_message.args
assert grouped_message.kw.keys() == ['uid']
uid_list.append(grouped_message.kw['uid'])
for method_id in context.getSqlDeferredUncatalogObjectList():
method = getattr(context, method_id)
method(uid=uid_list)
for grouped_message in grouped_message_list:
grouped_message.result = None
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Python Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>grouped_message_list</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SQLCatalog_deferUncatalogObjectActivity</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Python Script</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<catalog_method> <catalog_method>
<item key="sql_uncatalog_object" type="int">
<value>1</value>
</item>
</catalog_method> </catalog_method>
DELETE FROM catalog_full_text WHERE <dtml-sqltest uid op=eq type=int> DELETE FROM catalog_full_text WHERE <dtml-sqltest uid op=eq type=int multiple>
\ No newline at end of file \ No newline at end of file
<catalog_method> <catalog_method>
<item key="sql_uncatalog_object" type="int"> <item key="sql_deferred_uncatalog_object" type="int">
<value>1</value> <value>1</value>
</item> </item>
</catalog_method> </catalog_method>
DELETE FROM full_text WHERE <dtml-sqltest uid op=eq type=int> DELETE FROM full_text WHERE <dtml-sqltest uid op=eq type=int multiple>
\ No newline at end of file \ No newline at end of file
<catalog_method> <catalog_method>
<item key="sql_deferred_catalog_object_list" type="int">
<value>1</value>
</item>
</catalog_method> </catalog_method>
erp5_mysql_innodb/SQLCatalog_deferFullTextIndex erp5_mysql_innodb/SQLCatalog_deferFullTextIndex
erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity
erp5_mysql_innodb/SQLCatalog_deferUncatalogObject
erp5_mysql_innodb/SQLCatalog_deferUncatalogObjectActivity
erp5_mysql_innodb/SQLCatalog_makeFullTextQuery erp5_mysql_innodb/SQLCatalog_makeFullTextQuery
erp5_mysql_innodb/z0_drop_catalog_fulltext erp5_mysql_innodb/z0_drop_catalog_fulltext
erp5_mysql_innodb/z0_drop_content_translation erp5_mysql_innodb/z0_drop_content_translation
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>select_variable</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/multiple selection</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Methods to be called to catalog the list of objects with a deferred connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sql_deferred_catalog_object_list_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>select_variable</string> </key>
<value> <string>getCatalogMethodIds</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/multiple selection</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Methods to be called to uncatalog an object with a deferred connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sql_deferred_uncatalog_object_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>select_variable</string> </key>
<value> <string>getCatalogMethodIds</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -118,7 +118,9 @@ ...@@ -118,7 +118,9 @@
<value> <value>
<list> <list>
<string>my_sql_catalog_object_list_list</string> <string>my_sql_catalog_object_list_list</string>
<string>my_sql_deferred_catalog_object_list_list</string>
<string>my_sql_uncatalog_object_list</string> <string>my_sql_uncatalog_object_list</string>
<string>my_sql_deferred_uncatalog_object_list</string>
<string>my_sql_search_tables_list</string> <string>my_sql_search_tables_list</string>
<string>my_sql_catalog_datetime_search_keys_list</string> <string>my_sql_catalog_datetime_search_keys_list</string>
</list> </list>
......
<?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>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_sql_deferred_catalog_object_list_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>
</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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>field_id</string> </key>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deferred Catalog Objects</string> </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.getCatalogMethodIds()</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>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_sql_deferred_uncatalog_object_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>
</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>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>field_id</string> </key>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deferred Uncatalog Object</string> </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.getCatalogMethodIds()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -29,7 +29,6 @@ from OFS.Folder import Folder ...@@ -29,7 +29,6 @@ from OFS.Folder import Folder
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from AccessControl.Permissions import ( from AccessControl.Permissions import (
access_contents_information, access_contents_information,
import_export_objects,
manage_zcatalog_entries, manage_zcatalog_entries,
) )
from AccessControl.SimpleObjectPolicies import ContainerAssertions from AccessControl.SimpleObjectPolicies import ContainerAssertions
...@@ -54,10 +53,6 @@ import pprint ...@@ -54,10 +53,6 @@ import pprint
import re import re
import warnings import warnings
from contextlib import contextmanager from contextlib import contextmanager
from xml.dom.minidom import parse
from xml.sax.saxutils import escape, quoteattr
import os
from hashlib import md5
from .interfaces.query_catalog import ISearchKeyCatalog from .interfaces.query_catalog import ISearchKeyCatalog
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
...@@ -402,11 +397,21 @@ class Catalog(Folder, ...@@ -402,11 +397,21 @@ class Catalog(Folder,
'type' : 'multiple selection', 'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds', 'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' }, 'mode' : 'w' },
{ 'id' : 'sql_deferred_catalog_object_list',
'description' : 'Methods to be called to catalog the list of objects with a deferred connection',
'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_uncatalog_object', { 'id' : 'sql_uncatalog_object',
'description' : 'Methods to be called to uncatalog an object', 'description' : 'Methods to be called to uncatalog an object',
'type' : 'multiple selection', 'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds', 'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' }, 'mode' : 'w' },
{ 'id' : 'sql_deferred_uncatalog_object',
'description' : 'Methods to be called to uncatalog an object with a deferred connection',
'type' : 'multiple selection',
'select_variable' : 'getCatalogMethodIds',
'mode' : 'w' },
{ 'id' : 'sql_catalog_translation_list', { 'id' : 'sql_catalog_translation_list',
'description' : 'Methods to be called to catalog the list of translation objects', 'description' : 'Methods to be called to catalog the list of translation objects',
'type' : 'selection', 'type' : 'selection',
...@@ -587,7 +592,9 @@ class Catalog(Folder, ...@@ -587,7 +592,9 @@ class Catalog(Folder,
sql_catalog_delete_uid = '' sql_catalog_delete_uid = ''
sql_catalog_clear_reserved = '' sql_catalog_clear_reserved = ''
sql_catalog_object_list = () sql_catalog_object_list = ()
sql_deferred_catalog_object_list = ()
sql_uncatalog_object = () sql_uncatalog_object = ()
sql_deferred_uncatalog_object = ()
sql_clear_catalog = () sql_clear_catalog = ()
sql_catalog_translation_list = '' sql_catalog_translation_list = ''
sql_delete_translation_list = '' sql_delete_translation_list = ''
...@@ -1217,11 +1224,10 @@ class Catalog(Folder, ...@@ -1217,11 +1224,10 @@ class Catalog(Folder,
elapse = time.time() elapse = time.time()
c_elapse = time.clock() c_elapse = time.clock()
words = 0
obj = REQUEST.PARENTS[1] obj = REQUEST.PARENTS[1]
path = '/'.join(obj.getPhysicalPath()) path = '/'.join(obj.getPhysicalPath())
results = self.aq_parent.ZopeFindAndApply(obj, self.aq_parent.ZopeFindAndApply(obj,
obj_metatypes=obj_metatypes, obj_metatypes=obj_metatypes,
obj_ids=obj_ids, obj_ids=obj_ids,
obj_searchterm=obj_searchterm, obj_searchterm=obj_searchterm,
...@@ -1281,6 +1287,9 @@ class Catalog(Folder, ...@@ -1281,6 +1287,9 @@ class Catalog(Folder,
def getSqlCatalogObjectListList(self): def getSqlCatalogObjectListList(self):
return self.sql_catalog_object_list return self.sql_catalog_object_list
def getSqlDeferredCatalogObjectListList(self):
return self.sql_deferred_catalog_object_list
def _catalogObjectList(self, object_list, method_id_list=None, def _catalogObjectList(self, object_list, method_id_list=None,
disable_cache=0, check_uid=1, idxs=None): disable_cache=0, check_uid=1, idxs=None):
"""This is the real method to catalog objects.""" """This is the real method to catalog objects."""
...@@ -1496,6 +1505,9 @@ class Catalog(Folder, ...@@ -1496,6 +1505,9 @@ class Catalog(Folder,
def getSqlUncatalogObjectList(self): def getSqlUncatalogObjectList(self):
return self.sql_uncatalog_object return self.sql_uncatalog_object
def getSqlDeferredUncatalogObjectList(self):
return self.sql_deferred_uncatalog_object
security.declarePrivate('uncatalogObject') security.declarePrivate('uncatalogObject')
def uncatalogObject(self, path=None, uid=None): def uncatalogObject(self, path=None, uid=None):
""" """
...@@ -1874,9 +1886,7 @@ class Catalog(Folder, ...@@ -1874,9 +1886,7 @@ class Catalog(Folder,
""" """
search_key, related_key_definition = self.getColumnSearchKey(key, search_key, related_key_definition = self.getColumnSearchKey(key,
search_key_name=search_key_name) search_key_name=search_key_name)
if search_key is None: if search_key is not None:
result = None
else:
if related_key_definition is not None: if related_key_definition is not None:
search_key = search_key.getSearchKey(sql_catalog=self, search_key = search_key.getSearchKey(sql_catalog=self,
related_key_definition=related_key_definition, related_key_definition=related_key_definition,
...@@ -2450,30 +2460,12 @@ class Catalog(Folder, ...@@ -2450,30 +2460,12 @@ class Catalog(Folder,
if method.meta_type in ('Z SQL Method', 'ERP5 SQL Method') and ('deferred' in method.connection_id) == deferred: if method.meta_type in ('Z SQL Method', 'ERP5 SQL Method') and ('deferred' in method.connection_id) == deferred:
return method.connection_id return method.connection_id
def getSqlCatalogObjectList(self):
try:
return self.sql_catalog_object
except AttributeError:
return ()
def getSqlUncatalogObjectList(self):
try:
return self.sql_uncatalog_object
except AttributeError:
return ()
def getSqlUpdateObjectList(self): def getSqlUpdateObjectList(self):
try: try:
return self.sql_update_object return self.sql_update_object
except AttributeError: except AttributeError:
return () return ()
def getSqlCatalogObjectListList(self):
try:
return self.sql_catalog_object_list
except AttributeError:
return ()
security.declarePrivate('getFilterableMethodList') security.declarePrivate('getFilterableMethodList')
def getFilterableMethodList(self): def getFilterableMethodList(self):
""" """
...@@ -2482,10 +2474,11 @@ class Catalog(Folder, ...@@ -2482,10 +2474,11 @@ class Catalog(Folder,
method_id_set = set() method_id_set = set()
if withCMF: if withCMF:
method_id_set.update( method_id_set.update(
self.getSqlCatalogObjectList() + self.getSqlCatalogObjectListList() +
self.getSqlDeferredCatalogObjectListList() +
self.getSqlUncatalogObjectList() + self.getSqlUncatalogObjectList() +
self.getSqlUpdateObjectList() + self.getSqlDeferredUncatalogObjectList() +
self.getSqlCatalogObjectListList() self.getSqlUpdateObjectList()
) )
return [ return [
method method
......
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