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: CopyDir, CopyDirGen, Deserialize, LoadAcl, MirrorDir, MirrorDirGen, Serialize, SerializeAclAndOwner, ValidateAttribute |  |  |  | Fields: DC, EMPTY_NAMESPACE, IMT_MAP, PRODUCT_NAMESPACE, ext, g_defaultFileMap, g_typeMap, g_xmldocMapping, generators, imt

## 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)

## Fields

DC = 'http://purl.org/dc/elements/1.1/'
EMPTY_NAMESPACE = None
IMT_MAP = {'.gif': 'image/gif', '.htm': 'text/html', '.html': 'text/html', '.jpeg': 'image/jpeg', '.jpg': 'image/jpeg', '.png': 'image/png', '.rdf': 'text/xml', '.svg': 'image/svg', '.xhtml': 'text/html', '.xml': 'text/xml', ...}
PRODUCT_NAMESPACE = 'http://xmlns.4suite.org/reserved#product'
ext = '.htm'
g_defaultFileMap = {'.daml': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.gif': (None, 'image/gif', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.htm': (None, 'text/html', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.html': (None, 'text/html', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.jpeg': (None, 'image/jpeg', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.jpg': (None, 'image/jpeg', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.owl': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.png': (None, 'image/png', <class Ft.Server.Common.Install.InstallUtil.RawFile>), '.rdf': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), '.rdfs': (None, None, <class Ft.Server.Common.Install.InstallUtil.RdfDocument>), ...}
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 = 'text/html'