Back to index

plone3  3.1.7
Public Member Functions
CMFFormController.Actions.TraverseTo.TraverseTo Class Reference
Inheritance diagram for CMFFormController.Actions.TraverseTo.TraverseTo:
Inheritance graph
[legend]
Collaboration diagram for CMFFormController.Actions.TraverseTo.TraverseTo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __call__

Detailed Description

Definition at line 13 of file TraverseTo.py.


Member Function Documentation

def CMFFormController.Actions.TraverseTo.TraverseTo.__call__ (   self,
  controller_state 
)

Definition at line 14 of file TraverseTo.py.

00014 
00015     def __call__(self, controller_state):
00016         url = self.getArg(controller_state)
00017         # see if this is a relative url or an absolute
00018         if len(urlparse.urlparse(url)[1]) != 0:
00019             # host specified, so url is absolute.  No good for traversal.
00020             raise ValueError, 'Can\'t traverse to absolute url %s' % str(url)
00021 
00022         url_path = urlparse.urlparse(url)[2]
00023         # combine args from query string with args from the controller state
00024         # (args in the state supercede those in the query string)
00025         args = self.combineArgs(url, controller_state.kwargs)
00026 
00027         # put the args in the REQUEST
00028         REQUEST = controller_state.getContext().REQUEST
00029         for (key, value) in args.items():
00030             REQUEST.set(key, value)
00031 
00032         # make sure target exists
00033         context = controller_state.getContext()
00034         obj = context.restrictedTraverse(url_path, default=None)
00035         if obj is None:
00036             raise ValueError, 'Unable to find %s\n' % str(url_path)
00037         return mapply(obj, REQUEST.args, REQUEST,
00038                                call_object, 1, missing_name, dont_publish_class,
00039                                REQUEST, bind=1)
00040 
00041 
00042 registerFormAction('traverse_to',
00043                    factory,
00044                    'Traverse to the URL specified in the argument (a TALES expression).  The URL must be a relative URL.')

Here is the call graph for this function:

Here is the caller graph for this function:


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