Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
klaus_wendelin
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
Eteri
klaus_wendelin
Commits
ec398f34
Commit
ec398f34
authored
Mar 01, 2019
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ingestion: include destination section reference in data ingestion search if provided
parent
1517839a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+18
-11
No files found.
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
ec398f34
...
...
@@ -6,16 +6,22 @@ portal = context.getPortalObject()
portal_catalog
=
portal
.
portal_catalog
data_ingestion_reference
=
movement_dict
.
get
(
'reference'
,
reference
)
data_ingestion_id
=
"%s-%s"
%
(
today_string
,
data_ingestion_reference
)
resource_reference
=
movement_dict
.
get
(
'resource_reference'
,
None
)
specialise_reference
=
movement_dict
.
get
(
'specialise_reference'
,
None
)
destination_section_reference
=
movement_dict
.
get
(
'destination_section_reference'
,
None
)
data_ingestion_id
=
"%s-%s-%s"
%
(
today_string
,
destination_section_reference
,
data_ingestion_reference
)
# first search for applicable data ingestion
data_ingestion
=
portal_catalog
.
getResultValue
(
data_ingestion_query_kw
=
dict
(
portal_type
=
'Data Ingestion'
,
simulation_state
=
[
'started'
,
'stopped'
],
reference
=
data_ingestion_reference
)
if
destination_section_reference
is
not
None
:
data_ingestion_query_kw
[
"destination_section_reference"
]
=
destination_section_reference
# first search for applicable data ingestion
data_ingestion
=
portal_catalog
.
getResultValue
(
**
data_ingestion_query_kw
)
def
init_input_line
(
input_line
,
operation_line
):
# copy device and configuration from operation line to input line
input_line
.
setAggregateSet
(
...
...
@@ -92,21 +98,22 @@ def init_input_line(input_line, operation_line):
if
data_ingestion
is
None
:
document
=
portal
.
data_ingestion_module
.
get
(
data_ingestion_id
)
if
(
document
is
not
None
)
and
document
.
getSimulationState
()
==
'started'
:
if
(
document
is
not
None
)
and
document
.
getSimulationState
()
in
(
'started'
,
'stopped'
)
:
data_ingestion
=
document
if
modify
and
data_ingestion
is
None
:
specialise_list
=
[
x
.
getRelativeUrl
()
for
x
in
portal_catalog
.
searchResults
(
portal_type
=
'Data Supply'
,
specialise_query_kw
=
dict
(
portal_type
=
'Data Supply'
,
reference
=
specialise_reference
,
validation_state
=
'validated'
)]
validation_state
=
'validated'
)
if
destination_section_reference
is
not
None
:
specialise_query_kw
[
"destination_section_reference"
]
=
destination_section_reference
specialise_list
=
[
x
.
getRelativeUrl
()
for
x
in
portal_catalog
.
searchResults
(
specialise_query_kw
)]
# if we do not find a validated data supply, we look for a default data supply
if
not
specialise_list
:
specialise_list
=
[
x
.
getRelativeUrl
()
for
x
in
portal_catalog
.
searchResults
(
portal_type
=
'Data Supply'
,
reference
=
specialise_reference
,
validation_state
=
'default'
)]
specialise_query_kw
[
"validation_state"
]
=
'default'
specialise_list
=
[
x
.
getRelativeUrl
()
for
x
in
portal_catalog
.
searchResults
(
specialise_query_kw
)]
# create a new data ingestion
data_ingestion
=
portal
.
ERP5Site_createDataIngestion
(
specialise_list
,
...
...
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