How to do Array of objects

Hi,
I was wondering if XMP is capable of holding an array of multiple objects. We have historical data that is represented with multiple fields. The normal schema would look like:
  <rdf:Description rdf:about="" xmlns:nef="http://ns.phics.com/nefclient/1.0/">
         <nef:Division>BTF</nef:Division>
         <nef:Season>0914</nef:Season>
         <nef:Sku>91346</nef:Sku>
         <nef:Usage>Print</nef:Usage>
         <nef:Status>Approved</nef:Status>
      </rdf:Description>
How can I add this addionional data some?
          <nef:History>
               <nef:issue>blah01</nef:issue>
               <nef:date>12-12-12</nef:date>
               <nef:color>red</nef:color>
               <nef:issue>blah02</nef:issue>
               <nef:date>1-12-10</nef:date>
               <nef:color>blue</nef:color>
               <nef:issue>blah03</nef:issue>
               <nef:date>02-12-08</nef:date>
               <nef:color>red</nef:color>
               <nef:issue>blah04</nef:issue>
               <nef:date>11-09-06</nef:date>
               <nef:color>white</nef:color>   
           </nef:History>
Thank you for your time
Dean Krueger

Hi Dean,
what you want to do is perfectly supported in XMP. The History property would be an array (ordered or unordered, as you like) and each array element is a struct with three fields.
It would look like this:
<nef:History>
     <rdf:Bag>
          <rdf:li  rdf:parseType="Resource">
               <nef:issue>issue</nef:issue>
               <nef:date>date</nef:date>
               <nef:color>color</nef:color>
          </rdf:li>
          ...etc
     </rdf:Bag>
</nef:History>
If you are using the XMP toolkit in your program, you can refer to the Programmer's Guide for reference how to create such an array.
regards
Jörg

