Commit abb249ae authored by Jean-Paul Smets's avatar Jean-Paul Smets

Quick implementation of crawler API (until well defined by interfaces)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26792 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4e64d30d
...@@ -30,6 +30,7 @@ from Products.CMFCore.utils import getToolByName ...@@ -30,6 +30,7 @@ from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Document.Url import UrlMixIn from Products.ERP5.Document.Url import UrlMixIn
from Products.ERP5.Document.Document import UpdateMixIn
import mimetypes import mimetypes
import re import re
...@@ -37,7 +38,7 @@ import urllib ...@@ -37,7 +38,7 @@ import urllib
from htmlentitydefs import name2codepoint from htmlentitydefs import name2codepoint
from DateTime import DateTime from DateTime import DateTime
class ExternalSource(XMLObject, UrlMixIn): class ExternalSource(XMLObject, UrlMixIn, UpdateMixIn):
""" """
An External Source consists of single URL which defines the An External Source consists of single URL which defines the
root of a collection of documents, each of which can be accessed root of a collection of documents, each of which can be accessed
...@@ -156,6 +157,14 @@ class ExternalSource(XMLObject, UrlMixIn): ...@@ -156,6 +157,14 @@ class ExternalSource(XMLObject, UrlMixIn):
return False return False
return method(content) return method(content)
security.declareProtected(Permissions.AccessContentsInformation, 'isExternalDocument')
def isExternalDocument(self):
"""
Return true if this document was obtained from an external source
XXX - is this really the right place ?
"""
return 1
# Search API # Search API
security.declareProtected(Permissions.SearchCatalog, 'searchResults') security.declareProtected(Permissions.SearchCatalog, 'searchResults')
def searchResults(self, **kw): def searchResults(self, **kw):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment