Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes
Marshall.predicates._base.Predicate Class Reference
Inheritance diagram for Marshall.predicates._base.Predicate:
Inheritance graph
[legend]
Collaboration diagram for Marshall.predicates._base.Predicate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def apply
def getComponentName
def setComponentName
def setExpression
def expression
def getExpression
def manage_availableComponents
def manage_changePredicate

Public Attributes

 id
 title

Static Public Attributes

string meta_type = "Marshaller Predicate"
tuple security = ClassSecurityInfo()
tuple manage_options
tuple manage_changePredicateForm
 manage = manage_mainmanage_changePredicateForm

Private Attributes

 _component_name
 _expression_text
 _expression

Static Private Attributes

tuple __implements__ = (IPredicate,)

Detailed Description

A Predicate for selecting marshallers.

Each Predicate is composed of a Expression  which
is evaluated in the context of the object to
decide if the Predicate applies, and returns
a component name to be used for that object.

Definition at line 33 of file _base.py.


Constructor & Destructor Documentation

def Marshall.predicates._base.Predicate.__init__ (   self,
  id,
  title,
  expression = '',
  component_name = '' 
)

Definition at line 61 of file _base.py.

00061 
00062     def __init__(self, id, title, expression='', component_name=''):
00063         self.id = id
00064         self.title = title
00065         self.setExpression(expression)
00066         self.setComponentName(component_name)


Member Function Documentation

def Marshall.predicates._base.Predicate.apply (   self,
  obj,
  kw 
)
Evaluate expression using the object as
context and return a component name if applicable.

Definition at line 68 of file _base.py.

00068 
00069     def apply(self, obj, **kw):
00070         """ Evaluate expression using the object as
00071         context and return a component name if applicable.
00072         """
00073         if not self.getExpression():
00074             # Short-circuit for speedup when no expression.
00075             return (self.getComponentName(),)
00076         context = createExprContext(obj, **kw)
00077         if self.expression(context):
00078             return (self.getComponentName(),)
00079         return ()

Here is the call graph for this function:

def Marshall.predicates._base.Predicate.expression (   self,
  context 
)
Evaluate the expression using context 

Definition at line 103 of file _base.py.

00103 
00104     def expression(self, context):
00105         """ Evaluate the expression using context """
00106         return self._expression(context)

Here is the caller graph for this function:

Return the component name configured for
this predicate.

Definition at line 81 of file _base.py.

00081 
00082     def getComponentName(self):
00083         """ Return the component name configured for
00084         this predicate.
00085         """
00086         return self._component_name

Here is the caller graph for this function:

Get the expression as text 

Definition at line 108 of file _base.py.

00108 
00109     def getExpression(self):
00110         """ Get the expression as text """
00111         return self._expression_text

Here is the caller graph for this function:

Definition at line 112 of file _base.py.

Here is the call graph for this function:

def Marshall.predicates._base.Predicate.manage_changePredicate (   self,
  title = None,
  expression = None,
  component_name = None,
  REQUEST = None 
)
Change the settings of this predicate 

Definition at line 119 of file _base.py.

00119 
00120                                REQUEST=None):
00121         """ Change the settings of this predicate """
00122 
00123         if title is not None:
00124             self.title = title
00125         if expression is not None:
00126             self.setExpression(expression)
00127         if component_name is not None:
00128             self.setComponentName(component_name)
00129 
00130         if REQUEST is not None:
00131             message = 'Predicate Constraints Changed.'
00132             return self.manage_changePredicateForm(
00133                 manage_tabs_message=message,
00134                 management_view='Edit')
00135         return self
00136 
00137 InitializeClass(Predicate)
00138 registerPredicate('default', 'Default Predicate', Predicate)

Here is the call graph for this function:

Here is the caller graph for this function:

def Marshall.predicates._base.Predicate.setComponentName (   self,
  component_name 
)
Change the component name 

Definition at line 88 of file _base.py.

00088 
00089     def setComponentName(self, component_name):
00090         """ Change the component name """
00091         valid_components = [i['name'] for i in getRegisteredComponents()]
00092         if component_name not in valid_components:
00093             raise ValueError, ('Not a valid registered '
00094                                'component: %s' % component_name)
00095         self._component_name = component_name

Here is the call graph for this function:

Here is the caller graph for this function:

def Marshall.predicates._base.Predicate.setExpression (   self,
  expression 
)
Change the expression 

Definition at line 97 of file _base.py.

00097 
00098     def setExpression(self, expression):
00099         """ Change the expression """
00100         self._expression_text = expression
00101         self._expression = Expression(expression)

Here is the caller graph for this function:


Member Data Documentation

tuple Marshall.predicates._base.Predicate.__implements__ = (IPredicate,) [static, private]

Definition at line 42 of file _base.py.

Definition at line 94 of file _base.py.

Definition at line 100 of file _base.py.

Definition at line 99 of file _base.py.

Definition at line 62 of file _base.py.

Marshall.predicates._base.Predicate.manage = manage_mainmanage_changePredicateForm [static]

Definition at line 59 of file _base.py.

Initial value:
PageTemplateFile(
        '../www/predicateChange', globals(),
        __name__='manage_changePredicateForm')

Definition at line 54 of file _base.py.

Initial value:
(
        {'label':'Edit', 'action':'manage_changePredicateForm'},
        )

Definition at line 47 of file _base.py.

Definition at line 44 of file _base.py.

tuple Marshall.predicates._base.Predicate.security = ClassSecurityInfo() [static]

Definition at line 45 of file _base.py.

Definition at line 63 of file _base.py.


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