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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
c3de53b8
Commit
c3de53b8
authored
Feb 07, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ActivityTool: Inherit from BaseTool.
Reduces code duplication.
parent
c2ebc937
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+6
-11
No files found.
product/CMFActivity/ActivityTool.py
View file @
c3de53b8
...
@@ -34,7 +34,7 @@ from types import StringType
...
@@ -34,7 +34,7 @@ from types import StringType
from
collections
import
defaultdict
from
collections
import
defaultdict
from
cPickle
import
dumps
,
loads
from
cPickle
import
dumps
,
loads
from
Products.CMFCore
import
permissions
as
CMFCorePermissions
from
Products.CMFCore
import
permissions
as
CMFCorePermissions
from
Products.ERP5Type.
Core.Folder
import
Folder
from
Products.ERP5Type.
Tool.BaseTool
import
BaseTool
from
Products.CMFActivity.ActiveResult
import
ActiveResult
from
Products.CMFActivity.ActiveResult
import
ActiveResult
from
Products.CMFActivity.ActiveObject
import
DEFAULT_ACTIVITY
from
Products.CMFActivity.ActiveObject
import
DEFAULT_ACTIVITY
from
Products.CMFActivity.ActivityConnection
import
ActivityConnection
from
Products.CMFActivity.ActivityConnection
import
ActivityConnection
...
@@ -607,7 +607,7 @@ def cancelProcessShutdown():
...
@@ -607,7 +607,7 @@ def cancelProcessShutdown():
is_running_lock
.
release
()
is_running_lock
.
release
()
has_processed_shutdown
=
False
has_processed_shutdown
=
False
class
ActivityTool
(
Folder
,
UniqueObject
):
class
ActivityTool
(
BaseTool
):
"""
"""
ActivityTool is the central point for activity management.
ActivityTool is the central point for activity management.
...
@@ -634,7 +634,7 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -634,7 +634,7 @@ class ActivityTool (Folder, UniqueObject):
,
{
'label'
:
'LoadBalancing'
,
'action'
:
'manageLoadBalancing'
}
,
{
'label'
:
'LoadBalancing'
,
'action'
:
'manageLoadBalancing'
}
,
{
'label'
:
'Advanced'
,
'action'
:
'manageActivitiesAdvanced'
}
,
{
'label'
:
'Advanced'
,
'action'
:
'manageActivitiesAdvanced'
}
,
,
]
+
list
(
Folder
.
manage_options
))
]
+
list
(
BaseTool
.
manage_options
))
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'manageActivities'
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'manageActivities'
)
manageActivities
=
DTMLFile
(
'dtml/manageActivities'
,
globals
()
)
manageActivities
=
DTMLFile
(
'dtml/manageActivities'
,
globals
()
)
...
@@ -660,15 +660,10 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -660,15 +660,10 @@ class ActivityTool (Folder, UniqueObject):
LOG
(
'ActivityTool'
,
0
,
real_SQLDict_setPriority
(
src__
=
1
,
**
kw
))
LOG
(
'ActivityTool'
,
0
,
real_SQLDict_setPriority
(
src__
=
1
,
**
kw
))
return
real_SQLDict_setPriority
(
**
kw
)
return
real_SQLDict_setPriority
(
**
kw
)
def
__init__
(
self
,
id
=
None
):
if
id
is
None
:
id
=
ActivityTool
.
id
Folder
.
__init__
(
self
,
id
)
# Filter content (ZMI))
# Filter content (ZMI))
def
filtered_meta_types
(
self
,
user
=
None
):
def
filtered_meta_types
(
self
,
user
=
None
):
# Filters the list of available meta types.
# Filters the list of available meta types.
all
=
Folder
.
filtered_meta_types
(
self
)
all
=
BaseTool
.
filtered_meta_types
(
self
)
meta_types
=
[]
meta_types
=
[]
for
meta_type
in
self
.
all_meta_types
():
for
meta_type
in
self
.
all_meta_types
():
if
meta_type
[
'name'
]
in
self
.
allowed_types
:
if
meta_type
[
'name'
]
in
self
.
allowed_types
:
...
@@ -844,12 +839,12 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -844,12 +839,12 @@ class ActivityTool (Folder, UniqueObject):
security
.
declarePrivate
(
'manage_beforeDelete'
)
security
.
declarePrivate
(
'manage_beforeDelete'
)
def
manage_beforeDelete
(
self
,
item
,
container
):
def
manage_beforeDelete
(
self
,
item
,
container
):
self
.
unsubscribe
()
self
.
unsubscribe
()
Folder
.
inheritedAttribute
(
'manage_beforeDelete'
)(
self
,
item
,
container
)
BaseTool
.
inheritedAttribute
(
'manage_beforeDelete'
)(
self
,
item
,
container
)
security
.
declarePrivate
(
'manage_afterAdd'
)
security
.
declarePrivate
(
'manage_afterAdd'
)
def
manage_afterAdd
(
self
,
item
,
container
):
def
manage_afterAdd
(
self
,
item
,
container
):
self
.
subscribe
()
self
.
subscribe
()
Folder
.
inheritedAttribute
(
'manage_afterAdd'
)(
self
,
item
,
container
)
BaseTool
.
inheritedAttribute
(
'manage_afterAdd'
)(
self
,
item
,
container
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'getServerAddress'
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'getServerAddress'
)
def
getServerAddress
(
self
):
def
getServerAddress
(
self
):
...
...
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