def getContentBaseURL(self): """ Returns the content base URL based on the actual content (in HTML) """ if self.hasTextContent(): html = self._asHTML() # a document can be entirely stripped by safe_html # so its html conversion can be empty if html.strip(): html_tree = etree_html.fromstring(html) base_list = [href for href in html_tree.xpath('//base/@href') if href] if base_list: return str(base_list[0]) return Document.getContentBaseURL(self)
def index_html(self, REQUEST, *args, **kw): """Return the document data.""" return Document.index_html(self, REQUEST, *args, **kw)
def index_html(self, REQUEST, *args, **kw): """Return the image data.""" self._upgradeImage() return Document.index_html(self, REQUEST, *args, **kw)
def __call__(self): _setCacheHeaders(_ViewEmulator().__of__(self), {}) return Document.__call__(self)
def __init__(self, id, **kw): self.initBucketTree() self.initIndexTree() Document.__init__(self, id, **kw)