--- MPIWGWeb/Attic/MPIWGTemplate.py 2009/04/17 08:55:32 1.1.2.9 +++ MPIWGWeb/Attic/MPIWGTemplate.py 2012/01/09 10:36:48 1.1.2.11 @@ -8,6 +8,7 @@ import logging from OFS.Folder import Folder from AccessControl import ClassSecurityInfo from MPIWGHelper import * +from ZODB import FileStorage, DB # dummy definitions for backwards compatibility import MPIWGFeature @@ -64,14 +65,28 @@ class MPIWGTemplate(ZopePageTemplate): getSection = getSection getSubSection = getSubSection - def harvest_page(self): + def harvest_page(self,mode="normal"): """harvest main""" + + + + # Ensure that a 'userdb' key is present + # in the root + + templates = self.en.getHarvestCache() + #templates = getattr(self,'getHarvestCache',self.en.getHarvestCache)() try: - return self.pt_render() + rendered = self.pt_render() + templates[self.absolute_url()]=rendered + logging.debug("harvest:"+self.absolute_url()) + return rendered except: logging.error("cannot harvest: %s"%self.absolute_url()) + + + def manage_addMPIWGTemplateForm(self): """Form for adding""" @@ -120,4 +135,4 @@ def manage_addMPIWGTemplate(self, MPIWGT REQUEST.RESPONSE.redirect(u+'/manage_main') return '' - \ No newline at end of file +