Changeset 17975

Show
Ignore:
Timestamp:
10/06/08 16:40:58 (2 months ago)
Author:
rambo
Message:

forward port r17974

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/baseclasses/components/interface.php

    r17731 r17975  
    840840                $this->_on_watched_dba_delete($object); 
    841841                break; 
     842 
     843            case MIDCOM_OPERATION_DBA_IMPORT: 
     844                $this->_on_watched_dba_import($object); 
     845                break; 
    842846        } 
    843847    } 
     
    862866     * @param int $operation The operation identifier (one of the MIDCOM_OPERATION constants) 
    863867     *     which applies. 
    864      * @param obect $object The object on which the operation has occurred. 
     868     * @param object $object The object on which the operation has occured. 
    865869     */ 
    866870    function _on_watched_operation($operation, $object) {} 
     
    876880     * It is called after the generic _on_watched_operation event handler. 
    877881     * 
    878      * @param obect $object The object on which the operation has occurred. 
     882     * @param object $object The object on which the operation has occured. 
    879883     */ 
    880884    function _on_watched_dba_create($object) {} 
     
    890894     * It is called after the generic _on_watched_operation event handler. 
    891895     * 
    892      * @param obect $object The object on which the operation has occurred. 
     896     * @param object $object The object on which the operation has occured. 
    893897     */ 
    894898    function _on_watched_dba_update($object) {} 
     
    898902     * that has been done during the request. 
    899903     * 
    900      * It will be called once per operation and unique object, where object uniqueness 
    901      * is determined by the combination of object class and guid. The object has been 
    902      * refreshed before being passed to this event handler. 
    903      * 
    904904     * It is called after the generic _on_watched_operation event handler. 
    905905     * 
    906      * @param obect $object The object on which the operation has occurred. 
     906     * @param object $object The object on which the operation has occured. 
    907907     */ 
    908908    function _on_watched_dba_delete($object) {} 
     909 
     910    /** 
     911     * This function is triggered at the end of the request for each watched import operation 
     912     * that has been done during the request. 
     913     * 
     914     * It is called after the generic _on_watched_operation event handler. 
     915     * 
     916     * @param object $object The object on which the operation has occured. 
     917     */ 
     918    function _on_watched_dba_import($object) {} 
    909919 
    910920    /** 
  • trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php

    r17955 r17975  
    14781478    function refresh(&$object) 
    14791479    { 
     1480        // FIXME: be GUID based, but needs further testing... 
     1481        //return $object->get_by_guid($object->guid); 
    14801482        return $object->get_by_id($object->id); 
    14811483    } 
  • trunk/midcom/midcom.core/midcom/helper/_componentloader.php

    r17558 r17975  
    196196        MIDCOM_OPERATION_DBA_UPDATE => Array(), 
    197197        MIDCOM_OPERATION_DBA_DELETE => Array(), 
     198        MIDCOM_OPERATION_DBA_IMPORT => Array(), 
    198199    ); 
    199200 
     
    212213        MIDCOM_OPERATION_DBA_UPDATE => Array(), 
    213214        MIDCOM_OPERATION_DBA_DELETE => Array(), 
     215        MIDCOM_OPERATION_DBA_IMPORT => Array(), 
    214216    ); 
    215217 
     
    883885    { 
    884886        debug_push_class(__CLASS__, __FUNCTION__); 
    885  
    886887        if ($this->_watch_notifications === null) 
    887888        { 
     
    896897            { 
    897898                $object = array_shift($data); 
    898                 if ($operation != MIDCOM_OPERATION_DBA_DELETE) 
     899                if (   $operation != MIDCOM_OPERATION_DBA_DELETE 
     900                    && $operation != MIDCOM_OPERATION_DBA_IMPORT) 
    899901                { 
    900                     // Only refresh when we haven't deleted the record. 
     902                    // Only refresh when we haven't deleted/imported the record. 
    901903                    if (! $object->refresh()) 
    902904                    { 
  • trunk/midcom/midcom.core/midcom/helper/_dbfactory.php

    r17907 r17975  
    573573 
    574574        $acl_object->_on_imported(); 
    575         $_MIDCOM->componentloader->trigger_watches(MIDCOM_OPERATION_DBA_IMPORT, $object); 
     575        $_MIDCOM->componentloader->trigger_watches(MIDCOM_OPERATION_DBA_IMPORT, $acl_object); 
    576576        debug_pop(); 
    577577        return true;