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
8c71e57a
Commit
8c71e57a
authored
Oct 04, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: handling special chars in urls, ids and references
parent
3014e80e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_callables/HandleFifEmbulkIngestion.py
...TemplateItem/portal_callables/HandleFifEmbulkIngestion.py
+7
-0
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/getDataStreamList.py
...m/portal_skins/erp5_wendelin_telecom/getDataStreamList.py
+7
-5
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
...l_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
+1
-1
No files found.
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_callables/HandleFifEmbulkIngestion.py
View file @
8c71e57a
...
...
@@ -10,6 +10,13 @@ if (length < 7):
context
.
logEntry
(
"[ERROR] Data Ingestion reference is not well formated"
)
raise
ValueError
(
"Data Ingestion reference is not well formated."
)
invalid_chars
=
[
"&"
,
";"
,
"#"
,
"%"
,
'"'
,
"+"
]
for
char
in
invalid_chars
:
if
char
in
reference
:
context
.
logEntry
(
"[ERROR] Data Ingestion reference contains chars that are not allowed"
)
raise
ValueError
(
"Data Ingestion reference contains chars that are not allowed."
)
supplier
=
record
[
0
]
dataset_reference
=
record
[
1
]
filename
=
'/'
.
join
(
record
[
2
:
-
4
])
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
8c71e57a
...
...
@@ -18,8 +18,8 @@ try:
supplier
=
movement_dict
.
get
(
'supplier'
,
None
)
extension
=
movement_dict
.
get
(
'extension'
,
None
)
dataset_reference
=
movement_dict
.
get
(
'dataset_reference'
,
None
)
data_ingestion_id
=
'%s_%s_%s_%s'
%
(
supplier
,
data
_ingestion_reference
.
replace
(
"/"
,
"_"
).
replace
(
" "
,
"_"
)
,
now_string
,
eof
)
context
.
logEntry
(
"Data Ingestion ID: %s"
%
reference
)
data_ingestion_id
=
'%s_%s_%s_%s'
%
(
supplier
,
data
set_reference
,
now_string
,
eof
)
context
.
logEntry
(
"Data Ingestion ID: %s"
%
data_ingestion_id
)
size
=
movement_dict
.
get
(
'size'
,
None
)
if
movement_dict
.
get
(
'size'
,
None
)
!=
""
else
None
hash_value
=
movement_dict
.
get
(
'hash'
,
None
)
if
movement_dict
.
get
(
'hash'
,
None
)
!=
""
else
None
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDataStreamList.py
View file @
8c71e57a
import
re
import
json
from
Products.ERP5Type.Log
import
log
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
SimpleQuery
,
ComplexQuery
...
...
@@ -28,9 +29,10 @@ data_stream_list = []
for
stream
in
portal_catalog
(
**
query_dict
):
if
stream
.
getVersion
()
==
""
:
return
{
"status_code"
:
2
,
"result"
:
[]
}
data_stream_list
.
append
({
"id"
:
"data_stream_module/"
+
stream
.
getId
(),
"reference"
:
stream
.
getReference
(),
"size"
:
stream
.
getSize
(),
"hash"
:
stream
.
getVersion
()
})
data_stream_list
.
append
({
'id'
:
'data_stream_module/'
+
stream
.
getId
(),
'reference'
:
stream
.
getReference
(),
'size'
:
stream
.
getSize
(),
'hash'
:
stream
.
getVersion
()
})
return
{
"status_code"
:
0
,
"result"
:
data_stream_list
}
dict
=
{
'status_code'
:
0
,
'result'
:
data_stream_list
}
return
json
.
dumps
(
dict
)
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDescriptorHTMLContent.py
View file @
8c71e57a
...
...
@@ -15,7 +15,7 @@ ingestions = portal_catalog(**ing_dict)
if
len
(
ingestions
)
==
1
:
data_ingestion
=
ingestions
[
0
]
else
:
context
.
logEntry
(
"ERROR getting Data Ingestion of file %s. The file does not have a unique data ingestion in correct state."
)
context
.
logEntry
(
"ERROR getting Data Ingestion of file %s. The file does not have a unique data ingestion in correct state."
%
reference
)
return
'{"metadata":"No metadata available for this type of file yet"}'
try
:
...
...
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