• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I think Im almost there with the tree..please let mw know what you think

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- - I feel like I am getting close with this finally - -

So as someone at the company Im doing this for so succinctly put it:

"Why not just build up the tree from the objects returned by simpleXML?

1) Call Web service
2) Use simple to parse XML into objects
3) loop through objects and add to TreeNode data"


Here I have a class to set a tree node with setters and getters:




edit - continued in reply
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or here we go -

I have



to get the data from the service, and then this to parse it:



So now I need to use this to set the value of data:



my problem I guess is what should go in node1.setData();

I think it will be one of three things:

node.setData(node.getChild(deviceId));

or

node.setData(data.getChild(deviceId));

or

node.setData(deviceCollection.getChild(deviceId));

Im playng around with it now, so hopefully I will have the answer on my own soon, but please let me know if you see me going wrong somewhere
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm

Ok I have a DeviceCollection class that looks like this:



And if I use simplexml to parse the follwoing into this list object:



What is this list going to look like? I need to study up more on java collections I think..
Im doing so now but if anyone can help clear it up it will save me some time
reply
    Bookmark Topic Watch Topic
  • New Topic