From abb249aeac501cdf8e303d06e45fb7a068b63c18 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Mon, 4 May 2009 21:49:27 +0000 Subject: [PATCH] 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 --- product/ERP5/Document/ExternalSource.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/product/ERP5/Document/ExternalSource.py b/product/ERP5/Document/ExternalSource.py index d7c41b2731..9316d226db 100644 --- a/product/ERP5/Document/ExternalSource.py +++ b/product/ERP5/Document/ExternalSource.py @@ -30,6 +30,7 @@ from Products.CMFCore.utils import getToolByName from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5.Document.Url import UrlMixIn +from Products.ERP5.Document.Document import UpdateMixIn import mimetypes import re @@ -37,7 +38,7 @@ import urllib from htmlentitydefs import name2codepoint from DateTime import DateTime -class ExternalSource(XMLObject, UrlMixIn): +class ExternalSource(XMLObject, UrlMixIn, UpdateMixIn): """ An External Source consists of single URL which defines the root of a collection of documents, each of which can be accessed @@ -156,6 +157,14 @@ class ExternalSource(XMLObject, UrlMixIn): return False 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 security.declareProtected(Permissions.SearchCatalog, 'searchResults') def searchResults(self, **kw): -- 2.30.9