Commit 01a21bbd authored by Romain Courteaud's avatar Romain Courteaud

Call getMetadataMappingDict instead of hardcoding a mapping.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19024 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3dd22991
<?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>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>return {\'title\':\'title\',\n
\'subject\':\'keywords\',\n
\'description\':\'description\',\n
\'reference\':\'reference\',\n
\'version\':\'version\',\n
\'language\':\'language\'}\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>_owner</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/>
</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>OOoDocument_getMetadataMappingDict</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,15 +75,9 @@ XXX - This script must be verified, written with clean syntax\n
document = state_change[\'object\']\n
kw = state_change[\'kwargs\']\n
\n
# XXX hardcoded?\n
# key is a name of erp5 field.\n
# value is a name of document metadata.\n
metadata_field_mapping_dict = {\'title\':\'title\',\n
\'subject\':\'keywords\',\n
\'description\':\'description\',\n
\'reference\':\'reference\',\n
\'version\':\'version\',\n
\'language\':\'language\'}\n
metadata_field_mapping_dict = document.getMetadataMappingDict()\n
\n
# edit metadata (only if we have OOo file)\n
if document.hasBaseData():\n
......@@ -157,8 +151,8 @@ if document.hasBaseData():\n
<string>_getitem_</string>
<string>document</string>
<string>kw</string>
<string>metadata_field_mapping_dict</string>
<string>_getattr_</string>
<string>metadata_field_mapping_dict</string>
<string>new_metadata</string>
<string>_getiter_</string>
<string>field</string>
......
815
\ No newline at end of file
816
\ 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