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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
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 @@
...
@@ -50,9 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string>
"""\n
"""\n
when OOoDocument is edited, we update metadata in the ODF file\n
when OOoDocument is edited, we update metadata in the ODF file\n
\n
\n
XXX - This script must be verified, written with clean syntax\n
XXX - This script must be verified, written with clean syntax\n
...
@@ -70,12 +68,7 @@ if document.hasBaseData():\n
...
@@ -70,12 +68,7 @@ if document.hasBaseData():\n
for field in metadata_field_mapping_dict.keys():\n
for field in metadata_field_mapping_dict.keys():\n
value = kw.get(field, None)\n
value = kw.get(field, None)\n
if value is None:\n
if value is None:\n
value_list = kw.get(\'%s_list\' % field, None)\n
value = 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
if value is not None:\n
if value is not None:\n
metadata_key = metadata_field_mapping_dict[field]\n
metadata_key = metadata_field_mapping_dict[field]\n
new_metadata[metadata_key] = value\n
new_metadata[metadata_key] = value\n
...
@@ -83,9 +76,7 @@ if document.hasBaseData():\n
...
@@ -83,9 +76,7 @@ if document.hasBaseData():\n
# edit metadata via server\n
# edit metadata via server\n
after_tag = \'document_%s_convert\' % document.getPath()\n
after_tag = \'document_%s_convert\' % document.getPath()\n
document.activate(after_tag=after_tag).Document_tryToUpdateBaseMetadata(**new_metadata)\n
document.activate(after_tag=after_tag).Document_tryToUpdateBaseMetadata(**new_metadata)\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<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):
...
@@ -651,7 +651,7 @@ class TestIngestion(ERP5TypeTestCase):
"""
"""
document
=
self
.
portal
.
restrictedTraverse
(
sequence
.
get
(
'document_path'
))
document
=
self
.
portal
.
restrictedTraverse
(
sequence
.
get
(
'document_path'
))
kw
=
dict
(
title
=
'another title'
,
kw
=
dict
(
title
=
'another title'
,
subject
=
'another subject'
,
subject
_list
=
[
'another'
,
'subject'
]
,
description
=
'another description'
)
description
=
'another description'
)
document
.
edit
(
**
kw
)
document
.
edit
(
**
kw
)
self
.
tic
()
self
.
tic
()
...
@@ -669,8 +669,8 @@ class TestIngestion(ERP5TypeTestCase):
...
@@ -669,8 +669,8 @@ class TestIngestion(ERP5TypeTestCase):
xml_tree
=
etree
.
fromstring
(
builder
.
extract
(
'meta.xml'
))
xml_tree
=
etree
.
fromstring
(
builder
.
extract
(
'meta.xml'
))
title
=
xml_tree
.
find
(
'*/{%s}title'
%
xml_tree
.
nsmap
[
'dc'
]).
text
title
=
xml_tree
.
find
(
'*/{%s}title'
%
xml_tree
.
nsmap
[
'dc'
]).
text
self
.
assertEqual
(
title
,
'another title'
)
self
.
assertEqual
(
title
,
'another title'
)
subject
=
xml_tree
.
find
(
'*/{%s}keyword'
%
xml_tree
.
nsmap
[
'meta'
]).
text
subject
=
[
x
.
text
for
x
in
xml_tree
.
findall
(
'*/{%s}keyword'
%
xml_tree
.
nsmap
[
'meta'
])]
self
.
assertEqual
(
subject
,
u'another subject'
)
self
.
assertEqual
(
subject
,
[
u'another'
,
u'subject'
]
)
description
=
xml_tree
.
find
(
'*/{%s}description'
%
xml_tree
.
nsmap
[
'dc'
]).
text
description
=
xml_tree
.
find
(
'*/{%s}description'
%
xml_tree
.
nsmap
[
'dc'
]).
text
self
.
assertEqual
(
description
,
u'another description'
)
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