Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
Marshall.namespaces.uuns.UUNS Class Reference
Inheritance diagram for Marshall.namespaces.uuns.UUNS:
Inheritance graph
[legend]
Collaboration diagram for Marshall.namespaces.uuns.UUNS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getAttributeByName
def getAttributes
def serialize
def deserialize

Static Public Attributes

string xmlns = 'uuns:ns:data'
string prefix = 'at_data'
list attributes = []

Detailed Description

Definition at line 136 of file uuns.py.


Member Function Documentation

def Marshall.namespaces.uuns.UUNS.deserialize (   self,
  instance,
  ns_data 
)

Definition at line 214 of file uuns.py.

00214 
00215     def deserialize(self, instance, ns_data):
00216         if not ns_data:
00217             return
00218 
00219         for attribute in self.getAttributes( instance ):
00220             attribute.deserialize( instance, ns_data )

Here is the call graph for this function:

def Marshall.namespaces.uuns.UUNS.getAttributeByName (   self,
  schema_name,
  context = None 
)

Definition at line 145 of file uuns.py.

00145 
00146     def getAttributeByName(self, schema_name, context=None):
00147         if context is not None and schema_name not in self.at_fields:
00148             assert context.instance.Schema().has_key( schema_name )
00149         
00150         #if schema_name in self.at_fields:
00151         #    return self.at_fields[ schema_name ]
00152             
00153         attribute = UUAttribute( schema_name )
00154         attribute.setNamespace( self )
00155         
00156         return attribute
00157         
        

Here is the caller graph for this function:

def Marshall.namespaces.uuns.UUNS.getAttributes (   self,
  instance 
)

Definition at line 158 of file uuns.py.

00158 
00159     def getAttributes(self, instance):
00160         
00161         field_keys = instance.Schema().keys()
00162         if DEBUG :
00163             print "UUNS/getAttributes", field_keys
00164         #import pdb; pdb.set_trace() # @@@
00165         #return fields
00166         
00167         # remove fields delegated to other namespaces
00168         #fields = []
00169         #for ns in getRegisteredNamespaces():
00170         #    if ns.uses_at_fields:
00171         #        fields.extend( ns.getATFields() )
00172         #mset = Set(fields)
00173         #assert len(mset) == len(fields), "Multiple NS multiplexing field"
00174         #
00175         #field_keys = Set(instance.Schema().keys())-mset
00176         #
00177         ## remove primary field if still present
00178         #p = instance.getPrimaryField()
00179         #pk = p and p.getName() or None
00180         #if pk:
00181         #    field_keys.remove( pk )
00182         #
00183 
00184 
00185 #        import pdb; pdb.set_trace() # @@@
00186         
00187         for fk in field_keys:
00188             field = instance.Schema().getField(fk)
00189             
00190             if hasattr(field, 'getBaseUnit') :
00191                 baseunit = field.getBaseUnit(instance)
00192             else :
00193                 #print ">>>>>>>> field==", field, "no getBaseUnit!"
00194                 continue
00195                 
00196             isBinary = baseunit.isBinary()
00197             
00198             if isBinary or instance.getPrimaryField() == field:
00199                 yield self.getAttributeByName( fk )
00200             
00201             if DEBUG :        
00202                 print fk, isBinary
00203             
00204         #
00205         ## yield additional intrinsic at framework attrs
00206         #for attribute in self.at_fields.values():
00207         #    yield attribute
00208 

Here is the call graph for this function:

Here is the caller graph for this function:

def Marshall.namespaces.uuns.UUNS.serialize (   self,
  dom,
  parent_node,
  instance 
)

Definition at line 209 of file uuns.py.

00209 
00210     def serialize(self, dom, parent_node, instance):
00211 
00212         for attribute in self.getAttributes( instance ):
00213             attribute.serialize( dom, parent_node, instance )

Here is the call graph for this function:


Member Data Documentation

Definition at line 140 of file uuns.py.

string Marshall.namespaces.uuns.UUNS.prefix = 'at_data' [static]

Definition at line 139 of file uuns.py.

string Marshall.namespaces.uuns.UUNS.xmlns = 'uuns:ns:data' [static]

Definition at line 138 of file uuns.py.


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