Personal tools
You are here: Home Members tiran's Home References interfaces.py
Document Actions

interfaces.py

by Christian Heimes last modified 2006-06-12 19:20

Interface ideas

from zope.interface import Interface, Attribute

class ISimpmleReferenceEngine(Interface):
    """Simple reference engine
    
    The reference engine is
    """

    _sids = Attribute('BTree with source id -> reference id')
    _tids = Attribute('BTree with target id -> reference id')
    _rids = Attribute('BTree with reference id -> reference object')
    _data = Attribute('BTree with object id -> ObjectInformation object')
    _ptmapping = Attribute('BTree with portal_type -> object id')

    # common object related methods

    def registerObject(obj):
        """
        """

    def unregisterObject(obj_or_uid):
        """
        """

    def getUidOf(obj_or_uid):
        """
        """

    def isReferenceable(obj):
        """
        """

    def lookupObject(uid):
        """
        """

    def getObjectInfo(uid):
        """
        """

    def getBrainFromCatalog(uid):
        """
        """

    # add / remove / clone / move events

    def objectAdded(self, obj_or_id):
        """
        """

    def objectChanged(self, obj_or_id):
        """
        """

    def objectRemoved(obj_or_id):
        """
        """

    def objectCloned(obj_or_id):
        """
        """

    def objectMoved(obj_or_id):
        """
        """

    # add reference methods

    def addReference(source, target, relationship, **kwargs):
        """
        """

    # get reference methods

    def getReference(source, relationship=None):
        """
        """

    def getBackReference(target, relationship=None):
        """
        """

    def getReferenceById(self, rid):
        """
        """

    # relationship methods

    def hasRelationship(source, target, relationship=None):
        """
        """

    def getRelationships(source):
        """
        """

    def getBackRelationships(source):
        """
        """

    def getReferenceIdsByPortalType(portal_type, relationship=None):
        """
        """

    # delete reference methods

    def delReference(source, target, relationship=None):
        """
        """

    def delReferenceById(rid):
        """
        """

    def delReferences(object, relationship=None):
        """
        """

    def delSourceReferences(source, relationship=None):
        """
        """

    def delTargetReferences(source, relationship=None):
        """
        """

class IUIDProvider(Interface):
    """
    """

    def UID():
        """
        """

class IReference(IUIDProvider):
    """
    """
    sid = Attribute("Source object id")
    tid = Attribute("Target object id")
    rid = Attribute("Reference id")
    relationship = Attribute("Relationship name between source and target")

    def Type(self):
        """
        """

    def addHook(self, engine, source, target, relationship):
        """
        """

    def delHook(self, engine, source, target, relationship):
        """
        """

class IContextReference(IReference):
    """
    """

    def getSource():
        """
        """

    def getTarget():
        """
        """

    def beforeDelTargetNotifySource(self):
        """
        """

    def beforeDelSourceNotifyTarget(self):
        """
        """

class IObjectInformation(IUIDProvider):
    """
    """

    uid = Attribute('unique id of the object')
    physical_path = Attribte('Physical ZODB path to object')
    id = Attribute("'id' attribute of the object")
    Type = Attribute("'Type' attribute of the object")
    Title = Attribute("'Title' attribute of the object")
    portal_type = Attribute("'portal_type' attribute of the object")

class IRelativeObjectInformation(IObjectInformation):
    """
    """

    relative_path = Attribute('Relative path to a base path')
    relative_to = Attribute('Base path')

class IContextObjectInformation(IObjectInformation):
    """
    """

    def getObject():
        """
        """

class IContextRelativeObjectInformation(IRelativeObjectInformation,
    IContextObjectInformation):
    """
    """

class IReferenceableMixin(Interface):
    """
    """

    def addReference(target, relationship, **kwargs):
        """
        """

    def hasRelationshipTo(target, relationship=None):
        """
        """

    def deleteReference(self, target, relationship=None):
        """
        """

    def deleteReferences(self, relationship=None):
        """
        """

    def getRelationships(self):
        """
        """

    def getBackRelationships(self):
        """
        """

    def getReferences(self, relationship=None):
        """
        """

    def getBackReferences(self, relationship=None):
        """
        """

    def getReferenceIds(self, relationship=None):
        """
        """

    def getBackReferenceIds(self, relationship=None):
        """
        """

    # annotations

    def setSREAnnotations(annotation):
        """
        """

    def getSREAnnotations():
        """
        """

    def initializeSREAnnotations():
        """
        """

Powered by Plone CMS, the Open Source Content Management System