Back to index

plone3  3.1.7
kss_sharing.py
Go to the documentation of this file.
00001 from zope.interface import implements
00002 from zope.component import getMultiAdapter
00003 
00004 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
00005 
00006 from kss.core.interfaces import IKSSView
00007 from plone.app.kss.plonekssview import PloneKSSView as base
00008 
00009 
00010 class KSSSharingView(base):
00011     """KSS view for sharing page.
00012     """
00013     implements(IKSSView)
00014 
00015     template = ViewPageTemplateFile('sharing.pt')
00016     macro_wrapper = ViewPageTemplateFile('macro_wrapper.pt')
00017     
00018     def updateSharingInfo(self, search_term=''):
00019         sharing = getMultiAdapter((self.context, self.request,), name="sharing")
00020     
00021         # get the html from a macro
00022         ksscore = self.getCommandSet('core')
00023 
00024         the_id = 'user-group-sharing'
00025         macro = self.template.macros[the_id]
00026         res = self.macro_wrapper(the_macro=macro, instance=self.context, view=sharing)
00027         ksscore.replaceHTML(ksscore.getHtmlIdSelector(the_id), res)
00028 
00029         return self.render()
00030