Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.browser.formhelper.NullAddForm Class Reference
Inheritance diagram for plone.app.portlets.browser.formhelper.NullAddForm:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.browser.formhelper.NullAddForm:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __call__
def nextURL
def create

Detailed Description

An add view that will add its content immediately, without presenting
a form.

You should subclass this for portlets that do not require any configuration
before being added, and write a create() method that takes no parameters
and returns the appropriate assignment instance.

Definition at line 81 of file formhelper.py.


Member Function Documentation

Definition at line 90 of file formhelper.py.

00090 
00091     def __call__(self):
00092         IPortletPermissionChecker(aq_parent(aq_inner(self.context)))()
00093         ob = self.create()
00094         zope.event.notify(zope.lifecycleevent.ObjectCreatedEvent(ob))
00095         self.context.add(ob)
00096         nextURL = self.nextURL()
00097         if nextURL:
00098             self.request.response.redirect(self.nextURL())
00099         return ''
    

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in plone.app.portlets.portlets.calendar.AddForm, plone.app.portlets.portlets.login.AddForm, plone.app.portlets.portlets.review.AddForm, and plone.app.portlets.portlets.language.AddForm.

Definition at line 110 of file formhelper.py.

00110 
00111     def create(self):
00112         raise NotImplementedError("concrete classes must implement create()")
00113     

Here is the caller graph for this function:

Definition at line 100 of file formhelper.py.

00100 
00101     def nextURL(self):
00102         referer = self.request.get('referer')
00103         if referer:
00104             return referer
00105         else:
00106             addview = aq_parent(aq_inner(self.context))
00107             context = aq_parent(aq_inner(addview))
00108             url = str(getMultiAdapter((context, self.request), name=u"absolute_url"))
00109             return url + '/@@manage-portlets'
    

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: