Commit 40dd93d3 authored by Rafael Monnerat's avatar Rafael Monnerat

Added a method for get the activities list and Install one business template.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26063 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ccfc2b36
......@@ -34,7 +34,6 @@ from Products.ERP5Type import Permissions
from AccessControl.SecurityManagement import setSecurityManager
from Products.ERP5 import _dtmldir
from Products.ERP5Type.Utils import _setSuperSecurityManager
from Products.ERP5Type.Cache import CachingMethod
_MARKER = []
......@@ -105,4 +104,36 @@ class IntrospectionTool(BaseTool):
return erp5_module_list
security.declareProtected(Permissions.AccessContentsInformation,
'getActivityMessageList')
def getActivityMessageList(self, processing_node=None):
"""
Returns the activity messages (as dict) list
"""
portal_activities = self.getPortalObject().portal_activities
m_list = portal_activities.getMessageList()
def getPropertyDict(message):
return message.__dict__
#return dict(object_path = message.object_path,
# method_id = message.method_id,
# processing_node = message.processing_node)
return [ getPropertyDict(m) for m in m_list ]
security.declareProtected(Permissions.AccessContentsInformation,
'installBusinessTemplate')
def installBusinesstemplate(self, url="", activate_kw={} ):
"""
install one business template
"""
portal_templates = self.getPortalObject().portal_templates
bt = portal_templates.download(url)
bt.activate(**activate_kw).install(force=True)
return [ bt.getId() , bt.getTitle() ]
InitializeClass(IntrospectionTool)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment