Documentation

Horde_Kolab_Format_Xml_Annotation extends Horde_Kolab_Format_Xml
in package

Kolab XML handler for IMAP folder annotations.

Copyright 2008-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Kolab

author

Gunnar Wrobel wrobel@pardus.de

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

link
http://www.horde.org/libraries/Horde_Kolab_Format

Table of Contents

PRODUCT_ID  = __CLASS__
Defines a XML value that should get a default value if missing
TYPE_BOOLEAN  = 'Horde_Kolab_Format_Xml_Type_Boolean'
Defines a XML value as boolean type
TYPE_COLOR  = 'Horde_Kolab_Format_Xml_Type_Color'
Defines a XML value as color type
TYPE_COMPOSITE  = 'Horde_Kolab_Format_Xml_Type_Composite'
Defines a XML value as composite value type
TYPE_DATE  = 'Horde_Kolab_Format_Xml_Type_Date'
Defines a XML value as date type
TYPE_DATE_OR_DATETIME  = 'Horde_Kolab_Format_Xml_Type_DateTime'
Defines a XML value as date or datetime type
TYPE_DATETIME  = 'Horde_Kolab_Format_Xml_Type_DateTime'
Defines a XML value as datetime type
TYPE_INTEGER  = 'Horde_Kolab_Format_Xml_Type_Integer'
Defines a XML value as integer type
TYPE_MULTIPLE  = 'Horde_Kolab_Format_Xml_Type_Multiple'
Defines a XML value as array type
TYPE_ROOT  = 'Horde_Kolab_Format_Xml_Type_Root'
Represents the Kolab format root node
TYPE_STRING  = 'Horde_Kolab_Format_Xml_Type_String'
Defines a XML value as string type
TYPE_XML  = 'Horde_Kolab_Format_Xml_Type_XmlAppend'
Defines a XML value as raw XML
VALUE_CALCULATED  = 3
Defines a XML value that will be calculated by its own function
VALUE_DEFAULT  = 0
Defines a XML value that should get a default value if missing
VALUE_MAYBE_MISSING  = 1
Defines a XML value that may be missing
VALUE_NOT_EMPTY  = 2
Defines a XML value that may not be missing
$_factory  : Horde_Kolab_Format_Factory
The factory for additional objects.
$_fields_specific  : Kolab
Specific data fields for the prefs object
$_parser  : Horde_Kolab_Format_Xml_Parser
The parser dealing with the input.
$_root_name  : string
The name of the root element.
$_root_version  : string
Kolab format version of the root element.
$_version  : int
Requested version of the data array to return
$_xmldoc  : DOMDocument
The XML document this driver works with.
__construct()  : mixed
Constructor
getVersion()  : int
Return the API version of the data structures that are being used for in- and output.
load()  : array<string|int, mixed>
Load an object based on the given XML stream. The stream may only contain UTF-8 data.
save()  : string
Convert the data to a XML stream. Strings contained in the data array may only be provided as UTF-8 data.
_load()  : array<string|int, mixed>
Load the groupware object based on the specifc XML values.
_save()  : bool
Save the specific XML values.
_getParameters()  : array<string|int, mixed>
Generate the internal parameter list for this operation.
_getParser()  : Horde_Kolab_Format_Xml_Parser
Fetch the XML parser.
_getRoot()  : Horde_Kolab_Xml_Type_Root
Return the root handler.
_refreshParser()  : null
Throw the parser instance away.

Constants

PRODUCT_ID

Defines a XML value that should get a default value if missing

public mixed PRODUCT_ID = __CLASS__

TYPE_BOOLEAN

Defines a XML value as boolean type

public mixed TYPE_BOOLEAN = 'Horde_Kolab_Format_Xml_Type_Boolean'

TYPE_COLOR

Defines a XML value as color type

public mixed TYPE_COLOR = 'Horde_Kolab_Format_Xml_Type_Color'

TYPE_COMPOSITE

Defines a XML value as composite value type

public mixed TYPE_COMPOSITE = 'Horde_Kolab_Format_Xml_Type_Composite'

TYPE_DATE

Defines a XML value as date type

public mixed TYPE_DATE = 'Horde_Kolab_Format_Xml_Type_Date'

TYPE_DATE_OR_DATETIME

Defines a XML value as date or datetime type

public mixed TYPE_DATE_OR_DATETIME = 'Horde_Kolab_Format_Xml_Type_DateTime'

TYPE_DATETIME

Defines a XML value as datetime type

