Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
DCWorkflow.Expression.StateChangeInfo Class Reference

List of all members.

Public Member Functions

def __init__
def __getitem__
def getHistory
def getPortal
def getDateTime

Public Attributes

 object
 workflow
 old_state
 new_state
 transition
 status
 kwargs

Static Public Attributes

 ObjectDeleted = ObjectDeleted
 ObjectMoved = ObjectMoved
tuple security = ClassSecurityInfo()

Static Private Attributes

 _date = None

Detailed Description

Provides information for expressions and scripts.

Definition at line 49 of file Expression.py.


Constructor & Destructor Documentation

def DCWorkflow.Expression.StateChangeInfo.__init__ (   self,
  object,
  workflow,
  status = None,
  transition = None,
  old_state = None,
  new_state = None,
  kwargs = None 
)

Definition at line 62 of file Expression.py.

00062 
00063                  old_state=None, new_state=None, kwargs=None):
00064         if kwargs is None:
00065             kwargs = {}
00066         else:
00067             # Don't allow mutation
00068             kwargs = SafeMapping(kwargs)
00069         if status is None:
00070             tool = aq_parent(aq_inner(workflow))
00071             status = tool.getStatusOf(workflow.id, object)
00072             if status is None:
00073                 status = {}
00074         if status:
00075             # Don't allow mutation
00076             status = SafeMapping(status)
00077         self.object = object
00078         self.workflow = workflow
00079         self.old_state = old_state
00080         self.new_state = new_state
00081         self.transition = transition
00082         self.status = status
00083         self.kwargs = kwargs


Member Function Documentation

Definition at line 84 of file Expression.py.

00084 
00085     def __getitem__(self, name):
00086         if name[:1] != '_' and hasattr(self, name):
00087             return getattr(self, name)
00088         raise KeyError, name

Here is the caller graph for this function:

Definition at line 115 of file Expression.py.

00115 
00116     def getDateTime(self):
00117         date = self._date
00118         if not date:
00119             date = self._date = DateTime()
00120         return date
00121 
00122 Globals.InitializeClass(StateChangeInfo)
00123 

Definition at line 89 of file Expression.py.

00089 
00090     def getHistory(self):
00091         wf = self.workflow
00092         tool = aq_parent(aq_inner(wf))
00093         wf_id = wf.id
00094         h = tool.getHistoryOf(wf_id, self.object)
00095         if h:
00096             return map(lambda dict: dict.copy(), h)  # Don't allow mutation
00097         else:
00098             return ()

Definition at line 99 of file Expression.py.

00099 
00100     def getPortal(self):
00101         ob = aq_inner(self.object)
00102         while ob is not None:
00103             if ISiteRoot.providedBy(ob):
00104                 return ob
00105             if getattr(ob, '_isPortalRoot', None) is not None:
00106                 # BBB
00107                 warn("The '_isPortalRoot' marker attribute for site "
00108                      "roots is deprecated and will be removed in "
00109                      "CMF 2.3;  please mark the root object with "
00110                      "'ISiteRoot' instead.",
00111                      DeprecationWarning, stacklevel=2)
00112                 return ob
00113             ob = aq_parent(ob)
00114         return None

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 53 of file Expression.py.

Definition at line 82 of file Expression.py.

Definition at line 79 of file Expression.py.

Definition at line 76 of file Expression.py.

Definition at line 55 of file Expression.py.

Definition at line 56 of file Expression.py.

Definition at line 78 of file Expression.py.

tuple DCWorkflow.Expression.StateChangeInfo.security = ClassSecurityInfo() [static]

Definition at line 58 of file Expression.py.

Definition at line 81 of file Expression.py.

Definition at line 80 of file Expression.py.

Definition at line 77 of file Expression.py.


The documentation for this class was generated from the following file: