File:  [Repository] / kupu / plone / interfaces.py
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Thu Sep 15 13:06:00 2005 UTC (18 years, 10 months ago) by dwinter
Branches: first, MAIN
CVS tags: dwinter, HEAD
modifizierter kupu fuer webpages des instituts

    1: ##############################################################################
    2: #
    3: # Copyright (c) 2003-2005 Kupu Contributors. All rights reserved.
    4: #
    5: # This software is distributed under the terms of the Kupu
    6: # License. See LICENSE.txt for license text. For a list of Kupu
    7: # Contributors see CREDITS.txt.
    8: #
    9: ##############################################################################
   10: """Kupu Plone interfaces
   11: 
   12: $Id: interfaces.py,v 1.1.1.1 2005/09/15 13:06:00 dwinter Exp $
   13: """
   14: from Interface import Interface
   15: 
   16: class ILibraryManager(Interface):
   17:     """Provide an interface for managing and retrieving libraries for
   18:     the Kupu editor.
   19:     """
   20: 
   21:     def getLibraries(context):
   22:         """Return an ordered sequence of libraries.
   23: 
   24:         Since libraries might be defined placefully, we look them up
   25:         using a context. The return value is provided as a sequence of
   26:         dictionaries with the following keys:
   27: 
   28:           id    - the computed id
   29:           title - the computed title of the library
   30:           uri   - the computed URI of the library
   31:           src   - the computed source URI
   32:           icon  - the computed icon URI
   33:         """
   34: 
   35:     def addLibrary(id, title, uri, src, icon):
   36:         """Add a library.
   37:         """
   38: 
   39:     def deleteLibraries(indices):
   40:         """Delete libraries
   41:         """
   42: 
   43:     def updateLibraries(libraries):
   44:         """Update libraries.
   45: 
   46:         Update libraries using the sequence of mapping objects
   47:         provided in the 'libraries' parameter. Each mapping object
   48:         needs to provide an 'index' key to indicate which library it
   49:         is updating.
   50:         """
   51: 
   52:     def moveUp(indices):
   53:         """Reorder libraries by moving specified libraries up.
   54:         """
   55: 
   56:     def moveDown(indices):
   57:         """Reorder libraries by moving specified libraries down.
   58:         """
   59: 
   60: class IResourceTypeMapper(Interface):
   61:     """Map portal types to resource types"""
   62: 
   63:     def getPortalTypesForResourceType(resource_type):
   64:         """Return a sequence of portal types for a specific resource type.
   65: 
   66:         Raises KeyError if resource_type is not found.
   67:         """
   68: 
   69:     def queryPortalTypesForResourceType(resource_type, default=None):
   70:         """Return a sequence of portal types for a specific resource type.
   71: 
   72:         Returns 'default' if resource_type is not found.
   73:         """
   74: 
   75:     def addResourceType(resource_type, portal_types):
   76:         """Add a resource type pointing to a sequence of portal_types."""
   77: 
   78:     def updateResourceTypes(type_mapping):
   79:         """Update resource types using the type mapping passed as argument."""
   80: 
   81:     def deleteResourceTypes(resource_types):
   82:         """Delete the type mapping for the specififed resource types
   83: 
   84:         Raises KeyError if one of the resource_types is not found.
   85:         """
   86: 
   87: class IKupuLibraryTool(ILibraryManager, IResourceTypeMapper):
   88:     """Interface for the Kupu library tool"""

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>