Back to index

plone3  3.1.7
_layer.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 class ILayer(Interface):
00004     """Layering support
00005     """
00006 
00007 
00008     def initializeInstance(instance, item=None, container=None):
00009         """Optionally called to initialize a layer for an entire
00010         instance
00011         """
00012 
00013     def initializeField(instance, field):
00014         """Optionally called to initialize a layer for a given field
00015         """
00016 
00017     def cleanupField(instance, field):
00018         """Optionally called to cleanup a layer for a given field
00019         """
00020 
00021     def cleanupInstance(instance, item=None, container=None):
00022         """Optionally called to cleanup a layer for an entire
00023         instance
00024         """
00025 
00026 class ILayerContainer(Interface):
00027     """An object that contains layers and can use/manipulate them"""
00028 
00029     def registerLayer(name, object):
00030         """Register an object as providing a new layer under a given
00031         name
00032         """
00033 
00034     def registeredLayers():
00035         """Provides a list of (name, object) layer pairs
00036         """
00037 
00038     def hasLayer(name):
00039         """Boolean indicating if the layer is implemented on the
00040         object
00041         """
00042 
00043     def getLayerImpl(name):
00044         """Return an object implementing this layer
00045         """
00046 
00047 class ILayerRuntime(Interface):
00048     """ Layer Runtime """
00049 
00050     def initializeLayers(instance, item=None, container=None):
00051         """Optionally process all layers attempting their
00052         initializeInstance and initializeField methods if they exist
00053         """
00054 
00055     def cleanupLayers(instance, item=None, container=None):
00056         """Optionally process all layers attempting their
00057         cleanupInstance and cleanupField methods if they exist.
00058         """