[sync] more syncml command classes

Anthony Mills amills at gascard.net
Sat Dec 20 03:14:31 PST 2003


I put these files in this directory horde/framework/RPC/RPC/syncml_command.
Feel free to move them around.  The factory can be rewritten to use file names
instead of a switch statement.  The elements are case sensitive.

Anthony

-------------- next part --------------
<?php

include_once 'Horde/RPC/syncml_state.php';

/**
 * The Horde_RPC_syncml class provides a SyncML implementation of the
 * Horde RPC system.
 *
 * $Horde: framework/RPC/RPC/syncml.php,v 1.6 2003/12/17 16:02:44 chuck Exp $
 *
 * Copyright 2003 Anthony Mills <amills at pyramid6.com>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  Anthony Mills <amills at pyramid6.com>
 * @version $Revision: 1.6 $
 * @since   Horde 3.0
 * @package Horde_RPC
 */
 
 /**
  * All variables are from the client standpoint.
  *
  *
  */
class Horde_RPC_syncml_sync_Final extends Horde_RPC_syncml_sync_command {
    
    function output($currentCmdID, $output)
    {
        attrs = array();
        $output->startElement(uri, 'Final', attrs);
                
        $output->endElement(uri, 'Final');

        return $currentCmdID;
    }
    
}
-------------- next part --------------
<?php

include_once 'Horde/RPC/syncml_state.php';
include_once 'Horde/RPC/syncml_status.php';
include_once 'Horde/RPC/syncml_command/command.php';

/**
 * The Horde_RPC_syncml class provides a SyncML implementation of the
 * Horde RPC system.
 *
 * $Horde: framework/RPC/RPC/syncml.php,v 1.6 2003/12/17 16:02:44 chuck Exp $
 *
 * Copyright 2003 Anthony Mills <amills at pyramid6.com>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  Anthony Mills <amills at pyramid6.com>
 * @version $Revision: 1.6 $
 * @since   Horde 3.0
 * @package Horde_RPC
 */
 
 /**
  * All variables are from the client standpoint.
  *
  *
  */
class Horde_RPC_syncml_command_Get extends Horde_RPC_syncml_command {
    
    var $targetURI;
    
    function output($currentCmdID, $output)
    {                
        $status = new Status((($this->_isAuthorized) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Get');
        $status->setVersion($this->_version);
        $status->setCmdRef($this->_cmdID);
        $status->setMsgID($this->_msgID);
        
        if ($this->_targetURI != null)
            $status->setTargetRef($targetURI);
        
        $currentCmdID = $status->output($currentCmdID, $output);
        
//        if (isAuthorized) {
//            Results results = new Results();
//            results.setVersion(version);
//            results.setCmdRef(cmdID);
//            results.setMsgID(msgID);
//            
//            //DevInf returnDevInf = new DevInf((version == 0) ? "./devinf" : "./devinf11");
//            
//            //result.setData(devinf);
//            currentCmdID = results.output(currentCmdID, contentHandler,  errorHandler);
//        }
        
        return $currentCmdID;        
    }
    
}
-------------- next part --------------
<?php

include_once 'Horde/RPC/syncml_state.php';
include_once 'Horde/RPC/syncml_status.php';
include_once 'Horde/RPC/syncml_command/command.php';

/**
 * The Horde_RPC_syncml class provides a SyncML implementation of the
 * Horde RPC system.
 *
 * $Horde: framework/RPC/RPC/syncml.php,v 1.6 2003/12/17 16:02:44 chuck Exp $
 *
 * Copyright 2003 Anthony Mills <amills at pyramid6.com>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 *
 * @author  Anthony Mills <amills at pyramid6.com>
 * @version $Revision: 1.6 $
 * @since   Horde 3.0
 * @package Horde_RPC
 */
 
 /**
  * All variables are from the client standpoint.
  *
  *
  */
class Horde_RPC_syncml_command_Put extends Horde_RPC_syncml_command {
    
    var $_sourceURI;
    
    function output($currentCmdID, $output )
    {
        $status = &new Horde_RPC_syncml_command_Status((($this->_isAuthorized) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Put');
        $status.setVersion($this->_version);
        $status.setCmdRef($this->_cmdID);
        $status.setMsgID($this->_msgID);
        
        if ($this->_sourceURI != null)
            $status.setSourceRef($this->_sourceURI);
        
        return $status->output($currentCmdID, $output);
    }
    
    function setSourceURI($sourceURI) {
        $this->_sourceURI = $sourceURI;
    }
    
}



More information about the sync mailing list