Passing array to remote object.

Hi All,
   I'm able to pass 'String' to RemoteObject method but can someone please let me know how to pass array to remoteobject.
  Say I have following array:
   public var mySourceDataProvider:Array = new Array({isRowSelected: false, name:'Name1', age:10, comment:'Comment1'},
                         {isRowSelected: false, name:'Name2', age:20, comment:'Comment2'},
                         {isRowSelected: false, name:'Name3', age:30, comment:'Comment3'},
                         {isRowSelected: false, name:'Name4', age:40, comment:'Comment4'});
  I'd like to pass this array to RemoteObject method.
  Thanks in advance.
Regards,
Sharath.

Say I have 'mySourceDataProvider' array, which I'd like to pass to RemoteObject method in backend....how to declare this RemoteObject method which takes array from flex UI.
If this not clear then let me know, I'll try to send some sample code...

Similar Messages

  • Passing Array of java objects to and from oracle database-Complete Example

    Hi all ,
    I am posting a working example of Passing Array of java objects to and from oracle database . I have struggled a lot to get it working and since finally its working , postinmg it here so that it coudl be helpful to the rest of the folks.
    First thinsg first
    i) Create a Java Value Object which you want to pass .
    create or replace and compile java source named Person as
    import java.sql.*;
    import java.io.*;
    public class Person implements SQLData
    private String sql_type = "PERSON_T";
    public int person_id;
    public String person_name;
    public Person () {}
    public String getSQLTypeName() throws SQLException { return sql_type; }
    public void readSQL(SQLInput stream, String typeName) throws SQLException
    sql_type = typeName;
    person_id = stream.readInt();
    person_name = stream.readString();
    public void writeSQL(SQLOutput stream) throws SQLException
    stream.writeInt (person_id);
    stream.writeString (person_name);
    ii) Once you created a Java class compile this class in sql plus. Just Copy paste and run it in SQL .
    you should see a message called "Java created."
    iii) Now create your object Types
    CREATE TYPE person_t AS OBJECT
    EXTERNAL NAME 'Person' LANGUAGE JAVA
    USING SQLData (
    person_id NUMBER(9) EXTERNAL NAME 'person_id',
    person_name VARCHAR2(30) EXTERNAL NAME 'person_name'
    iv) Now create a table of Objects
    CREATE TYPE person_tab IS TABLE OF person_t;
    v) Now create your procedure . Ensure that you create dummy table called "person_test" for loggiing values.
    create or replace
    procedure give_me_an_array( p_array in person_tab,p_arrayout out person_tab)
    as
    l_person_id Number;
    l_person_name Varchar2(200);
    l_person person_t;
    l_p_arrayout person_tab;
    errm Varchar2(2000);
    begin
         l_p_arrayout := person_tab();
    for i in 1 .. p_array.count
    loop
         l_p_arrayout.extend;
         insert into person_test values(p_array(i).person_id, 'in Record '||p_array(i).person_name);
         l_person_id := p_array(i).person_id;
         l_person_name := p_array(i).person_name;
         l_person := person_t(null,null);
         l_person.person_id := l_person_id + 5;
         l_person.person_name := 'Out Record ' ||l_person_name ;
         l_p_arrayout(i) := l_person;
    end loop;
    p_arrayout := l_p_arrayout;
         l_person_id := p_arrayout.count;
    for i in 1 .. p_arrayout.count
    loop
    insert into person_test values(l_person_id, p_arrayout(i).person_name);
    end loop;
    commit;
    EXCEPTION WHEN OTHERS THEN
         errm := SQLERRM;
         insert into person_test values(-1, errm);
         commit;
    end;
    vi) Now finally create your java class which will invoke the pl/sql procedure and get the updated value array and then display it on your screen>Alternatively you can also check the "person_test" tbale
    import java.util.Date;
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class ArrayDemo
    public static void passArray() throws SQLException
    Connection conn = getConnection();
    ArrayDemo a = new ArrayDemo();
    Person pn1 = new Person();
    pn1.person_id = 1;
    pn1.person_name = "SunilKumar";
    Person pn2 = new Person();
    pn2.person_id = 2;
    pn2.person_name = "Superb";
    Person pn3 = new Person();
    pn3.person_id = 31;
    pn3.person_name = "Outstanding";
    Person[] P_arr = {pn1, pn2, pn3};
    Person[] P_arr_out = new Person[3];
    ArrayDescriptor descriptor =
    ArrayDescriptor.createDescriptor( "PERSON_TAB", conn );
    ARRAY array_to_pass =
    new ARRAY( descriptor, conn, P_arr);
    OracleCallableStatement ps =
    (OracleCallableStatement )conn.prepareCall
    ( "begin give_me_an_array(?,?); end;" );
    ps.setARRAY( 1, array_to_pass );
         ps.registerOutParameter( 2, OracleTypes.ARRAY,"PERSON_TAB" );
         ps.execute();
         oracle.sql.ARRAY returnArray = (oracle.sql.ARRAY)ps.getArray(2);
    Object[] personDetails = (Object[]) returnArray.getArray();
    Person person_record = new Person();
    for (int i = 0; i < personDetails.length; i++) {
              person_record = (Person)personDetails;
              System.out.println( "row " + i + " = '" + person_record.person_name +"'" );
                        public static void main (String args[]){
         try
                             ArrayDemo tfc = new ArrayDemo();
                             tfc.passArray();
         catch(Exception e) {
                        e.printStackTrace();
              public static Connection getConnection() {
         try
                             Class.forName ("oracle.jdbc.OracleDriver");
                             return DriverManager.getConnection("jdbc:oracle:thin:@<<HostNanem>>:1523:VIS",
                             "username", "password");
         catch(Exception SQLe) {
                        System.out.println("IN EXCEPTION BLOCK ");
                        return null;
    and thats it. you are done.
    Hope it atleast helps people to get started. Comments are appreciated. I can be reached at ([email protected]) or [email protected]
    Thanks
    Sunil.s

    Hi Sunil,
    I've a similar situation where I'm trying to insert Java objects in db using bulk insert. My issue is with performance for which I've created a new thread.
    http://forum.java.sun.com/thread.jspa?threadID=5270260&tstart=30
    I ran into your code and looked into it. You've used the Person object array and directly passing it to the oracle.sql.ARRAY constructor. Just curios if this works, cos my understanding is that you need to create a oracle.sql.STRUCT out of ur java object collection and pass it to the ARRAY constructor. I tried ur way but got this runtime exception.
    java.sql.SQLException: Fail to convert to internal representation: JavaBulkInsertNew$Option@10bbf9e
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:239)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatumArray(OracleTypeADT.java:274)
                        at oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(OracleTypeUPT.java:115)
                        at oracle.sql.ArrayDescriptor.toOracleArray(ArrayDescriptor.java:1314)
                        at oracle.sql.ARRAY.<init>(ARRAY.java:152)
                        at JavaBulkInsertNew.main(JavaBulkInsertNew.java:76)
    Here's a code snippet I used :
    Object optionVal[] =   {optionArr[0]};   // optionArr[0] is an Option object which has three properties
    oracle.sql.ArrayDescriptor empArrayDescriptor = oracle.sql.ArrayDescriptor.createDescriptor("TT_EMP_TEST",conn);
    ARRAY empArray = new ARRAY(empArrayDescriptor,conn,optionVal);If you visit my thread, u'll see that I'm using STRUCT and then pass it to the ARRAY constructor, which works well, except for the performance issue.
    I'll appreciate if you can provide some information.
    Regards,
    Shamik

  • How to pass Array of Java objects to Callable statement

    Hi ,
    I need to know how can I pass an array of objects to PL/SQL stored procedure using callable statement.
    So I am having and array list of some object say xyz which has two attributes string and double type.
    Now I need to pass this to a PL/SQL Procedure as IN parameter.
    Now I have gone through some documentation for the same and found that we can use ArrayDescriptor tp create array (java.sql.ARRAY).
    And we will use a record type from SQL to map this to our array of java objects.
    So my question is how this mapping of java object's two attribute will be done to the TYPE in SQL? can we also pass this array as a package Table?
    Please help
    Thanks

    I seem to remember that that is in one of Oracle's online sample programs.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html

  • Passing array to ActiveX object method

    I need to pass the array by pointer as a parameter into method of an ActiveX object. More detailed - to ActiveX/COM object which represents the arbitrary waveform generator hardware.
    How it is possible to do in LabView?
    Thank you!

    There is declaration of COM method I need to use:
    [id(15), helpstring("method SetData")]
    HRESULT SetData([in] DOUBLE* newVal, [in] ULONG length, [in] USHORT MBIndex, VARIANT_BOOL bUpdate).
    The main important psrsmeters is newVal and length.
    Unfortunately I can not wire an array to NewVal.
    There is a screenshot from LabView in the attachement...
    Attachments:
    array_to_COM.jpg ‏17 KB

  • Passing Array variables between objects

    While troubleshooting a Flash app, it took me hours to figure
    out that you need to make a duplicate of an Array variable if you
    are passing it between objects. Otherwise, any alterations that you
    make to the array will result in the original array being altered
    as well as the "new" array.
    I'm no developer, can someone please explain why you have to
    do this? Or, give me an instance when you wouldn't want to make a
    duplicate? Just trying to understand.
    Thanks.

    it is because if you do something like this
    a=[1,2,3]
    b=a
    all you are doing is storing a reference to a in a variable
    b.Instead, either copy oput the array again or use one of the array
    methods which return an array eg
    b=a.slice()
    b=a.concat()

  • HOW TO PASS NON REMOTE OBJECT PARAMETER

    good day,
    hi im new to java and rmi, and i need help pls, my question is how can i pass a non-remote object/local object as a parameter to a remote method. can u pls give a code for the:
    1. client that will invoke the remote method and pass the object in remote objects method.
    2. object that will be passed to the server/remote object( a serilizable object of course).
    3. the remote object and the method that will receive the object parameter.
    thank you very much for your kindness,
    p.s.
    you can email me to [email protected]
    batusai,

    When you create the object locally, and pass it to the server, at that point it exists on both systems/in both jvms.
    Why don't you write your own example, and try it. If you get in trouble, post the code, and we will help you.

  • When  submit remote object call getting error Client.Error.DeliveryInDoubt

    Hello,
    We are having very weird error DeliveryInDoubt from blazeds.
    [ERROR] failed to call the remote service !!![FaultEvent fault=[RPC Fault faultString="Channel disconnected" faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected before an acknowledgement was received"] messageId="98F7B030-0FE0-0B88-300C-EC422D055E21" type="fault" bubbles=false cancelable=true eventPhase=2
    Error does not happen every time, but rather from time to time but happens on all client machines.
    Environment:
    blazeds v3.
    Flex application with Remote Object.
    Browser IE7.
    Object that passed to blazeds is complex and might have 100 items.But number of items does not seem affect error occurences.
    Short description for the object passed to blazeds remote object call for processing:
    Remote Object call takes an argument ArrayCollection of SyncRequest objects (_requestSyncList)
                    var syncRequest:SyncRequest = new SyncRequest();
                    var syncObject:Object = new Object();
                    syncObject[requestBuilder.direction] = requestBuilder.jobMap;
                    syncRequest.syncJobs = syncObject;
                    _requestSyncList.addItem(syncRequest);          
    requestBuilder.jobMap is an object that have different artifacts.
    jobMap[obj.artifact] = myColl;
    myColl is ArrayCollection of artifact of SyncJob
    Here is the definition of SyncJob
       public class SyncJob
            public var jobName:String;
            [ArrayElementType("com.farmers.docprocessing.remotesync.vo.JobParameter")]
            public var jobParams:ArrayCollection;
    Not sure what causing that issue and how to debug it. 
    Please advice.
    Thank you

    Not without you psoting some code.
    Possible problem: Difference between object type being returned, vs the type of the reference (i.e., the method that returns an object should have a return type of the interface name).

  • Passing an Array Remote Object

    Hi,
    I am a newbie and I've been able to call Java methods when
    they return a simple String. However, I am unable to get a
    collection of Java objects. I get the following error message :
    Type Coercion failed: cannot convert
    mx.rpc.remoting.mxml::Operation@31717b1 to Array.
    I have a datagrid in my application that has to be populated
    by calling a method of a remote object.
    The remote object (Java class looks like this).
    public class PlayerService {
    public PlayerService() {
    public Player[] getPlayersAsArray() {
    Player[] players = new Player[3];
    Player rahul = new Player("Rahul",,"Dravid");
    Player sachin = new Player("Sachin","Tendulkar");
    Player saurav = new Player("Saurav","Ganguly");
    players[0] = rahul;
    players[1] = sachin;
    players[2] = saurav;
    return players;
    I've configured the destination in my service-config.xml as
    <destination id="PlayerService">
    <properties>
    <source>rpc.playerinfo.PlayerService</source>
    <scope>application</scope>
    </properties>
    </destination>
    My mxml application code is given below :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import rpc.playerinfo.Player;
    import mx.utils.ArrayUtil;
    [Bindable]
    public var players:ArrayCollection;
    public var myPlayer:Player;
    ]]>
    </mx:Script>
    <mx:RemoteObject
    id="playMe"
    destination="PlayerService"
    showBusyCursor="true">
    <mx:method name="getPlayersAsArray">
    <mx:arguments>
    </mx:arguments>
    </mx:method>
    </mx:RemoteObject>
    <mx:ArrayCollection id="playerList"
    source="{playMe.getPlayersAsArray}"/>
    <mx:DataGrid dataProvider="playerList" width="100%">
    <mx:columns>
    <mx:DataGridColumn dataField="FirstName"
    headerText="FirstName"/>
    <mx:DataGridColumn dataField="LastName"
    headerText="LastName"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    One question I have is, how does Flex know that what's
    returned is an array of Player objects. I did define the Player in
    an Action script file.
    package rpc.playerinfo
    [RemoteClass(alias="rpc.playerinfo.Player")]
    [Bindable]
    public class Player
    public var firstName:String;
    public var lastName:String;
    public function Player() {}
    but it appears that I have never actually used it in the mxml
    file.
    Thank you very much.

    Thanks guys.
    JS, I got what you are saying. Now I don't have any error
    messages, but the data grid is blank.
    This is the mxml code. (I added your input)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import rpc.playerinfo.Player;
    import mx.utils.ArrayUtil;
    [Bindable]
    public var players:ArrayCollection;
    public function handlePlayersResult(event: ArrayCollection)
    //then set the event result which is being sent into this
    function to the playerList
    players = event;
    ]]>
    </mx:Script>
    <mx:RemoteObject id="playMe" destination="PlayerService"
    showBusyCursor="true">
    <mx:method name="getPlayersAsArray"
    result="handlePlayersResult(event.result as ArrayCollection)"/>
    </mx:RemoteObject>
    <mx:DataGrid dataProvider="{players}" width="100%"
    creationComplete="playMe.getPlayersAsArray()">
    <mx:columns>
    <mx:DataGridColumn dataField="firstName"
    headerText="FirstName"/>
    <mx:DataGridColumn dataField="lastName"
    headerText="LastName"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    What is it missing ?
    Thank you so much.

  • Creating remote objects and passing the retrieved data to modules

    I found at this Adobe tutorial a nice "RemoteService" class that  creates a RemoteObject and contains the functions for handling the  result and fault events. If I wanted to use this approach, how could I  pass the data from the result handler to interfaces that modules from  the main application could use?
    I could put the RemoteService/RemoteObject in the modules, but (in my  opinion- and I could be wrong) the best design seems to be using the  remote calls in the main app and passing the data along to the modules.
    Ultimately, I would like to know what the "best practices" are for creating remote objects and passing the retrieved data to modules
    Thanks!

    public void mouseClicked(MouseEvent e) {
      X x = new X(e.getX(), e.getY());
    }I don't see the difficulty.

  • Over technologies rather than RMI to pass remote objects

    Hi,
    Just a general question about remote objects. Currently I am familiar with RMI, IIOP and JMS to pass remote objects. What other technologies are available? in particular, technologies for passing remote objects between different software systems?
    Just a simple response detailing the names would be great, gives me something to research then.
    thanks

    ofcourse passing over socket is always an option. Sure in that case you will have to serialize the object yourself or make a mini-protocol of some kind.
    In our project we also use XML to pass object between C++ and Java world, instead of using CORBA.

  • Error passing a remote object in a rmi function call

    Hi,
    I've a problem passing an UnicastRemoteObject extended object in a rmi function call. I get the following error
    java.lang.IllegalArgumentException: argument type mismatch
    I've 2 Remote Objects: GalaxyRegistration and Station. I want to pass a Station Object as argument in a function from GalaxyRegistration. Does anyone know what the problem is?
    Here is the code:
    public class GalaxyRegistration
    extends UnicastRemoteObject
    implements GalaxyRegistrationInterface, Galaxy {
         public GalaxyRegistration() throws RemoteException {
         public void add(Station station) throws RemoteException {
              stations.addElement(station);
              System.out.println("Add Station " + station.getName());
    public class Station
    extends UnicastRemoteObject
    implements StationInterface {
         SystemInfo system;
         public Station(String name, String description, Coordinate position, Profile profile)
    throws RemoteException {
              system = new SystemInfo(name, description, position, profile);
    public class StationServer {
         Station station;
         public void run() {
              // create new Station
              System.out.println("Create new Station:");
              // register and bind new station
              try     {
                   station = new Station(name, descr, location, profile);
                   System.out.println("Station created ...");
                   GalaxyRegistrationInterface registry =
                             (GalaxyRegistrationInterface)
                             Naming.lookup
    ("//localhost/GalaxyRegistration");
                   System.out.println("Registry looked up ...");               
                   // >>>>>>>> NEXT LINE IS THE ERROR LINE <<<<<<<<<<<<<<     
                   registry.add(station);
              } catch(Exception e) {
                   System.out.println(e);
    }

    regardless of any other problems in your code, neither of the objects which you are subclassing from UnicastRemoteObject call the superclass constructor, which is a pretty basic flaw - in this case, it will lead to neither of these objects being exported properly.

  • Is possible to pass array/list as parameter in TopLink StoredProcedureCall?

    Hi, We need to pass an array/List/Vector of values (each value is a 10 character string) into TopLink's StoredProcedureCall. The maximum number of elements on the list is 3,000 (3,000 * 10 = 30,000 characters).
    This exposed two questions:
    1. Is it possible to pass a Vector as a parameter in TopLink's StoredProcedureCall, such as
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    Vector strVect = new Vector(3000);
    strVect.add(“ab-gthhjko”);
    strVect.add(“cd-gthhjko”);
    strVect.add(“ef-gthhjko”);
    Vector parameters = new Vector();
    parameters.addElement(strVect);
    session.executeQuery(query,parameters);
    2. If the answer on previous question is yes:
    - How this parameter has to be defined in Oracle’s Stored Procedure?
    - What is the maximum number of elements/bytes that can be passed into the vector?
    The best way that we have found so far was to use single string as a parameter. The individual values would be delimited by comma, such as "ab-gthhjko,cd-gthhjko,ef-gthhjko..."
    However, in this case concern is the size that can be 3,000 * 11 = 33, 000 characters. The maximum size of VARCHAR2 is 4000, so we would need to break calls in chunks (max 9 chunks).
    Is there any other/more optimal way to do this?
    Thanks for your help!
    Zoran

    Hello,
    No, you cannot currently pass a vector of objects as a parameter to a stored procedure. JDBC will not take a vector as an argument unless you want it to serialize it (ie a blob) .
    The Oracle database though does have support for struct types and varray types. So you could define a stored procedure to take a VARRAY of strings/varchar, and use that stored procedure through TopLink. For instance:
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("STORED_PROCEDURE_NAME");
    call.addNamedArgument("PERSON_CODE");
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor("ARRAYTYPE_NAME", dbconnection);
    oracle.sql.ARRAY dbarray = new oracle.sql.ARRAY(descriptor, dbconnection, dataArray);
    Vector parameters = new Vector();
    parameters.addElement(dbarray);
    session.executeQuery(query,parameters);This will work for any values as long as you are not going to pass in null as a value as the driver can determine the type from the object.
    dataArray is an Object array consisting of your String objects.
    For output or inoutput parameters you need to set the type and typename as well:
      sqlcall.addUnamedInOutputArgument("PERSON_CODE", "PERSON_CODE", Types.ARRAY, "ARRAYTYPE_NAME"); which will take a VARRAY and return a VARRAY type object.
    The next major release of TopLink will support taking in a vector of strings and performing the conversion to a VARRAY for you, as well as returning a vector instead of a VARRAY for out arguments.
    Check out thread
    Using VARRAYs as parameters to a Stored Procedure
    showing an example on how to get the conection to create the varray, as well as
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html on using Varrays in Oracle, though I'm sure the database docs might have more information.
    Best Regards,
    Chris

  • I can't seem to get individual elements when comparing 2 arrays using Compare-Object

    My backup software keeps track of servers with issues using a 30 day rolling log, which it emails to me once a week in CSV format. What I want to do is create a master list of servers, then compare that master list against the new weekly lists to identify
    servers that are not in the master list, and vice versa. That way I know what servers are new problem and which ones are pre-existing and which ones dropped off the master list. At the bottom is the entire code for the project. I know it's a bit much
    but I want to provide all the information, hopefully making it easier for you to help me :)
    Right now the part I am working on is in the Compare-NewAgainstMaster function, beginning on line 93. After putting one more (fake) server in the master file, the output I get looks like this
    Total entries (arrMasterServers): 245
    Total entries (arrNewServers): 244
    Comparing new against master
    There are 1 differences.
    InputObject SideIndicator
    @{Agent= Virtual Server in vCenterServer; Backupse... <=
    What I am trying to get is just the name of the server, which should be $arrDifferent[0] or possibly $arrDifferent.Client. Once I have the name(s) of the servers that are different, then I can do stuff with that. So either I am not accessing the array
    right, building the array right, or using Compare-Object correctly.
    Thank you!
    Sample opening lines from the report
    " CommCells > myComCellServer (Reports) >"
    " myComCellServer -"
    " 30 day SLA"
    CommCell Details
    " Client"," Agent"," Instance"," Backupset"," Subclient"," Reason"," Last Job Id"," Last Job End"," Last Job Status"
    " myServerA"," vCenterServer"," VMware"," defaultBackupSet"," default"," No Job within SLA Period"," 496223"," Nov 17, 2014"," Killed"
    " myServerB"," Oracle Database"," myDataBase"," default"," default"," No Job within SLA Period"," 0"," N/A"," N/A"
    Entire script
    # things to add
    # what date was server entered in list
    # how many days has server been on list
    # add temp.status = pre-existing, new, removed from list
    # copy sla_master before making changes. Copy to archive folder, automate rolling 90 days?
    ## 20150114 Created script ##
    #declare global variables
    $global:arrNewServers = @()
    $global:arrMasterServers = @()
    $global:countNewServers = 1
    function Get-NewServers
    Param($path)
    Write-Host "Since we're skipping the 1st 6 lines, create test to check for opening lines of report from CommVault."
    write-host "If not original report, break out of script"
    Write-Host ""
    #skip 5 to include headers, 6 for no headers
    (Get-Content -path $path | Select-Object -Skip 6) | Set-Content $path
    $sourceNewServers = get-content -path $path
    $global:countNewServers = 1
    foreach ($line in $sourceNewServers)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0].Substring(2, $tempLine[0].Length-3)
    $temp.Agent = $tempLine[1].Substring(2, $tempLine[1].Length-3)
    $temp.Backupset = $tempLine[3].Substring(2, $tempLine[3].Length-3)
    $temp.Reason = $tempLine[5].Substring(2, $tempLine[5].Length-3)
    #write temp object to array
    $global:arrNewServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countNewServers ++
    Write-Host ""
    $exportYN = Read-Host "Do you want to export new servers to new master list?"
    $exportYN = $exportYN.ToUpper()
    if ($exportYN -eq "Y")
    $exportPath = Read-Host "Enter full path to export to"
    Write-Host "Exporting to $($exportPath)"
    foreach ($server in $arrNewServers)
    $newtext = $Server.Client + ", " + $Server.Agent + ", " + $Server.Backupset + ", " + $Server.Reason
    Add-Content -Path $exportPath -Value $newtext
    function Get-MasterServers
    Param($path)
    $sourceMaster = get-content -path $path
    $global:countMasterServers = 1
    foreach ($line in $sourceMaster)
    #declare array to hold object temporarily
    $temp = @{}
    $tempLine = $line.Split(",")
    #get and assign values
    $temp.Client = $tempLine[0]
    $temp.Agent = $tempLine[1]
    $temp.Backupset = $tempLine[2]
    $temp.Reason = $tempLine[3]
    #write temp object to array
    $global:arrMasterServers += New-Object -TypeName psobject -Property $temp
    #increment counter
    $global:countMasterServers ++
    function Compare-NewAgainstMaster
    Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    Write-Host "Total entries (arrNewServers): $($countNewServers)"
    Write-Host "Comparing new against master"
    #Compare-Object $arrMasterServers $arrNewServers
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Write-Host "There are $($arrDifferent.Count) differences."
    foreach ($item in $arrDifferent)
    $item
    ## BEGIN CODE ##
    cls
    $getMasterServersYN = Read-Host "Do you want to get master servers?"
    $getMasterServersYN = $getMasterServersYN.ToUpper()
    if ($getMasterServersYN -eq "Y")
    $filePathMaster = Read-Host "Enter full path and file name to master server list"
    $temp = Test-Path $filePathMaster
    if ($temp -eq $false)
    Read-Host "File not found ($($filePathMaster)), press any key to exit script"
    exit
    Get-MasterServers -path $filePathMaster
    $getNewServersYN = Read-Host "Do you want to get new servers?"
    $getNewServersYN = $getNewServersYN.ToUpper()
    if ($getNewServersYN -eq "Y")
    $filePathNewServers = Read-Host "Enter full path and file name to new server list"
    $temp = Test-Path $filePathNewServers
    if ($temp -eq $false)
    Read-Host "File not found ($($filePath)), press any key to exit script"
    exit
    Get-NewServers -path $filePathNewServers
    #$global:arrNewServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrNewServers): $($countNewServers)"
    #Write-Host ""
    #$global:arrMasterServers | format-table client, agent, backupset, reason -AutoSize
    #Write-Host ""
    #Write-Host "Total entries (arrMasterServers): $($countMasterServers)"
    #Write-Host ""
    Compare-NewAgainstMaster

    do not do this:
    $arrDifferent = @(Compare-Object $arrMasterServers $arrNewServers)
    Try this:
    $arrDifferent = Compare-Object $arrMasterServers $arrNewServers -PassThru
    ¯\_(ツ)_/¯
    This is what made the difference. I guess you don't have to declare arrDifferent as an array, it is automatically created as an array when Compare-Object runs and fills it with the results of the compare operation. I'll look at that "pass thru" option
    in a little more detail. Thank you very much!
    Yes - this is the way PowerShell works.  You do not need to write so much code once you understand what PS can and is doing.
    ¯\_(ツ)_/¯

  • Breaking up data in a remote object

    Currently I have a chart that gets its data using a remote
    object connection. The chart currently shows a months worth of
    data. Now I need to break that monthly data into weekly data. The
    customer would rather have the data spread acroos four weekly
    charts instead of just one monthly chart. The customer would then
    just click click a 'Next' or 'Previous' button to cycle through the
    charts.
    I know that I just change the function (CFC) that calls for
    the data to only return a weeks worth of data, but I don't want to
    make a separate data call every time the user clicks 'Next' or
    'Previous'
    Is there a way to grab the whole month's data set and then
    divide it into weekly data sets within the app?

    Okay I figured this one out. If I add a hSlider with two
    thumbs I can set the thumbs with just a couple of functions.
    Basically when the user clicks either button a function is called
    that passes in a predetermined value of how many tick marks to
    move.
    The HSlider has a property called 'values' that holds the
    positions of all the thumbs. Using some simple functions they can
    easily be manipulated.
    Setting the slider's visible property to 'false' will keep
    the navigation focused on just the buttons.

  • File upload through BlazeDS remote object?

    Hi,
    After researching file upload options in flex, it seems like the only option is through HTTP service requests, such as:
    private var fileRef:FileReference;
    fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
    Is there any way to use BlazeDS remote objects to upload a file from Flex interface? Perhaps passing in a FileReference object and marshalling it into an equivalent Java object?
    Thanks!

    I know there is a workaround like this. It uses a servlet to upload a file and returns a url. The uploaded file is either stored in session or server file system until the session expires. Use the PropertyProxy to register a custom class which contains this url and convert to java.io.File. It is the limitation of the player. It cannot read the local file system for security reason. There is a sample in blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/blazeds/qa/remotingService/Echo.java
    static
    PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
    PropertyProxy proxy = registry.getProxy(java.io.File.class);
    if (proxy == null)
    registry.register(java.io.File.class, new FileProxy());
    proxy = registry.getProxy(FileReference.class);
    if (proxy == null)
    registry.register(FileReference.class, new FileReferenceProxy());
    Hope it can help

Maybe you are looking for

  • What are the license conditions for the customer ?

    What is the license agreement for the customer to use Beehiveonline ? Is it similar as the OUM Customer model copied below? thanks Francis OUM Customer Program: The OUM Customer Program allows customers to obtain copies of the method for their intern

  • Oracle WebADI: How to Download the WebADI Excel File with Parameter

    Hello Friends, How to Download the Oracle WebADI Excel File with Parameter?? For Ex: How to download the Employees for Specific Department from Oracle WebADI. And After to change the specific changes on Employee Data to Upload. Thanks in Advance.

  • DataGrid Horizontal Scroll Problem when datagrid contains Item renderer

    I have datagrid with horizontal scroll policy enabled. Grid contains some item renderer also.One of the item renderer is datefield when i select a date from the datefield and say the adjacent cell of the grid also contain datefield itemrenderer and i

  • Combining music with a slide show dvd

    I just purchased a photo DVD on shutterfly but I need to add music then burn a new dvd, is there any software from apple that will let me do this?   Windows XP     Windows XP  

  • Tables which stores Variables information

    Hi Gurus, I want to know how to find the vaiables information ??? where can i find the complete information of the Variables of Bex reports . there must be tables which stores complete info.. right kindly help me in this regard Regards AK