Beispiel #1
0
    def enable(self):
        utils = getToolByName(self.context, 'plone_utils')

        if not IIssuu.providedBy(self.context):
            alsoProvides(self.context, IIssuu)

            self.context.reindexObject(idxs=['object_provides'])
            utils.addPortalMessage("You have uploaded this file to issuu.com. You will have to wait a little before before the doucment is found (issuu.com has to process it).")
            IssuuView(self.context, self.request).upload_document()
        else:  
            self.request.response.redirect(self.context.absolute_url()) + '/@@file_view'
Beispiel #2
0
 def disable(self):
     utils = getToolByName(self.context, 'plone_utils')
     
     if IIssuu.providedBy(self.context):
         noLongerProvides(self.context, IIssuu)
         self.context.reindexObject(idxs=['object_provides'])
         
         #now delete the annotation
         annotations = IAnnotations(self.context)
         metadata = annotations.get('medialog.issuu', None)
         if metadata is not None:
             del annotations['medialog.issuu']
         
         IssuuView(self.context, self.request).delete_document()
         utils.addPortalMessage("Issuu removed.")
         
     self.context.setLayout("file_view")
     self.request.response.redirect(self.context.absolute_url() + '/@@file_view')
Beispiel #3
0
 def enabled(self):
     return IIssuu.providedBy(self.context)