Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
Archetypes.Storage.Facade.FacadeMetadataStorage Class Reference
Inheritance diagram for Archetypes.Storage.Facade.FacadeMetadataStorage:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.Storage.Facade.FacadeMetadataStorage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getTool
def initializeInstance
def initializeField
def get
def set
def unset
def cleanupField
def cleanupInstance

Public Attributes

 metadata_set

Static Public Attributes

tuple security = ClassSecurityInfo()

Static Private Attributes

tuple __implements__ = (IStorage, ILayer)

Detailed Description

A Facade Storage which delegates to
CMFMetadata's Metadata Tool for actually
storing the metadata values

Definition at line 10 of file Facade.py.


Constructor & Destructor Documentation

Definition at line 20 of file Facade.py.

00020 
00021     def __init__(self, metadata_set):
00022         self.metadata_set = metadata_set

Here is the caller graph for this function:


Member Function Documentation

def Archetypes.Storage.Facade.FacadeMetadataStorage.cleanupField (   self,
  instance,
  field,
  kwargs 
)

Definition at line 63 of file Facade.py.

00063 
00064     def cleanupField(self, instance, field, **kwargs):
00065         pass

def Archetypes.Storage.Facade.FacadeMetadataStorage.cleanupInstance (   self,
  instance,
  item = None,
  container = None 
)

Definition at line 67 of file Facade.py.

00067 
00068     def cleanupInstance(self, instance, item=None, container=None):
00069         pass
00070 
00071 registerStorage(FacadeMetadataStorage)
def Archetypes.Storage.Facade.FacadeMetadataStorage.get (   self,
  name,
  instance,
  kwargs 
)

Definition at line 36 of file Facade.py.

00036 
00037     def get(self, name, instance, **kwargs):
00038         field = kwargs['field']
00039         tool = self.getTool(instance)
00040         mdata = tool.getMetadata(instance)
00041         value = mdata[self.metadata_set][field.metadata_name]
00042         return value

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 24 of file Facade.py.

00024 
00025     def getTool(self, instance):
00026         return getToolByName(instance, 'portal_metadata')

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.Storage.Facade.FacadeMetadataStorage.initializeField (   self,
  instance,
  field 
)

Definition at line 32 of file Facade.py.

00032 
00033     def initializeField(self, instance, field):
00034         pass

def Archetypes.Storage.Facade.FacadeMetadataStorage.initializeInstance (   self,
  instance,
  item = None,
  container = None 
)

Definition at line 28 of file Facade.py.

00028 
00029     def initializeInstance(self, instance, item=None, container=None):
00030         pass

def Archetypes.Storage.Facade.FacadeMetadataStorage.set (   self,
  name,
  instance,
  value,
  kwargs 
)

Definition at line 44 of file Facade.py.

00044 
00045     def set(self, name, instance, value, **kwargs):
00046         field = kwargs['field']
00047         tool = self.getTool(instance)
00048         mdata = tool.getMetadata(instance)
00049         if type(value) == type(u''):
00050             value = encode(value, instance)
00051         data = {field.metadata_name:value}
00052         # Calling _setData directly, because there's
00053         # *no* method for setting one field at a time,
00054         # and setValues takes a dict and does
00055         # validation, which prevents us from setting
00056         # values.
00057         mdata._setData(data, set_id=self.metadata_set)

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.Storage.Facade.FacadeMetadataStorage.unset (   self,
  name,
  instance,
  kwargs 
)

Definition at line 59 of file Facade.py.

00059 
00060     def unset(self, name, instance, **kwargs):
00061         pass


Member Data Documentation

tuple Archetypes.Storage.Facade.FacadeMetadataStorage.__implements__ = (IStorage, ILayer) [static, private]

Definition at line 18 of file Facade.py.

Definition at line 21 of file Facade.py.

tuple Archetypes.Storage.Facade.FacadeMetadataStorage.security = ClassSecurityInfo() [static]

Definition at line 16 of file Facade.py.


The documentation for this class was generated from the following file: