def getContext(self): context = Acquisition.aq_inner(self.context) # if dynamic-pressroom was used on a Document, get the parent-folder if IATDocument.providedBy(context): context = Acquisition.aq_parent(context) context = context.getCanonical() return context
def getContext(self): context = aq_inner(self.context) # if dynamic-pressroom was used on a Document, get the parent-folder if IATDocument.providedBy(context): context = aq_parent(context) if hasattr(context, 'isCanonical') and not context.isCanonical(): context = context.getCanonical() return context
def __call__(self): purl = getToolByName(self.context, 'portal_url') pobj = purl.getPortalObject() disc = pobj.get('disclaimer') if not disc: raise AttributeError(u'Disclaimer Object missing') if not IATDocument.providedBy(disc): raise AttributeError(u'Unknown Object declared as Disclaimer') return disc.getText()