Building netui:tree from XML

          Hi,
          I am trying to build a Tree in Workshop 8.1 using netui:tree tag (for data in
          an XML file).
          The BEA docs say that we have to assign the TreeNode object to the 'tree' attribute
          in the netui:tree tag.
          What is the best way to translate the XML doc into a TreeNode object(s)?
          Thanks,
          Ajay
          

          "Ajay Oruganti" <[email protected]> wrote:
          >
          >Hi,
          >
          >I am trying to build a Tree in Workshop 8.1 using netui:tree tag (for
          >data in
          >an XML file).
          >
          >The BEA docs say that we have to assign the TreeNode object to the 'tree'
          >attribute
          >in the netui:tree tag.
          >
          >What is the best way to translate the XML doc into a TreeNode object(s)?
          >
          >
          >Thanks,
          >Ajay
          Did you resolve your problem?
          I have the similar one.
          So. I can draw my tree for my data, but if i receive second xml document with
          new data and try repaint the tree, i have the same tree, whitout changes.
          Can you help me?
          Best regards
          Hubert.
          

Similar Messages

  • Building tree from xml

    i have an xml file and trying to build a tree out of it.
    can anyone please help me what is the best way to do that?

    Or any DOM parser, including the one built into the standard Java API.

  • Tree from XML (JMX monitoring and management application)

    I am trying to create a tree structure from XML. I am setting
    the below XML as the dataProvider for the tree.
    Now I only want to see the "element" labels in the tree
    structure. But I also see the operationList and the operations
    under it too. Is there any way I can filter these out from the tree
    structure ?
    The reason why I have the operations is that I have to
    display them on the right hand side, i.e whenever someone clicks on
    an element the operations corresponding to that have to be
    displayed on the right hand side.
    If you see the "flex-admin" application under the livecycle
    data services ... my applications is exactly similar to that.
    If anyone needs more information, I would be happy to
    provide.
    <?xml version="1.0" encoding="UTF-8"?>
    <centralmbeanserver>
    <element label = "FMC-DropCopies-QA" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA" >
    <element label = "Cache Manager" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Cache Manager"
    >
    <element label = "SACFixFilterRulesCache" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Cache Manager,DB
    Cache=SACFixFilterRulesCache" >
    <operationList>
    <operation name = "reloadDBCache" returnType =
    "java.lang.String">
    </operation>
    </operationList>
    </element>
    <element label = "SACFIXExecBrokerMapCache" canonicalName
    = "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Cache
    Manager,DB Cache=SACFIXExecBrokerMapCache" >
    <operationList>
    <operation name = "reloadDBCache" returnType =
    "java.lang.String">
    </operation>
    </operationList>
    </element>
    </element>
    <element label = "Source Manager" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Source Manager"
    >
    <operationList>
    <operation name = "enableAllMsgSources" returnType =
    "void">
    </operation>
    <operation name = "disableAllMsgSources" returnType =
    "void">
    </operation>
    <operation name = "listMsgSourceNames" returnType =
    "java.util.List">
    </operation>
    <operation name = "reloadSources" returnType = "void">
    </operation>
    </operationList>
    <element label = "CS-SACFIX6-SS" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Source
    Manager,Msg Source=CS-SACFIX6-SS" >
    <operationList>
    <operation name = "enableMsgSource" returnType = "class
    java.lang.String">
    </operation>
    <operation name = "disableMsgSource" returnType = "class
    java.lang.String">
    </operation>
    </operationList>
    </element>
    <element label = "CS-SACFIX1-SS" canonicalName =
    "CentralMBeanServer:App=FMC-DropCopies-QA,Componet=Source
    Manager,Msg Source=CS-SACFIX1-SS" >
    <operationList>
    <operation name = "enableMsgSource" returnType = "class
    java.lang.String">
    </operation>
    <operation name = "disableMsgSource" returnType = "class
    java.lang.String">
    </operation>
    </operationList>
    </element>
    </element>
    </element>
    </centralmbeanserver>

    How is the WebSphere node connected to the cluster? Is it using TCMP? Extend?
    Local, Distributed, Replicated, Near, Overflow, External and Optimistic cache statistics appear in the Coherence JMX server. However, near and local caches created on extend nodes do not appear. Therefore the -Dtangosol.coherence.management.remote=true on an Extend client will not register the near or local caches.
    Thanks,
    Everett

  • How to build n Tree from Vector

    Hi,
    i just want to build an n Tree from Vector.
    the Vector contains the elements {1,2,3,4}
    the tree should be like this (actually it should not be limited to 3 child, but just as an Example)
    i will be happy to use the jTree from Sun
    ++1
    +++2
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    +++2
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    +++2
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    ++++3
    +++++4
    +++++4
    +++++4
    any Ideas?
    thanx.

    Massive crosspost. Answer here if you must.
    http://forum.java.sun.com/thread.jsp?forum=4&thread=444422

  • Create a tree from XML

    hi. I have created a simple XML file which contains a hierarchical structure of strings.
    Also, I have created a SAXParser to read from the xml.
    But I don't know how to put this structure in a JTree.I don't want to show the tree on screen. I want to be able to access certain nodes at different times.
    Any help?

    I've created the SAXParser and as you can see I've read the XML file. I need to write some code in the characters method to add the relecvant strings to the tree. I'm quite new at this...
    public class Echo extends DefaultHandler
    public static void main(String args[])
    DefaultHandler handler=new Echo();
    SAXParserFactory factory=SAXParserFactory.newInstance();
    try
    SAXParser saxParser=factory.newSAXParser();
    saxParser.parse(new File("meniu.xml"),handler);
    }catch(Throwable t)
    t.printStackTrace();
    System.exit(0);
    public void startDocument()
    throws SAXException
    public void endDocument()
    throws SAXException
    public void startElement(String namespaceURI,
    String sName,
    String qName,
    Attributes attrs)
    throws SAXException
    String eName=sName;
    if("".equals(eName)) eName=qName;
    public void endElement(String namespaceURI,
    String sName,
    String qName)
    throws SAXException
    public void characters(char[] buf,int offset, int len)
    throws SAXException
    String s=new String(buf,offset,len);
    if(!s.trim().equals("")) {

  • Tree from XML

    I have a tree control that is rendered from an xml file with
    the following format:
    <element name="textnode1">value here</element>
    <element name="groupnode1">
    .....<element name="item">
    ..........<element name="itemnode1">value
    here</element>
    ..........<element name="itemnode2">value
    here</element>
    ..........<element name="itemnode3">value
    here</element>
    .....</element>
    </element>
    <element name="textnode1">value here</element>
    Using a simple labeling function, I render the tree nodes for
    each "element" labeling them with the "name" attribute. But, by
    default behavior, the tree also renders each node value ("value
    here") as a child of the "element" node.
    How can I tell the tree control to ignore the node values and
    only render tree nodes from the "element" nodes in the XML?

    By using a custom ITreeDataDescriptor.
    But if it was me, I might just process the xml into the
    correct form.
    Tracy

  • Hierarchical menu tree from dynamic xml

    Can anyone give me ideas on how to create a hierarchical tree using xml / xsl / javascript. Please note that the xml data is dynamic and changes for each user/company. I have downloaded the xalan processor. Any ideas on the line of approach is highly appreciated.
    Thanks in advance

    I've used Joust Outliner, www.ivanpeters.com. This a free javascript package that builds treeviews for html. A XSL-stylesheet was used to produce the javascript code from a dynamic xml source. (Although the structure of the xml was more or less the same, the content was changed from time to time)

  • Creating a Java content tree from scratch and then marshal it to XML data

    Hi,
    After binding a schema using JAXB binding, I wrote a class to create a Java content tree from scratch and then marshal it to create an XML document. To see if the resulting xml document is correct, I opened it in XMLSpy and tried to validate it against the original schema.... I got the following error:
    "Unable to locate a reference to a supported schema kind (DTD, DCD, W3C Schema, XML-Data, Biz Talk) within this document instance"
    Then I realized that the generated xml document didnot contain the following for the root element:
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xsi:schemaLocation="....."
    i.e, the XML Schema Instance namespace and the schema location.
    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Thanks.

    How do I get these attributes incorporated into the XML document generated during the marshal process.
    Add xmlns:xsi and xsi:schemaLocation attributes to the root element in the schema.
    <xsd:attribute name="xmlns:xsi"  fixed="http://www.w3.org/2001/XMLSchema-instance"/>

  • Building charts from xml

    I'm trying to build a series of charts from xml (sample below). Examples might be a column chart of all scores, or a column chart of all 'fred' values. All the examples I've seen are ArrayCollections, or if they are XML, they are very simple xml. I've tried converting the xml to an ArrayCollection (didn't work) and I've tried using the xml as the datasource. I could loop through and build a simple xml for each chart but there must be an easier way. Any suggestions.
    <results>
                    <item name="group1" speed="100" score="23" time="123">
                        <detail>
                            <element name='fred'>2</element>
                            <element name='john'>3</element>
                        </detail>
                    </item>
                    <item name="group2" speed="10" score="3" time="1">
                         <detail>
                             <element name='fred'>12</element>
                             <element name='john'>31</element>
                         </detail>
                     </item>
                    <item name="group3" speed="230" score="53" time="78">
                         <detail>
                             <element name='fred'>42</element>
                             <element name='john'>81</element>
                         </detail>
                     </item>
    </results> 

    Charting framework access the fields like this item[yField] so any of the y field values that you have given does not work i.e. item["item.detail[0]"] etc. do not work.
    For this purpose we created a property called dataFunction on Series, CategoryAxis classes through which you can provide appropriate value for your fields.
    From the livedocs - http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/Series.html#dataFunction
    You typically use the dataFunction property to access fields in a data provider that are not scalar values, but are instead nested in the data provider. For example, the following data requires a data function to access the fields for a chart's data provider:
          , open:25.19}
    The following example returns a value from this data provider:
         public function myDataFunction(series:Series, item:Object, fieldName:String):Object {
              if(fieldName == 'yValue')
                  return(item.close.High);
              else if(fieldName == "xValue")
                  return(item.month);
              else
                  return null;
    Thanks
    -Sunil

  • Is there any util or ant build to generate xmlbeans from xml

    hi all
    is there any utility tools or ant build process that can generate xmlbeans from xml schema? thanks.

    exactly,
    here are some libraries which are open sources;
    http://java-source.net/open-source/pdf-libraries hope it's useful. :D

  • Build XSD (XML Schema Defenition) from XML using Oracle SOAz

    Hi:
    I want to integrate Application A to Application B using Oracle SOA suite. Application A will give me a XML file. Application B will supports XSD. Can any one help me how to build XSD using existing XML in Oracle SOA suite?
    Appreciate if you give me the steps.
    Thanks,
    RAO

    You might want to ask this question in the SOA forum. To get there ...
    at the top of this page you will see a set of links that look like "Forum Home » Technology Network Community » Certification".
    Click on 'Forum Home' to get to the Forum Home page.
    Then press Ctrl+F to enable search in your browser.
    Enter SOA in the search box, and if you are using Internet Explorer you might want to press the Next button.
    You will see a list
    SOA & Process Management
      SOA Suite 
      BPEL
      Applications Integration using Oracle Fusion Middleware
      Business Process Management Suite 
      More... You could click on 'SOA Suite' to chat with people who use the SOA Suite.
    You could click on 'More...' to see whether there are other useful forums.
    Just to satisfy my curiosity, why did you select the Certification forum for this question?

  • How to remove an Element from XML by confirming Attribute of that element

    Hi guys
    I have an XML file where i have all users DB. Now i want to remove a user from that XML file. I want to check an user id attribute which is uniqe with existing users in XML file, if its the same user then delete this user from XML file and save the changes in XML file.
    here is my XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <users>
    <user id="zahid" password="X8UrUN79avT27LYwUESiliAV328=" name="Zahid Nawaz" phone="9599808" email="[email protected]" role="Tnr+vPuuAAsix8heVWD4mioCgLQ=" />
    <user id="Admin" name="alpha beta" password="fEqNCco3Yq9h5ZUglD3CZJT4lBs=" phone="456782656" email="[email protected]" role="Tnr+vPuuAAsix8heVWD4mioCgLQ=" />
    <user id="Guest" name="beta alpha" password="+ml3yZuAnbaOHFaIjsOL0ARxmzk=" phone="8765432" email="[email protected]" role="+s6D7jAUvcj5ggPMlOLokiJFLpA=" /><user id="Guest1" name="unknown unknown" password="+ml3yZuAnbaOHFaIjsOL0ARxmzk=" phone="123122112" email="[email protected]" role="+s6D7jAUvcj5ggPMlOLokiJFLpA=" />
    </users>for example i want to delete a user which have user id= Guest.
    How can i do it in Java. Any code example please. i am using JDOM document and SAXBuilder for parsing.
    Waiting for your replay.
    Thanks in Advance
    Best regard

    Hi,
    Till now i tried the following code which give null pointer exception at following line
    element.getParentNode().removeChild(element);
         public String removeUserByID(String id) throws Exception{
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                 DocumentBuilder builder = factory.newDocumentBuilder();
                 TransformerFactory tFactory = TransformerFactory.newInstance();
                 Transformer tFormer = tFactory.newTransformer();
                   doc = builder.parse(usersXml);
                 Element element = (Element)doc.getElementsByTagName("user id="+id).item(0);
    //             Remove the node
                 element.getParentNode().removeChild(element);
    //             Normalize the DOM tree to combine all adjacent nodes
                 doc.normalize();
                 FileOutputStream fos = new FileOutputStream(this.usersXml);
                   XMLOutputter out = new XMLOutputter();
                   out.output(((org.jdom.Document)doc), fos);
              /*     Source source = new DOMSource(doc);
                 Result dest = new StreamResult(System.out);
                 tFormer.transform(source, dest);
                 System.out.println();
                 return "true";
              if following line i m trying to use first attribute of my XML file where i am passing a string which is for example like "user id=Guest". id is a string which have user Id "Guest".
    Element element = (Element)doc.getElementsByTagName("user id="+id).item(0);So any suggestion??Whats wrong here?
    Best regards and thanks again 4 ur reply.

  • Hierarchy tree with XML attributes in jsp

    hi,
    i need to build a hierarchy tree. data(parent and child) should be read from xml file. data is attributes of nodes in xml. i need to write the JSP code for above functionality. please help me. thanks in advance.

    Check this link for further details.
    http://www.dpawson.co.uk/xsl/sect4/N10301.html
    http://www.devx.com/getHelpOn/Article/11874
    The solution is based on XSLT approach. That can be still converted in other server side technologies.
    Regards,
    Vikrant.

  • JAXB: Creating Java content tree from scratch - examples?

    I'm trying to create XML output by building the content tree from scratch (using a the DDI schema which is fairly complex). I don't have any existing XML instances. Sample application 3 in Sun's JAXB tutorial doesn't give enough info about how to relate the nodes to create the heirarchy. I can create the root node and set it's attributes OK, but then the practical info runs out.
    Can anyone point me at some good practical examples? (i.e. not those of the "How to play the quitar: Put your fingers on the frets and move your other hand around" genre).
    Thanks in advance.

    I don't have examples, but the main thing to remember is that you should use the ObjectFactory to create all of the objects in your tree. That's important.
    You must use the element object class for the root node, but you can use type object classes for all the data contained (you can use element object classes for all the nodes, if that's easier).
    Use the accessor methods to load the data into the objects you create.
    One tip that almost everyone runs into - JAXB only provides a getter for lists - use the getter to get the list, then use .add() methods to add the objects to that list.

  • Creating tree from HTTPService

    Hi, I'm new under flex builder and I have a simple (?)
    problem :
    I would like to generate a tree from a XML file generate by
    PHP. I can display items (source) in tree but not subitems
    (playlist)...
    Here my XML file generated by PHP :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <sourcelist>
    <source id="3" nom="WarholinDaMix">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    </source>
    <source id="2" nom="YoyesGirl">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    <playlist id="2" nom="Yo la liste
    Girly"></playlist>
    </source>
    <source id="1" nom="Yoyesman">
    <playlist id="0" nom="Tous les
    fichiers"></playlist>
    <playlist id="1" nom="Yo ma liste 1"></playlist>
    <playlist id="3" nom="Yo ma liste 2"></playlist>
    </source>
    </sourcelist>
    Here the code I use :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="GetSource.send(null);">
    <mx:HTTPService id="GetSource" url="
    http://127.0.0.1/SchmittTunes/bin/music.php?gettype=source"
    useProxy="false"/>
    <mx:Panel layout="absolute" left="10" right="10">
    <mx:Tree labelField="nom"
    dataProvider="{GetSource.lastResult.sourcelist.source}"
    width="100%" x="0" height="100%" y="0"
    showRoot="false"></mx:Tree>
    </mx:Panel>
    </mx:Application>
    How I said, I have 3 items displaying the 'source' on my
    tree, but I can't expand them. There is no arrow on the left side.
    So subitems like 'playlist' are not display.
    Does anyone know why or have an idea ?
    Thanks for your help
    Mika

    Thanks ! it's working with resultFormat="e4x" tag in my
    HTTPService, but with some adaptations :
    I change the following :
    <mx:Tree labelField="nom"
    dataProvider="{GetSource.lastResult.sourcelist.source}"
    width="100%" x="0" height="100%" y="0"
    showRoot="false"></mx:Tree>
    By :
    <mx:Tree labelField="@nom"
    dataProvider="{GetSource.lastResult}" width="100%" x="0"
    height="100%" y="0" showRoot="false"></mx:Tree>
    Changes are about labelfield and dataprovider.
    Thanks for your help !

Maybe you are looking for

  • Account Payable - Scheduled Payments

    Hello All, I am working in AP and need to identify any invoices that have a scheduled pay dates in the future. This must have to do with the AP_PAYMENT_SCHEDULES_ALL table. Metalink says almost nothig about these fields. (1) Is the "creation_date" th

  • Is there a way for merging a same apple ID with different store region

    Hi, I have a problem of seeing my previous purchased as I used 2 different stores under the same apple id. I was using a US credit card and address until my credit card expired and after that I have been using my local Indonesian credit card with a l

  • Attention! Catalogs 1.3 are not compatible with 1.2.

    I've made rollback fom 1.3 because of UI problems in loupe library module. It caused problem with writing metadata for new pictures. Exited with restore of last 1.2 catalog from backup.

  • Terrible Experience

    I hate to be that guy, but after multiple issues with Best Buy's coupons, customer service rep, "Birthday coupons", etc, I have to say something. I recently purchased (or tried to) a Netgear Night Hawk R7000 frome BestBuy.com and elected for store pi

  • Boots up - Screen is blank

    The S10 worked fine the few times I used it, maybe a total of 30 hours.  Took it out last night after many months of no usage (I bought it for travel use).  It  seemed to boot up (with loud beeps) the hard drive is humming but the screen is blank.  I