PHP Class Horde_SyncMl_XmlOutput, horde

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-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Karsten Fourmont ([email protected])
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$output The outputhandler to whom the XML is passed: like Horde_Xml_Wbxml_Encoder

Protected Properties

Property Type Description
$_msg_CmdID The CmdID provides a unique ID for each command in a syncml packet.
$_uri

Public Methods

Method Description
getOutput ( ) The final output as procuded by the _output Encoder. Either an XML string or a WBXML string.
getOutputSize ( ) The length of the output as produced by the Encoder. To limit the size of individual messages.
init ( &$theoutputhandler )
isWBXML ( ) To we create wbxml or not?
outputAlert ( $alertCode, $clientDB = '', $serverDB = '', $lastAnchor = '', $nextAnchor = '' )
outputBodyStart ( )
outputDevInf ( $cmdRef )
outputEnd ( )
outputFinal ( )
outputGetDevInf ( )
outputHeader ( string $respURI ) Creates a SyncHdr output.
outputInit ( )
outputStatus ( $cmdRef, $cmd, $data, $targetRef = '', $sourceRef = '', $syncAnchorNext = '', $syncAnchorLast = '' )
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
outputSyncEnd ( )
outputSyncStart ( $clientLocURI, $serverLocURI, $numberOfChanges = null )
singleton ( )

Protected Methods

Method Description
_outputCmdID ( ) internal helper functions:
_singleEle ( $tag, $str, $uri = null ) Output a single $str element.
_writeDataStore ( string $sourceref, string $mimetype, string $version, Horde_Xml_Wbxml_ContentHandler &$output, array $additionaltypes = [] ) Writes DevInf data for one DataStore.

Method Details

_outputCmdID() protected method

internal helper functions:
protected _outputCmdID ( )

_singleEle() protected method

Output a single $str element.
protected _singleEle ( $tag, $str, $uri = null )

_writeDataStore() protected method

Writes DevInf data for one DataStore.
protected _writeDataStore ( string $sourceref, string $mimetype, string $version, Horde_Xml_Wbxml_ContentHandler &$output, array $additionaltypes = [] )
$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 Array of additional types for and ; format array('text/directory' => '3.0')

getOutput() public method

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

getOutputSize() public method

The length of the output as produced by the Encoder. To limit the size of individual messages.
public getOutputSize ( )

init() public method

public init ( &$theoutputhandler )

isWBXML() public method

To we create wbxml or not?
public isWBXML ( )

outputAlert() public method

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

outputBodyStart() public method

public outputBodyStart ( )

outputDevInf() public method

public outputDevInf ( $cmdRef )

outputEnd() public method

public outputEnd ( )

outputFinal() public method

public outputFinal ( )

outputGetDevInf() public method

public outputGetDevInf ( )

outputHeader() public method

Required data is retrieved from state.
public outputHeader ( string $respURI )
$respURI string The url of the server endpoint.

outputInit() public method

public outputInit ( )

outputStatus() public method

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

outputSyncCommand() public method

Creates a single Sync command
public 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
$command string The Sync command (Add, Delete, Replace).
$content string The actual object content.
$contentType string The content's MIME type.
$encodingType string The content encoding of the object.
$cuid string The client's object UID.
$suid string The server's object UID.
$contentSize integer The total content size.
$moreData boolean Add MoreData tag when splitting messages.
return integer The CmdID used for this command.

outputSyncEnd() public method

public outputSyncEnd ( )

outputSyncStart() public method

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

singleton() public method

public singleton ( )

Property Details

$_msg_CmdID protected_oe property

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

$_uri protected_oe property

protected $_uri

$output public_oe property

The outputhandler to whom the XML is passed: like Horde_Xml_Wbxml_Encoder
public $output