4Suite API Documentation

Module Ft.Server.Common.Install.Serialize

Serialization and Deserialization of setup files.
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
Functions:
Globals:

Functions

CopyDir(path, src, fileMap={}, resources=[])
For compatibility, same as CopyDir, but returns a complete list, rather than a generator.
CopyDirGen(path, src, fileMap={}, resources=[])
Returns a generator of objects representing resources to add to the repository. The resources mirror a current snapshot of a local file system directory.
path = destination repo path (an existing Container)
src = file system source path (a directory)
      must be a valid absolute URI if srcIsUri is True (default)
      must be a local path if srcIsUri is False
fileMap = mapping of filename extensions to resource classes

A tree like /root/dir1/dir2 will be returned as a list like
['/root', '/root/dir1', '/root/dir1/dir2']. Files in each
directory will be listed immediately following that directory.
So files in dir1 will come before the entry for dir2.
Directories are processed breadth-first.

path = destination repo path (an existing Container)
src = file system source path (a directory)
fileMap = mapping of filename extensions to resource classes
resources = list of resource objects to append to
Deserialize(stream, refUri='')
Deserialize a stream that references a setup file by URI
LoadAcl(node)
MirrorDir(path, src, fileMap, srcIsUri=True)
For compatibility, same as MirrorDirGen, but returns a complete list, rather than a generator.
MirrorDirGen(path, src, fileMap, srcIsUri=True)
Wrapper for CopyDirGen().
It optionally accepts a 'file' URI for src, and
verifies that src refers to a directory. It does not
accept an initial list of resources to append to.
Serialize(product, refUri='')
Serialize a product list into a string
SerializeAclAndOwner(res)
ValidateAttribute(node, ns, ln)

Globals

DC = 'http://purl.org/dc/elements/1.1/'
EMPTY_NAMESPACE = None
IMT_MAP = {'%': 'application/x-trash', '323': 'text/h323', 'ai': 'application/postscript', 'aif': 'audio/x-aiff', 'aifc': 'audio/x-aiff', 'aiff': 'audio/x-aiff', 'art': 'image/x-jg', 'asc': 'text/plain', 'asf': 'video/x-ms-asf', 'asx': 'video/x-ms-asf', ...}
PRODUCT_NAMESPACE = 'http://xmlns.4suite.org/reserved#product'
ext = 'phps'
g_defaultFileMap = {'%': (None, 'application/x-trash', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.daml': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.owl': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.rdf': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.rdfs': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '323': (None, 'text/h323', <class Ft.Server.Common.Install.InstallUtil.RawFile>), 'ai': (None, 'application/postscript', <class Ft.Server.Common.Install.InstallUtil.RawFile>), 'aif': (None, 'audio/x-aiff', <class Ft.Server.Common.Install.InstallUtil.RawFile>), 'aifc': (None, 'audio/x-aiff', <class Ft.Server.Common.Install.InstallUtil.RawFile>), 'aiff': (None, 'audio/x-aiff', <class Ft.Server.Common.Install.InstallUtil.RawFile>), ...}
g_typeMap = {'Command': <class Ft.Server.Common.Install.InstallUtil.Command>, 'RdfDocument': <class Ft.Server.Common.Install.InstallUtil.RdfDocument>, 'SchematronDocument': <class Ft.Server.Common.Install.InstallUtil.SchematronDocument>, 'Server': <class Ft.Server.Common.Install.InstallUtil.Server>, 'XPathDocumentDefinition': <class Ft.Server.Common.Install.InstallUtil.XPathDocumentDefinition>, 'XmlDocument': <class Ft.Server.Common.Install.InstallUtil.XmlDocument>, 'XsltDocument': <class Ft.Server.Common.Install.InstallUtil.XsltDocument>, 'XsltDocumentDefinition': <class Ft.Server.Common.Install.InstallUtil.XsltDocumentDefinition>}
g_xmldocMapping = {4: 'XmlDocument', 5: 'XsltDocument', 6: 'SchematronDocument', 9: 'XPathDocumentDefinition', 11: 'XsltDocumentDefinition', 12: 'RdfDocument', 14: 'Command', 15: 'Server'}
generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096)
imt = 'application/x-httpd-php-source'