Exemple #1
0
    def pdf(self, value):
        """ Invalidate last generated PDF?
        """
        if not value:
            return

        updateContext(self.context)

        if value.get("relatedItems"):
            updateRelatedItems(self.context)

        if value.get("backRefs"):
            updateBackRefs(self.context)
Exemple #2
0
    def pdf(self, value):
        """ Invalidate last generated PDF?
        """
        if not value:
            return

        updateContext(self.context)

        if value.get('relatedItems'):
            updateRelatedItems(self.context)

        if value.get('backRefs'):
            updateBackRefs(self.context)
Exemple #3
0
 def flushPDFsCache(self):
     """ Flush all PDFs cache for this theme
     """
     catalog = getToolByName(self.context, 'portal_catalog')
     for brain in catalog.searchResults(portal_type=self.types):
         obj = brain.getObject()
         storage = IStorage(obj).of('pdf')
         storage_pdf_obj = obj.unrestrictedTraverse(
             storage.absolute_url(True), None)
         #change modification time only if
         #the object has a PDF generated in downloads
         if storage_pdf_obj is not None:
             updateContext(obj)
     return json.dumps('ok')
Exemple #4
0
 def flushPDFsCache(self):
     """ Flush all PDFs cache for this theme
     """
     catalog = getToolByName(self.context, 'portal_catalog')
     for brain in catalog.searchResults(portal_type=self.types):
         obj = brain.getObject()
         storage = IStorage(obj).of('pdf')
         storage_pdf_obj = obj.unrestrictedTraverse(
             storage.absolute_url(True), None)
         #change modification time only if
         #the object has a PDF generated in downloads
         if storage_pdf_obj is not None:
             updateContext(obj)
     return json.dumps('ok')