diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromMail.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml similarity index 88% rename from bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromMail.xml rename to bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml index 86e2fadbcd07a18fed9fa3c38799bcb9f5647da6..e5027c4417beabce2f9681b2e09004405e5e05e0 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromMail.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml @@ -68,26 +68,18 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string encoding="cdata"><![CDATA[ - -# determine content type\n + <value> <string># determine content type\n ctype=context.content_type_registry.findTypeName(fname,None,None)\n context.log(fname,ctype)\n if ctype is None:\n raise Exception("content type for file %s not registered" % fname)\n \n # create content\n -ob=context.document_module.newContent(portal_type=ctype,file=data)\n -ob.setSourceReference(fname)\n -ob.setPropertyListFromFilename(fname)\n -ob.guessMimeType(fname)\n -code,msg=ob.convert()\n -if code>0:\n - raise Exception(msg)\n +ob=context.document_module.newContent(portal_type=ctype)\n +ob.Base_edit(file=data) # XXX to nie jest dobrze\n +ob.DMS_ingestFile(fname,data)\n return ob\n - - -]]></string> </value> +</string> </value> </item> <item> <key> <string>_code</string> </key> @@ -132,14 +124,11 @@ return ob\n <string>fname</string> <string>data</string> <string>_getattr_</string> - <string>context</string> +<string>context</string> <string>None</string> <string>ctype</string> <string>Exception</string> <string>ob</string> - <string>_getiter_</string> - <string>code</string> - <string>msg</string> </tuple> </value> </item> @@ -156,7 +145,7 @@ return ob\n </item> <item> <key> <string>id</string> </key> - <value> <string>DMS_createObjectFromMail</string> </value> + <value> <string>DMS_createObjectFromFile</string> </value> </item> <item> <key> <string>warnings</string> </key> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml new file mode 100644 index 0000000000000000000000000000000000000000..2a0906d7659bde22089c8bd89f62efa6775606c9 --- /dev/null +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml @@ -0,0 +1,161 @@ +<?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># this script does not save file data in a document\n +# it can be run any time\n +# is meant to extract metadata from file name and contents\n +\n +if fname is None:\n + fname=context.getSourceReference()\n +else:\n + context.setSourceReference(fname)\n +if fname is not None:\n + context.setPropertyListFromFilename(fname)\n + context.guessMimeType(fname)\n + if not context.getTitle():\n + context.setTitle(fname)\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>fname=None,data=None</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>fname</string> + <string>data</string> + <string>None</string> + <string>_getattr_</string> + <string>context</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <none/> + <none/> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>DMS_ingestFile</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view.xml index 12fe851c530786435fd92a4747f5a704bbec6234..4abbf758c1282a7e23ef27a5b20f4a5c9e35b1ce 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view.xml @@ -108,6 +108,7 @@ <string>my_translated_simulation_state_title</string> <string>my_file</string> <string>my_source_reference</string> + <string>my_status_message</string> <string>my_contributor_title_list</string> </list> </value> diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_status_message.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_status_message.xml new file mode 100644 index 0000000000000000000000000000000000000000..b9432a87fe644f440729bdcbb1dbd703dfeb31ca --- /dev/null +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/OOoDocument_view/my_status_message.xml @@ -0,0 +1,266 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <tuple> + <string>Products.Formulator.StandardFields</string> + <string>StringField</string> + </tuple> + <none/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_status_message</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <int>20</int> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Status message</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml index 338f081ea4a9f6cd03cd4a48bc7e31f1cd71ffbf..1d44ec983ab2c6ae3a2fe9e62ab649c1e5e72046 100644 --- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/interactions/All_edit.xml @@ -42,7 +42,7 @@ <list> <string>AssignCategories</string> <string>ClearCacheUponUpload</string> - <string>SetReferenceFromFilename</string> + <string>IngestAfterUpload</string> </list> </value> </item> @@ -85,7 +85,9 @@ <item> <key> <string>script_name</string> </key> <value> - <tuple/> + <list> + <string>CreateNewOnUpload</string> + </list> </value> </item> <item> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/CreateNewOnUpload.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/CreateNewOnUpload.xml new file mode 100644 index 0000000000000000000000000000000000000000..eaabb7a4d02b23991d1a84c353eeb397f6c3ba11 --- /dev/null +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/CreateNewOnUpload.xml @@ -0,0 +1,148 @@ +<?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>o=state_change.object\n +mod=o.aq_parent\n +return context.REQUEST.RESPONSE.redirect(mod.absolute_url())\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>o</string> + <string>mod</string> + <string>context</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>CreateNewOnUpload</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/IngestAfterUpload.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/IngestAfterUpload.xml new file mode 100644 index 0000000000000000000000000000000000000000..269df0db31cd42ea7ec9b4c3c13fdfc5c70fba34 --- /dev/null +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/IngestAfterUpload.xml @@ -0,0 +1,153 @@ +<?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 + ob.DMS_ingestFile()\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> + </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>IngestAfterUpload</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml index fa6711c5833d749b620ad12968dc36f333e2b553..f62749398bed8725c49b42ed84c2be4e0254be95 100644 --- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/dms_file_interaction_workflow/scripts/Pdf_File_edit.xml @@ -70,17 +70,13 @@ <key> <string>_body</string> </key> <value> <string>ob=state_change.object\n kw=ob.REQUEST\n -ob.log(\'interaction\',\'edit\')\n f=kw.get(\'my_file\',None)\n -ob.log(\'f\',f)\n \n if f is not None and f:\n # if file uploaded, then:\n - ob.log(\'file\',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 - context.log(context.getPortalType(),ctype)\n if ctype is None:\n raise Exception(\'This file should be created as DMS File\')\n if ctype!=ob.getPortalType():\n diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow.xml index e2feaa2565412cdeb86fd9383bf031352c7071a4..84e91c2ff4f5db22c7d041468b909e3992a01658 100644 --- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow.xml +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow.xml @@ -30,6 +30,16 @@ <none/> </value> </item> + <item> + <key> <string>creation_guard</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>AUC KM</string> </value> + </item> <item> <key> <string>groups</string> </key> <value> @@ -40,6 +50,14 @@ <key> <string>id</string> </key> <value> <string>ooo_interaction_workflow</string> </value> </item> + <item> + <key> <string>manager_bypass</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>OpenOffice document interaction workflow</string> </value> + </item> </dictionary> </pickle> </record> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/interactions/OOo_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/interactions/OOo_edit.xml index efbae781f2e89d66440f0bc03023b7107af438a7..039a37035368c0e4b2d483267af9c6f88440fd64 100644 --- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/interactions/OOo_edit.xml +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/interactions/OOo_edit.xml @@ -33,7 +33,9 @@ <item> <key> <string>activate_script_name</string> </key> <value> - <tuple/> + <list> + <string>Convert_after</string> + </list> </value> </item> <item> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/Convert_after.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/Convert_after.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0f7211f010aeeafd709ef3bc2459384cdaf365c --- /dev/null +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/Convert_after.xml @@ -0,0 +1,154 @@ +<?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 +ob.log(ob.getRelativeUrl())\n +ob.log(ob.hasFile())\n +ob.log(ob.hasOOfile())\n +if ob.hasFile() and not ob.hasOOfile():\n + res=ob.convert()\n + ob.log(res)\n + ob.setStatusMessage(str(res[1]))\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>res</string> + <string>str</string> + <string>_getitem_</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>Convert_after</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml index 5692d6d8c1ec4bff5daf77e27ff93a2ae43f0c4c..35fca3775ea3e7c9167fd636caa4ac331c11397b 100644 --- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml +++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/ooo_interaction_workflow/scripts/OOo_edit.xml @@ -85,6 +85,7 @@ if ob.hasOOfile():\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 @@ -92,10 +93,7 @@ if f is not None and f:\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.setSourceReference(fname)\n - ob.setTitle(fname)\n - ob.oo_data=None # we clear it\n - #ob.setLastUploadTime(DateTime())\n + ob.reset()\n </string> </value> </item> <item> @@ -151,11 +149,10 @@ if f is not None and f:\n <string>keymf</string> <string>_getitem_</string> <string>_write_</string> - <string>fname</string> <string>context</string> + <string>fname</string> <string>ctype</string> <string>Exception</string> - <string>oo_data</string> </tuple> </value> </item> diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision index 05cf25896dd490bcd4fab7bf941de67c6b30edee..5e78f1eb7e724c1f81ad095d4c4db388506df297 100644 --- a/bt5/erp5_dms/bt/revision +++ b/bt5/erp5_dms/bt/revision @@ -1 +1 @@ -201 \ No newline at end of file +203 \ No newline at end of file