Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer Class Reference
Inheritance diagram for plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def blacklist_status_action
def manager_name
def context_blacklist_status
def group_blacklist_status
def content_type_blacklist_status
def visible
def filter
def update
def render
def normalized_manager_name
def baseUrl
def portlets
def addable_portlets
def referer
def url_quote_referer
def context_url

Public Attributes

 manager
 context
 request

Static Public Attributes

tuple template = ViewPageTemplateFile('templates/edit-manager-contextual.pt')

Detailed Description

Render a portlet manager in edit mode for contextual portlets

Definition at line 142 of file editmanager.py.


Constructor & Destructor Documentation

def plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer.__init__ (   self,
  context,
  request,
  view,
  manager 
)

Reimplemented from plone.app.portlets.browser.editmanager.EditPortletManagerRenderer.

Definition at line 149 of file editmanager.py.

00149 
00150     def __init__(self, context, request, view, manager):
00151         EditPortletManagerRenderer.__init__(self, context, request, view, manager)
        

Here is the caller graph for this function:


Member Function Documentation

Definition at line 101 of file editmanager.py.

00101 
00102     def addable_portlets(self):
00103         baseUrl = self.baseUrl()
00104         addviewbase = baseUrl.replace(self.context_url(), '')
00105         def sort_key(v):
00106             return v.get('title')
00107         portlets =  [{
00108             'title' : p.title,
00109             'description' : p.description,
00110             'addview' : '%s/+/%s' % (addviewbase, p.addview)
00111             } for p in self.manager.getAddablePortletTypes()]
00112         portlets.sort(key=sort_key)
00113         return portlets

Here is the call graph for this function:

Definition at line 66 of file editmanager.py.

00066 
00067     def baseUrl(self):
00068         return self.__parent__.getAssignmentMappingUrl(self.manager)

Here is the caller graph for this function:

Definition at line 152 of file editmanager.py.

00152 
00153     def blacklist_status_action(self):
00154         baseUrl = str(getMultiAdapter((self.context, self.request), name='absolute_url'))
00155         return baseUrl + '/@@set-portlet-blacklist-status'
    

Definition at line 167 of file editmanager.py.

00167 
00168     def content_type_blacklist_status(self):
00169         assignable = getMultiAdapter((self.context, self.manager,), ILocalPortletAssignmentManager)
        return assignable.getBlacklistStatus(CONTENT_TYPE_CATEGORY)

Definition at line 159 of file editmanager.py.

00159 
00160     def context_blacklist_status(self):
00161         assignable = getMultiAdapter((self.context, self.manager,), ILocalPortletAssignmentManager)
00162         return assignable.getBlacklistStatus(CONTEXT_CATEGORY)

Definition at line 139 of file editmanager.py.

00139 
00140     def context_url(self):
00141         return str(getMultiAdapter((self.context, self.request), name='absolute_url'))
          

Here is the caller graph for this function:

Definition at line 50 of file editmanager.py.

00050 
00051     def filter(self, portlets):
00052         return portlets

Here is the caller graph for this function:

Definition at line 163 of file editmanager.py.

00163 
00164     def group_blacklist_status(self):
00165         assignable = getMultiAdapter((self.context, self.manager,), ILocalPortletAssignmentManager)
00166         return assignable.getBlacklistStatus(GROUP_CATEGORY)
    

Definition at line 156 of file editmanager.py.

00156 
00157     def manager_name(self):
00158         return self.manager.__name__
    

Definition at line 63 of file editmanager.py.

00063 
00064     def normalized_manager_name(self):
00065         return self.manager.__name__.replace('.', '-')

Definition at line 69 of file editmanager.py.

00069 
00070     def portlets(self):
00071         baseUrl = self.baseUrl()
00072         assignments = self._lazyLoadAssignments(self.manager)
00073         data = []
00074         
00075         manager_name = self.manager.__name__
00076         category = self.__parent__.category
00077         key = self.__parent__.key
00078         
00079         for idx in range(len(assignments)):
00080             name = assignments[idx].__name__
00081             
00082             editview = queryMultiAdapter((assignments[idx], self.request), name='edit', default=None)
00083             if editview is None:
00084                 editviewName = ''
00085             else:
00086                 editviewName = '%s/%s/edit' % (baseUrl, name)
00087             
00088             portlet_hash = hashPortletInfo(dict(manager=manager_name, category=category, 
00089                                                 key=key, name=name,))
00090             
00091             data.append( {'title'      : assignments[idx].title,
00092                           'editview'   : editviewName,
00093                           'hash'       : portlet_hash,
00094                           'up_url'     : '%s/@@move-portlet-up?name=%s' % (baseUrl, name),
00095                           'down_url'   : '%s/@@move-portlet-down?name=%s' % (baseUrl, name),
00096                           'delete_url' : '%s/@@delete-portlet?name=%s' % (baseUrl, name),
00097                           })
00098         if len(data) > 0:
00099             data[0]['up_url'] = data[-1]['down_url'] = None
00100         return data
        

Here is the call graph for this function:

Definition at line 115 of file editmanager.py.

00115 
00116     def referer(self):
00117         view_name = self.request.get('viewname', None)
00118         key = self.request.get('key', None)
00119         base_url = self.request['ACTUAL_URL']
00120         
00121         if view_name:
00122             base_url = self.context_url() + '/' + view_name
00123         
00124         if key:
00125             base_url += '?key=%s' % key
00126         
00127         return base_url

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 56 of file editmanager.py.

00056 
00057     def render(self):
00058         if not self.__updated:
00059             raise UpdateNotCalled
00060         return self.template()
    

Definition at line 53 of file editmanager.py.

00053 
00054     def update(self):
00055         self.__updated = True

Here is the caller graph for this function:

Definition at line 129 of file editmanager.py.

00129 
00130     def url_quote_referer(self):
00131         return url_quote(self.referer())
    

Here is the call graph for this function:

Definition at line 47 of file editmanager.py.

00047 
00048     def visible(self):
00049         return True


Member Data Documentation

Definition at line 42 of file editmanager.py.

Definition at line 41 of file editmanager.py.

Definition at line 43 of file editmanager.py.

tuple plone.app.portlets.browser.editmanager.ContextualEditPortletManagerRenderer.template = ViewPageTemplateFile('templates/edit-manager-contextual.pt') [static]

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