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
be176741
Commit
be176741
authored
Jul 12, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: slash ( / ) reference separator and directory tree
parent
3728c446
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_callables/HandleFifEmbulkIngestion.py
...TemplateItem/portal_callables/HandleFifEmbulkIngestion.py
+7
-6
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
...ortal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
+2
-2
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+2
-2
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
...l_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
+6
-2
No files found.
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_callables/HandleFifEmbulkIngestion.py
View file @
be176741
...
@@ -3,12 +3,13 @@ from Products.ERP5Type.Log import log
...
@@ -3,12 +3,13 @@ from Products.ERP5Type.Log import log
context
.
logEntry
(
"[NEW INGESTION]"
)
context
.
logEntry
(
"[NEW INGESTION]"
)
context
.
logEntry
(
"Reference: %s"
%
reference
)
context
.
logEntry
(
"Reference: %s"
%
reference
)
record
=
reference
.
rsplit
(
'.'
)
record
=
reference
.
rsplit
(
'/'
)
filename
=
record
[
2
]
if
(
len
(
record
)
>=
5
)
else
reference
length
=
len
(
record
)
extension
=
record
[
3
]
if
(
len
(
record
)
>=
5
)
else
"fif"
specialise_reference
=
record
[
0
]
if
(
length
>=
5
)
else
"default"
eof
=
record
[
4
]
if
(
len
(
record
)
>=
5
)
else
"eof"
aggregate_data_set_reference
=
record
[
1
]
if
(
length
>=
5
)
else
"default"
specialise_reference
=
record
[
0
]
if
(
len
(
record
)
>=
5
)
else
"default"
filename
=
'/'
.
join
(
record
[
2
:
-
2
])
if
(
length
>=
5
)
else
reference
aggregate_data_set_reference
=
record
[
1
]
if
(
len
(
record
)
>=
5
)
else
"default"
extension
=
record
[
length
-
2
]
if
(
length
>=
5
)
else
"fif"
eof
=
record
[
length
-
1
]
if
(
length
>=
5
)
else
"eof"
dict
=
{
'filename'
:
filename
,
dict
=
{
'filename'
:
filename
,
'extension'
:
extension
,
'extension'
:
extension
,
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
View file @
be176741
...
@@ -12,11 +12,11 @@ for data_set in portal_catalog(**kw_dict):
...
@@ -12,11 +12,11 @@ for data_set in portal_catalog(**kw_dict):
if
not
data_set
.
getReference
().
endswith
(
"_invalid"
):
if
not
data_set
.
getReference
().
endswith
(
"_invalid"
):
context
.
logEntry
(
"Invalidating data set and dependencies for: "
+
data_set
.
getReference
())
context
.
logEntry
(
"Invalidating data set and dependencies for: "
+
data_set
.
getReference
())
log
(
"Ivalid Dataset: "
+
str
(
data_set
.
getReference
()))
log
(
"Ivalid Dataset: "
+
str
(
data_set
.
getReference
()))
reference_query
=
Query
(
**
{
'reference'
:
data_set
.
getReference
()
+
'
_
%'
})
reference_query
=
Query
(
**
{
'reference'
:
data_set
.
getReference
()
+
'
/
%'
})
kw_dict
=
{
"portal_type"
:
"Data Stream"
,
kw_dict
=
{
"portal_type"
:
"Data Stream"
,
"query"
:
reference_query
}
"query"
:
reference_query
}
for
data_stream
in
portal_catalog
(
**
kw_dict
):
for
data_stream
in
portal_catalog
(
**
kw_dict
):
if
data_stream
.
getReference
().
startswith
(
data_set
.
getReference
()
+
'
_
'
):
if
data_stream
.
getReference
().
startswith
(
data_set
.
getReference
()
+
'
/
'
):
log
(
"Related data stream: "
+
data_stream
.
getReference
())
log
(
"Related data stream: "
+
data_stream
.
getReference
())
portal
.
ERP5Site_invalidateIngestionObjects
(
data_stream
.
getReference
())
portal
.
ERP5Site_invalidateIngestionObjects
(
data_stream
.
getReference
())
log
(
"Invalidating data set"
)
log
(
"Invalidating data set"
)
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
be176741
...
@@ -9,7 +9,7 @@ portal_catalog = portal.portal_catalog
...
@@ -9,7 +9,7 @@ portal_catalog = portal.portal_catalog
try
:
try
:
# remove supplier and eof from reference
# remove supplier and eof from reference
reference
=
'
_'
.
join
(
reference
.
split
(
'.
'
)[
1
:
-
1
])
#'_'.join(reference.split('.')[:-1])
reference
=
'
/'
.
join
(
reference
.
split
(
'/
'
)[
1
:
-
1
])
#'_'.join(reference.split('.')[:-1])
log
(
"Reference: "
+
reference
)
log
(
"Reference: "
+
reference
)
context
.
logEntry
(
"Data Ingestion reference: %s"
%
reference
)
context
.
logEntry
(
"Data Ingestion reference: %s"
%
reference
)
...
@@ -18,7 +18,7 @@ try:
...
@@ -18,7 +18,7 @@ try:
resource_reference
=
movement_dict
.
get
(
'resource_reference'
,
None
)
resource_reference
=
movement_dict
.
get
(
'resource_reference'
,
None
)
specialise_reference
=
movement_dict
.
get
(
'specialise_reference'
,
None
)
specialise_reference
=
movement_dict
.
get
(
'specialise_reference'
,
None
)
dataset_reference
=
movement_dict
.
get
(
'aggregate_data_set_reference'
,
None
)
dataset_reference
=
movement_dict
.
get
(
'aggregate_data_set_reference'
,
None
)
data_ingestion_id
=
'%s_%s_%s'
%
(
specialise_reference
,
data_ingestion_reference
,
today_string
)
data_ingestion_id
=
'%s_%s_%s'
%
(
specialise_reference
,
data_ingestion_reference
.
replace
(
"/"
,
"_"
)
,
today_string
)
context
.
logEntry
(
"Data Ingestion ID: %s"
%
reference
)
context
.
logEntry
(
"Data Ingestion ID: %s"
%
reference
)
# search for applicable data ingestion
# search for applicable data ingestion
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ingestionReferenceExists.py
View file @
be176741
...
@@ -14,8 +14,12 @@ try:
...
@@ -14,8 +14,12 @@ try:
context
.
logEntry
(
"Attempt to do a new ingestion with reference: %s"
%
reference
)
context
.
logEntry
(
"Attempt to do a new ingestion with reference: %s"
%
reference
)
# remove supplier and eof from reference
# remove supplier and eof from reference
data_ingestion_reference
=
'_'
.
join
(
reference
.
split
(
'.'
)[
1
:
-
1
])
data_ingestion_reference
=
'/'
.
join
(
reference
.
split
(
'/'
)[
1
:
-
1
])
EOF
=
reference
.
split
(
'.'
)[
-
1
]
EOF
=
reference
.
split
(
'/'
)[
-
1
]
if
data_ingestion_reference
is
""
:
context
.
logEntry
(
"[ERROR] Data Ingestion reference is not well formated"
)
raise
ValueError
(
"Data Ingestion reference is not well formated"
)
data_ingestion
=
portal_catalog
.
getResultValue
(
data_ingestion
=
portal_catalog
.
getResultValue
(
portal_type
=
'Data Ingestion'
,
portal_type
=
'Data Ingestion'
,
...
...
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