Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
telecom
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
telecom
Commits
0f63ea28
Commit
0f63ea28
authored
Aug 03, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: bug fix in data descriptor invalidation
parent
300a725f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_createDataAnalysisList.py
.../erp5_wendelin_telecom/ERP5Site_createDataAnalysisList.py
+1
-1
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
...l_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
+18
-10
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_createDataAnalysisList.py
View file @
0f63ea28
...
...
@@ -72,7 +72,7 @@ for line_data_ingestion in portal_catalog(**query_dict):
module
=
portal
.
getDefaultModule
(
item_type
)
item
=
module
.
newContent
(
portal_type
=
item_type
,
title
=
data_ingestion
.
getTitle
(),
#title = data_ingestion.getReference
(),
id
=
data_ingestion
.
getId
(),
reference
=
data_ingestion
.
getReference
(),
version
=
'001'
)
if
"Data Descriptor"
not
in
item_type
:
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
View file @
0f63ea28
...
...
@@ -20,18 +20,26 @@ try:
if
data_analysis
.
getSimulationState
()
!=
'stopped'
:
return
'{"metadata":"Metadata not ready yet, please wait some minutes."}'
query
=
Query
(
portal_type
=
"Data Descriptor"
)
content
=
None
try
:
url
=
'data_descriptor_module/'
+
data_ingestion
.
getId
()
data_descriptor
=
context
.
restrictedTraverse
(
url
)
except
Exception
as
e
:
# backward compatibility
log
(
"ERROR while looking for data descriptor with id %s : %s"
%
(
str
(
data_ingestion
.
getId
()),
str
(
e
)))
query
=
Query
(
portal_type
=
"Data Descriptor"
)
data_descriptor
=
None
for
document
in
portal_catalog
(
query
=
query
):
if
document
.
reference
==
reference
:
data_descriptor
=
document
if
data_descriptor
is
None
:
return
'{"metadata":"No metadata descriptor found for this file"}'
for
document
in
portal_catalog
(
query
=
query
,
sort_on
=
((
'id'
,
'DESC'
,
'int'
),)):
if
document
.
reference
==
reference
:
content
=
document
.
getTextContent
()
if
content
is
not
None
:
return
content
else
:
return
'{"metadata":"No metadata available for this type of file yet"}'
return
'{"metadata":"No metadata descriptor found for this file"}'
content
=
data_descriptor
.
getTextContent
()
if
content
is
not
None
:
return
content
else
:
return
'{"metadata":"No metadata available for this type of file yet"}'
except
Exception
as
e
:
log
(
"Error getting data descriptor content: "
+
str
(
e
))
...
...
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