Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
a72cbbb0
Commit
a72cbbb0
authored
Feb 05, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass Keywords metadata as a list to cloudooo.
parent
0e5afb66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
16 deletions
+7
-16
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/document_conversion_interaction_workflow/scripts/OOoDocument_updateMetadata.xml
...teraction_workflow/scripts/OOoDocument_updateMetadata.xml
+3
-12
bt5/erp5_base/bt/revision
bt5/erp5_base/bt/revision
+1
-1
product/ERP5OOo/tests/testIngestion.py
product/ERP5OOo/tests/testIngestion.py
+3
-3
No files found.
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/document_conversion_interaction_workflow/scripts/OOoDocument_updateMetadata.xml
View file @
a72cbbb0
...
...
@@ -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>
...
...
bt5/erp5_base/bt/revision
View file @
a72cbbb0
106
0
106
1
\ No newline at end of file
product/ERP5OOo/tests/testIngestion.py
View file @
a72cbbb0
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment