適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.data 

ConflictDetector  - AS3 ADEP Data Services

套件mx.data
類別public class ConflictDetector
繼承ConflictDetector Inheritance Object

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

A DataService instance uses a ConflictDetector instance to determine when a conflict occurs for an operation pushed from a remote destination.

It has three methods that are used to determine if a conflict exists when processing a pushed operation, checkCreate(), checkDelete(), and checkUpdate(). Each of these methods is called for the corresponding operation with two parameters, the local and the remote change.

If you want to customize how conflicts are detected on the client, you can extend this class and augment the behavior as needed to match remote assembler logic.

The following code provides examples of how these methods can be used to indicate a conflict has occurred. Conflicts are always indicated on the remoteChange.

檢視範例



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
公用方法
 方法定義自
  
ConflictDetector(dataService:ConcreteDataService)
Constructs an instance of the default conflict detection mechanism.
ConflictDetector
  
checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when a create operation is pushed/processed from the remote destination.
ConflictDetector
  
checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when a delete operation is pushed/processed from the remote destination.
ConflictDetector
  
checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void
Called by the DataService when a remove from fill operation is pushed/processed from the remote destination.
ConflictDetector
  
checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void
Called by the DataService when an update operation is pushed/processed from the remote destination.
ConflictDetector
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
建構函式詳細資料

ConflictDetector

()建構函式
public function ConflictDetector(dataService:ConcreteDataService)

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

Constructs an instance of the default conflict detection mechanism.

參數
dataService:ConcreteDataService — ConcreteDataService reference to the data service that will use this conflict detector.
方法詳細資訊

checkCreate

()方法
public function checkCreate(remoteChange:IChangeObject, localChange:IChangeObject):void

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

Called by the DataService when a create operation is pushed/processed from the remote destination.

參數

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

checkDelete

()方法 
public function checkDelete(remoteChange:IChangeObject, localChange:IChangeObject):void

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

Called by the DataService when a delete operation is pushed/processed from the remote destination.

參數

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

checkRemoveFromFill

()方法 
public function checkRemoveFromFill(localChange:IChangeObject, fillParameters:Object):void

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

Called by the DataService when a remove from fill operation is pushed/processed from the remote destination.

參數

localChange:IChangeObject — IChangeObject representing the local version of the item that the server is telling us to remove from the specified dill
 
fillParameters:Object — fill parameters identifying the fill from which the item is to be removed.

checkUpdate

()方法 
public function checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3
執行階段版本: Flash Player 9, AIR 1.1

Called by the DataService when an update operation is pushed/processed from the remote destination.

參數

remoteChange:IChangeObject — IChangeObject representing the remote change being processed.
 
localChange:IChangeObject — IChangeObject representing any local changes made to the same object referenced by the remoteChange parameter. This value can be null if no local changes have been made to the item represented by the remoteChange parameter.

 override public function checkCreate(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // if we have created a local item that is the same item as the remote 
     // change then we have a conflict
     if (localChange != null && 
         ObjectUtil.compare(remoteChange.identity, localChange.identity) == 0)
     {
         remoteChange.conflict("Local created item is in conflict with remotely created item",
                               localChange.changedPropertyNames);
     }
 }
 
 override public function checkDelete(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // if we have an update locally for an item that was deleted remotely
     // that is considered a conflict.
     if (localChange != null)
     {
         if (localChange.isUpdate())
         {
             remoteChange.conflict("Local item was updated and is in conflict with pushed delete.",
                                   localChange.changedPropertyNames);
         }
     }
 }
 
 override public function checkUpdate(remoteChange:IChangeObject,
                                      localChange:IChangeObject):void
 {
     // get a list of all of the changed properties
     var changes:Array = remoteChange.changedPropertyNames;
     // get the remote state of the item's properties
     var newVersion:Object = remoteChange.newVersion;
     var prevVersion:Object = localChange.previousVersion;
     // properties will be in conflict if the old value of a property on the 
     // local item is different from the same property value of the new version
     // of the remote item.
     var conflictingProps:Array = [];
     for (var i:int=0; i<changes.length; i++)
     {
         var prop:Object = changes[i]; // could be a String or QName
         if (ObjectUtil.compare(prevVersion[prop], newVersion[prop]) != 0)
         {
             conflictingProps.push(prop);
         }
     }
 
     if (conflictingProps.length > 0)
     {
         remoteChange.conflict("Local item has changes to properties that conflict with remote change.",
                               conflictingProps);
     }
 }
 




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。