Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 def index_html(self, REQUEST, *args, **kw):
     """Return the document data."""
     return Document.index_html(self, REQUEST, *args, **kw)
Exemple #4
0
 def index_html(self, REQUEST, *args, **kw):
   """Return the image data."""
   self._upgradeImage()
   return Document.index_html(self, REQUEST, *args, **kw)
Exemple #5
0
 def index_html(self, REQUEST, *args, **kw):
     """Return the image data."""
     self._upgradeImage()
     return Document.index_html(self, REQUEST, *args, **kw)
Exemple #6
0
 def __call__(self):
   _setCacheHeaders(_ViewEmulator().__of__(self), {})
   return Document.__call__(self)
Exemple #7
0
 def index_html(self, REQUEST, *args, **kw):
   """Return the document data."""
   return Document.index_html(self, REQUEST, *args, **kw)
Exemple #8
0
 def __init__(self, id, **kw):
     self.initBucketTree()
     self.initIndexTree()
     Document.__init__(self, id, **kw)