cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind dynamic data to JNet

Former Member
0 Kudos

Develop tools: NWDS 7.1

Server: Windows2000

Does anyone have experiences with using JNET within Webdynpro Project ?

In our case, we use JNet to generate a hierachical network diagram in the Webdypro's GUI. The data source is from the tables in a DB. However, till now, we only know how to let JNet generate the network diagram from a static XML file.

Since the data in the DB changes all the time, how to let the network diagram reflect the newest data status automatically? That is, how to bind JNet to a dynamic data source then?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Network UI element is related with Jnet. What you need to start up working with this is you need to create a context structure mentioned below.

Node:Source

Element--- xml -> this should be of type binary.

Place the following code in the init.

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(), "jnettest.xml");

element.setXml(readFile(fileName));

}

catch (WDAliasResolvingException e)

{}

You have to place the Jnet test.xml under the mimes folder of your application.

Place the network element in the view and in the data source specify the context attribute source.xml

if your xml file complies with the jnet schema your application will render it.

Pl go through this

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj,

Thank you for your professional answer.

Sorry, I didn't describe the issue quite clearly. What I actually want to achieve, is to let JNet read the changed data source automatically and rerender the Network GUI.

With your approach, after each little change, I have to save the whole data tables as a XML file and reload the XML file into JNet. It costs 2x times File saveing/loading plus the large time for saving the whole data tables.

Does Webdynpro support binding to dynamic data source so that after a data source change, only the part reletated to that change will be reloaded for rendering?

Former Member
0 Kudos

Hi,

Jnet supports the concept of delta xml. which is ideal in your scenario.

Currently i dont have any sample of this.

Regards

Ayyapparaj

Former Member
0 Kudos

That's really cool! I will search for the sample myself. Thank you so much.

Btw, does JNet only supports loading XML file? Since we have large data saved in RDB, it would be more meaningful to read the data from RDB directly than to save it first as XML file (The XML file has 50MB size and costs extra time for loading and rendering). Could you give me some suggestions on this case? Should we keep on using JNet or change to other tools?