Commit 2dea317e authored by Rafael Monnerat's avatar Rafael Monnerat

Added Action to generate a detailed report (Colored diff) when compared 2...

Added Action to generate a detailed report (Colored diff) when compared 2 business templates. (This is the first draft version)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32354 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a79fa4a8
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>detailed_diff</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>8.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detailed Diff Business Template</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TemplateTool_viewDetailedDiff</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 encoding="cdata"><![CDATA[
ZMI_OBJECT_CLASS_LIST = ["Skin"]\n
ERP5_OBJECT_CLASS_LIST = ["Path", "Category", "PortalType", "Module"]\n
PORTAL_TYPE_OBJECT_LIST = ["PortalTypePropertySheet", "PortalTypeBaseCategory", \n
"PortalTypeBaseCategory", "PortalTypeAllowedContentType"]\n
WORKFLOW_OBJECT_CLASS_LIST = [\'PortalTypeWorkflowChain\']\n
\n
color_dict = { \'Modified\' : \'#FDE406\', \n
\'New\' : \'#B5FFB5\', \n
\'Removed\' : \'#FFA4A4\' }\n
link = 0\n
request = context.REQUEST\n
print \'<div style="background-color:white;padding:4px">\'\n
for diff_object in context.BusinessTemplate_getDiffObjectList():\n
color = color_dict.get(diff_object.object_state, \'#FDE406\')\n
print \'<div style="background-color:%s;padding:4px">\' % color\n
# XXX This header could be more improved to have icons and more options, like\n
# See XML, full diff, unified diff, link to svn (if available).\n
print \'&nbsp; [<b>%s</b>] [<b>%s</b>] &nbsp;\' % (diff_object.object_state,\n
diff_object.object_class)\n
\n
if diff_object.object_class in ERP5_OBJECT_CLASS_LIST:\n
print \'<a href="%s">\' % (diff_object.object_id)\n
link = 1\n
elif diff_object.object_class in PORTAL_TYPE_OBJECT_LIST:\n
print \'<a href="portal_types/%s">\' % (diff_object.object_id)\n
link = 1\n
elif diff_object.object_class in ZMI_OBJECT_CLASS_LIST:\n
print \'<a href="%s/manage_main">\' % (diff_object.object_id)\n
link = 1\n
elif diff_object.object_class in WORKFLOW_OBJECT_CLASS_LIST:\n
print \'<a href="portal_workflow/manage_main">\'\n
link = 1\n
print \'%s\' % (diff_object.object_id)\n
if link == 1: \n
print \'</a>\'\n
print \'</div>\'\n
if diff_object.object_state == "Modified":\n
request.set(\'bt1\', diff_object.bt1)\n
request.set(\'bt2\', diff_object.bt2)\n
request.set(\'object_id\', diff_object.object_id)\n
request.set(\'object_class\', diff_object.object_class)\n
print context.portal_templates.diffObjectAsHTML(request)\n
print \'<hr>\'\n
print \'</div>\'\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>ZMI_OBJECT_CLASS_LIST</string>
<string>ERP5_OBJECT_CLASS_LIST</string>
<string>PORTAL_TYPE_OBJECT_LIST</string>
<string>WORKFLOW_OBJECT_CLASS_LIST</string>
<string>color_dict</string>
<string>link</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>_getiter_</string>
<string>diff_object</string>
<string>color</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>TemplateTool_getDetailedDiff</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="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>diffhtml</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TemplateTool_viewDetailedDiff</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>TemplateTool_viewDetailedDiff</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_report</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detailed Diff Business Template</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1464
\ No newline at end of file
1465
\ No newline at end of file
......@@ -56,6 +56,7 @@ Rule Tool | view
Simulation Movement | view
Simulation Tool | view
System Preference | view
Template Tool | detailed_diff
Template Tool | diff
Template Tool | download
Template Tool | download_from_repository
......
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