Back to index

plone3  3.1.7
Classes | Functions | Variables
Marshall.namespaces.atns Namespace Reference

Classes

class  BoundReference
class  ATAttribute
class  ReferenceAttribute
class  ArchetypeUID
class  Archetypes
class  Reference

Functions

def serialize
 XXX: we dont want to remove the PF, but want to be backward compatible (how to do that best?) p = instance.getPrimaryField() pk = p and p.getName() or None if pk and pk in field_keys: field_keys.remove( pk )
def deserialize
def processXml
def processXmlEnd
def getSchemaInfo

Variables

tuple _marker = object()
string RNGSchemaFragment
tuple attribute = self.getAttributeByName(schema_name, context)
 while context.reader.MoveToNextAttribute(): if context.reader.LocalName() == 'id': schema_name = context.reader.Value() break
tuple data = context.getDataFor(self.xmlns)
tuple srefs = data.setdefault( self.last_schema_id, [])
tuple ref = Reference()
 in_reference_mode
 new_reference_p
 last_schema_id

Function Documentation

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

Definition at line 310 of file atns.py.

00310 
00311     def deserialize(self, instance, ns_data, options):
00312         if not ns_data:
00313             return
00314             
00315         for attribute in self.getAttributes( instance ):
00316             if not config.HANDLE_REFS and hasattr(attribute, 'isReference') and attribute.isReference( instance ):
00317                 # simply skip it then... Gogo
00318                 continue
00319             attribute.deserialize( instance, ns_data )

Definition at line 397 of file atns.py.

00397 
00398     def getSchemaInfo( self ):
00399         return [ ("ArchetypesFields", "zeroOrMore", RNGSchemaFragment) ]

def Marshall.namespaces.atns.processXml (   self,
  context,
  data_node 
)

Definition at line 320 of file atns.py.

00320 
00321     def processXml(self, context, data_node):
00322 
00323         tagname, namespace = utils.fixtag(data_node.tag, context.ns_map)
00324         
00325         if tagname == 'metadata':
00326             # ignore the container
00327             return False
00328 
00329         elif tagname == 'reference':
00330             # switch to reference mode, we tell the parser that we want
00331             # to explictly recieve all new node parse events, so we
00332             # can introspect the nested metadata that can be used
00333             # in reference specification.
00334             self.in_reference_mode = True
00335             self.new_reference_p = True
00336             assert self.last_schema_id
00337             context.setNamespaceDelegate( self )
00338             return False
00339 
00340         elif tagname == 'field':
00341             # basic at field specified, find the matching attribute
00342             # and annotate the data node with it
00343             schema_name = data_node.attrib.get('name', None)
00344             if schema_name is None:
00345                 log("'id' attribute for at:field is deprecated, use 'name' instead")
                schema_name = data_node.attrib.get('id')
def Marshall.namespaces.atns.processXmlEnd (   self,
  name,
  context 
)

Definition at line 391 of file atns.py.

00391 
00392     def processXmlEnd(self, name, context):
00393         if name == 'reference':
00394             context.setNamespaceDelegate( None )
00395             self.in_reference_mode = False
00396             self.last_schema_id = None # guard against bad xml

def Marshall.namespaces.atns.serialize (   self,
  dom,
  parent_node,
  instance,
  options 
)

XXX: we dont want to remove the PF, but want to be backward compatible (how to do that best?) p = instance.getPrimaryField() pk = p and p.getName() or None if pk and pk in field_keys: field_keys.remove( pk )

Definition at line 301 of file atns.py.

00301 
00302     def serialize(self, dom, parent_node, instance, options ):
00303         
00304         exclude_attrs = options.get('atns_exclude', () )
00305             
00306         for attribute in self.getAttributes( instance, exclude_attrs):
00307             if hasattr(attribute, 'isReference') and attribute.isReference( instance ):
00308                 continue
00309             attribute.serialize( dom, parent_node, instance, options )


Variable Documentation

Definition at line 46 of file atns.py.

tuple Marshall.namespaces.atns.attribute = self.getAttributeByName(schema_name, context)

while context.reader.MoveToNextAttribute(): if context.reader.LocalName() == 'id': schema_name = context.reader.Value() break

Definition at line 353 of file atns.py.

tuple Marshall.namespaces.atns.data = context.getDataFor(self.xmlns)

Definition at line 364 of file atns.py.

Definition at line 333 of file atns.py.

Definition at line 395 of file atns.py.

Definition at line 334 of file atns.py.

Definition at line 371 of file atns.py.

Definition at line 202 of file atns.py.

tuple Marshall.namespaces.atns.srefs = data.setdefault( self.last_schema_id, [])

Definition at line 365 of file atns.py.