Commit a7308ec9 authored by Gabriel Monnerat's avatar Gabriel Monnerat

2010-12-22 gabriel

* Clean up the script to generate the UNG Domains and remove not used scripts.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41656 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1991546f
......@@ -55,18 +55,28 @@
XXX - The generation of domains should be more dynamic because some domains is create manually.\n
"""\n
\n
def appendTempDomain(id, title, property_dict):\n
def appendTempDomain(id, \n
title,\n
property_dict,\n
parent=parent,\n
membership_criterion_base_category=(),\n
membership_criterion_category=()):\n
domain = parent.generateTempDomain(id=id)\n
domain.edit(title=title,\n
domain_generator_method_id = script.id)\n
domain_generator_method_id=script.id,\n
membership_criterion_base_category=membership_criterion_base_category,\n
membership_criterion_category=membership_criterion_category) \n
\n
domain.setCriterionPropertyList(property_dict.keys())\n
for key, value in property_dict.items():\n
domain.setCriterion(key, value)\n
domain_list.append(domain)\n
\n
if parent.getId() == "ung_domain":\n
domain_list.append(domain)\n
return domain\n
\n
\n
domain_list = []\n
validation_state_list = [\'draft\']\n
validation_state_list = [\'draft\', \'published\', \'shared\']\n
\n
if depth == 1:\n
return domain_list\n
......@@ -89,7 +99,7 @@ appendTempDomain(\'owner_document_list\', \n
\n
appendTempDomain(\'shared_document_list\', \n
\'Shared by me\',\n
dict(validation_state=validation_state_list))\n
dict(validation_state=[\'shared\']))\n
\n
appendTempDomain(\'starred_document_list\',\n
\'Starred\',\n
......@@ -104,27 +114,26 @@ domain = appendTempDomain(\'webpage_module_list\',\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
webpage_subdomain.edit(title="Web Page",\n
membership_criterion_base_category = ("webpage_module_list"),\n
membership_criterion_category = ("webpage_module_list"),\n
list_method=\'WebPageModule_getWebPageListFiltered\',\n
domain_generator_method_id=script.id)\n
\n
webtable_subdomain = domain.generateTempDomain(id=\'subWebTable\')\n
webtable_subdomain.edit(title="Web Table",\n
membership_criterion_base_category = ("webpage_module_list"),\n
membership_criterion_category = ("webpage_module_list"),\n
list_method=\'WebPageModule_getWebTableListFiltered\',\n
domain_generator_method_id=script.id)\n
\n
webillustration_subdomain = domain.generateTempDomain(id=\'subWebIllustraion\')\n
webillustration_subdomain.edit(title="Web Illustration",\n
membership_criterion_base_category = ("webpage_module_list"),\n
membership_criterion_category = ("webpage_module_list"),\n
list_method=\'WebPageModule_getWebIllustrationListFiltered\',\n
domain_generator_method_id=script.id)\n
appendTempDomain(\'subWebPage\',\n
\'Web Page\',\n
dict(validation_state=validation_state_list, portal_type=["Web Page"]),\n
domain,\n
("webpage_module_list",),\n
("webpage_module_list",))\n
\n
appendTempDomain(\'subWebTable\',\n
\'Web Table\',\n
dict(validation_state=validation_state_list, portal_type=["Web Table"]),\n
domain,\n
("webpage_module_list",),\n
("webpage_module_list",))\n
\n
appendTempDomain(\'subWebIllustration\',\n
\'Web Illustration\',\n
dict(validation_state=validation_state_list, portal_type=["Web Illustration"]),\n
domain,\n
("webpage_module_list",),\n
("webpage_module_list",))\n
\n
return domain_list\n
</string> </value>
......@@ -171,11 +180,6 @@ return domain_list\n
<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>
......
<?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 Web Illustration objects except objects \n
with validation state == \'deleted\'.\n
"""\n
# XXX - the query should returns Web Illustration objects except validation_state == "deleted". \n
# Try use Query or ComplexQuery object for it\n
return context.portal_catalog(portal_type=["Web Illustration"], \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_getWebIllustrationListFiltered</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 Web Page objects except objects \n
with validation state == \'deleted\'.\n
"""\n
# XXX - the query should returns Web Page objects except validation_state == "deleted". \n
# Try use Query or ComplexQuery object for it\n
return context.portal_catalog(portal_type=["Web Page"], \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_getWebPageListFiltered</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 Web Table objects except objects \n
with validation state == \'deleted\'.\n
"""\n
# XXX - the query should returns Web Table objects except validation_state == "deleted". \n
# Try use Query or ComplexQuery object for it\n
return context.portal_catalog(portal_type=["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_getWebTableListFiltered</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-12-22 gabriel
* Clean up the script to generate the UNG Domains and remove not used scripts.
2010-12-20 gabriel
* Added page to Login and script to Logout
* Initial implementation to share documents in UNG.
......
135
\ No newline at end of file
136
\ 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