--- MPIWGWeb/Attic/MPIWGTemplate.py 2009/04/17 08:55:32 1.1.2.9 +++ MPIWGWeb/Attic/MPIWGTemplate.py 2012/01/09 13:14:46 1.1.2.12 @@ -8,6 +8,8 @@ import logging from OFS.Folder import Folder from AccessControl import ClassSecurityInfo from MPIWGHelper import * +from ZODB import FileStorage, DB +import transaction # dummy definitions for backwards compatibility import MPIWGFeature @@ -64,14 +66,29 @@ 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()) + transaction.commit() + return rendered except: logging.error("cannot harvest: %s"%self.absolute_url()) + + + def manage_addMPIWGTemplateForm(self): """Form for adding""" @@ -120,4 +137,4 @@ def manage_addMPIWGTemplate(self, MPIWGT REQUEST.RESPONSE.redirect(u+'/manage_main') return '' - \ No newline at end of file +