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
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
Papa Tamsir Kane
erp5
Commits
ce36c199
Commit
ce36c199
authored
Aug 30, 2017
by
Papa Tamsir Kane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_curation_request: Improve curation request creation alarm scalability
Do not loop over URLs. Use SearchAndActivate
parent
9b7db145
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
31 deletions
+89
-31
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_base_approval.xml
...usiness_process_module/curation_request_base_approval.xml
+0
-8
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_base_approval/2.xml
...iness_process_module/curation_request_base_approval/2.xml
+1
-1
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_business_process/3.xml
...ss_process_module/curation_request_business_process/3.xml
+1
-1
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/Alarm_createCurationRequestForNewUrl.py
..._curation_request/Alarm_createCurationRequestForNewUrl.py
+6
-21
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequestModule_viewCurationRequestList/listbox.xml
...CurationRequestModule_viewCurationRequestList/listbox.xml
+12
-0
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequest_newCurationRequestForUrl.py
...ation_request/CurationRequest_newCurationRequestForUrl.py
+7
-0
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequest_newCurationRequestForUrl.xml
...tion_request/CurationRequest_newCurationRequestForUrl.xml
+62
-0
No files found.
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_base_approval.xml
View file @
ce36c199
...
...
@@ -14,9 +14,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -27,9 +25,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -40,9 +36,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -54,9 +48,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_base_approval/2.xml
View file @
ce36c199
...
...
@@ -22,9 +22,9 @@
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
predecessor/trade_state/curation_request/submitted
</string>
<string>
trade_phase/curation_request/approve/legal
</string>
<string>
delivery_builder/portal_deliveries/decision_builder
</string>
<string>
predecessor/trade_state/curation_request/submitted
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_curation_request/PathTemplateItem/business_process_module/curation_request_business_process/3.xml
View file @
ce36c199
...
...
@@ -22,8 +22,8 @@
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
source_decision/person_module/2
</string>
<string>
trade_phase/curation_request/approve/legal
</string>
<string>
source_decision/person_module/1
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/Alarm_createCurationRequestForNewUrl.py
View file @
ce36c199
from
Products.ERP5Type.DateUtils
import
addToDate
from
DateTime
import
DateTime
from
Products.ZSQLCatalog.SQLCatalog
import
ComplexQuery
from
Products.ZSQLCatalog.SQLCatalog
import
Query
now
=
DateTime
()
five_min_ago
=
addToDate
(
now
,
minute
=-
5
)
url_query
=
ComplexQuery
(
Query
(
portal_type
=
'Url'
),
Query
(
validation_state
=
(
'draft'
,)),
Query
(
modification_date
=
[
five_min_ago
,
now
],
range
=
'minmax'
),
logical_operator
=
'and'
)
urls
=
context
.
getPortalObject
().
portal_catalog
(
query
=
url_query
)
for
url
in
urls
:
if
url
.
getAggregateRelatedValue
()
is
None
:
curation_request
=
context
.
curation_request_module
.
newContent
(
portal_type
=
'Curation Request'
)
curation_record_line
=
curation_request
.
newContent
(
portal_type
=
'Curation Request Line'
,
aggregate_value
=
url
)
portal
=
context
.
getPortalObject
()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Url'
,
validation_state
=
'draft'
,
method_id
=
'CurationRequest_newCurationRequestForUrl'
)
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequestModule_viewCurationRequestList/listbox.xml
View file @
ce36c199
...
...
@@ -12,6 +12,7 @@
<list>
<string>
columns
</string>
<string>
selection_name
</string>
<string>
sort_columns
</string>
<string>
title
</string>
</list>
</value>
...
...
@@ -103,6 +104,17 @@
<key>
<string>
selection_name
</string>
</key>
<value>
<string>
curation_request_module_selection
</string>
</value>
</item>
<item>
<key>
<string>
sort_columns
</string>
</key>
<value>
<list>
<tuple>
<string>
id
</string>
<string>
Id
</string>
</tuple>
</list>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Curation Requests
</string>
</value>
...
...
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequest_newCurationRequestForUrl.py
0 → 100644
View file @
ce36c199
#portal = context.getPortalObject()
#url = portal.restrictedTraverse(url_relative_url)
if
context
.
getAggregateRelatedValue
()
is
None
:
curation_request
=
context
.
curation_request_module
.
newContent
(
portal_type
=
'Curation Request'
)
curation_record_line
=
curation_request
.
newContent
(
portal_type
=
'Curation Request Line'
,
aggregate_value
=
context
)
context
.
submit
()
bt5/erp5_curation_request/SkinTemplateItem/portal_skins/erp5_curation_request/CurationRequest_newCurationRequestForUrl.xml
0 → 100644
View file @
ce36c199
<?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>
CurationRequest_newCurationRequestForUrl
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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