Class SyncML_XMLOutput

Description

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

Each member 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 SyncML_XMLOutput class takes automatically care of creating a unique CmdID for each command created.

$Horde: framework/SyncML/SyncML/XMLOutput.php,v 1.14.2.8 2009/01/06 15:23:37 jan Exp $

Copyright 2006-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /SyncML/SyncML/XMLOutput.php (line 26)


	
			
Variable Summary
 mixed $_msg_CmdID
 mixed $_output
 mixed $_uri
Method Summary
 void getOutput ()
 void getOutputSize ()
 void init ( &$theoutputhandler)
 void isWBXML ()
 void outputAlert ( $alertCode, [ $clientDB = ''], [ $serverDB = ''], [ $lastAnchor = ''], [ $nextAnchor = ''])
 void outputBodyStart ()
 void outputDevInf ( $cmdRef)
 void outputEnd ()
 void outputFinal ()
 void outputGetDevInf ()
 void outputHeader (string $respURI)
 void outputInit ()
 void outputStatus ( $cmdRef,  $cmd,  $data, [ $targetRef = ''], [ $sourceRef = ''], [ $syncAnchorNext = ''], [ $syncAnchorLast = ''])
 integer outputSyncCommand (string $command, [string $content = null], [string $contentType = null], [string $encodingType = null], [string $cuid = null], [string $suid = null])
 void outputSyncEnd ()
 void outputSyncStart ( $clientLocURI,  $serverLocURI, [ $numberOfChanges = null])
 void &singleton ()
 void _outputCmdID ()
 void _singleEle ( $tag,  $str, [ $uri = null])
 void _writeDataStore (string $sourceref, string $mimetype, string $version,  &$output, [array $additionaltypes = array()], XML_WBXML_ContentHandler $output)
Variables
mixed $_msg_CmdID (line 31)

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

mixed $_output (line 36)

The outputhandler to whom the XML is passed: like XML_WBXML_Encoder

mixed $_uri (line 38)
Methods
getOutput (line 44)

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

void getOutput ()
getOutputSize (line 53)

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

void getOutputSize ()
init (line 75)
void init ( &$theoutputhandler)
  • &$theoutputhandler
isWBXML (line 61)

To we create wbxml or not?

void isWBXML ()
outputAlert (line 438)
void outputAlert ( $alertCode, [ $clientDB = ''], [ $serverDB = ''], [ $lastAnchor = ''], [ $nextAnchor = ''])
  • $alertCode
  • $clientDB
  • $serverDB
  • $lastAnchor
  • $nextAnchor
outputBodyStart (line 168)
void outputBodyStart ()
outputDevInf (line 281)
void outputDevInf ( $cmdRef)
  • $cmdRef
outputEnd (line 179)
void outputEnd ()
outputFinal (line 173)
void outputFinal ()
outputGetDevInf (line 497)
void outputGetDevInf ()
outputHeader (line 89)

Creates a SyncHdr output.

Required data is retrieved from state.

void outputHeader (string $respURI)
  • string $respURI: The url of the server endpoint.
outputInit (line 161)
void outputInit ()
outputStatus (line 186)
void outputStatus ( $cmdRef,  $cmd,  $data, [ $targetRef = ''], [ $sourceRef = ''], [ $syncAnchorNext = ''], [ $syncAnchorLast = ''])
  • $cmdRef
  • $cmd
  • $data
  • $targetRef
  • $sourceRef
  • $syncAnchorNext
  • $syncAnchorLast
outputSyncCommand (line 539)

Creates a single Sync command

  • return: The CmdID used for this command.
integer outputSyncCommand (string $command, [string $content = null], [string $contentType = null], [string $encodingType = null], [string $cuid = null], [string $suid = null])
  • 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.
outputSyncEnd (line 629)
void outputSyncEnd ()
outputSyncStart (line 604)
void outputSyncStart ( $clientLocURI,  $serverLocURI, [ $numberOfChanges = null])
  • $clientLocURI
  • $serverLocURI
  • $numberOfChanges
singleton (line 66)
void &singleton ()
_outputCmdID (line 637)
void _outputCmdID ()
_singleEle (line 648)

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

void _singleEle ( $tag,  $str, [ $uri = null])
  • $tag
  • $str
  • $uri
_writeDataStore (line 376)

Writes DevInf data for one DataStore.

void _writeDataStore (string $sourceref, string $mimetype, string $version,  &$output, [array $additionaltypes = array()], XML_WBXML_ContentHandler $output)
  • string $sourceref: Data for <SourceRef> element.
  • string $mimetype: Data for <Rx-Pref><CTType> and <Tx-Pref><CTType>.
  • string $version: Data for <Rx-Pref><VerCT> and <Tx-Pref><VerCT>.
  • XML_WBXML_ContentHandler $output: Content handler that will received the output.
  • array $additionaltypes: Array of additional types for <Tx> and <Rx>; format array('text/directory' => '3.0')
  • &$output

Documentation generated on Sun, 30 Jan 2011 05:23:32 +0000 by phpDocumentor 1.4.3