Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.browser.navtree.DefaultNavtreeStrategy Class Reference
Inheritance diagram for CMFPlone.browser.navtree.DefaultNavtreeStrategy:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.browser.navtree.DefaultNavtreeStrategy:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def subtreeFilter
def nodeFilter
def decoratorFactory
def showChildrenOf

Public Attributes

 bottomLevel
 rootPath
 context
 portal
 excludedIds
 parentTypesNQ
 viewActionTypes
 showAllParents
 memberId

Detailed Description

The navtree strategy used for the default navigation portlet

Definition at line 198 of file navtree.py.


Constructor & Destructor Documentation

def CMFPlone.browser.navtree.DefaultNavtreeStrategy.__init__ (   self,
  context,
  view = None 
)

Reimplemented from CMFPlone.browser.navtree.SitemapNavtreeStrategy.

Definition at line 204 of file navtree.py.

00204 
00205     def __init__(self, context, view=None):
00206         SitemapNavtreeStrategy.__init__(self, context, view)
00207         portal_properties = getToolByName(context, 'portal_properties')
00208         navtree_properties = getattr(portal_properties, 'navtree_properties')
00209         # XXX: We can't do this with a 'depth' query to EPI...
00210         self.bottomLevel = navtree_properties.getProperty('bottomLevel', 0)
00211         if view is not None:
00212             self.rootPath = view.navigationTreeRootPath()
00213         else:
00214             self.rootPath = getNavigationRoot(context)

Here is the call graph for this function:


Member Function Documentation

Reimplemented from plone.app.layout.navigation.navtree.NavtreeStrategyBase.

Definition at line 149 of file navtree.py.

00149 
00150     def decoratorFactory(self, node):
00151         context = aq_inner(self.context)
00152         request = context.REQUEST
00153         
00154         newNode = node.copy()
00155         item = node['item']
00156 
00157         portalType = getattr(item, 'portal_type', None)
00158         itemUrl = item.getURL()
00159         if portalType is not None and portalType in self.viewActionTypes:
00160             itemUrl += '/view'
00161 
00162         isFolderish = getattr(item, 'is_folderish', None)
00163         showChildren = False
00164         if isFolderish and (portalType is None or portalType not in self.parentTypesNQ):
00165             showChildren = True
00166 
00167         ploneview = getMultiAdapter((context, request), name=u'plone')
00168 
00169         newNode['Title'] = utils.pretty_title_or_id(context, item)
00170         newNode['absolute_url'] = itemUrl
00171         newNode['getURL'] = itemUrl
00172         newNode['path'] = item.getPath()
00173         newNode['icon'] = getattr(item, 'getIcon', None) # Deprecated, use item_icon
00174         newNode['item_icon'] = ploneview.getIcon(item)
00175         newNode['Creator'] = getattr(item, 'Creator', None)
00176         newNode['creation_date'] = getattr(item, 'CreationDate', None)
00177         newNode['portal_type'] = portalType
00178         newNode['review_state'] = getattr(item, 'review_state', None)
00179         newNode['Description'] = getattr(item, 'Description', None)
00180         newNode['getRemoteUrl'] = getattr(item, 'getRemoteUrl', None)
00181         newNode['show_children'] = showChildren
00182         newNode['no_display'] = False # We sort this out with the nodeFilter
00183         newNode['link_remote'] = newNode['getRemoteUrl'] and newNode['Creator'] != self.memberId
00184 
00185         idnormalizer = queryUtility(IIDNormalizer)
00186         newNode['normalized_portal_type'] = idnormalizer.normalize(portalType)
00187         newNode['normalized_review_state'] = idnormalizer.normalize(newNode['review_state'])
00188 
00189         return newNode
        
def CMFPlone.browser.navtree.SitemapNavtreeStrategy.nodeFilter (   self,
  node 
) [inherited]

Reimplemented from plone.app.layout.navigation.navtree.NavtreeStrategyBase.

Definition at line 133 of file navtree.py.

00133 
00134     def nodeFilter(self, node):
00135         item = node['item']
00136         if getattr(item, 'getId', None) in self.excludedIds:
00137             return False
00138         elif getattr(item, 'exclude_from_nav', False):
00139             return False
00140         else:
00141             return True

def CMFPlone.browser.navtree.SitemapNavtreeStrategy.showChildrenOf (   self,
  object 
) [inherited]

Reimplemented from plone.app.layout.navigation.navtree.NavtreeStrategyBase.

Definition at line 190 of file navtree.py.

00190 
00191     def showChildrenOf(self, object):
00192         getTypeInfo = getattr(object, 'getTypeInfo', None)
00193         if getTypeInfo is not None:
00194             portal_type = getTypeInfo().getId()
00195             if portal_type in self.parentTypesNQ:
00196                 return False
00197         return True

Reimplemented from CMFPlone.browser.navtree.SitemapNavtreeStrategy.

Definition at line 215 of file navtree.py.

00215 
00216     def subtreeFilter(self, node):
00217         sitemapDecision = SitemapNavtreeStrategy.subtreeFilter(self, node)
00218         if sitemapDecision == False:
00219             return False
00220         depth = node.get('depth', 0)
00221         if depth > 0 and self.bottomLevel > 0 and depth >= self.bottomLevel:
00222             return False
00223         else:
00224             return True

Member Data Documentation

Definition at line 209 of file navtree.py.

Definition at line 114 of file navtree.py.

Definition at line 121 of file navtree.py.

Definition at line 131 of file navtree.py.

Definition at line 124 of file navtree.py.

Definition at line 117 of file navtree.py.

Reimplemented from CMFPlone.browser.navtree.SitemapNavtreeStrategy.

Definition at line 211 of file navtree.py.

Reimplemented from plone.app.layout.navigation.navtree.NavtreeStrategyBase.

Definition at line 127 of file navtree.py.

Definition at line 125 of file navtree.py.


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