Logo Search packages:      
Sourcecode: zope-cmfplone version File versions

def zope-cmfplone-2.0.4::NavigationTool::NavigationTool::addTransitionFor (   self,
  content,
  script,
  status,
  destination 
)

Adds a transition.  When SCRIPT with context CONTENT
returns STATUS, go to DESTINATION

content - is a object or a TypeInfo that you would like to
register.  A None content object will register
Default values.

script - the script/template that was just called

status - SUCCESS or FAILURE strings used in calculating destination

destination - is an action registed on the TypeInfo or a free-form script
that would be appended to the url of the content

Destinations are specified as follows: action:ACTION_NAME
invokes the action ACTION_NAME on the current context
script:SCRIPT_NAME invokes the python script SCRIPT_NAME on
the current context.  The script should return a tuple
containing a status code (either 'success' or 'failure') and
optional kwargs.  getNext() will be called using the return
code to determine the next page to load.  url:URL redirects to
the url specified by URL.  URL may be absolute or relative
PAGE invokes the page PAGE on the current context

Definition at line 122 of file NavigationTool.py.

00122                                                                     :
        """ Adds a transition.  When SCRIPT with context CONTENT
        returns STATUS, go to DESTINATION

        content - is a object or a TypeInfo that you would like to
        register.  A None content object will register
        Default values.

        script - the script/template that was just called

        status - SUCCESS or FAILURE strings used in calculating destination

        destination - is an action registed on the TypeInfo or a free-form script
        that would be appended to the url of the content

        Destinations are specified as follows: action:ACTION_NAME
        invokes the action ACTION_NAME on the current context
        script:SCRIPT_NAME invokes the python script SCRIPT_NAME on
        the current context.  The script should return a tuple
        containing a status code (either 'success' or 'failure') and
        optional kwargs.  getNext() will be called using the return
        code to determine the next page to load.  url:URL redirects to
        the url specified by URL.  URL may be absolute or relative
        PAGE invokes the page PAGE on the current context
        """

        property_tool = getattr(self, 'portal_properties')
        #propertymanager that holds data
        navprops = getattr(property_tool, 'navigation_properties')

        content=self._getContentFrom(content)
        status = self._normalize(status, lower=1)
        script = self._normalize(script)

        transition = '%s.%s.%s'%( content
                                , script
                                , status )

        if navprops.hasProperty(transition):
            navprops._updateProperty(transition, destination)
        else:
            navprops._setProperty(transition, destination)


    security.declarePrivate('removeTransitionFrom')
    def removeTransitionFrom(self, content, script=None, status=None):


Generated by  Doxygen 1.6.0   Back to index