cancel
Showing results for 
Search instead for 
Did you mean: 

Network UI Element

Former Member
0 Kudos

Hi experts

I need to do Organitaional chart in web dynpro

do you have samples

i don't need the reference to help

i want to see samples with the element

Thanks

Yossi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I Have Important question

Where I need to store file TypeRepository.xml

by the way

The datafile is stored in Mime Repository in directory <project name>/src/mimes/Components/<component name>.

and not in directory <project name>/src/mimes/Applications/<application name>. If you do so, you can refer to this file without specifying a directory.

Former Member
0 Kudos

Hi,

Try to add repository too part of the data file.

Regards

Ayyapparaj

Answers (6)

Answers (6)

Former Member
0 Kudos

One little question

when i put the application in iview in the portal

i can't see the orgchart

but when i deploy the app from WD

I see the org chart

i think the problem in the typerepository

where the file supposed to be?

and other gifs??

Former Member
0 Kudos

Hi,

Can you givethe method

readFromFileToByte (filename)

Best Regards

Yossi

Former Member
0 Kudos

Hi,

May be of use for you


private byte[] transformXmltoBytes(String fileName){
		try{
			File docFile = new File(fileName);
			DocumentBuilderFactory factory = DocumentBuilderFactoryImpl.newInstance();
			DocumentBuilder builder = factory.newDocumentBuilder();
			Document document = builder.parse(docFile);
		   	TransformerFactory xformFactory = TransformerFactoryImpl.newInstance();
			Transformer idTransform = xformFactory.newTransformer();
			ByteArrayOutputStream sw = new ByteArrayOutputStream();
			Source input = new DOMSource(document);
			Result output = new StreamResult(sw);
			idTransform.transform(input, output);
			return sw.toByteArray();
		}catch(Exception e)
		{
			throw new RuntimeException(e);
		}
	}	

Regards

Ayyapparaj

Former Member
0 Kudos

Hi

I have a few Question?

The DataFile supposed to be in Mimes/Appliaction?

and if You Have A new Code to Open The DataFile

without problem

Thanks

Best Regards

Yossi

Former Member
0 Kudos

Hi,

The DataFile supposed to be in Mimes/Appliaction?

Yes

Following is the code based on IWDResource

IXMLNodeElement element = null;//Your node Which contains the xml attribute of type IWDResource

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

byte xmldata[] = readFromFileToBytes(fileName);

ByteArrayInputStream is = new ByteArrayInputStream(xmldata);

element.setXml(WDResourceFactory.createResource(is, "", WDWebResourceType.XML, false));

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

I'm Sorry

but it's not work,

i can't open the link:

http://graphics1.wdf.sap.corp:1080/jnet/devdocs/schema/xml-spy/jnet-schema.html

do you have another link or another sample

i'ts very important to me

thanks

Yossi

Former Member
0 Kudos

Hi,

Following links might be of use for you

https://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-UsingGanttandNetworkUI+Element

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/f010ec31-9658-2910-3c83-c6e62904eceb

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj,

thank's fo example,

but can yo tell me what's the type of the variable filename

in the example

try

{

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

element.setXml(readFile(fileName));

}

catch (WDAliasResolvingException e)

{}

Former Member
0 Kudos

Hi,

That is an old code which uses byte instead of this you can make use of IWDResource in latest version on NW.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Following is what you need to do create an xml based on the schema from the jnet which suits your expected org chart

http://graphics1.wdf.sap.corp:1080/jnet/devdocs/schema/xml-spy/jnet-schema.html

Regards

Ayyapparaj