Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.app.kss.plonekssview.PloneKSSView Class Reference
Inheritance diagram for plone.app.kss.plonekssview.PloneKSSView:
Inheritance graph
[legend]
Collaboration diagram for plone.app.kss.plonekssview.PloneKSSView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def macroContent
def issueAllPortalMessages

Static Public Attributes

tuple header_macros = ZopeTwoPageTemplateFile('browser/macro_wrapper.pt')

Detailed Description

The base view that contains helpers, to be imported
be other plone products

Definition at line 15 of file plonekssview.py.


Member Function Documentation

Definition at line 45 of file plonekssview.py.

00045 
00046     def issueAllPortalMessages(self):
00047         if hasattr(self.request.RESPONSE, 'cookies'):
00048             cookie = self.request.RESPONSE.cookies.get(STATUSMESSAGEKEY)
00049             if cookie:
00050                 encodedstatusmessages = cookie['value']
00051                 statusmessages = _decodeCookieValue(encodedstatusmessages)
00052             else:
00053                 statusmessages = []
00054             for msg in statusmessages:
00055                 self.getCommandSet('plone').issuePortalMessage(msg)
00056             self.request.RESPONSE.expireCookie(STATUSMESSAGEKEY, path='/')

Here is the call graph for this function:

Here is the caller graph for this function:

def plone.app.kss.plonekssview.PloneKSSView.macroContent (   self,
  macropath,
  kw 
)

Definition at line 24 of file plonekssview.py.

00024 
00025     def macroContent(self, macropath, **kw):
00026         'Renders a macro and returns its text'
00027         path = macropath.split('/')
00028         if len(path) < 2 or path[-2] != 'macros':
00029             raise RuntimeError, 'Path must end with macros/name_of_macro (%s)' % (repr(macropath), )
00030         # needs string, do not tolerate unicode (causes but at traverse)
00031         jointpath = '/'.join(path[:-2]).encode('ascii')
00032         macroobj = self.context.restrictedTraverse(jointpath)
00033         try:
00034             the_macro = macroobj.macros[path[-1]]
00035         except AttributeError, IndexError:
00036             raise RuntimeError, 'Macro not found'
00037         #  
00038         # put parameters on the request, by saving the original context
00039         self.request.form, orig_form = kw, self.request.form
00040         content = self.header_macros.__of__(macroobj.aq_parent)(the_macro=the_macro)
00041         self.request.form = orig_form
00042         # Always encoded as utf-8
00043         content = force_unicode(content, 'utf')
00044         return content

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tuple plone.app.kss.plonekssview.PloneKSSView.header_macros = ZopeTwoPageTemplateFile('browser/macro_wrapper.pt') [static]

Definition at line 22 of file plonekssview.py.


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