Documentation

Horde_SyncMl_XmlOutput
in package

This class creates the actual XML data and passes it on to a ContentHandler for optional WBXML encoding.

Each member public function creates one type of SyncML artefact (like a Status response). Currently some of the information is retrieved from state. Maybe remove these dependencies (by providing the data as parameter) for an even cleaner implementation.

The Horde_SyncMl_XmlOutput class takes automatically care of creating a unique CmdID for each command created.

Copyright 2006-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
author

Karsten Fourmont karsten@horde.org

Table of Contents

$output  : mixed
The outputhandler to whom the XML is passed: like Horde_Xml_Wbxml_Encoder
$_msg_CmdID  : mixed
The CmdID provides a unique ID for each command in a syncml packet.
$_uri  : mixed
getOutput()  : mixed
The final output as procuded by the _output Encoder. Either an XML string or a WBXML string.
getOutputSize()  : mixed
The length of the output as produced by the Encoder. To limit the size of individual messages.
init()  : mixed
isWBXML()  : mixed
To we create wbxml or not?
outputAlert()  : mixed
outputBodyStart()  : mixed
outputDevInf()  : mixed
outputEnd()  : mixed
outputFinal()  : mixed
outputGetDevInf()  : mixed
outputHeader()  : mixed
Creates a SyncHdr output.
outputInit()  : mixed
outputStatus()  : mixed
outputSyncCommand()  : int
Creates a single Sync command
outputSyncEnd()  : mixed
outputSyncStart()  : mixed
singleton()  : mixed
_outputCmdID()  : mixed
_singleEle()  : mixed
Output a single <ele>$str</ele> element.
_writeDataStore()  : mixed
Writes DevInf data for one DataStore.

Properties

$output

The outputhandler to whom the XML is passed: like Horde_Xml_Wbxml_Encoder

public mixed $output

$_msg_CmdID

The CmdID provides a unique ID for each command in a syncml packet.

protected mixed $_msg_CmdID

Methods

getOutput()

The final output as procuded by the _output Encoder. Either an XML string or a WBXML string.

public getOutput() : mixed
Return values
mixed

getOutputSize()

The length of the output as produced by the Encoder. To limit the size of individual messages.

public getOutputSize() : mixed
Return values
mixed

init()

public init(mixed &$theoutputhandler) : mixed
Parameters
$theoutputhandler : mixed
Return values
mixed

isWBXML()

To we create wbxml or not?

public isWBXML() : mixed
Return values
mixed

outputAlert()

public outputAlert(mixed $alertCode[, mixed $clientDB = '' ][, mixed $serverDB = '' ][, mixed $lastAnchor = '' ][, mixed $nextAnchor = '' ]) : mixed
Parameters
$alertCode : mixed
$clientDB : mixed = ''
$serverDB : mixed = ''
$lastAnchor : mixed = ''
$nextAnchor : mixed = ''
Return values
mixed

outputBodyStart()

public outputBodyStart() : mixed
Return values
mixed

outputDevInf()

public outputDevInf(mixed $cmdRef) : mixed
Parameters
$cmdRef : mixed
Return values
mixed

outputEnd()

public outputEnd() : mixed
Return values
mixed

outputFinal()

public outputFinal() : mixed
Return values
mixed

outputGetDevInf()

public outputGetDevInf() : mixed
Return values
mixed

outputHeader()

Creates a SyncHdr output.

public outputHeader(string $respURI) : mixed

Required data is retrieved from state.

Parameters
$respURI : string

The url of the server endpoint.

Tags
throws
Horde_Xml_Wbxml_Exception
Return values
mixed

outputInit()

public outputInit() : mixed
Return values
mixed

outputStatus()

public outputStatus(mixed $cmdRef, mixed $cmd, mixed $data[, mixed $targetRef = '' ][, mixed $sourceRef = '' ][, mixed $syncAnchorNext = '' ][, mixed $syncAnchorLast = '' ]) : mixed
Parameters
$cmdRef : mixed
$cmd : mixed
$data : mixed
$targetRef : mixed = ''
$sourceRef : mixed = ''
$syncAnchorNext : mixed = ''
$syncAnchorLast : mixed = ''
Return values
mixed

outputSyncCommand()

Creates a single Sync command

public outputSyncCommand(string $command[, string $content = null ][, string $contentType = null ][, string $encodingType = null ][, string $cuid = null ][, string $suid = null ][, int $contentSize = null ][, bool $moreData = false ]) : int
Parameters
$command : string

The Sync command (Add, Delete, Replace).

$content : string = null

The actual object content.

$contentType : string = null

The content's MIME type.

$encodingType : string = null

The content encoding of the object.

$cuid : string = null

The client's object UID.

$suid : string = null

The server's object UID.

$contentSize : int = null

The total content size.

$moreData : bool = false

Add MoreData tag when splitting messages.

Return values
int

The CmdID used for this command.

outputSyncEnd()

public outputSyncEnd() : mixed
Return values
mixed

outputSyncStart()

public outputSyncStart(mixed $clientLocURI, mixed $serverLocURI[, mixed $numberOfChanges = null ]) : mixed
Parameters
$clientLocURI : mixed
$serverLocURI : mixed
$numberOfChanges : mixed = null
Return values
mixed

singleton()

public singleton() : mixed
Return values
mixed

_outputCmdID()

protected _outputCmdID() : mixed
Return values
mixed

_singleEle()

Output a single <ele>$str</ele> element.

protected _singleEle(mixed $tag, mixed $str[, mixed $uri = null ]) : mixed
Parameters
$tag : mixed
$str : mixed
$uri : mixed = null
Return values
mixed

_writeDataStore()

Writes DevInf data for one DataStore.

protected _writeDataStore(string $sourceref, string $mimetype, string $version, Horde_Xml_Wbxml_ContentHandler &$output[, array<string|int, mixed> $additionaltypes = array() ]) : mixed
Parameters
$sourceref : string

Data for element.

$mimetype : string

Data for and .

$version : string

Data for and .

$output : Horde_Xml_Wbxml_ContentHandler

Content handler that will received the output.

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

Array of additional types for and ; format array('text/directory' => '3.0')

Return values
mixed

Search results