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
a5f52a27
Commit
a5f52a27
authored
Oct 29, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: refactoring for ingestion reference utils (WIP)
- dataset invalidation uses utils suffix
parent
075059cf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
316 additions
and
13 deletions
+316
-13
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils.xml
...plateItem/portal_skins/erp5_ingestion_reference_utils.xml
+26
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/InvalidateReference.py
...ins/erp5_ingestion_reference_utils/InvalidateReference.py
+9
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/InvalidateReference.xml
...ns/erp5_ingestion_reference_utils/InvalidateReference.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/IsReferenceInvalidated.py
.../erp5_ingestion_reference_utils/IsReferenceInvalidated.py
+5
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/IsReferenceInvalidated.xml
...erp5_ingestion_reference_utils/IsReferenceInvalidated.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/RevalidateReference.py
...ins/erp5_ingestion_reference_utils/RevalidateReference.py
+9
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/RevalidateReference.xml
...ns/erp5_ingestion_reference_utils/RevalidateReference.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionReferenceDictionary.py
...estion_reference_utils/getIngestionReferenceDictionary.py
+7
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionReferenceDictionary.xml
...stion_reference_utils/getIngestionReferenceDictionary.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
...5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
+7
-10
bt5/erp5_wendelin_telecom_ingestion/WorkflowTemplateItem/portal_workflow/validation_workflow/scripts/Action_invalidateRelatedObjects.py
...ation_workflow/scripts/Action_invalidateRelatedObjects.py
+4
-3
bt5/erp5_wendelin_telecom_ingestion/bt/template_skin_id_list
bt5/erp5_wendelin_telecom_ingestion/bt/template_skin_id_list
+1
-0
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils.xml
0 → 100644
View file @
a5f52a27
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
erp5_ingestion_reference_utils
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/InvalidateReference.py
0 → 100644
View file @
a5f52a27
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
try
:
if
not
document
.
getReference
().
endswith
(
INVALID_SUFFIX
):
document
.
setReference
(
document
.
getReference
()
+
INVALID_SUFFIX
)
except
Exception
as
e
:
context
.
logEntry
(
"[ERROR] Error invalidating object: %s"
%
str
(
e
))
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/InvalidateReference.xml
0 → 100644
View file @
a5f52a27
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
document
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
InvalidateReference
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/IsReferenceInvalidated.py
0 → 100644
View file @
a5f52a27
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
return
document
.
getReference
().
endswith
(
INVALID_SUFFIX
)
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/IsReferenceInvalidated.xml
0 → 100644
View file @
a5f52a27
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
document
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
IsReferenceInvalidated
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/RevalidateReference.py
0 → 100644
View file @
a5f52a27
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
try
:
if
document
.
getReference
().
endswith
(
INVALID_SUFFIX
):
document
.
setReference
(
document
.
getReference
().
replace
(
INVALID_SUFFIX
,
""
))
except
Exception
as
e
:
context
.
logEntry
(
"[ERROR] Error revalidating object: %s"
%
str
(
e
))
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/RevalidateReference.xml
0 → 100644
View file @
a5f52a27
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
document
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
RevalidateReference
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionReferenceDictionary.py
0 → 100644
View file @
a5f52a27
return
{
"invalid_suffix"
:
"_invalid"
,
"split_end_suffix"
:
"EOF"
,
"single_end_suffix"
:
"END"
,
"split_first_suffix"
:
"001"
,
"reference_separator"
:
"/"
,
"complex_files_extensions"
:[
"fif"
,
"nii"
,
".nii/gz"
],
}
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionReferenceDictionary.xml
0 → 100644
View file @
a5f52a27
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getIngestionReferenceDictionary
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
View file @
a5f52a27
...
...
@@ -11,13 +11,10 @@ portal_type_query = ComplexQuery(Query(portal_type='Data Stream'),
logical_operator
=
"OR"
)
kw_dict
=
{
"query"
:
portal_type_query
,
"reference"
:
reference
}
try
:
for
document
in
portal_catalog
(
**
kw_dict
):
if
not
document
.
getReference
().
endswith
(
"_invalid"
):
document
.
setReference
(
document
.
getReference
()
+
"_invalid"
)
try
:
document
.
invalidate
()
except
:
pass
# fails if it's already invalidated, draft or if it doens't allow invalidation (e.g. DI)
except
Exception
as
e
:
context
.
logEntry
(
"[ERROR] Error invalidating objects for reference '%s': %s"
%
(
reference
,
str
(
e
)))
for
document
in
portal_catalog
(
**
kw_dict
):
portal
.
InvalidateReference
(
document
)
try
:
document
.
invalidate
()
except
:
pass
# fails if it's already invalidated, draft or if it doens't allow invalidation (e.g. DI)
bt5/erp5_wendelin_telecom_ingestion/WorkflowTemplateItem/portal_workflow/validation_workflow/scripts/Action_invalidateRelatedObjects.py
View file @
a5f52a27
...
...
@@ -6,14 +6,15 @@ object = state_change['object']
if
object
.
getPortalType
()
==
"Data Set"
:
data_set
=
object
data_set_prefix
=
data_set
.
getReference
()
+
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
]
context
.
logEntry
(
"Invalidating data set '%s' and dependencies."
%
data_set
.
getReference
())
reference_query
=
Query
(
**
{
'reference'
:
data_set
.
getReference
()
+
'/
%'
})
reference_query
=
Query
(
**
{
'reference'
:
data_set
_prefix
+
'
%'
})
kw_dict
=
{
"portal_type"
:
"Data Stream"
,
"query"
:
reference_query
}
for
data_stream
in
portal_catalog
(
**
kw_dict
):
if
data_stream
.
getReference
().
startswith
(
data_set
.
getReference
()
+
'/'
)
and
not
data_stream
.
getReference
().
endswith
(
"_invalid"
):
if
data_stream
.
getReference
().
startswith
(
data_set
_prefix
)
and
not
portal
.
IsReferenceInvalidated
(
data_stream
):
portal
.
ERP5Site_invalidateIngestionObjects
(
data_stream
.
getReference
())
data_set
.
setReference
(
data_set
.
getReference
()
+
"_invalid"
)
portal
.
InvalidateReference
(
data_set
)
data_set
.
setVersion
(
"000"
)
elif
object
.
getPortalType
()
==
"Data Stream"
:
data_stream
=
object
...
...
bt5/erp5_wendelin_telecom_ingestion/bt/template_skin_id_list
View file @
a5f52a27
erp5_ingestion_reference_utils
erp5_wendelin_telecom
\ No newline at end of file
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