Back to index

plone3  3.1.7
interfaces.py
Go to the documentation of this file.
00001 from zope.interface import Interface, Attribute
00002 
00003 class INavigationRoot(Interface):
00004     """A marker interface for signaling the navigation root.
00005     """
00006     
00007 class IDefaultPage(Interface):
00008     """Interface for a view that can determine if its context is the
00009     default page or not.
00010     """
00011 
00012     def isDefaultPage(obj):
00013         """Finds out if the given obj is the default page for the
00014         adapted object.
00015         """
00016 
00017     def getDefaultPage():
00018         """Returns the id of the default page for the adapted object.
00019         """
00020 
00021 class INavigationQueryBuilder(Interface):
00022     """An object which returns a catalog query when called, used to 
00023     construct a navigation tree.
00024     """
00025     
00026     def __call__():
00027         """Returns a mapping describing a catalog query used to build a
00028            navigation structure.
00029         """
00030 
00031 class INavtreeStrategy(Interface):
00032     """An object that is used by buildFolderTree() to determine how to 
00033     construct a navigation tree.
00034     """
00035 
00036     rootPath = Attribute("The path to the root of the navtree (None means use portal root)")
00037 
00038     showAllParents = Attribute("Whether or not to show all parents of the current context always")
00039 
00040     def nodeFilter(node):
00041         """Return True or False to determine whether to include the given node
00042         in the tree. Nodes are dicts with at least one key - 'item', the
00043         catalog brain of the object the node represents.
00044         """
00045 
00046     def subtreeFilter(node):
00047         """Return True or False to determine whether to expand the given
00048         (folderish) node
00049         """
00050 
00051     def decoratorFactory(node):
00052         """Inject any additional keys in the node that are needed and return
00053         the new node.
00054         """
00055         
00056     def showChildrenOf(object):
00057         """Given an object (usually the root of the site), determine whether
00058         children should be shown or not. Even if this returns True, if
00059         showAllParents is True, the path to the current item may be shown.
00060         """