Commit 03a1712f authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: ZODB Components: Migrate SelectionTool from filesystem.

TODO:
  + Cannot be merged as Upgrader requires UI access and without Selections
    it is not really useable...
  + Monkey patch FolderMixIn wrapping its method with Selections:
    Products.ERP5Form.SelectionTool.candidate_method_id_list:
     foldDomain
     setFlatListMode
     nextLanePage
     callSelectionFor
     setListboxDisplayMode
     viewPrevious
     setPage
     getSelectionParams
     getSelectionNameList
     checkAll
     setSelectionFor
     setDomainRoot
     getListboxDisplayMode
     setReportRoot
     getSelectionDomainDictFor
     selectionHasChanged
     setSelectionColumns
     getSelectionSortOrder
     setSelectionToAll
     getSelectionCheckedValueList
     getSelectionUidList
     setDomainDictFromParam
     setLanePath
     getSelectionInvertModeUidListFor
     unfoldDomain
     getSelectionIndexFor
     lastPage
     unfoldReport
     getSelectionChecksum
     setReportTreeMode
     setSelectionQuickSortOrder
     foldReport
     getSelectionFor
     previousPage
     setSelectionInvertModeFor
     getSelectionParamsFor
     setSelectionSortOrder
     setSelectionParamsFor
     setDomainRootFromParam
     getSelectionCheckedUidsFor
     getSelectionInvertModeFor
     nextPage
     setDomainTreeMode
     setSelectionToIds
     setSelectionCheckedUidsFor
     getSelectionValueList
     getSelectionListUrlFor
     viewNext
     getSelectionReportDictFor
     uncheckAll
     getSelectionNames
     getSelectionStats
     getSelectionColumns
     previousLanePage
     getSelectionSelectedValueList
     viewFirst
     setSelectionStats
     firstPage
     updateSelectionCheckedUidList
     viewLast
     clearCachedContainer
    => Should perhaps be moved to Folder.py (implemented in SelectionTool to
       avoid ERP5Type depending on ERP5Form: it probably makes no sense anymore
       though...).
  + makeTreeList() and createFolderMixInPageSelectionMethod() used in
    ERP5Form.{PlanningBox,ListBox} but these cannot be migrated (non-ERP5 objects).
  + Products.ERP5Type.tests.testFunctionalAnonymousSelection => erp5_ui_test? What about monkey patch?
  + Fix pylint warnings.
