Package amplee :: Package atompub :: Module workspace :: Class AtomPubWorkspace
[hide private]
[frames] | no frames]

Class AtomPubWorkspace

source code

object --+
         |
        AtomPubWorkspace

Instance Methods [hide private]
 
__init__(self, service, name_or_id, title, xml_attrs=None)
Atom Publishing Protocol workspace entity
source code
AtomPubCollection
get_collection(self, name_or_id)
Returns a collection identified by name_or_id
source code
amara.root_base
to_workspace(self, prefix=u'app', namespace=u'http://www.w3.org/2007/app', include_id=False)
Generate a amara instance of the workspace
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, service, name_or_id, title, xml_attrs=None)
(Constructor)

source code 
Atom Publishing Protocol workspace entity
Parameters:
  • service (AtomPubService) - parent of this workspace instance
  • name_or_id (string) - internal identifier.
  • title (unicode) - human readable label of this workspace.
  • xml_attrs (dict) - allows for XML attributes to be provided: lang, base
Overrides: object.__init__

get_collection(self, name_or_id)

source code 
Returns a collection identified by name_or_id
Parameters:
  • name_or_id (string) - identifier of the collection to look up
Returns: AtomPubCollection
the instance of the collection retrieved or None

to_workspace(self, prefix=u'app', namespace=u'http://www.w3.org/2007/app', include_id=False)

source code 

Generate a amara instance of the workspace

The first collection shown will be the one having the favorite attribute set to True.
Parameters:
  • prefix (string) - XML prefix to use
  • namespace (string) - namespace associated with the workspace element
  • include_id (bool) - set this to True in order to include the name_or_id value as an xml:id attribute.
Returns: amara.root_base
amara instance of the workspace document