[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/catalog - __init__.py:1.1.2.1 catalog.py:1.1.2.1

Anthony Baxter anthony@interlink.com.au
Sat, 12 Jul 2003 02:15:21 -0400


Update of /cvs-repository/Zope3/src/zope/app/interfaces/catalog
In directory cvs.zope.org:/tmp/cvs-serv26101/interfaces/catalog

Added Files:
      Tag: melb-2003-content-catalog-branch
	__init__.py catalog.py 
Log Message:
first cut at catalogs. There are both content-space catalogs and utility-space
catalogs - in zope/app/catalog/catalog.txt is an example of creating the 
latter.

Next up is to re-work the Catalog<->Index interface. If you create 
catalogs now, you'll need to throw them away when those changes land
(soon). Note also that the search interface at the moment is a little
bit primitive - you call 'searchResults(key=value, key2=value2)'.



=== Added File Zope3/src/zope/app/interfaces/catalog/__init__.py ===


=== Added File Zope3/src/zope/app/interfaces/catalog/catalog.py ===
from zope.interface import Interface

class ICatalogView(Interface):
    "Provides read-only access to Catalog"

    def getSubscribed(): "get current subscription status"

class ICatalogQuery(Interface):
    "Provides Catalog Queries"
    def searchResults(**kw):
	"search on the given indexes"

class ICatalogEdit(Interface):
    "Provides read-write Catalog info"
    def clearIndexes(): 
        "nuke the indexes"
    def updateIndexes(): 
        "reindex all objects"
    def subscribeEvents(update=True): 
	"start receiving events, if update, reindex all existing events"
    def unsubscribeEvents(): 
	"stop receiving events"

class ICatalog(ICatalogView, ICatalogQuery, ICatalogEdit): 
    "a content-space catalog"
    pass