Similar Messages

  • How to return array of object

    public class A{
    public class B{
    publc C[] sample()
    int i=0;
    ResultSet rset = s.executeQuery("select name, id  from emp ");
    while(rs.next()){
    name = rset.getString("nam");
    id = rset.getInt("id");
    c.setName(name )
    c[i].setId(id)
    return c[]
    public class C{
    // here i have getter and setter metod for name & id
    When I try to return the object c[]..i am getting "cannot conver from C to C[]".
    Can u pls help me, how to return array of object and how to get name and id values in other class using this array object
    Thanks for ur help

    public class Starting{
    public long empID;
    Data data = new Data();
    Value[] value;
    int count = 0;
         public static void executeDe(){
              value = new Value[100]
              try{
                     data.getDetails()
                     processDetails(value);
                   }catch(Exception e){e.printStackTrace();}
         public static void processDetails(Value[] value){
         count = data.i;
              int i;
              for(i=0;i<count;i++){
                  empID=value.getempID(); \\ here i am not getting all values..... am getting only last value of the array
    public class Data{
    public long empID;
    public int i=0;
    static Value[] value = new Value[100];
    public static Value[] getDetails(){
    Connection con=null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@" + hostname + ":1521:" + sid, user, password);
    System.out.println(" conn " + con);
    System.out.println("");
    Statement s=con.createStatement();
    try{
         ResultSet rset = s.executeQuery("select EMPID from Employee ");
         while(rset.next()){
    empID = rset.getLong("EMPID");
    value[i].setCycleID(cy_i);
    i++;
         rset.close();
         con.close();
    }catch (SQLException sqle){sqle.printStackTrace();}
         finally{
              try{
              s.close();
         con.close();
              }catch(SQLException e){e.printStackTrace();}
    catch(Exception e){e.printStackTrace();}
    return value;
         public class Value {
         public static long cycleID;
              public static void setempID(long empID) {
                   Value.empID = empID;
              public static long getempID() {
                   return empID;
    This is my actual code..... I am able to set the values in Value class from Data class using getDetails() method, which is returning array of value object.
    In Starting class, I am trying to get values using value[i].. i am getting last value of the array. This is my actual problem... here i want to get all values.
    Please help me how to resolve this.

  • How to pass array of Object in A Procedure using OCCI.......

    I m also trying for How to pass Object to a procedureb using OCCI...
    Steps....
    1. I created A type.....
    2. Then I created a VARRAY using that Type.
    3.After that I have written An Procedure with object as a parameter..
    now using OCCI how do u bind the parameter with this . plz note that using OTT
    i have already created the class representation of above object type i.e class
    four Files Created 1> demo.h 2>registermapping.h
    3> demo.cpp 2>registermapping.cpp
    After I want to Pass the Values in A Vector...
    vctor<full_name *> vect;
    stmt=con->createStatement("BEGIN Add_Object(:1); END;");
    full_name *name1 = new full_name; //Giving the Error here Given below....
    name1->
    name1->
    Through name1 Which Function I will call in which I will Pass a String....
    like
    name1->readSQL("Sanjay"); Or I have to add a function......
    vect.push_back(name1);
    setVector(stmt,1,vect,"FULL_NAME");
    error C2259: 'FullName' : cannot instantiate abstract class
    can u plz suggest me Why this Error is Giving......?
    How to pass the data?
    setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
    Can u lz Suggest me ASAP....

    hi Nishant ,
    What u have done Now I mm trying ....
    can u Plz Suggest me......
    How to pass and Array of Object in Procedure using OCCI... Doing....
    90% finished Two Error's Are Coming...
    1> If I create the Class then Data Not Inserting table......
    2> If I will create the Class through OTT command.......
    then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
    Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
    But I added this Function Still SAme Error Giving..
    getSQLTypeName(oracle::occi::Environment env, void *schName,
    unsigned int &schNameLen, void **typeName,
         unsigned int &typeNameLen) const
    Plz Suggest me....
    regard's
    sanjay

  • How to Sort Array of Object

    Hallo. I have an array of objects. Each object has id and name. How can i sort by name or by id??
    Thx for all
    Max

    array.sortOn("name");

  • How to implement array of objects or vector of objects?

    Hello, i am working on a javabean that is connecting to a database and executes an sql string. The javabean returns the records retrieved in a tabular format.
    Currently i can achieve the above requireement, but only through using a simple table-formatted string, this is not dynamic and a 2d array approach would not be dynamic either.
    I have read a little about using a dynamic approach, possiblya vector of objects, or array list of objects to solve the problem, but i don't really know how to start, could anybody help me??
    The code i have so far is:
    package webtech;
    import java.sql.*;
    public class questiona {
    /* Step 1) Initialize Variables*/
    String result = "";
    String query = "select id, name, url, thumb_url, keywords, category, author from mytable;";
    String url = "";
    String driver = "";
    String uname = "";
    String dpass = "";
    /*Step 2) Make a database connection*/
    private Connection dbconn = null;
    public questiona()
    try
    Class.forName(driver);
    dbconn = DriverManager.getConnection(url, uname, dpass);
    /*Create an SQL statement*/
    Statement statement = dbconn.createStatement();
    if (statement.execute(query))
    {/*Step 3) If we have a result lets loop through*/
    ResultSet results = statement.getResultSet();
    ResultSetMetaData metadata = results.getMetaData();
    /*Validate result. Note switch to while loop if we plan on multiple results from query*/
    if(results != null)
    /*Use results setmetadata object to determine the columns*/
    int li_columns = metadata.getColumnCount();
    result += " <tr>\n\r";
    result += " <td>" + metadata.getColumnLabel(1) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(2) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(3) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(4) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(5) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(6) + "</td>\n\r";
    result += " <td>" + metadata.getColumnLabel(7) + "</td>\n\r";
    result += " </tr>\n\r";
    /*loop throught the columns and append data to our table*/
    while(results.next())
    result += " <tr>\n\r";
    result += " <td>" + results.getObject(1).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(2).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(3).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(4).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(5).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(6).toString() +"</td>\n\r";
    result += " <td>" + results.getObject(7).toString() +"</td>\n\r";
    result += " </tr>\n\r";
    catch (ClassNotFoundException e)
    {     result = "<tr><td> Error in database";
    result += " <br/>" + e.toString() + "</td></tr>";
    catch (SQLException e)
    {     result = "<tr><td> Error in SQL";
    result += " <br/>" + e.toString() + "</td></tr>";
    finally
    try {
    if (dbconn !=null)
    { dbconn.close();}
    catch (SQLException e)
    {   result  = " <tr><td> Error in closing connection.";
    result += " <br/>" + e.toString() + "</td></tr>";
    public String getResults() {
    return result;
    }

    Cross-post
    http://forum.java.sun.com/thread.jspa?threadID=604770

  • How to manage Arrays as Object members

    I found a realy strange behavior with the instanciation of a
    Class which contains an Array member.
    Here is the code wich is self explanatory.

    Create the array instance in the constructor.
    class MyObj {
    public var tab:Array;
    function MyObj(index) {
    this.tab= new Array();
    "Chris_007" <[email protected]> wrote in
    message
    news:[email protected]...
    > I found a realy strange behavior with the instanciation
    of a Class which
    > contains an Array member.
    >
    > Here is the code wich is self explanatory.
    >
    >
    >
    >
    >
    > class MyObj {
    > //
    > public var tab:Array = new Array();
    > private var objectName:String;
    > private var theIndex:Number;
    > //
    > // Constructeur
    > function MyObj(index) {
    > this.theIndex = index;
    > // Object name
    > this.objectName = "name#" + index;
    > for (var i = 0; i < 3; i++) {
    > this.tab
    = index * 3 + i;
    > }
    > }
    > //
    > function printObject() {
    > trace(" Printing Object name --> " +
    this.objectName);
    > for (var i = 0; i < 3; i++) {
    > trace(" tab[" + i + "] : " + this.tab);
    > }
    > }
    > //
    > function getClone() {
    > return new MyObj(theIndex);
    > }
    > }
    >
    >
    > // And the main scenario code
    > //
    > var index:Number = 0;
    > //
    > var objArray:Array = new Array();
    > //
    > var oob:MyObj;
    > //
    > function printMyArray(arr:Array):Void {
    > for (var i = 0; i < arr.length; i++) {
    > trace(" tab[" + i + "] : " + arr
    > }
    > }
    > //
    > // Filling in the Array
    > for (var i = 0; i < 4; i++) {
    > oob = new MyObj(index);
    > // oobj = oob.getClone();
    > trace("-- New object #" + i + " created. MyObj[" + index
    + "]");
    > oob.printObject();
    > objArray = oob;
    > trace("-- Now entered into the array -- printing from
    object #" + i );
    > objArray
    .printObject();
    > trace("-- or printing from the scenario -- objArray[" +
    i + "] is realy
    > stored");
    > printMyArray(objArray.tab);
    > trace("____________________________________");
    > index += 1;
    > }
    > //
    > // Printing the array of pointers to MyObj
    > trace("___________________________________________");
    > trace("And now, all in one...\nPrinting the array of
    pointers to MyObj
    > trace("___________________________________________");
    > for (var i = 0; i < 4; i++) {
    > objArray
    .printObject();
    > }
    > trace("------ Or directly from the scenario -------");
    > for (var i = 0; i < 4; i++) {
    > trace(" Printing from scenario Object name --> " +
    objArray.objectName);
    > printMyArray(objArray
    .tab);
    > }
    > trace("___________________________________________");
    > trace("They are all the same ?!\nIt seems to have lost
    something !!!!");
    > trace("___________________________________________");
    > //
    > //
    > trace("\nAmazingly, the array's elements do not refer to
    the same
    object\n");
    > //
    > trace("objArray[0] == objArray[0] ? -->" +
    (objArray[0] == objArray[0]));
    > trace("objArray[0] == objArray[1] ? -->" +
    (objArray[0] == objArray[1]));
    > trace("objArray[0] instanceof MyObj ? -->" +
    (objArray[0] instanceof
    MyObj));
    > trace("");
    > //
    > trace("\nThey realy seem to point different objects
    !\n");
    > //
    > // So, why do they have different outputs ?
    > //
    > //
    > //
    > // It seems the 'new' constructor creates a new Object
    'MyObj'
    > // which always resides at the same memory location.
    > // 'oob' is in fact a pointer, and objArray[] an array
    of pointers,
    > // as so an array of memory addresses.
    > // The objArray[] elements are pointers which always
    refer to the
    > // the same memory zone, which in fact contains the last
    content of the
    > object.
    > //
    > //
    > // And then manualy
    > //
    >
    trace("**********************************************************");
    > trace("\nAnd then another way to create each new object
    manualy\n");
    >
    trace("**********************************************************");
    > //
    > //
    > var otherObjArray:Array = new Array();
    > //
    > var oob0 = new MyObj(100);
    > trace("-- New object created #100");
    > oob0.printObject();
    > otherObjArray[0] = oob0;
    > trace("-- Now entered into the array --
    otherObjArray[0]");
    > otherObjArray[0].printObject();
    > //
    > var oob1 = new MyObj(200);
    > trace("-- New object created #200");
    > oob1.printObject();
    > otherObjArray[1] = oob1;
    > trace("-- Now entered into the array --
    otherObjArray[1]");
    > otherObjArray[1].printObject();
    > //
    > var oob2 = new MyObj(300);
    > trace("-- New object created #300");
    > oob2.printObject();
    > otherObjArray[2] = oob2;
    > trace("-- Now entered into the array --
    otherObjArray[2]");
    > otherObjArray[2].printObject();
    > //
    > trace("___________________________________________");
    > trace("And now, all in one...\nEnjoy the show !!!!");
    > trace("___________________________________________");
    > otherObjArray[0].printObject();
    > otherObjArray[1].printObject();
    > otherObjArray[2].printObject();
    > //
    > trace("\nThe problem seems to reside in the way the
    Arrays members are
    managed
    > by the Objects !\n");
    > trace("\nHELP me please to find the bug\n");
    > //
    >

  • Array of Object

    How to create array of object dynamically and the class is also having constructor.
    like:
    class Cir{
    private double radius;
    Cir(double r){
    redius=r;
    10 objects are to be created within for loop

    Cir c[]=new Cir[10]
    for(int i=0;i<10;i++)
    c [ i ] =new Cir(radious);
    Message was edited by:
    ramireddi

  • How to make arrays or repeat objects in circle?

    Hello,
    1 - How to make arrays without copying and pasting? Fig-1
    2 - how to create objects repeated in circles? Fig-2
    Regards and Thanks

    1) Patterns
    2) One option is Scripting (or Actions).
    http://forums.adobe.com/message/3472806#3472806
    Edit: That was only for text layers, you could give this a try:
    // xonverts to smart object, copies and rotates a layer;
    // for photoshop cs5 on mac;
    // 2011; use it at your own risk;
    #target photoshop
    ////// filter for checking if entry is numeric and positive, thanks to xbytor //////
    posNumberKeystrokeFilter = function() {
              this.text = this.text.replace(",", ".");
              this.text = this.text.replace("-", "");
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\-\.\d]/g, '');
    posNumberKeystrokeFilter2 = function() {
              this.text = this.text.replace(",", "");
              this.text = this.text.replace("-", "");
              this.text = this.text.replace(".", "");
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\-\.\d]/g, '');
              if (this.text == "") {this.text = "2"}
              if (this.text == "1") {this.text = "2"}
    var theCheck = photoshopCheck();
    if (theCheck == true) {
    // do the operations;
    var myDocument = app.activeDocument;
    var myResolution = myDocument.resolution;
    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var dlg = new Window('dialog', "set circle-radius for arrangement", [500,300,840,450]);
    // field for radius;
    dlg.radius = dlg.add('panel', [15,17,162,67], 'inner radius');
    dlg.radius.number = dlg.radius.add('edittext', [12,12,60,32], "30", {multiline:false});
    dlg.radius.numberText = dlg.radius.add('statictext', [65,14,320,32], "mm radius ", {multiline:false});
    dlg.radius.number.onChange = posNumberKeystrokeFilter;
    dlg.radius.number.active = true;
    // field for number;
    dlg.number = dlg.add('panel', [172,17,325,67], 'number of copies');
    dlg.number.value = dlg.number.add('edittext', [12,12,60,32], "30", {multiline:false});
    dlg.number.value.onChange = posNumberKeystrokeFilter2;
    dlg.number.value.text = "12";
    // buttons for ok, and cancel;
    dlg.buttons = dlg.add('panel', [15,80,325,130], '');
    dlg.buttons.buildBtn = dlg.buttons.add('button', [13,13,145,35], 'OK', {name:'ok'});
    dlg.buttons.cancelBtn = dlg.buttons.add('button', [155,13,290,35], 'Cancel', {name:'cancel'});
    // show the dialog;
    dlg.center();
    var myReturn = dlg.show ();
    if (myReturn == true) {
    // the layer;
              var theLayer = smartify(myDocument.activeLayer);
              app.togglePalettes();
    // get layer;
              var theName = myDocument.activeLayer.name;
              var theBounds = theLayer.bounds;
              var theWidth = theBounds[2] - theBounds[0];
              var theHeight = theBounds[3] - theBounds[1];
              var theOriginal = myDocument.activeLayer;
              var theHorCenter = (theBounds[0] + ((theBounds[2] - theBounds[0])/2));
              var theVerCenter = (theBounds[1] + ((theBounds[3] - theBounds[1])/2));
    // create layerset;
              var myLayerSet = myDocument.layerSets.add();
              theOriginal.visible = false;
              myLayerSet.name = theName + "_rotation";
    // create copies;
              var theNumber = dlg.number.value.text;
              var theLayers = new Array;
              for (var o = 0; o < theNumber; o++) {
                        var theCopy = theLayer.duplicate(myLayerSet, ElementPlacement.PLACEATBEGINNING);
                        theLayers.push(theCopy);
    // calculate the radius in pixels;
              var theRadius = Number(dlg.radius.number.text) / 10 * myResolution / 2.54;
              myDocument.selection.deselect();
    // get the angle;
              theAngle = 360 / theNumber;
    // work through the layers;
              for (var d = 0; d < theNumber; d++) {
                        var thisAngle = theAngle * d ;
                        var theLayer = theLayers[d];
    // determine the offset for outer or inner radius;
                        var theMeasure = theRadius + theHeight/2;
    //                    var theMeasure = theRadius + theWidth/2;
                        var theHorTarget = Math.cos(radiansOf(thisAngle)) * theMeasure;
                        var theVerTarget = Math.sin(radiansOf(thisAngle)) * theMeasure;
    // do the transformations;
                        rotateAndMove(myDocument, theLayer, thisAngle + 90, - theHorCenter + theHorTarget + (myDocument.width / 2), - theVerCenter + theVerTarget + (myDocument.height / 2));
    // reset;
    app.preferences.rulerUnits = originalUnits;
    app.togglePalettes()
    ////// function to determine if open document is eligible for operations //////
    function photoshopCheck () {
    var checksOut = true;
    if (app.documents.length == 0) {
              alert ("no open document");
              checksOut = false
    else {
              if (app.activeDocument.activeLayer.isBackgroundLayer == true) {
                        alert ("please select a non background layer");
                        checksOut = false
              else {}
    return checksOut
    ////// function to smartify if not //////
    function smartify (theLayer) {
    // make layers smart objects if they are not already;
              if (theLayer.kind != LayerKind.SMARTOBJECT) {
                        myDocument.activeLayer = theLayer;
                        var id557 = charIDToTypeID( "slct" );
                        var desc108 = new ActionDescriptor();
                        var id558 = charIDToTypeID( "null" );
                        var ref77 = new ActionReference();
                        var id559 = charIDToTypeID( "Mn  " );
                        var id560 = charIDToTypeID( "MnIt" );
                        var id561 = stringIDToTypeID( "newPlacedLayer" );
                        ref77.putEnumerated( id559, id560, id561 );
                        desc108.putReference( id558, ref77 );
                        executeAction( id557, desc108, DialogModes.NO );
                        return myDocument.activeLayer
              else {return theLayer}
    ////// radians //////
    function radiansOf (theAngle) {
              return theAngle * Math.PI / 180
    ////// rotate and move //////
    function rotateAndMove (myDocument, theLayer, thisAngle, horizontalOffset, verticalOffset) {
    // do the transformations;
    myDocument.activeLayer = theLayer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc3 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc3.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc4 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc4.putUnitDouble( idHrzn, idPxl, horizontalOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc4.putUnitDouble( idVrtc, idPxl, verticalOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc3.putObject( idOfst, idOfst, desc4 );
        var idAngl = charIDToTypeID( "Angl" );
        var idAng = charIDToTypeID( "#Ang" );
        desc3.putUnitDouble( idAngl, idAng, Number(thisAngle) );
    executeAction( idTrnf, desc3, DialogModes.NO );

  • 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

  • How to list an array of objects using struts in jsp and ActionForm

    I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
    private AddRmvParts addRmv[];
    But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
    I am thinking I need to use an iterator in the jsp page to display it.
    I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
    Thanks.

    Most probably the easiest way to make it accessible in your page is as a collection.
    ie
    public Collection getAddRmvParts()
    You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
    As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
    Example using JSTL:
    <c:forEach var="addRmvPart" items="${addRmvParts}">
      <c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
    </c:forEach>

  • How to update an object property located in an array of objects

    Hello all,
    I have a script that creates custom objects and populates them and saves them into an array. This array of objects is later converted to a CSV file for reuse later on. On a subsequent need to run the script and to save time and avoid recollecting
    data I have previously amassed, I read in the contents of the csv file and put this data into an arryOfObjects.
    I need to manipulate the data in specific objects but I can't figure out how to accomplish that task.
    I can identify the correct object within the array with the following command. I have been trying to pipe that result into either set-variable or set-itemproperty without success.
    $arrayOfObjects | select-object | where HostName -like $_.'name'
    This works, I can see my desired object and the data fields contained within it.
    I now need to modify one of the property fields. (Alias).
    I have been trying the following as a line of thought, but so far without success. It doesn't fail/error out, but it doesn't update the data either.
    $arrayOfObjects | select-object | where HostName -like $_.'name' | set-itemproperty -name Alias -value "newAlias"
    I'm wondering if I need to specify something for the -path argument, but since the array is in memory and not a registry location or a file I am not sure what I should use, if this is the problem at all.
    Any suggestions would be appreciated.
    Thanks
    Smitty

    yes, I have redacted things, and obscured other things because I can not go around posting critical infrastructure information out on the internet.
    Here is the first three lines of my .csv file
    "OrigIP","AL_HostName","AL_Found","AL_Enabled","AL_Status","N_HostName","InREDACTED","N_Found","Delta","IsStale","Ping","InDNS","InAD","Location","Alias","IsServer","HostType","OS","ApplianceName","FQDN","ChatterValue"
    "10.24.11.4","ABCD","yes","yes","never","abcd.domain.com","yes","yes","*","*","Y","Y","N","TEST","*","*","eventlog","","","ABCD.DOMAIN.COM","*"
    "10.24.12.18","EFGH","yes","yes","Dec 30 2014 09:15:00","efgh.domain.com","yes","yes","-25","No","Y","Y","Y","TEST","*","yes","eventlog","xxxxxx","","EFGH.DOMAIN.COM","*"
    When I import this file I create a new custom object (objectCurrent) which I populate with the data from the csv file. I then store this object into an array of objects (objectCollection).
    All of the data is present.
    I then read in a new csv file that would contain most of the same hosts, but possibly additional new ones. upon importing the second csv file I loop through the entries.
     I have a conditional statement that checks to see if the host name from the second csv file, if it isn't then treat it like a new object and go fill in all of the details of the object using my various functions, etc.
    Import-CSV$currentALReport-Delimiter","|ForEach-Object
         if($objectCollection.N_HostName
    -notcontains$_.'name')
            # then create a new currentObject and go populate the properties of the object 
         elseif ($objectCollection.N_HostName -contains $_.'name') {
              # copy this object and update the object's AL_Status (which is the last reported message date info)
                  # send that to the function that will parse it, compare Julian dates and see if it falls within my
                  # criteria as being stale.  if so set the IsStale property to Yes, but reguardless set the AL_Status
                  # newest last reported message data
    JRV states that "The "select object" does nothing at all unless you have a column in your CSV called "object".  The where clause will do nothing because it is syntatctically wrong and illogical. "
    I beg to differ.  Using the above command :   with the script running and the current focus ($_.'name') equals "abcd.domain.com"
     $arrayOfObjects | select-object | where N_HostName -like $_.'name'
    It obtain a single object within my array of objects similar to this:
    IP: 1.2.3.4
    N_HostName: abcd.domain.com
    IsStale: No
    LastMsgDate: Dec 30 2014 09:15:00
    Delta: 1
    Ping: Yes
    InDNS: Yes
    InAD: Yes
    Alias: *
    (other fields omitted for brevity) I could get any of my existing objects if I match the hostname
    If I used only the command "  $objectCollection | Select-Object "    it returns every object in my array.
    So to narrow down the selection to a single object I add the " | where N_HostName -like $_.'name'  "
    which gives me the exact object I am searching for.
    My only question is how can I modify the contents of the object that I have specified within the array of object???

  • How to bind bar chart(columns) to array list object in c# win form

    how to bind bar chart(columns) to array list  object in c#win form

    Hi Ramesh,
    Did you want to bind list object to bar chart? I made a simple code to achieve binding list to bar chart.
    public partial class Form0210 : Form
    public Form0210()
    InitializeComponent();
    private void Form0210_Load(object sender, EventArgs e)
    BindData();
    public void BindData()
    List<int> yValues = new List<int>(new int[] { 20, 30, 10, 90, 50 });
    List<string> xValues = new List<string>(new string[] { "1:00", "2:00", "3:00", "4:00", "5:00" });
    chart1.Series[0].Points.DataBindXY(xValues, yValues);
    The links below might be useful to you:
    # Data Binding Microsoft Chart Control
    http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
    # Series and Data Points (Chart Controls)
    https://msdn.microsoft.com/en-us/library/vstudio/dd456769(v=vs.100).aspx
    In addition, if I misunderstood you, please share us more information about your issue.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • How do I insert an object in an array?

    How can I insert an object in an array of variable size?
    I input two numbers from keyboard
    1
    2that form the following object (Pair)
    (1,2)
    how can I add such objects to an array
    private Pair s[];
    e.g.
    public PairList(int x){
    top = -1;
    s = new Pair[x];
    }//constructor
    public void getPairs()throws FullException{
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    try{
    a=input.readLine();b=input.readLine();
    }//try
    catch(IOException e){System.out.println("Can't read input");}//catch
    int x=0;
    int y=0;
    try{
    x=Integer.parseInt(a);}//try
    catch(NumberFormatException e){}
    try{
    y=Integer.parseInt(b);}//try
    catch(NumberFormatException e){}
    Pair k=new Pair(x,y);
    System.out.println(k);
    s[++top]=k; --here is my problem
    }//getPairs

    I tried making as few changes to your code as possible, but your idea should basically work. Potential problems:
    1. Doesn't allow for more input than 1 pair.
    2. By storing pair in an array, you must know the exact size of the array you will need beforehand. You might be better off storing the Pair(s) in a Vector and then converting that to an array.
    3.Your exception handlers need some work. Basically, your exception handlers put out a message or do nothing and then you continue processing. Not good.
    4. No cleanup of file resources after you have completed
    import java.io.*;
    public class PairList{
         private Pair s[];
         private int top;
         public PairList(int x){
              top = -1;
              s = new Pair[x];
         }//constructor
         public void getPairs()throws Exception{
              BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
              String a = null, b = null;
              try{
                   a=input.readLine();
                   b=input.readLine();
              }//try
              catch(IOException e){
                   System.out.println("Can't read input");
              }//catch
              int x=0;
              int y=0;
              try{
                   x=Integer.parseInt(a);
              }//try
              catch(NumberFormatException e){
              try{
                   y=Integer.parseInt(b);}//try
              catch(NumberFormatException e){
              Pair k=new Pair(x,y);
              System.out.println(k.toString());
              s[++top]=k; //here is my problem
         }//getPairs
    class Pair {
         private int xx;
         private int yy;
         public Pair(int x, int y) {
              xx = x;
              yy = y;
         public String toString() {
              return("X = " + xx + "  Y = " + yy);
    }

  • How Does On Reference An Array Of Objects?

    Howdy!
    Ive read through Flex 2's help and also through the wonderful
    book 'Developing Rich Clients With Flex' for topics relating to
    this question but very strangely with no luck (and I assume it's
    quite straight forward)! So hopefully you chaps can help...
    Now, to get a value from an object model is very straight
    forward -
    quote:
    <mx:Model id="MyModel">
    <Inbox>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    </Inbox>
    </mx:Model>
    To get the <Sender> value its a simple case of -
    quote:
    MyModel.Inbox.Message.Sender
    Because obviously 'Sender' is just an object. But when I have
    an array of objects like so -
    quote:
    <mx:Model id="MyModel">
    <Inbox>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    <Message>
    <Sender>[email protected]</sender>
    <Subject>Blah Blah</Subject>
    <Content>This is the content of the
    email!</Content>
    </Message>
    </Inbox>
    </mx:Model>
    How do I reference the individual 'Sender' objects?
    Any help would really perk up my day :-)
    Thanks

    Thank you kindly!
    Just one more question (i'd select a different forum but it's
    related to this)...
    How would I loop through e.g.
    MyModel.Inbox.Message.Sender[n], from within a dataProvidor for a
    repeator?
    I'm basically creating a UI which is based on template data
    stored in an external data model which is using nested loops -
    Data Model
    quote:
    <TemplatesConfigurator>
    <Template label="Elite II" table="tbl_Category" id="2"
    description="Elite II So Quote Template 00038_TMP_V9">
    <Category label="Heading - Base System Elite"
    table="tbl_CategorySub" id="1">
    <CategorySub label="Base System" table="tbl_CategorySub"
    id="4">
    <Parts1 label="08639" table="tbl_Template"
    id="1"></Parts1>
    </CategorySub>
    <CategorySub label="Elite II (included in base system)"
    table="tbl_CategorySub" id="5">
    <Parts1 label="05356" table="tbl_Template"
    id="2"></Parts1>
    <Parts1 label="03703" table="tbl_Template"
    id="3"></Parts1>
    <Parts1 label="05904" table="tbl_Template"
    id="4"></Parts1>
    <Parts1 label="06327" table="tbl_Template"
    id="5"></Parts1>
    <Parts1 label="06767" table="tbl_Template"
    id="6"></Parts1>
    </CategorySub>
    </Category>
    <Category label="Heading - Support Contracts &
    Warranty" table="tbl_CategorySub" id="28">
    <CategorySub label="Support Contract Options "
    table="tbl_CategorySub" id="29">
    </CategorySub>
    <CategorySub label="Warranty Options"
    table="tbl_CategorySub" id="30">
    </CategorySub>
    </Category>
    </Template>
    </TemplatesConfigurator>
    Repeaters
    quote:
    <mx:Repeater id="r1"
    dataProvider="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template}">
    <mx:Form height="100%" width="100%"
    horizontalScrollPolicy="off" paddingBottom="0" paddingLeft="0"
    paddingRight="0" paddingTop="0" backgroundColor="#ffffff"
    verticalScrollPolicy="auto">
    <mx:Label
    text="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.label}"
    fontWeight="bold" fontSize="13" paddingBottom="0"/>
    <mx:Text
    text="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.description}"
    fontSize="10"/>
    <mx:Repeater id="r2"
    dataProvider="{TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.Categor y}">
    <mx:Label id="SubHeadings" text="{r2.currentItem.label}"
    fontWeight="bold" fontSize="12"/>
    <mx:Repeater id="r3" dataProvider="{
    TemplateConfiguratorData.lastResult.TemplatesConfigurator.Template.Category[0].CategorySub}">
    <mx:Label text="{r3.currentItem.label}" fontWeight="bold"
    fontSize="10"/>
    </mx:Repeater>
    </mx:Repeater>
    </mx:Form>
    </mx:Repeater>

  • How do I convert an Object into an Array?

    If I have an instance of type object that I know is really a DataGrid row that was cast into an object when passed to a function, how can I cast that Object to an array, such that each index of this array would correspond to the information in a given column of the row?

    @Sathyamoorthi
    Can you please explain what this function does? Essentially, what should be contained in the String?
    I printed out the string and it seems like I am getting a random row in the Object, as opposed to first or last. Why is that?
    UPDATE: I printed out the value of dataGrid0.columns[5].dataField but it just turned out to be the id of the column.

Maybe you are looking for

  • TS1369 These methods did not work for me, did anyone find another usefull way?

    So i have tried all the methods that apple provides when your Ipod is not being detected by Itunes or my computer. Does anyone else know what to do or what i should try to figure this issue out??

  • I want to move files on my hard drive without 'losing' them in iTUnes

    I currently have lots of my music files stored in various folders in my hard drive (mp3 files created before I had an iPod and started using iTunes). I've got this music in my iTunes library, by using 'Add folder to library' prompt. However, since ge

  • PF attribute modification in Access Policy for existing users.

    Hi Guys, I have an access policy for provisioning a resource. Suppose if I make some changes for the process form attribute value inside the access policy,How can I have the same attribute value reflected in the process form of users who are already

  • Short Dump to extending internal table memory

    Hi All, I have an internal table with 10 million records . While appending records to this internal table iam getting dump as "No storage space available for extending the internal table." .I declared internal table with "OCCURS 0 "How can i avoid th

  • Widget arrows in slide show

    Hello, How to change arrows in a slide show (I want arrows from top to bottom and not from right to left. comment changer les flèches dans un diaporama (je veux des flèches de haut en bas et pas de droite à gauche. Thank you