Back to index

plone3  3.1.7
Layer.py
Go to the documentation of this file.
00001 from Products.Archetypes.interfaces.layer import ILayerContainer
00002 from ExtensionClass import Base
00003 from Globals import InitializeClass
00004 from AccessControl import ClassSecurityInfo
00005 
00006 class DefaultLayerContainer(Base):
00007     __implements__ = ILayerContainer
00008 
00009     security = ClassSecurityInfo()
00010 
00011     def __init__(self):
00012         self._layers = {}
00013 
00014     security.declarePrivate('registerLayer')
00015     def registerLayer(self, name, object):
00016         self._layers[name] = object
00017 
00018     security.declarePrivate('registeredLayers')
00019     def registeredLayers(self):
00020         return self._layers.items()
00021 
00022     security.declarePrivate('hasLayer')
00023     def hasLayer(self, name):
00024         return name in self._layers.keys()
00025 
00026     security.declarePrivate('getLayerImpl')
00027     def getLayerImpl(self, name):
00028         return self._layers[name]
00029 
00030 InitializeClass(DefaultLayerContainer)