Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def index_html(self, REQUEST, *args, **kw):
     """Return the document data."""
     return Document.index_html(self, REQUEST, *args, **kw)
Exemplo n.º 4
0
 def index_html(self, REQUEST, *args, **kw):
   """Return the image data."""
   self._upgradeImage()
   return Document.index_html(self, REQUEST, *args, **kw)
Exemplo n.º 5
0
Arquivo: Image.py Projeto: poses/erp5
 def index_html(self, REQUEST, *args, **kw):
     """Return the image data."""
     self._upgradeImage()
     return Document.index_html(self, REQUEST, *args, **kw)
Exemplo n.º 6
0
 def __call__(self):
   _setCacheHeaders(_ViewEmulator().__of__(self), {})
   return Document.__call__(self)
Exemplo n.º 7
0
 def index_html(self, REQUEST, *args, **kw):
   """Return the document data."""
   return Document.index_html(self, REQUEST, *args, **kw)
Exemplo n.º 8
0
 def __init__(self, id, **kw):
     self.initBucketTree()
     self.initIndexTree()
     Document.__init__(self, id, **kw)