Commit 603c8600 authored by wenjie.zheng's avatar wenjie.zheng

ERP5Workflow Method Generation for live test.

parent 425949fe
This diff is collapsed.
...@@ -46,6 +46,7 @@ from TranslationProviderBase import TranslationProviderBase ...@@ -46,6 +46,7 @@ from TranslationProviderBase import TranslationProviderBase
from sys import exc_info from sys import exc_info
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
from Products.CMFCore.exceptions import zExceptions_Unauthorized from Products.CMFCore.exceptions import zExceptions_Unauthorized
from types import NoneType
def getCurrentUserIdOrAnonymousToken(): def getCurrentUserIdOrAnonymousToken():
"""Return connected user_id or simple token for """Return connected user_id or simple token for
...@@ -421,10 +422,9 @@ class ERP5TypeInformation(XMLObject, ...@@ -421,10 +422,9 @@ class ERP5TypeInformation(XMLObject,
for workflow5 in self.getTypeWorkflowList(): for workflow5 in self.getTypeWorkflowList():
workflow_module = portal.getDefaultModule(portal_type="Workflow") workflow_module = portal.getDefaultModule(portal_type="Workflow")
if workflow_module is not None: workflow5 = workflow_module._getOb(workflow5)
workflow5 = workflow_module._getOb(workflow5) workflow5.initializeDocument(ob)
workflow5.initializeDocument(ob)
if not temp_object: if not temp_object:
init_script = self.getTypeInitScriptId() init_script = self.getTypeInitScriptId()
...@@ -531,6 +531,7 @@ class ERP5TypeInformation(XMLObject, ...@@ -531,6 +531,7 @@ class ERP5TypeInformation(XMLObject,
""" """
Return all the properties of the Portal Type Return all the properties of the Portal Type
""" """
### cls's class is PortalTypeMetaClass defined in ERP5Type/dynamic/lazy_class.py
cls = self.getPortalObject().portal_types.getPortalTypeClass(self.getId()) cls = self.getPortalObject().portal_types.getPortalTypeClass(self.getId())
return_set = set() return_set = set()
for property_dict in cls.getAccessorHolderPropertyList(content=True): for property_dict in cls.getAccessorHolderPropertyList(content=True):
......
...@@ -7,7 +7,7 @@ from Products.ERP5Type.Accessor.Constant import Getter as ConstantGetter ...@@ -7,7 +7,7 @@ from Products.ERP5Type.Accessor.Constant import Getter as ConstantGetter
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Base import Base as ERP5Base from Products.ERP5Type.Base import Base as ERP5Base
from . import aq_method_lock from . import aq_method_lock
from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWorkflowMethods from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWorkflowMethods, intializePortalTypeERP5WorkflowMethod
from Products.ERP5Type.Utils import UpperCase from Products.ERP5Type.Utils import UpperCase
from Products.ERP5Type.Core.CategoryProperty import CategoryProperty from Products.ERP5Type.Core.CategoryProperty import CategoryProperty
from ExtensionClass import ExtensionClass, pmc_init_of from ExtensionClass import ExtensionClass, pmc_init_of
...@@ -266,6 +266,25 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -266,6 +266,25 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else: else:
initializePortalTypeDynamicWorkflowMethods(cls, portal_workflow) initializePortalTypeDynamicWorkflowMethods(cls, portal_workflow)
# ================== Workflow5 Project, Wenjie, Dec 2014 =======================
#raise NotImplementedError (cls.__name__) # Category Property
### the ERP5Workflow list is defined in ERP5Type, only try to get erp5workflow
### when it's an erp5workflow related type.
if cls.__name__ == "Object Type":
portal_workflow5 = site.getDefaultModule(portal_type="Workflow")
#raise NotImplementedError (portal_workflow5) #<Workflow Module at workflow_module>
#raise NotImplementedError (cls.__module__) #<class 'erp5.portal_type.Category Property'>
if portal_workflow5 is None:
LOG("ERP5Type.Dynamic", WARNING,
"no workflow5 methods for %s"
% cls.__name__)
else:
intializePortalTypeERP5WorkflowMethod(cls, portal_workflow5)
# ================== WF5 =======================================================
# portal type group methods, isNodeType, isResourceType... # portal type group methods, isNodeType, isResourceType...
from Products.ERP5Type.ERP5Type import ERP5TypeInformation from Products.ERP5Type.ERP5Type import ERP5TypeInformation
# XXX possible optimization: # XXX possible optimization:
......
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