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
483ff587
Commit
483ff587
authored
Oct 27, 2017
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: alarm and scripts to handle invalidated objects from the website
parent
2d6b94e0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
296 additions
and
1 deletion
+296
-1
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_alarms/wendelin_handle_invalids.xml
...thTemplateItem/portal_alarms/wendelin_handle_invalids.xml
+112
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
...ortal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
+33
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.xml
...rtal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
...5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
+25
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.xml
..._wendelin_telecom/ERP5Site_invalidateIngestionObjects.xml
+62
-0
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+1
-1
bt5/erp5_wendelin_telecom_ingestion/bt/template_path_list
bt5/erp5_wendelin_telecom_ingestion/bt/template_path_list
+1
-0
No files found.
bt5/erp5_wendelin_telecom_ingestion/PathTemplateItem/portal_alarms/wendelin_handle_invalids.xml
0 → 100644
View file @
483ff587
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_handleInvalids
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
wendelin_handle_invalids
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
id=
"1.1"
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1420502400.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_stop_date
</string>
</key>
<value>
<object>
<klass>
<reference
id=
"1.1"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
32503680000.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Handle Invalids
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
0 → 100644
View file @
483ff587
from
Products.ERP5Type.Log
import
log
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
SimpleQuery
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
kw_dict
=
{
"portal_type"
:
"Data Set"
,
"validation_state"
:
"Invalidated"
}
# data set
for
data_set
in
portal_catalog
(
**
kw_dict
):
if
not
data_set
.
getReference
().
endswith
(
"_invalid"
):
context
.
logEntry
(
"Invalidating data set and dependencies for: "
+
data_set
.
getReference
())
log
(
"Ivalid Dataset: "
+
str
(
data_set
.
getReference
()))
reference_query
=
Query
(
**
{
'reference'
:
data_set
.
getReference
()
+
'_%'
})
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
()
+
'_'
):
log
(
"Related data stream: "
+
data_stream
.
getReference
())
portal
.
ERP5Site_invalidateIngestionObjects
(
data_stream
.
getReference
())
log
(
"Invalidating data set"
)
data_set
.
setReference
(
data_set
.
getReference
()
+
"_invalid"
)
# data arrays
kw_dict
=
{
"portal_type"
:
"Data Array"
,
"validation_state"
:
"Invalidated"
}
for
data_array
in
portal_catalog
(
**
kw_dict
):
if
not
data_array
.
getReference
().
endswith
(
"_invalid"
):
log
(
"Ivalid Data Array: "
+
str
(
data_array
.
getReference
()))
context
.
logEntry
(
"Ivalid Data Array: "
+
str
(
data_array
.
getReference
()))
portal
.
ERP5Site_invalidateIngestionObjects
(
data_array
.
getReference
())
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.xml
0 → 100644
View file @
483ff587
<?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>
Alarm_handleInvalids
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.py
0 → 100644
View file @
483ff587
from
Products.ERP5Type.Log
import
log
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
SimpleQuery
,
ComplexQuery
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
log
(
"Invalidating related objects for reference "
+
reference
)
context
.
logEntry
(
"Invalidating objects for reference: "
+
reference
)
portal_type_query
=
ComplexQuery
(
Query
(
portal_type
=
'Data Stream'
),
Query
(
portal_type
=
'Data Array'
),
Query
(
portal_type
=
'Data Descriptor'
),
Query
(
portal_type
=
'Data Ingestion'
),
operator
=
"OR"
)
kw_dict
=
{
"query"
:
portal_type_query
,
"reference"
:
reference
}
for
document
in
portal_catalog
(
**
kw_dict
):
if
not
document
.
getReference
().
endswith
(
"_invalid"
):
context
.
logEntry
(
"%s %s (id:%s) invalidated"
%
(
document
.
getPortalType
(),
document
.
getReference
(),
document
.
getId
()))
document
.
setReference
(
document
.
getReference
()
+
"_invalid"
)
try
:
document
.
invalidate
()
except
:
pass
# fails if it's already invalidated or if it doens't allow invalidation (e.g. DI)
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_invalidateIngestionObjects.xml
0 → 100644
View file @
483ff587
<?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>
reference
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_invalidateIngestionObjects
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
483ff587
...
...
@@ -2,7 +2,7 @@ from DateTime import DateTime
from
Products.ERP5Type.Log
import
log
now
=
DateTime
()
today_string
=
now
.
strftime
(
'%Y%m%d'
)
today_string
=
now
.
strftime
(
'%Y%m%d
-%H%M%S
'
)
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
...
...
bt5/erp5_wendelin_telecom_ingestion/bt/template_path_list
View file @
483ff587
...
...
@@ -7,6 +7,7 @@ data_stream_module/embulk_download_script
data_supply_module/**
data_transformation_module/**
person_module/**
portal_alarms/wendelin_handle_invalids
portal_callables/DataIngestionLine_writeEmbulkIngestionToDataStream
portal_callables/DataTransformation_transformFIFDataToDataArray
portal_callables/HandleFifEmbulkIngestion
...
...
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