Commit a72cbbb0 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

pass Keywords metadata as a list to cloudooo.

parent 0e5afb66
......@@ -50,9 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
<value> <string>"""\n
when OOoDocument is edited, we update metadata in the ODF file\n
\n
XXX - This script must be verified, written with clean syntax\n
......@@ -70,12 +68,7 @@ if document.hasBaseData():\n
for field in metadata_field_mapping_dict.keys():\n
value = kw.get(field, None)\n
if value is None:\n
value_list = kw.get(\'%s_list\' % field, None)\n
if value_list is not None:\n
if len(value_list)>0:\n
value = \' \'.join(map(str, value_list))\n
else:\n
value = \'\'\n
value = kw.get(\'%s_list\' % field, None)\n
if value is not None:\n
metadata_key = metadata_field_mapping_dict[field]\n
new_metadata[metadata_key] = value\n
......@@ -83,9 +76,7 @@ if document.hasBaseData():\n
# edit metadata via server\n
after_tag = \'document_%s_convert\' % document.getPath()\n
document.activate(after_tag=after_tag).Document_tryToUpdateBaseMetadata(**new_metadata)\n
]]></string> </value>
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
1060
1061
\ No newline at end of file
......@@ -651,7 +651,7 @@ class TestIngestion(ERP5TypeTestCase):
"""
document = self.portal.restrictedTraverse(sequence.get('document_path'))
kw = dict(title='another title',
subject='another subject',
subject_list=['another', 'subject'],
description='another description')
document.edit(**kw)
self.tic()
......@@ -669,8 +669,8 @@ class TestIngestion(ERP5TypeTestCase):
xml_tree = etree.fromstring(builder.extract('meta.xml'))
title = xml_tree.find('*/{%s}title' % xml_tree.nsmap['dc']).text
self.assertEqual(title, 'another title')
subject = xml_tree.find('*/{%s}keyword' % xml_tree.nsmap['meta']).text
self.assertEqual(subject, u'another subject')
subject = [x.text for x in xml_tree.findall('*/{%s}keyword' % xml_tree.nsmap['meta'])]
self.assertEqual(subject, [u'another', u'subject'])
description = xml_tree.find('*/{%s}description' % xml_tree.nsmap['dc']).text
self.assertEqual(description, u'another description')
......
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