parent 330f26f7
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSelectionTool</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testSelectionTool</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSelectionTool</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:335, 0: Method \'testPage\' is abstract in class \'TestSelectionTool\' but is not overridden (abstract-method)</string>
<string>W:335, 0: Method \'testView\' is abstract in class \'TestSelectionTool\' but is not overridden (abstract-method)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -32,6 +32,7 @@ test.erp5.testNotificationTool ...@@ -32,6 +32,7 @@ test.erp5.testNotificationTool
test.erp5.testPerson test.erp5.testPerson
test.erp5.testQueryModule test.erp5.testQueryModule
test.erp5.testRestrictedPythonSecurity test.erp5.testRestrictedPythonSecurity
test.erp5.testSelectionTool
test.erp5.testSessionTool test.erp5.testSessionTool
test.erp5.testTimeout test.erp5.testTimeout
test.erp5.testTimerService test.erp5.testTimerService
......
...@@ -2131,7 +2131,6 @@ class ERP5Generator(PortalGenerator): ...@@ -2131,7 +2131,6 @@ class ERP5Generator(PortalGenerator):
'CMF Activity SQL Server Connection') 'CMF Activity SQL Server Connection')
# Add ERP5Form Tools # Add ERP5Form Tools
addERP5Tool(p, 'portal_selections', 'Selection Tool')
addERP5Tool(p, 'portal_preferences', 'Preference Tool') addERP5Tool(p, 'portal_preferences', 'Preference Tool')
# Add Message Catalog # Add Message Catalog
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Tool Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SelectionTool</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.Tool.SelectionTool</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tool.erp5.SelectionTool</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Tool Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:1006, 38: Redefining name \'x\' from outer scope (line 1809) (redefined-outer-name)</string>
<string>W:1052, 40: Redefining name \'x\' from outer scope (line 1809) (redefined-outer-name)</string>
<string>W:1199, 39: Redefining name \'x\' from outer scope (line 1809) (redefined-outer-name)</string>
<string>W:1287, 40: Redefining name \'x\' from outer scope (line 1809) (redefined-outer-name)</string>
<string>W:1441, 10: Redefining name \'security_property_id\' from outer scope (line 1839) (redefined-outer-name)</string>
<string>W:1909, 4: Redefining name \'portal_selection_wrapper\' from outer scope (line 1829) (redefined-outer-name)</string>
<string>W:1940, 4: Redefining name \'new_property_id\' from outer scope (line 1879) (redefined-outer-name)</string>
<string>W:1945, 6: Redefining name \'new_security_property_id\' from outer scope (line 1884) (redefined-outer-name)</string>
<string>W:1943, 4: Redefining name \'security_property\' from outer scope (line 1840) (redefined-outer-name)</string>
<string>W:1942, 4: Redefining name \'security_property_id\' from outer scope (line 1839) (redefined-outer-name)</string>
<string>W:1908, 6: Redefining name \'property_id\' from outer scope (line 1828) (redefined-outer-name)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -12,6 +12,7 @@ tool.erp5.NotificationTool ...@@ -12,6 +12,7 @@ tool.erp5.NotificationTool
tool.erp5.OrderTool tool.erp5.OrderTool
tool.erp5.PasswordTool tool.erp5.PasswordTool
tool.erp5.RuleTool tool.erp5.RuleTool
tool.erp5.SelectionTool
tool.erp5.SessionTool tool.erp5.SessionTool
tool.erp5.SimulationTool tool.erp5.SimulationTool
tool.erp5.TestTool tool.erp5.TestTool
\ No newline at end of file
...@@ -11,7 +11,9 @@ portal_memcached ...@@ -11,7 +11,9 @@ portal_memcached
portal_notifications portal_notifications
portal_orders portal_orders
portal_password portal_password
portal_preferences
portal_rules portal_rules
portal_selections
portal_sessions portal_sessions
portal_simulation portal_simulation
portal_tests portal_tests
......
This diff is collapsed.
...@@ -42,7 +42,6 @@ document_classes = updateGlobals( this_module, globals(), ...@@ -42,7 +42,6 @@ document_classes = updateGlobals( this_module, globals(),
# Define object classes and tools # Define object classes and tools
import Form, FSForm, ListBox, ReportBox, MatrixBox import Form, FSForm, ListBox, ReportBox, MatrixBox
from Tool import SelectionTool
import OOoChart, PDFTemplate, Report, ParallelListField import OOoChart, PDFTemplate, Report, ParallelListField
import PlanningBox, POSBox, FormBox, EditorField, ProxyField, DurationField import PlanningBox, POSBox, FormBox, EditorField, ProxyField, DurationField
import RelationField, ImageField, MultiRelationField, MultiLinkField, InputButtonField import RelationField, ImageField, MultiRelationField, MultiLinkField, InputButtonField
...@@ -56,7 +55,7 @@ from Products.CMFCore.utils import registerIcon ...@@ -56,7 +55,7 @@ from Products.CMFCore.utils import registerIcon
object_classes = ( Form.ERP5Form, FSForm.ERP5FSForm, PDFTemplate.PDFTemplate, object_classes = ( Form.ERP5Form, FSForm.ERP5FSForm, PDFTemplate.PDFTemplate,
Report.ERP5Report) Report.ERP5Report)
portal_tools = ( SelectionTool.SelectionTool, PreferenceTool.PreferenceTool ) portal_tools = ( PreferenceTool.PreferenceTool, )
content_classes = ( ) content_classes = ( )
content_constructors = () content_constructors = ()
...@@ -197,5 +196,3 @@ allow_module('Products.ERP5Form.Selection') ...@@ -197,5 +196,3 @@ allow_module('Products.ERP5Form.Selection')
import Selection import Selection
allow_class(Selection) allow_class(Selection)
__module_aliases__ = ('Products.ERP5Form.SelectionTool', SelectionTool),
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