Back to index

plone3  3.1.7
Public Member Functions
Marshall.namespaces.atns.ArchetypeUID Class Reference
Inheritance diagram for Marshall.namespaces.atns.ArchetypeUID:
Inheritance graph
[legend]
Collaboration diagram for Marshall.namespaces.atns.ArchetypeUID:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def serialize
def deserialize
def resolveUID

Detailed Description

Definition at line 171 of file atns.py.


Member Function Documentation

def Marshall.namespaces.atns.ArchetypeUID.deserialize (   self,
  instance,
  ns_data 
)

Definition at line 180 of file atns.py.

00180 
00181     def deserialize(self, instance, ns_data):
00182         values = ns_data.get( self.name )
00183         if not values:
00184             return        
00185         self.resolveUID( instance, values )

Here is the call graph for this function:

def Marshall.namespaces.atns.ArchetypeUID.resolveUID (   self,
  instance,
  values 
)

Definition at line 186 of file atns.py.

00186 
00187     def resolveUID(self, instance, values):
00188         assert not isinstance(values, (list, tuple))
00189         at_uid = values
00190         existing = getattr(instance, atcfg.UUID_ATTR, _marker)
00191         if existing is _marker or existing != at_uid:
00192             ref = Reference(uid=at_uid)
00193             target = ref.resolve(instance)
00194             if target is not None:
00195                 raise MarshallingException, (
00196                         "Trying to set uid of "
00197                         "%s to an already existing uid "
00198                         "clashed with %s" % (
00199                         instance.absolute_url(), target.absolute_url()))
00200             instance._setUID(at_uid)
00201 

Here is the caller graph for this function:

def Marshall.namespaces.atns.ArchetypeUID.serialize (   self,
  dom,
  parent_node,
  instance,
  options = {} 
)

Definition at line 173 of file atns.py.

00173 
00174     def serialize(self, dom, parent_node, instance, options={}):
00175         value = getattr( instance, atcfg.UUID_ATTR, "")
00176         node = dom.createElementNS( Archetypes.xmlns, "uid")
00177         nvalue = dom.createTextNode( value )
00178         node.appendChild( nvalue )
00179         parent_node.appendChild( node )


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