Commit 20d6adda authored by Gabriel Monnerat's avatar Gabriel Monnerat

- clean up the script to generate Domains and remove one not used script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41542 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37c77c49
...@@ -63,45 +63,46 @@ def appendTempDomain(id, title, property_dict):\n ...@@ -63,45 +63,46 @@ def appendTempDomain(id, title, property_dict):\n
for key, value in property_dict.items():\n for key, value in property_dict.items():\n
domain.setCriterion(key, value)\n domain.setCriterion(key, value)\n
domain_list.append(domain)\n domain_list.append(domain)\n
return domain\n
\n \n
domain_list = []\n domain_list = []\n
validation_state_list = [\'draft\']\n
\n \n
if depth == 1:\n if depth == 1:\n
return domain_list\n return domain_list\n
\n \n
domain = appendTempDomain(\'all_document_list\', \n appendTempDomain(\'all_document_list\', \n
\'All Documents\', \n \'All Documents\', \n
dict(validation_state=[\'draft\']))\n dict(validation_state=validation_state_list))\n
\n \n
domain = appendTempDomain(\'hidden_document_list\', \n appendTempDomain(\'hidden_document_list\', \n
\'Hidden\', \n \'Hidden\', \n
dict(validation_state=[\'hidden\']))\n dict(validation_state=[\'hidden\']))\n
\n \n
domain = appendTempDomain(\'opened_document_list\', \n appendTempDomain(\'opened_document_list\', \n
\'Opened by me\', \n \'Opened by me\', \n
dict(local_roles=\'Owner\', validation_state=[\'draft\']))\n dict(local_roles=\'Owner\', validation_state=validation_state_list))\n
\n \n
domain = appendTempDomain(\'owner_document_list\', \n appendTempDomain(\'owner_document_list\', \n
\'Owned by me\',\n \'Owned by me\',\n
dict(local_roles=\'Owner\', validation_state=[\'draft\']))\n dict(local_roles=\'Owner\', validation_state=validation_state_list))\n
\n \n
domain = appendTempDomain(\'shared_document_list\', \n appendTempDomain(\'shared_document_list\', \n
\'Shared by me\',\n \'Shared by me\',\n
dict(validation_state=[\'draft\']))\n dict(validation_state=validation_state_list))\n
\n \n
domain = appendTempDomain(\'starred_document_list\',\n appendTempDomain(\'starred_document_list\',\n
\'Starred\',\n \'Starred\',\n
dict(validation_state=[\'draft\']))\n dict(validation_state=validation_state_list))\n
\n \n
domain = appendTempDomain(\'trash_document_list\',\n appendTempDomain(\'trash_document_list\',\n
\'Trash\',\n \'Trash\',\n
dict(validation_state=[\'deleted\']))\n dict(validation_state=[\'deleted\']))\n
\n \n
domain = parent.generateTempDomain(id=\'webpage_module_list\')\n domain = appendTempDomain(\'webpage_module_list\',\n
domain.edit(title=\'Document by Type\',\n \'Document by Type\',\n
list_method=\'WebPageModule_getDocumentListFiltered\',\n dict(portal_type=["Web Page", "Web Illustration", "Web Table"],\n
domain_generator_method_id = script.id)\n validation_state=validation_state_list))\n
domain_list.append(domain)\n
\n \n
# XXX - Review code to be more dynamic\n # XXX - Review code to be more dynamic\n
webpage_subdomain = domain.generateTempDomain(id=\'subWebPage\')\n webpage_subdomain = domain.generateTempDomain(id=\'subWebPage\')\n
...@@ -128,14 +129,77 @@ webillustration_subdomain.edit(title="Web Illustration",\n ...@@ -128,14 +129,77 @@ webillustration_subdomain.edit(title="Web Illustration",\n
return domain_list\n return domain_list\n
</string> </value> </string> </value>
</item> </item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value> <value> <string>depth, parent, **kw</string> </value>
</item> </item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>depth</string>
<string>parent</string>
<string>kw</string>
<string>domain_list</string>
<string>appendTempDomain</string>
<string>validation_state_list</string>
<string>dict</string>
<string>domain</string>
<string>_getattr_</string>
<string>webpage_subdomain</string>
<string>script</string>
<string>webtable_subdomain</string>
<string>webillustration_subdomain</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebPageModule_generateDomain</string> </value> <value> <string>WebPageModule_generateDomain</string> </value>
</item> </item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
<?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>"""\n
This script is used by domain to filter all objects from Web Page Module except objects \n
with validation state == \'deleted\'.\n
"""\n
# XXX - the query should returns all object except validation_state == "deleted". \n
# Try use Query or ComplexQuery object for it\n
return context.portal_catalog(portal_type=["Web Page", "Web Illustration", "Web Table"], \n
validation_state=["draft"])\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPageModule_getDocumentListFiltered</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
131 132
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment