Commit b9e688c8 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

2008-11-20 Kazuhiko

* Add ERP5Site_dumpSkinProperty
* Add ERP5Site_dumpWorkflowChain

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24649 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 444cc9be
def dumpWorkflowChain(self):
# This method outputs the workflow chain in the format that you can
# easily get diff like the following:
# ---
# Account,account_workflow
# Account,edit_workflow
# ...
# ---
workflow_tool = self.getPortalObject().portal_workflow
cbt = workflow_tool._chains_by_type
ti = workflow_tool._listTypeInfo()
types_info = []
for t in ti:
id = t.getId()
title = t.Title()
if title == id:
title = None
if cbt is not None and cbt.has_key(id):
chain = sorted(cbt[id])
else:
chain = ['(Default)']
types_info.append({'id': id,
'title': title,
'chain': chain})
output = []
for i in sorted(types_info, key=lambda x:x['id']):
for chain in i['chain']:
output.append('%s,%s' % (i['id'], chain))
return '\n'.join(output)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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># This method outputs the skin properties in the format that you can\n
# easily get diff like the following:\n
# ---\n
# CSV,erp5_access_tab\n
# CSV,custom\n
# CSV,erp5_csv_style\n
# CSV,erp5_csv_core\n
# ...\n
# ---\n
skin_tool = context.getPortalObject().portal_skins\n
for name, layers in skin_tool.getSkinPaths():\n
for layer in layers.split(\',\'):\n
print \'%s,%s\' % (name, layer)\n
return printed\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_print_</string>
<string>_print</string>
<string>_getattr_</string>
<string>context</string>
<string>skin_tool</string>
<string>_getiter_</string>
<string>name</string>
<string>layers</string>
<string>layer</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>ERP5Site_dumpSkinProperty</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>dumpWorkflowChain</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Administration</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_dumpWorkflowChain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2008-11-20 Kazuhiko
* Add ERP5Site_dumpSkinProperty
* Add ERP5Site_dumpWorkflowChain
2008-10-30 Vincent Pelletier
* Add a ZSQLMethod to recreate roles_and_users from ZODB security cache. Requires ZSQLCatalog r24410 or later.
......
8
\ No newline at end of file
9
\ 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