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
......@@ -63,45 +63,46 @@ def appendTempDomain(id, title, property_dict):\n
for key, value in property_dict.items():\n
domain.setCriterion(key, value)\n
domain_list.append(domain)\n
return domain\n
\n
domain_list = []\n
validation_state_list = [\'draft\']\n
\n
if depth == 1:\n
return domain_list\n
\n
domain = appendTempDomain(\'all_document_list\', \n
\'All Documents\', \n
dict(validation_state=[\'draft\']))\n
appendTempDomain(\'all_document_list\', \n
\'All Documents\', \n
dict(validation_state=validation_state_list))\n
\n
domain = appendTempDomain(\'hidden_document_list\', \n
\'Hidden\', \n
dict(validation_state=[\'hidden\']))\n
appendTempDomain(\'hidden_document_list\', \n
\'Hidden\', \n
dict(validation_state=[\'hidden\']))\n
\n
domain = appendTempDomain(\'opened_document_list\', \n
\'Opened by me\', \n
dict(local_roles=\'Owner\', validation_state=[\'draft\']))\n
appendTempDomain(\'opened_document_list\', \n
\'Opened by me\', \n
dict(local_roles=\'Owner\', validation_state=validation_state_list))\n
\n
domain = appendTempDomain(\'owner_document_list\', \n
\'Owned by me\',\n
dict(local_roles=\'Owner\', validation_state=[\'draft\']))\n
appendTempDomain(\'owner_document_list\', \n
\'Owned by me\',\n
dict(local_roles=\'Owner\', validation_state=validation_state_list))\n
\n
domain = appendTempDomain(\'shared_document_list\', \n
\'Shared by me\',\n
dict(validation_state=[\'draft\']))\n
appendTempDomain(\'shared_document_list\', \n
\'Shared by me\',\n
dict(validation_state=validation_state_list))\n
\n
domain = appendTempDomain(\'starred_document_list\',\n
\'Starred\',\n
dict(validation_state=[\'draft\']))\n
appendTempDomain(\'starred_document_list\',\n
\'Starred\',\n
dict(validation_state=validation_state_list))\n
\n
domain = appendTempDomain(\'trash_document_list\',\n
\'Trash\',\n
dict(validation_state=[\'deleted\']))\n
appendTempDomain(\'trash_document_list\',\n
\'Trash\',\n
dict(validation_state=[\'deleted\']))\n
\n
domain = parent.generateTempDomain(id=\'webpage_module_list\')\n
domain.edit(title=\'Document by Type\',\n
list_method=\'WebPageModule_getDocumentListFiltered\',\n
domain_generator_method_id = script.id)\n
domain_list.append(domain)\n
domain = appendTempDomain(\'webpage_module_list\',\n
\'Document by Type\',\n
dict(portal_type=["Web Page", "Web Illustration", "Web Table"],\n
validation_state=validation_state_list))\n
\n
# XXX - Review code to be more dynamic\n
webpage_subdomain = domain.generateTempDomain(id=\'subWebPage\')\n
......@@ -128,14 +129,77 @@ webillustration_subdomain.edit(title="Web Illustration",\n
return domain_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value>
</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>
<key> <string>id</string> </key>
<value> <string>WebPageModule_generateDomain</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</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
\ No newline at end of file
132
\ 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