Back to index

plone3  3.1.7
tools.py
Go to the documentation of this file.
00001 from zope.interface import implements
00002 from plone.memoize.view import memoize_contextless
00003 
00004 from Products.Five.browser import BrowserView
00005 from Products.CMFCore.utils import getToolByName
00006 
00007 from interfaces import ITools
00008 
00009 class Tools(BrowserView):
00010     """Common tools
00011     """
00012     
00013     implements(ITools)
00014     
00015     @memoize_contextless
00016     def actions(self):
00017         return getToolByName(self.context, 'portal_actions')
00018         
00019     @memoize_contextless
00020     def catalog(self):
00021         return getToolByName(self.context, 'portal_catalog')
00022         
00023     @memoize_contextless
00024     def interface(self):
00025         return getToolByName(self.context, 'portal_interface')
00026         
00027     @memoize_contextless
00028     def membership(self):
00029         return getToolByName(self.context, 'portal_membership')
00030         
00031     @memoize_contextless
00032     def properties(self):
00033         return getToolByName(self.context, 'portal_properties')
00034 
00035     @memoize_contextless
00036     def syndication(self):
00037         return getToolByName(self.context, 'portal_syndication')
00038         
00039     @memoize_contextless
00040     def url(self):
00041         return getToolByName(self.context, 'portal_url')
00042         
00043     @memoize_contextless
00044     def types(self):
00045         return getToolByName(self.context, 'portal_types')
00046 
00047     @memoize_contextless
00048     def workflow(self):
00049         return getToolByName(self.context, 'portal_workflow')