Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
f4c47fc0
Commit
f4c47fc0
authored
Jan 10, 2023
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
Mar 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_api_style: Simplify Alarm to update Revision List
parent
3dd65f28
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
24 deletions
+77
-24
bt5/erp5_api_style/PathTemplateItem/portal_alarms/update_jio_api_revision_template.xml
...teItem/portal_alarms/update_jio_api_revision_template.xml
+6
-2
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Alarm_activateUpdateJIOAPIRevision.py
...pi_jio_sql_revision/Alarm_activateUpdateJIOAPIRevision.py
+7
-21
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectMissingJIOAPIRevisionObjectList.py
...l_revision/Base_zSelectMissingJIOAPIRevisionObjectList.py
+1
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectMissingJIOAPIRevisionObjectList.xml
..._revision/Base_zSelectMissingJIOAPIRevisionObjectList.xml
+62
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectUpdatableJIOAPIRevisionObjectList.sql
...evision/Base_zSelectUpdatableJIOAPIRevisionObjectList.sql
+0
-0
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectUpdatableJIOAPIRevisionObjectList.xml
...evision/Base_zSelectUpdatableJIOAPIRevisionObjectList.xml
+1
-1
No files found.
bt5/erp5_api_style/PathTemplateItem/portal_alarms/update_jio_api_revision_template.xml
View file @
f4c47fc0
...
@@ -73,11 +73,15 @@
...
@@ -73,11 +73,15 @@
</item>
</item>
<item>
<item>
<key>
<string>
configuration_form_id
</string>
</key>
<key>
<string>
configuration_form_id
</string>
</key>
<value>
<string>
Alarm_viewConsistencyCheckConfiguration
</string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string>
Clone this alarm for you projects and configure it through the Configuration Tab
</string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
enabled
</string>
</key>
<key>
<string>
enabled
</string>
</key>
...
...
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Alarm_activateUpdateJIOAPIRevision.py
View file @
f4c47fc0
kw
=
{}
if
not
context
.
Base_zCheckjIOAPIRevisionTableExists
():
if
not
context
.
Base_zCheckjIOAPIRevisionTableExists
():
context
.
Base_zCreatejIOAPIRevisionTable
()
context
.
Base_zCreatejIOAPIRevisionTable
()
if
context
.
getProperty
(
'incremental_check'
):
last_active_process
=
context
.
getLastActiveProcess
()
if
last_active_process
is
not
None
:
kw
[
'indexation_timestamp'
]
=
'>= %s'
%
last_active_process
.
getStartDate
().
ISO
()
active_process
=
context
.
newActiveProcess
().
getRelativeUrl
()
query_string
=
context
.
getProperty
(
'catalog_query_string'
,
''
)
# the query sould be something like "validation_state:!=deleted validation_state:!=draft portal_type:Organisation" etc
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
if
query_string
is
not
None
:
# Get the list of objects that should have a jio api revision but do not have
kw
.
update
(
SearchableText
=
query_string
)
potentially_missing_object_list
=
portal
.
Base_zSelectMissingJIOAPIRevisionObjectList
()
for
element
in
potentially_missing_object_list
:
kw
.
update
(
parent_uid
=
[
portal
.
restrictedTraverse
(
module
).
getUid
()
for
module
in
context
.
getProperty
(
'module_list'
)
or
[]])
portal
.
unrestrictedTraverse
(
element
.
relative_url
).
updateJIOAPIRevision
()
object_list
=
portal
.
portal_catalog
(
**
kw
)
for
element
in
object_list
:
element
.
getObject
().
updateJIOAPIRevision
()
#
Catch any objects that might have fell through the cracks
#
Get the list of objects that have a jio api revision and where indexation timestamp has changed since last check
object_list
=
context
.
Base_zSelectOutdatedjIOAPIRevisionTable
()
updatable_object_list
=
context
.
Base_zSelectUpdatableJIOAPIRevisionObjectList
()
for
element
in
object_list
:
for
element
in
updatable_
object_list
:
portal
.
unrestrictedTraverse
(
element
.
relative_url
).
updateJIOAPIRevision
()
portal
.
unrestrictedTraverse
(
element
.
relative_url
).
updateJIOAPIRevision
()
context
.
activate
(
after_tag
=
tag
).
getId
()
context
.
activate
(
after_tag
=
tag
).
getId
()
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectMissingJIOAPIRevisionObjectList.py
0 → 100644
View file @
f4c47fc0
return
[]
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelectMissingJIOAPIRevisionObjectList.xml
0 → 100644
View file @
f4c47fc0
<?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>
Base_zSelectMissingJIOAPIRevisionObjectList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelect
OutdatedjIOAPIRevisionTable
.sql
→
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelect
UpdatableJIOAPIRevisionObjectList
.sql
View file @
f4c47fc0
File moved
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelect
OutdatedjIOAPIRevisionTable
.xml
→
bt5/erp5_api_style/SkinTemplateItem/portal_skins/erp5_api_jio_sql_revision/Base_zSelect
UpdatableJIOAPIRevisionObjectList
.xml
View file @
f4c47fc0
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_zSelect
OutdatedjIOAPIRevisionTable
</string>
</value>
<value>
<string>
Base_zSelect
UpdatableJIOAPIRevisionObjectList
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
...
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