cancel
Showing results for 
Search instead for 
Did you mean: 

XML for JNET or GANTT

0 Kudos

Hi all,

i am trying to use JNET for visualization our backend data.

I have already created simple prototype which stores the relevant <Graph> data within MIMES folder of the local WebDynpro Project. But now I want ro read data dynamicaly from backend, store them to XML and bind to the JNET context.

Would It be possible to modify directly the XML file stored in MIMES folder?

Or do I need to create my own XML file with appropriate data, store it on the J2EE filesystem and read again as resource? Or can I use "FileWriter" for creating a resource directly within WD context? What would be the best approach?

For binding the XML to JNET I used following code:

ISimpleTypeModifiable mod = wdContext.nodeSource().getNodeInfo().getAttribute("xml").getModifiableSimpleType();

IWDModifiableBinaryType bin = (IWDModifiableBinaryType) mod;

bin.setMimeType(new WDWebResourceType("xml", "application/octet-stream", false));

ISourceElement element = wdContext.nodeSource().createSourceElement();

wdContext.nodeSource().addElement(element);

try {

fileName = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "dtree2.xml");

element.setXml(readFile(fileName));

} catch (WDAliasResolvingException e) {

}

Thanx for any hint

Kamil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kamil,

Resolved your problem? . You did that? thanks !

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kamil,

You can either create the entire XML at runtime or else access the XML which is strored in the mimes folder and add or update certain tags and attributes.

Both the above mentioned approaches are possible.

For parsing you can either use DOM or SAX based on the size of the XML file.

Regards

Ayyapparaj

abhik_shome
Explorer
0 Kudos

Hi Kamil,

We use JNet extensively and we generate the <Graph></Graph> portion of the xml file at runtime through code. I guess that would give you the flexibility of getting the data form your resource and setting it.

Thanks.