steffen: server/kolab-horde-framework/kolab-horde-framework/SyncML/SyncML/Sync OneWayFromClientSync.php, NONE, 1.1 OneWayFromServerSync.php, NONE, 1.1 RefreshFromClientSync.php, NONE, 1.1 RefreshFromServerSync.php, NONE, 1.1 SlowSync.php, NONE, 1.1 TwoWaySync.php, NONE, 1.1

cvs at intevation.de cvs at intevation.de
Fri Oct 14 16:33:14 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-horde-framework/kolab-horde-framework/SyncML/SyncML/Sync
In directory doto:/tmp/cvs-serv28903/kolab-horde-framework/kolab-horde-framework/SyncML/SyncML/Sync

Added Files:
	OneWayFromClientSync.php OneWayFromServerSync.php 
	RefreshFromClientSync.php RefreshFromServerSync.php 
	SlowSync.php TwoWaySync.php 
Log Message:
Separated Horde Framework from kolab-resource-handlers

--- NEW FILE: OneWayFromClientSync.php ---
<?php

include_once 'Horde/SyncML/Sync.php';

/**
 * No need to run anything at begining or end of sync, Sync will
 * handle this.
 *
 * $Horde: framework/SyncML/SyncML/Sync/OneWayFromClientSync.php,v 1.6 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_OneWayFromClientSync extends Horde_SyncML_Sync {

}

--- NEW FILE: OneWayFromServerSync.php ---
<?php

include_once 'Horde/SyncML/Sync/TwoWaySync.php';

/**
 * Will run normal $end from TwoWaySync, the client should not send
 * any changes.
 *
 * $Horde: framework/SyncML/SyncML/Sync/OneWayFromServerSync.php,v 1.6 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_OneWayFromServerSync extends Horde_SyncML_Sync_TwoWaySync {

}

--- NEW FILE: RefreshFromClientSync.php ---
<?php

include_once 'Horde/SyncML/Sync.php';

/**
 * $Horde: framework/SyncML/SyncML/Sync/RefreshFromClientSync.php,v 1.7 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_RefreshFromClientSync extends Horde_SyncML_Sync {

    /**
     * We need to erase the current server contents, then we can add
     * the client's contents.
     */
    function startSync($currentCmdID, &$output)
    {
        $deletes = $registry->call($this->targetLocURI, '/list', array());
        foreach ($delete as $deletes) {
            $registry->call($this->targetLocURI . '/remove', array($delete));
        }

        return $currentCmdID;
    }

}

--- NEW FILE: RefreshFromServerSync.php ---
<?php

include_once 'Horde/SyncML/Sync.php';

/**
 * $Horde: framework/SyncML/SyncML/Sync/RefreshFromServerSync.php,v 1.7 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_RefreshFromServerSync extends Horde_SyncML_Sync {

    function endSync($currentCmdID, &$output)
    {
        global $registry;

        $adds = $registry->call($this->targetLocURI, '/list', array());
        foreach ($add as $adds) {
            $locid = $this->_currentState->getLocID($adds);
            // Add a replace.
            $add = &new Horde_SyncML_Command_Sync_ContentSyncElement();

            $add->setContent($registry->call($this->targetLocURI . '/listByAction',
                                             array($this->_currentState->getPreferedContentType($this->targetLocURI))));

            $currentCmdID = $add->outputCommand($currentCmdID, $output, 'Add');
        }

        // @TODO Get deletes.

        // @TODO Get adds.

        return $currentCmdID;
    }

}

--- NEW FILE: SlowSync.php ---
<?php

include_once 'Horde/SyncML/Sync/TwoWaySync.php';

/**
 * Slow sync may just work; I think most of the work is going to be
 * done by the API.
 *
 * $Horde: framework/SyncML/SyncML/Sync/SlowSync.php,v 1.7 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync {

}

--- NEW FILE: TwoWaySync.php ---
<?php

include_once 'Horde/SyncML/Sync.php';

/**
 * $Horde: framework/SyncML/SyncML/Sync/TwoWaySync.php,v 1.8 2004/05/26 17:32:50 chuck Exp $
 *
 * Copyright 2003-2004 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.1 $
 * @since   Horde 3.0
 * @package Horde_SyncML
 */
class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync {

    function endSync($currentCmdID, &$output)
    {
        global $registry;

        $state = $_SESSION['SyncML.state'];

        // Get changes.
        $changes = $registry->call($this->targetLocURI, '/listBy', array('timestamp' => 0, 'action' => 'modify'));
        foreach ($changes as $change) {
            $locid = $state->getLocID($changes);
            // Add a replace.
            $replace = &new Horde_SyncML_Command_Sync_ContentSyncElement();

            $replace->setContent($registry->call($this->targetLocURI . '/export',
                                                 array('guid' => $change, 'contentType' => $this->_currentState->getPreferedContentType($this->targetLocURI))));

            $currentCmdID = $replace->outputCommand($currentCmdID, $output, 'Replace');
        }

        // Get deletes.
        $deletes = $registry->call($this->targetLocURI, '/listByAction', array('timestamp' => 0, 'action' => 'delete'));
        foreach ($deletes as $delete) {
            $locid = $state->getLocID($delete);
            if ($locid) {
                // Add a replace.
                $delete = &new Horde_SyncML_Command_Sync_ContentSyncElement();

                $currentCmdID = $delete->outputCommand($currentCmdID, $output, 'Delete');
            }
        }

        // Get adds.
        $adds = $registry->call($this->targetLocURI, '/listByAction', array('timestamp' => 0, 'action' => 'add'));
        foreach ($adds as $add) {
            $locid = $state->getLocID($adds);
            // Add a replace.
            $add = &new Horde_SyncML_Command_Sync_ContentSyncElement();

            $replace->setContent($registry->call($this->targetLocURI . '/export',
                                                 array('guid' => $change, 'contentType' => $this->_currentState->getPreferedContentType($this->targetLocURI))));

            $currentCmdID = $add->outputCommand($currentCmdID, $output, 'Add');
        }

        return $currentCmdID;
    }

}





More information about the commits mailing list