Commit 4506e246 authored by Bartek Górny's avatar Bartek Górny

tidied up interaction workflows (bugfixes, logical naming)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10419 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c61c266b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5.Interaction</string>
<string>InteractionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Nonregistered_file_edit</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_edit</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>DMS File</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>CheckUnKnownType</string>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5.Interaction</string>
<string>InteractionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Registered_file_edit</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_edit</string>
</list>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Graphic</string>
<string>ImageDocument</string>
<string>PdfDocument</string>
<string>Presentation</string>
<string>Spreadsheet</string>
<string>Text</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>CheckKnownType</string>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>ob=state_change.object\n
kw=ob.REQUEST\n
f=kw.get(\'my_file\',None)\n
\n
if f is not None and f:\n
# if file uploaded, then:\n
fname=f.filename\n
# we check for appropriate file type (by extension, using content_type_registry)\n
# we accept or suggest appropriate portal type\n
ctype=context.content_type_registry.findTypeName(fname,None,None)\n
if ctype is None:\n
raise Exception(\'This file should be created as DMS File\')\n
if ctype!=ob.getPortalType():\n
raise Exception(\'This file should be created as \'+ctype)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>ob</string>
<string>kw</string>
<string>None</string>
<string>f</string>
<string>fname</string>
<string>context</string>
<string>ctype</string>
<string>Exception</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>CheckKnownType</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>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>ob=state_change.object\n
kw=ob.REQUEST\n
f=kw.get(\'my_file\',None)\n
\n
if f is not None and f:\n
# if file uploaded, then:\n
fname=f.filename\n
# we check for appropriate file type (by extension, using content_type_registry)\n
# we allow only not known types\n
ctype=context.content_type_registry.findTypeName(fname,None,None)\n
if ctype is not None:\n
raise Exception(\'This file should be created as \'+ctype)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>ob</string>
<string>kw</string>
<string>None</string>
<string>f</string>
<string>fname</string>
<string>context</string>
<string>ctype</string>
<string>Exception</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>CheckUnKnownType</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -76,7 +76,8 @@ ob.log(\'f\',f)\n
\n
if f is not None and f:\n
# if file uploaded, then:\n
ob.clearCache()\n
if hasattr(ob,\'clearCache\'): # e.g. DMS File doesnt have it\n
ob.clearCache()\n
</string> </value>
</item>
<item>
......@@ -125,6 +126,7 @@ if f is not None and f:\n
<string>kw</string>
<string>None</string>
<string>f</string>
<string>hasattr</string>
</tuple>
</value>
</item>
......
......@@ -33,9 +33,7 @@
<item>
<key> <string>activate_script_name</string> </key>
<value>
<list>
<string>Convert_after</string>
</list>
<tuple/>
</value>
</item>
<item>
......
......@@ -70,7 +70,7 @@
<key> <string>_body</string> </key>
<value> <string>ob=state_change.object\n
kw=ob.REQUEST\n
metafields=(\'title\',\'subject\',\'keywords\',\'description\',\'reference\',\'version\',\'language\')\n
metafields=(\'title\',\'subject\',\'description\',\'reference\',\'version\',\'language\')\n
f=kw.get(\'my_file\',None)\n
\n
# edit metadata (only if we have OOo file)\n
......@@ -83,17 +83,6 @@ if ob.hasOOfile():\n
if newmeta:\n
# edit metadata via server\n
ob.editMetadata(newmeta)\n
if f is not None and f:\n
# if file uploaded, then:\n
context.log(f)\n
fname=f.filename\n
# we check for appropriate file type (by extension, using content_type_registry)\n
ctype=context.content_type_registry.findTypeName(fname,None,None)\n
if ctype is None:\n
raise Exception(\'File type of \'+fname+\' is not registered\')\n
if ctype!=ob.getPortalType():\n
raise Exception(\'This file should be created as \'+ctype)\n
ob.reset()\n
</string> </value>
</item>
<item>
......@@ -149,10 +138,6 @@ if f is not None and f:\n
<string>keymf</string>
<string>_getitem_</string>
<string>_write_</string>
<string>context</string>
<string>fname</string>
<string>ctype</string>
<string>Exception</string>
</tuple>
</value>
</item>
......
212
\ No newline at end of file
218
\ 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