Back to index

plone3  3.1.7
propertysheets.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights
00004 # Reserved.
00005 #
00006 # This software is subject to the provisions of the Zope Public License,
00007 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this
00008 # distribution.
00009 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00010 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00011 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00012 # FOR A PARTICULAR PURPOSE.
00013 #
00014 ##############################################################################
00015 """ Interfaces:  IPropertySheet
00016 
00017 $Id: propertysheets.py 39343 2005-08-17 20:53:14Z sidnei $
00018 """
00019 
00020 try:
00021     from zope.interface import Interface
00022 except ImportError:
00023     from Interface import Interface
00024 
00025 class IPropertySheet( Interface ):
00026 
00027     """ Interface for queryable property sheets.
00028     
00029     o Objects implementing this interface can play in read-only fashion
00030       in OFS.PropertySheets' framework.
00031     """
00032 
00033     def getId():
00034 
00035         """ Identify the sheet within a collection.
00036         """
00037 
00038     def hasProperty( id ):
00039 
00040         """ Does the sheet have a property corresponding to 'id'?
00041         """
00042 
00043     def getProperty( id, default=None ):
00044 
00045         """ Return the value of the property corresponding to 'id'.
00046 
00047         o If no such property exists within the sheet, return 'default'.
00048         """
00049 
00050     def getPropertyType( id ):
00051 
00052         """ Return the string identifying the type of property, 'id'.
00053 
00054         o If no such property exists within the sheet, return None.
00055         """
00056 
00057     def propertyInfo( id ):
00058 
00059         """ Return a mapping describing property, 'id'.
00060 
00061         o Keys must include:
00062 
00063           'id'  -- the unique identifier of the property.
00064 
00065           'type' -- the string identifying the property type.
00066 
00067           'meta' -- a mapping containing additional info about the property.
00068         """
00069 
00070     def propertyMap():
00071 
00072         """ Return a tuple of 'propertyInfo' mappings, one per property.
00073         """
00074 
00075     def propertyIds():
00076 
00077         """ Return a sequence of the IDs of the sheet's properties.
00078         """
00079 
00080     def propertyValues():
00081 
00082         """ Return a sequence of the values of the sheet's properties.
00083         """
00084 
00085     def propertyItems():
00086 
00087         """ Return a sequence of ( id, value ) tuples, one per property.
00088         """