/**
 * This is a generated class and is not intended for modfication.  To customize behavior
 * of this service wrapper you may modify the generated sub-class of this class - PnlService.as.
 */
package services.pnlservice
{
import mx.rpc.AsyncToken;
import com.adobe.fiber.core.model_internal;
import mx.rpc.AbstractOperation;
import valueObjects.Pnl;
import mx.data.RPCDataManager;
import mx.data.ManagedOperation;
import mx.data.ManagedAssociation;
import mx.data.ManagedQuery;
import mx.data.ItemReference;
import mx.collections.ItemResponder;
import mx.rpc.remoting.RemoteObject; 
import mx.rpc.remoting.Operation;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.serializers.utility.TypeUtility;

[ExcludeClass]internal class _Super_PnlService extends RemoteObjectServiceWrapper
{      
    private var _pnlRPCDataManager : RPCDataManager;         
    private var managersArray : Array = new Array();
        
    public const DATA_MANAGER_PNL : String = "Pnl";         
        
    public function getDataManager(dataManagerName:String) : RPCDataManager
    {
        switch (dataManagerName)
        {
             case (DATA_MANAGER_PNL):
                return _pnlRPCDataManager;      
            default:
                return null;
        }
    }
    
    /**
     * Commit all of the pending changes for this DataService, as well as all of the pending changes of all DataServices
     * sharing the same DataStore.  By default, a DataService shares the same DataStore with other DataServices if they have 
     * managed association properties and share the same set of channels. 
     *
     * @see mx.data.DataManager
     * @see mx.data.DataStore
     *
     * @param itemsOrCollections:Array This is an optional parameter which defaults to null when
     *  you want to commit all pending changes.  If you want to commit a subset of the pending
     *  changes use this argument to specify a list of managed ListCollectionView instances
     *  and/or managed items.  ListCollectionView objects are most typically ArrayCollections
     *  you have provided to your fill method.  The items appropriate for this method are
     *  any managed version of the item.  These are any items you retrieve from getItem, createItem
     *  or using the getItemAt method from a managed collection.  Only changes for the
     *  items defined by any of the values in this array will be committed.
     *
     * @param cascadeCommit if true, also commit changes made to any associated
     *  items supplied in this list.
     *
     *  @return AsyncToken that is returned in <code>call</code> property of
     *  either the <code>ResultEvent.RESULT</code> or in the
     *  <code>FaultEvent.FAULT</code>.
     *  Custom data can be attached to this object and inspected later
     *  during the event handling phase.  If no changes have been made
     *  to the relevant items, null is returned instead of an AsyncToken.
     */
    public function commit(itemsOrCollections:Array=null, cascadeCommit:Boolean=false):AsyncToken
    {
        return _pnlRPCDataManager.dataStore.commit(itemsOrCollections, cascadeCommit);
    }
    
    /**
     *  Reverts all pending (uncommitted) changes for this DataService, as well as all of the pending changes of all DataServics
     *  sharing the same DataStore.  By default, a DataService shares the same DataStore with other DataServices if they have 
     * managed association properties and share the same set of channels. 
     *
     * @see mx.data.DataManager
     * @see mx.data.DataStore
     *
     *  @return true if any changes were reverted.
     *  
     */
    public function revertChanges():Boolean
    {
        return _pnlRPCDataManager.dataStore.revertChanges();
    }    
       
    // Constructor
    public function _Super_PnlService()
    {
        // initialize service control
        _serviceControl = new RemoteObject(); 
        
        var operations:Object = new Object();
        var operation:Operation;         
         
        operation = new Operation(null, "getAllPnl");
         operation.resultElementType = valueObjects.Pnl;
        operations["getAllPnl"] = operation;
         
     valueObjects.Pnl._initRemoteClassAlias();
        operation = new Operation(null, "getPnlByID");
         operation.resultElementType = valueObjects.Pnl;
        operations["getPnlByID"] = operation;
         
     valueObjects.Pnl._initRemoteClassAlias();
        operation = new Operation(null, "createPnl");
         operation.resultType = int;          
        operations["createPnl"] = operation;
         
        operation = new Operation(null, "updatePnl");
        operations["updatePnl"] = operation;
         
        operation = new Operation(null, "deletePnl");
        operations["deletePnl"] = operation;
         
        operation = new Operation(null, "count");
         operation.resultType = int;          
        operations["count"] = operation;
         
        operation = new Operation(null, "getPnl_paged");
         operation.resultElementType = valueObjects.Pnl;
        operations["getPnl_paged"] = operation;
         
     valueObjects.Pnl._initRemoteClassAlias();
    
        _serviceControl.operations = operations;   
        _serviceControl.convertResultHandler = TypeUtility.convertResultHandler;
        _serviceControl.source = "PnlService";
        _serviceControl.endpoint = "gateway.php";
        _serviceControl.destination = "PnlService";
        
        var managedAssociation : ManagedAssociation;
        var managedAssocsArray : Array;
        // initialize Pnl data manager     
        _pnlRPCDataManager = new RPCDataManager();        
        managersArray.push(_pnlRPCDataManager);
        
        managedAssocsArray = new Array();
        
        _pnlRPCDataManager.destination = "pnlRPCDataManager";
        _pnlRPCDataManager.service = _serviceControl;        
        _pnlRPCDataManager.identities =  "id";      
        _pnlRPCDataManager.itemClass = valueObjects.Pnl; 
        
                   
    
        var dmOperation : ManagedOperation;
        var dmQuery : ManagedQuery;
         
        dmQuery = new ManagedQuery("getPnlByID");
        dmQuery.propertySpecifier = "id,pl_name,clmA,clmB,clmC,cmlD,clmE,clmF,clmG,clmH,clmI,clmJ,clmK,clmL,clmM,clmN,clmO,clmP,clmQ,clmR,clmS,clmT,clmU,clmV,clmW,clmX,clmY,clmZ,clmAA,clmAB,clmAC";
        dmQuery.parameters = "itemID";
        _pnlRPCDataManager.addManagedOperation(dmQuery);                 

        dmOperation = new ManagedOperation("updatePnl", "update");
        dmOperation.parameters = "item";
        _pnlRPCDataManager.addManagedOperation(dmOperation);     
            
        dmOperation = new ManagedOperation("createPnl", "create");
        dmOperation.parameters = "item";
        _pnlRPCDataManager.addManagedOperation(dmOperation);     
            
        dmQuery = new ManagedQuery("getPnl_paged");
        dmQuery.propertySpecifier = "id,pl_name,clmA,clmB,clmC,cmlD,clmE,clmF,clmG,clmH,clmI,clmJ,clmK,clmL,clmM,clmN,clmO,clmP,clmQ,clmR,clmS,clmT,clmU,clmV,clmW,clmX,clmY,clmZ,clmAA,clmAB,clmAC";
        dmQuery.countOperation = "count";
        dmQuery.pagingEnabled = true;
        dmQuery.positionalPagingParameters = true;
        dmQuery.parameters = "startIndex,numItems";
        _pnlRPCDataManager.addManagedOperation(dmQuery);                 

        dmQuery = new ManagedQuery("getAllPnl");
        dmQuery.propertySpecifier = "id,pl_name,clmA,clmB,clmC,cmlD,clmE,clmF,clmG,clmH,clmI,clmJ,clmK,clmL,clmM,clmN,clmO,clmP,clmQ,clmR,clmS,clmT,clmU,clmV,clmW,clmX,clmY,clmZ,clmAA,clmAB,clmAC";
        dmQuery.parameters = "";
        _pnlRPCDataManager.addManagedOperation(dmQuery);                 

        dmOperation = new ManagedOperation("deletePnl", "delete");
        dmOperation.parameters = "id";
        _pnlRPCDataManager.addManagedOperation(dmOperation);     
            
        _serviceControl.managers = managersArray;
                      
         model_internal::initialize();
    }

    /**
      * This method is a generated wrapper used to call the 'getAllPnl' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getAllPnl() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getAllPnl");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'getPnlByID' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getPnlByID(itemID:int) : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getPnlByID");
        var _internal_token:AsyncToken = _internal_operation.send(itemID) ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'createPnl' operation. It returns an ItemReference whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.data.ItemReference
      * @see mx.rpc.CallResponder 
      *
      * @return an ItemReference whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function createPnl(item:valueObjects.Pnl) : ItemReference
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("createPnl");
        var _internal_token:ItemReference = _internal_operation.send(item) as ItemReference;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'updatePnl' operation. It returns an ItemReference whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.data.ItemReference
      * @see mx.rpc.CallResponder 
      *
      * @return an ItemReference whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function updatePnl(item:valueObjects.Pnl) : ItemReference
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("updatePnl");
        var _internal_token:ItemReference = _internal_operation.send(item) as ItemReference;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'deletePnl' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function deletePnl(itemID:int) : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("deletePnl");
        var _internal_token:AsyncToken = _internal_operation.send(itemID) ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'count' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function count() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("count");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
    /**
      * This method is a generated wrapper used to call the 'getPnl_paged' operation. It returns an AsyncToken whose 
      * result property will be populated with the result of the operation when the server response is received. 
      * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
      * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
      */          
    public function getPnl_paged() : AsyncToken
    {
        var _internal_operation:AbstractOperation = _serviceControl.getOperation("getPnl_paged");
        var _internal_token:AsyncToken = _internal_operation.send() ;

        return _internal_token;
    }   
     
}

}