\Horde_SyncMl_XmlOutput

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.

Summary

Methods
Properties
Constants
getOutput()
getOutputSize()
isWBXML()
singleton()
init()
outputHeader()
outputInit()
outputBodyStart()
outputFinal()
outputEnd()
outputStatus()
outputDevInf()
outputAlert()
outputGetDevInf()
outputSyncCommand()
outputSyncStart()
outputSyncEnd()
$output
No constants found
_writeDataStore()
_outputCmdID()
_singleEle()
$_msg_CmdID
$_uri
N/A
No private methods found
No private properties found
N/A

Properties

$output

$output : 

The outputhandler to whom the XML is passed: like Horde_Xml_Wbxml_Encoder

Type

$_msg_CmdID

$_msg_CmdID : 

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

Type

$_uri

$_uri : 

Type

Methods

getOutput()

getOutput() 

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

getOutputSize()

getOutputSize() 

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

isWBXML()

isWBXML() 

To we create wbxml or not?

singleton()

singleton() 

init()

init(  $theoutputhandler) 

Parameters

$theoutputhandler

outputHeader()

outputHeader(string  $respURI) 

Creates a SyncHdr output.

Required data is retrieved from state.

Parameters

string $respURI

The url of the server endpoint.

Throws

\Horde_Xml_Wbxml_Exception

outputInit()

outputInit() 

outputBodyStart()

outputBodyStart() 

outputFinal()

outputFinal() 

outputEnd()

outputEnd() 

outputStatus()

outputStatus(  $cmdRef,   $cmd,   $data,   $targetRef = '',   $sourceRef = '',   $syncAnchorNext = '',   $syncAnchorLast = '') 

Parameters

$cmdRef
$cmd
$data
$targetRef
$sourceRef
$syncAnchorNext
$syncAnchorLast

outputDevInf()

outputDevInf(  $cmdRef) 

Parameters

$cmdRef

outputAlert()

outputAlert(  $alertCode,   $clientDB = '',   $serverDB = '',   $lastAnchor = '',   $nextAnchor = '') 

Parameters

$alertCode
$clientDB
$serverDB
$lastAnchor
$nextAnchor

outputGetDevInf()

outputGetDevInf() 

outputSyncCommand()

outputSyncCommand(string  $command, string  $content = null, string  $contentType = null, string  $encodingType = null, string  $cuid = null, string  $suid = null, integer  $contentSize = null, boolean  $moreData = false) : integer

Creates a single Sync command

Parameters

string $command

The Sync command (Add, Delete, Replace).

string $content

The actual object content.

string $contentType

The content's MIME type.

string $encodingType

The content encoding of the object.

string $cuid

The client's object UID.

string $suid

The server's object UID.

integer $contentSize

The total content size.

boolean $moreData

Add MoreData tag when splitting messages.

Returns

integer —

The CmdID used for this command.

outputSyncStart()

outputSyncStart(  $clientLocURI,   $serverLocURI,   $numberOfChanges = null) 

Parameters

$clientLocURI
$serverLocURI
$numberOfChanges

outputSyncEnd()

outputSyncEnd() 

_writeDataStore()

_writeDataStore(string  $sourceref, string  $mimetype, string  $version, \Horde_Xml_Wbxml_ContentHandler  $output, array  $additionaltypes = array()) 

Writes DevInf data for one DataStore.

Parameters

string $sourceref

Data for element.

string $mimetype

Data for and

.
string $version

Data for and

.
\Horde_Xml_Wbxml_ContentHandler $output

Content handler that will received the output.

array $additionaltypes

Array of additional types for

and ; format array('text/directory' => '3.0')

_outputCmdID()

_outputCmdID() 

_singleEle()

_singleEle(  $tag,   $str,   $uri = null) 

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

Parameters

$tag
$str
$uri