PHP Class Jackalope\ImportExport\ImportExport

Implements the uuid behavior interface to import the constants.
Author: David Buchmann ([email protected])
Inheritance: implements PHPCR\ImportUUIDBehaviorInterface
ファイルを表示 Open project: jackalope/jackalope Class Usage Examples

Public Properties

Property Type Description
$escaping array Map of invalid xml names to escaping according to jcr/phpcr spec TODO: more invalid characters?

Public Methods

Method Description
escapeXmlName ( string $name ) : string Helper method for escaping node and property names into valid xml element and attribute names according to the jcr specification.
exportDocumentView ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse ) Recursively export data to an xml stream in document view format
exportSystemView ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse ) Recursively export data to an xml stream.
importXML ( PHPCR\NodeInterface $parentNode, PHPCR\NamespaceRegistryInterface $ns, string $uri, integer $uuidBehavior ) Import the xml document from the stream into the repository
unescapeXmlName ( string $name, array $namespaceMap ) : string Helper method to unescape node names that encoded invalid things for xml. At the same time, change document namespace prefix to repository prefix if needed.

Private Methods

Method Description
addNode ( PHPCR\NodeInterface $parentNode, string $nodename, string $type, array $properties, integer $uuidBehavior ) : PHPCR\NodeInterface Helper method for importing to add a node with the proper uuid behavior
cleanNamespace ( string $name, array $namespaceMap ) : string Helper function for importing to ensure prefix is same as in repository
exportDocumentViewRecursive ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse, boolean $root = false ) Recursively output node and all its children into the file in the document view format
exportNamespaceDeclarations ( PHPCR\NamespaceRegistryInterface $ns, resource $stream ) Helper method to produce the xmlns:.
exportSystemViewRecursive ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse, boolean $root = false ) Recursively output node and all its children into the file in the system view format
importDocumentView ( PHPCR\NodeInterface $parentNode, PHPCR\NamespaceRegistryInterface $ns, FilteredXMLReader $xml, integer $uuidBehavior, array $namespaceMap = [] ) Import document in system view
importSystemView ( PHPCR\NodeInterface $parentNode, PHPCR\NamespaceRegistryInterface $ns, FilteredXMLReader $xml, integer $uuidBehavior, array $namespaceMap = [] ) Import document in system view

Method Details

escapeXmlName() public static method

Helper method for escaping node and property names into valid xml element and attribute names according to the jcr specification.
public static escapeXmlName ( string $name ) : string
$name string A name possibly containing characters illegal in an XML document.
return string The name encoded to be valid xml

exportDocumentView() public static method

Recursively export data to an xml stream in document view format
See also: SessionInterface::exportDocumentView
public static exportDocumentView ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse )
$node PHPCR\NodeInterface The node to start exporting at
$ns PHPCR\NamespaceRegistryInterface The namespace registry to export namespaces too
$stream resource as in exportDocumentView
$skipBinary boolean as in exportDocumentView
$noRecurse boolean as in exportDocumentView

exportSystemView() public static method

Recursively export data to an xml stream.
See also: SessionInterface::exportSystemView
public static exportSystemView ( PHPCR\NodeInterface $node, PHPCR\NamespaceRegistryInterface $ns, resource $stream, boolean $skipBinary, boolean $noRecurse )
$node PHPCR\NodeInterface The node to start exporting at
$ns PHPCR\NamespaceRegistryInterface The namespace registry to export namespaces too
$stream resource as in exportSystemView
$skipBinary boolean as in exportSystemView
$noRecurse boolean as in exportSystemView

importXML() public static method

Import the xml document from the stream into the repository
See also: SessionInterface::importXML
public static importXML ( PHPCR\NodeInterface $parentNode, PHPCR\NamespaceRegistryInterface $ns, string $uri, integer $uuidBehavior )
$parentNode PHPCR\NodeInterface as in importXML
$ns PHPCR\NamespaceRegistryInterface as in importXML
$uri string as in importXML
$uuidBehavior integer as in importXML

unescapeXmlName() public static method

Helper method to unescape node names that encoded invalid things for xml. At the same time, change document namespace prefix to repository prefix if needed.
public static unescapeXmlName ( string $name, array $namespaceMap ) : string
$name string A name encoded with escapeXmlName
$namespaceMap array
return string the decoded name

Property Details

$escaping public_oe static_oe property

Map of invalid xml names to escaping according to jcr/phpcr spec TODO: more invalid characters?
public static array $escaping
return array