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
dd6bfa1d
Commit
dd6bfa1d
authored
Oct 26, 2017
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: refactoring in data ingestion reference
parent
89478a9c
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
151 deletions
+152
-151
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+130
-129
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
...l_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
+22
-22
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
dd6bfa1d
This diff is collapsed.
Click to expand it.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
View file @
dd6bfa1d
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.Log
import
log
# reference parameter example: telecom.MNE.filename.fif.EOF
# reference parameter example: supplier.dataset.filename.fif.EOF
# ingestion reference example: telecom_MNE_filename_fif
# ingestion reference example: dataset_filename_fif
# ingestion id example: telecom_MNE_filename_fif_20170615
FALSE
=
"FALSE"
FALSE
=
"FALSE"
TRUE
=
"TRUE"
TRUE
=
"TRUE"
today_string
=
DateTime
().
strftime
(
'%Y%m%d'
)
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
portal_catalog
=
portal
.
portal_catalog
data_ingestion_reference
=
'_'
.
join
(
reference
.
split
(
'_'
)[:
-
1
])
#'_'.join(reference.split('.')[:-1])
try
:
data_ingestion_id
=
'%s_%s'
%
(
data_ingestion_reference
,
today_string
)
context
.
logEntry
(
"Attempt to do a new ingestion with reference: %s"
%
reference
)
# first search for applicable data ingestion
# remove supplier and eof from reference
data_ingestion
=
portal_catalog
.
getResultValue
(
data_ingestion_reference
=
'_'
.
join
(
reference
.
split
(
'_'
)[
1
:
-
1
])
portal_type
=
'Data Ingestion'
,
simulation_state
=
'planned'
,
data_ingestion
=
portal_catalog
.
getResultValue
(
reference
=
data_ingestion_reference
)
portal_type
=
'Data Ingestion'
,
reference
=
data_ingestion_reference
)
if
data_ingestion
is
None
:
document
=
portal
.
data_ingestion_module
.
get
(
data_ingestion_id
)
if
data_ingestion
is
None
:
if
(
document
is
not
None
):
if
document
.
getSimulationState
()
==
'planned'
:
return
FALSE
else
:
return
TRUE
else
:
return
FALSE
return
FALSE
else
:
if
data_ingestion
.
getSimulationState
()
==
'planned'
:
return
FALSE
return
FALSE
context
.
logEntry
(
"[ERROR] Data Ingestion reference %s already exists"
%
data_ingestion_reference
)
return
TRUE
except
Exception
as
e
:
context
.
logEntry
(
"[ERROR] At script ingestionReferenceExists
\
n
[ERROR] "
+
str
(
e
))
raise
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