public mixed TYPE_DATETIME = 'Horde_Kolab_Format_Xml_Type_DateTime'

TYPE_INTEGER

Defines a XML value as integer type

public mixed TYPE_INTEGER = 'Horde_Kolab_Format_Xml_Type_Integer'

TYPE_MULTIPLE

Defines a XML value as array type

public mixed TYPE_MULTIPLE = 'Horde_Kolab_Format_Xml_Type_Multiple'

TYPE_ROOT

Represents the Kolab format root node

public mixed TYPE_ROOT = 'Horde_Kolab_Format_Xml_Type_Root'

TYPE_STRING

Defines a XML value as string type

public mixed TYPE_STRING = 'Horde_Kolab_Format_Xml_Type_String'

TYPE_XML

Defines a XML value as raw XML

public mixed TYPE_XML = 'Horde_Kolab_Format_Xml_Type_XmlAppend'

VALUE_CALCULATED

Defines a XML value that will be calculated by its own function

public mixed VALUE_CALCULATED = 3

VALUE_DEFAULT

Defines a XML value that should get a default value if missing

public mixed VALUE_DEFAULT = 0

VALUE_MAYBE_MISSING

Defines a XML value that may be missing

public mixed VALUE_MAYBE_MISSING = 1

VALUE_NOT_EMPTY

Defines a XML value that may not be missing

public mixed VALUE_NOT_EMPTY = 2

Properties

$_fields_specific

Specific data fields for the prefs object

protected Kolab $_fields_specific = array('annotation' => 'Horde_Kolab_Format_Xml_Type_Multiple_String')

$_root_name

The name of the root element.

protected string $_root_name = 'annotations'

$_root_version

Kolab format version of the root element.

protected string $_root_version = '1.0'

$_version

Requested version of the data array to return

protected int $_version = 2

$_xmldoc

The XML document this driver works with.

protected DOMDocument $_xmldoc = \null

Methods

getVersion()

Return the API version of the data structures that are being used for in- and output.

public getVersion() : int
Return values
int

The version number;

load()

Load an object based on the given XML stream. The stream may only contain UTF-8 data.

public load(resource $xml[, array<string|int, mixed> $options = array() ]) : array<string|int, mixed>
Parameters
$xml : resource

The XML stream of the message.

$options : array<string|int, mixed> = array()

Additional options when parsing the XML.

- relaxed: Relaxed error checking (default: false)
Tags
throws
Horde_Kolab_Format_Exception

If parsing the XML data failed.

todo

Check encoding of the returned array. It seems to be ISO-8859-1 at the moment and UTF-8 would seem more appropriate.

Return values
array<string|int, mixed>

The data array representing the object.

save()

Convert the data to a XML stream. Strings contained in the data array may only be provided as UTF-8 data.

public save(array<string|int, mixed> $object[, array<string|int, mixed> $options = array() ]) : string
Parameters
$object : array<string|int, mixed>

The data array representing the object.

$options : array<string|int, mixed> = array()

Additional options when writing the XML.

- previous: The previous XML text (default: empty string)
- relaxed: Relaxed error checking (default: false)
Tags
throws
Horde_Kolab_Format_Exception

If converting the data to XML failed.

Return values
string

The data as an XML string.

_load()

Load the groupware object based on the specifc XML values.

protected _load(array<string|int, mixed> &$children) : array<string|int, mixed>
Parameters
$children : array<string|int, mixed>

An array of XML nodes.

Tags
throws
Horde_Kolab_Format_Exception

If parsing the XML data failed.

Return values
array<string|int, mixed>

Array with the object data

_save()

Save the specific XML values.

protected _save(array<string|int, mixed> &$root, array<string|int, mixed> $object) : bool
Parameters
$root : array<string|int, mixed>

The XML document root.

$object : array<string|int, mixed>

The resulting data array.

Tags
throws
Horde_Kolab_Format_Exception

If converting the data to XML failed.

Return values
bool

True on success.

_getParameters()

Generate the internal parameter list for this operation.

private _getParameters(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

The options for this operation.

Return values
array<string|int, mixed>

_getRoot()

Return the root handler.

private _getRoot([array<string|int, mixed> $params = array() ]) : Horde_Kolab_Xml_Type_Root
Parameters
$params : array<string|int, mixed> = array()

Additional parameters.

Return values
Horde_Kolab_Xml_Type_Root

The root handler.

_refreshParser()

Throw the parser instance away.

private _refreshParser() : null
Return values
null

Search results