Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
plone.app.portlets.browser.kss.PortletManagerKSS Class Reference
Inheritance diagram for plone.app.portlets.browser.kss.PortletManagerKSS:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.browser.kss.PortletManagerKSS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def move_portlet_up
def move_portlet_down
def delete_portlet

Private Member Functions

def _render_column

Detailed Description

Opertions on portlets done using KSS

Definition at line 17 of file kss.py.


Member Function Documentation

def plone.app.portlets.browser.kss.PortletManagerKSS._render_column (   self,
  info,
  view_name 
) [private]

Definition at line 65 of file kss.py.

00065 
00066     def _render_column(self, info, view_name):
00067         ksscore = self.getCommandSet('core')
00068         selector = ksscore.getCssSelector('div#portletmanager-' + info['manager'].replace('.', '-'))
00069         
00070         context = aq_inner(self.context)
00071         request = aq_inner(self.request)
00072         view = getMultiAdapter((context, request), name=view_name)
00073         manager = getUtility(IPortletManager, name=info['manager'])
00074         
00075         request['key'] = info['key']
00076         
00077         request['viewname'] = view_name
00078         renderer = getMultiAdapter((context, request, view, manager,), IPortletManagerRenderer)
00079         renderer.update()
00080         ksscore.replaceInnerHTML(selector, renderer.__of__(context).render())
00081         return self.render()

Here is the caller graph for this function:

def plone.app.portlets.browser.kss.PortletManagerKSS.delete_portlet (   self,
  portlethash,
  viewname 
)

Definition at line 55 of file kss.py.

00055 
00056     def delete_portlet(self, portlethash, viewname):
00057         info = unhashPortletInfo(portlethash)
00058         assignments = assignment_mapping_from_key(self.context, 
00059                         info['manager'], info['category'], info['key'])
00060                         
00061         IPortletPermissionChecker(assignments.__of__(aq_inner(self.context)))()
00062         
00063         del assignments[info['name']]
00064         return self._render_column(info, viewname)
                

Here is the call graph for this function:

def plone.app.portlets.browser.kss.PortletManagerKSS.move_portlet_down (   self,
  portlethash,
  viewname 
)

Definition at line 39 of file kss.py.

00039 
00040     def move_portlet_down(self, portlethash, viewname):
00041         info = unhashPortletInfo(portlethash)
00042         assignments = assignment_mapping_from_key(self.context, 
00043                         info['manager'], info['category'], info['key'])
00044         
00045         IPortletPermissionChecker(assignments.__of__(aq_inner(self.context)))()
00046         
00047         keys = list(assignments.keys())
00048         name = info['name']
00049         idx = keys.index(name)
00050         del keys[idx]
00051         keys.insert(idx+1, name)
00052         assignments.updateOrder(keys)
00053         
00054         return self._render_column(info, viewname)
        

Here is the call graph for this function:

def plone.app.portlets.browser.kss.PortletManagerKSS.move_portlet_up (   self,
  portlethash,
  viewname 
)

Definition at line 22 of file kss.py.

00022 
00023     def move_portlet_up(self, portlethash, viewname):
00024         info = unhashPortletInfo(portlethash)
00025         assignments = assignment_mapping_from_key(self.context, 
00026                         info['manager'], info['category'], info['key'])
00027         
00028         IPortletPermissionChecker(assignments.__of__(aq_inner(self.context)))()
00029         
00030         keys = list(assignments.keys())
00031         name = info['name']
00032         idx = keys.index(name)
00033         del keys[idx]
00034         keys.insert(idx-1, name)
00035         assignments.updateOrder(keys)
00036         
00037         return self._render_column(info, viewname)
00038         
        

Here is the call graph for this function:


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