cancel
Showing results for 
Search instead for 
Did you mean: 

error in Java console

Former Member
0 Kudos

Hi experts

when I run Network UI Element

to presnt org Chart

I get in IE->Tools->Java Console

the follow error:

<<<--- Applet.destroy(): AppWin0/JNET --->>>

<<<--- EXIT for AppWin0/JNET --->>>

java.lang.NullPointerException

at sun.plugin.javascript.ocx.JSObject.eval(Unknown Source)

at com.sap.tc.webdynpro.ace.Acf2JavaScriptClient$1.run(Acf2JavaScriptClient.java:55)

at java.lang.Thread.run(Unknown Source)

ACF 7.1000.0.71

<<< frog.jar: version 5.4.6 02/01/06 sap.theme: null >>>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

please check the java script, activex are enabled on the browser.

Regards

Ayyapparaj

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

I need to change the activeX to disable

because The activeX is enabled

Former Member
0 Kudos

this is the file:

// -


// This file has been generated partially by the Web Dynpro Code Generator.

// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.

// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.

// -


package co.il.bnhp;

//

// IMPORTANT NOTE:

// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED

// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN

// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateOrgTree).

// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY

// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS

// OF IMPORT STATEMENTS.

//

//@@begin imports

import java.io.ByteArrayInputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.IOException;

import java.io.StringWriter;

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.parsers.FactoryConfigurationError;

import javax.xml.parsers.ParserConfigurationException;

import javax.xml.transform.OutputKeys;

import javax.xml.transform.Transformer;

import javax.xml.transform.TransformerConfigurationException;

import javax.xml.transform.TransformerException;

import javax.xml.transform.TransformerFactory;

import javax.xml.transform.TransformerFactoryConfigurationError;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.sax.SAXSource;

import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.DOMException;

import org.w3c.dom.DOMImplementation;

import org.w3c.dom.Document;

import org.w3c.dom.Element;

import org.w3c.dom.Entity;

import org.w3c.dom.Node;

import org.w3c.dom.Text;

import org.xml.sax.SAXException;

import co.i.bnhp.model.Zhr_Rfc_Disp_Manger_Employees2_Input;

import co.il.bnhp.wdp.IPrivateOrgTree;

import co.il.bnhp.wdp.IPublicOrgTree;

import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;

import com.sap.tc.webdynpro.progmodel.api.WDResourceFactory;

import com.sap.tc.webdynpro.services.sal.deployment.api.WDAliasResolvingException;

import com.sap.tc.webdynpro.services.sal.url.api.WDURLGenerator;

import com.sap.tc.webdynpro.services.sal.url.api.WDWebResource;

import com.sap.tc.webdynpro.services.sal.url.api.WDWebResourceType;

//@@end

//@@begin documentation

//@@end

public class OrgTree

{

/**

  • Logging location.

*/

private static final com.sap.tc.logging.Location logger =

com.sap.tc.logging.Location.getLocation(OrgTree.class);

static

{

//@@begin id

String id = "$Id$";

//@@end

com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);

}

/**

  • Private access to the generated Web Dynpro counterpart

  • for this controller class. </p>

*

  • Use <code>wdThis</code> to gain typed access to the context,

  • to trigger navigation via outbound plugs, to get and enable/disable

  • actions, fire declared events, and access used controllers and/or

  • component usages.

*

  • @see co.il.bnhp.wdp.IPrivateOrgTree for more details

*/

private final IPrivateOrgTree wdThis;

/**

  • Root node of this controller's context. </p>

*

  • Provides typed access not only to the elements of the root node

  • but also to all nodes in the context (methods node<i>XYZ</i>())

  • and their currently selected element (methods current<i>XYZ</i>Element()).

  • It also facilitates the creation of new elements for all nodes

  • (methods create<i>XYZ</i>Element()). </p>

*

  • @see co.il.bnhp.wdp.IPrivateOrgTree.IContextNode for more details.

*/

private final IPrivateOrgTree.IContextNode wdContext;

/**

  • A shortcut for <code>wdThis.wdGetAPI()</code>. </p>

  • Represents the generic API of the generic Web Dynpro counterpart

  • for this controller. </p>

*/

private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;

/**

  • A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>

  • Represents the generic API of the Web Dynpro component this controller

  • belongs to. Can be used to access the message manager, the window manager,

  • to add/remove event handlers and so on. </p>

*/

private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;

public OrgTree(IPrivateOrgTree wdThis)

{

this.wdThis = wdThis;

this.wdContext = wdThis.wdGetContext();

this.wdControllerAPI = wdThis.wdGetAPI();

this.wdComponentAPI = wdThis.wdGetAPI().getComponent();

}

//@@begin javadoc:wdDoInit()

/** Hook method called to initialize controller. */

//@@end

public void wdDoInit()

{

//@@begin wdDoInit()

buildDOM();

//@@end

}

//@@begin javadoc:wdDoExit()

/** Hook method called to clean up controller. */

//@@end

public void wdDoExit()

{

//@@begin wdDoExit()

//@@end

}

//@@begin javadoc:wdDoPostProcessing()

/**

  • Hook called to handle data retrieval errors before rendering.

*

  • After doModifyView(), the Web Dynpro Framework gets all context data needed

  • for rendering by validating the contexts (which in turn calls the supply

  • functions and supplying relation roles). In this hook, the application

  • should handle the errors which occurred during validation of the contexts.

  • Using preorder depth-first traversal, this hook is called for all component

  • controllers starting with the current root component.

*

  • Permitted operations:

  • - Flushing model queue

  • - Creating messages

  • - Reading context and model data

*

  • Forbidden operations:

  • - Invalidating model data

  • - Manipulating the context

  • - Firing outbound plugs

  • - Creating components

  • - ...

*

  • @param isCurrentRoot true if this is the root of the current request

*/

//@@end

public void wdDoPostProcessing(boolean isCurrentRoot)

{

//@@begin wdDoPostProcessing()

//@@end

}

//@@begin javadoc:wdDoBeforeNavigation()

/**

  • Hook before the navigation phase starts.

*

  • This hook allows you to flush the model queue and handle any

  • errors that occur. Firing outbound plugs is allowed in this hook.

*

  • Using preorder depth-first traversal, this hook is called for all component

  • controllers starting with the current root component.

*

  • @param isCurrentRoot true if this is the root of the current request

*/

//@@end

public void wdDoBeforeNavigation(boolean isCurrentRoot)

{

//@@begin wdDoBeforeNavigation()

//@@end

}

//@@begin javadoc:wdDoApplicationStateChange()

/**

  • Hook that informs the application about a state change.

  • <p>

  • This hook is called e.g. to tell the application that will be

  • <ul>

  • <li>left via a suspend plug and therefore should go into a suspend/sleep

  • mode with minimal need of resources. errors that occur. Firing

  • outbound plugs is allowed in this hook.

  • <li>left due to a timeout and could write it's state to a data base if the

  • user comes back later on

  • </ul>

*

  • The concrete reason is available via IWDApplicationStateChangeInfo

  • <p>

  • <b>Important</b>: This hook is called for the top level component only!

*

  • @param stateChangeInfo contains the information about the nature of the state change

  • @param stateChangeReturn allows the application to ask for a different state change.

  • The framework is allowed to ignore it considering i.e. the current resources situation.

*/

//@@end

public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)

{

//@@begin wdDoApplicationStateChange()

//@@end

}

//@@begin javadoc:buildDOM()

/** Declared method. */

//@@end

public void buildDOM( )

{

//@@begin buildDOM()

// File fileName = new File ("orgchart.xml");

wdThis.wdGetEmpUserIdInterface().getemp();

wdContext.currentContextElement().setPernrRet(wdContext.currentContextElement().getPernrRet());

Zhr_Rfc_Disp_Manger_Employees2_Input input = new co.i.bnhp.model.Zhr_Rfc_Disp_Manger_Employees2_Input();

wdContext.nodeZhr_Rfc_Disp_Manger_Employees2_Input().bind(input);

input.setP_Pernr("1511");

//input.setP_Pernr(wdContext.currentContextElement().getPernrRet());

try{

String xmlFile =WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "//tmp//tipex.xml");

File file = new File(xmlFile);

/////////////////////////////

//Creating an empty XML Document

//We need a Document

input.execute();

wdContext.nodeSource().invalidate();

DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();

DocumentBuilder docBuilder = dbfac.newDocumentBuilder();

// DOMImplementation impl = docBuilder.getDOMImplementation();

Document doc = docBuilder.newDocument();

////////////////////////

//Creating the XML tree

Element SapJNETData = doc.createElement("SAPJNetData");

SapJNETData.setAttribute("version","1.0");

doc.appendChild(SapJNETData);

// Element typeRepository = doc.createElement("TypeRepository");

// typeRepository.setAttribute("href","
tmp
TypeRepository.xml");

// SapJNETData.appendChild(typeRepository);

Element typeRepository = doc.createElement("TypeRepository");

typeRepository.setAttribute("id","orgchart");

typeRepository.setAttribute("version","1.0");

SapJNETData.appendChild(typeRepository);

Element color = doc.createElement("COLOR");

typeRepository.appendChild(color);

Element type1 = doc.createElement("type");

type1.setAttribute("name","OCBlue");

Element rgb1 = doc.createElement("rgb");

Text textRGB1 = doc.createTextNode("0,0,128");

color.appendChild(type1);

rgb1.appendChild(textRGB1);

type1.appendChild(rgb1);

Element type2 = doc.createElement("type");

type2.setAttribute("name","OCGray");

Element rgb2 = doc.createElement("rgb");

Text textRGB2 = doc.createTextNode("215,220,216");

color.appendChild(type2);

rgb2.appendChild(textRGB2);

type2.appendChild(rgb2);

Element type3 = doc.createElement("type");

type3.setAttribute("name","OCGrayer");

Element rgb3 = doc.createElement("rgb");

Text textRGB3 = doc.createTextNode("195,200,196");

color.appendChild(type3);

rgb3.appendChild(textRGB3);

type3.appendChild(rgb3);

Element type4 = doc.createElement("type");

type4.setAttribute("name","OCLighter");

Element rgb4 = doc.createElement("rgb");

Text textRGB4 = doc.createTextNode("235,240,236");

color.appendChild(type4);

rgb4.appendChild(textRGB4);

type4.appendChild(rgb4);

Element layout = doc.createElement("LAYOUT");

typeRepository.appendChild(layout);

Element typeLayout = doc.createElement("type");

typeLayout.setAttribute("name","OCLayout");

Element style = doc.createElement("style");

Text textStyle = doc.createTextNode("VERTICAL_FLOW");

layout.appendChild(typeLayout);

typeLayout.appendChild(style);

style.appendChild(textStyle);

Element label = doc.createElement("LABEL");

typeRepository.appendChild(label);

Element typeLabel1 = doc.createElement("type");

typeLabel1.setAttribute("name","OCLabelBase");

Element colorLabel = doc.createElement("color");

colorLabel.setAttribute("type","Black");

Element font1 = doc.createElement("font");

Element size1 = doc.createElement("size");

Text textSize1 = doc.createTextNode("12");

Element multiLine =doc.createElement("multiLine");

Text textMultiLine=doc.createTextNode("TRUE");

Element hAlign = doc.createElement("halign");

Text textHalign = doc.createTextNode("CENTER");

Element hAlignText = doc.createElement("halignText");

Text textHalignText = doc.createTextNode("CENTER");

Element border1 = doc.createElement("border");

Element insets1 = doc.createElement("insets");

insets1.setAttribute("top","3");

Element typeLabel2 = doc.createElement("type");

typeLabel2.setAttribute("name","OCLabelOrgUnit");

typeLabel2.setAttribute("inherits","OCLabelBase");

Element colorLabel2 = doc.createElement("color");

colorLabel2.setAttribute("type","OCBlue");

Element fillColorLabel2 = doc.createElement("fillColor");

fillColorLabel2.setAttribute("type","OCGrayer");

Element font2 = doc.createElement("font");

Element style2 = doc.createElement("style");

Text textStyle2 = doc.createTextNode("BOLD");

Element border2 = doc.createElement("border");

Element thickness = doc.createElement("thickness");

Text textThickness = doc.createTextNode("1");

Element Side = doc.createElement("sides");

Text textSide = doc.createTextNode("SOUTH");

Element typeLabel3 = doc.createElement("type");

typeLabel3.setAttribute("name","OCLabelNumber");

typeLabel3.setAttribute("inherits","OCLabelBase");

Element colorLabel3 = doc.createElement("color");

colorLabel3.setAttribute("type","OCBlue");

Element size3 = doc.createElement("size");

Text textSize3 = doc.createTextNode("40,0");

Element halign3 = doc.createElement("halign");

Text textHalign3 = doc.createTextNode("RIGHT");

Element multiLine3 = doc.createElement("multiline");

Text textMultiLine3 = doc.createTextNode("FALSE");

Element border3 = doc.createElement("border");

Element Thickness3 = doc.createElement("thickness");

Text textThickness3 = doc.createTextNode("1");

Element insets3 = doc.createElement("insets");

insets3.setAttribute("top","0");

Element Sides3 = doc.createElement("sides");

Text textSides3 = doc.createTextNode("NORTH,WEST");

Element typeLabel4 = doc.createElement("type");

typeLabel4.setAttribute("name","OCLabelChief");

typeLabel4.setAttribute("inherits","OCLabelBase");

Element font4 = doc.createElement("font");

Element style4 = doc.createElement("style");

Element border4 = doc.createElement("border");

Element insets4 = doc.createElement("insets");

insets4.setAttribute("top","6");

Element edgeT = doc.createElement("EDGE");

Element typeEdge= doc.createElement("type");

typeEdge.setAttribute("name","OCLink");

Element Shape = doc.createElement("shape");

Element ThickNess =doc.createElement("thickness");

Element targetDeco = doc.createElement("targetdeco");

targetDeco.setAttribute("shape","NONE");

Element nodeT = doc.createElement("NODE");

Element typeNode = doc.createElement("type");

typeNode.setAttribute("name","OCNodeBase");

Element shape = doc.createElement("shape");

shape.setAttribute("type","Box");

Element fillColor = doc.createElement("fillColor");

fillColor.setAttribute("type","OCGray");

Element borderNode = doc.createElement("border");

Element styleNode = doc.createElement("style");

Element plugs = doc.createElement("plugs");

plugs.setAttribute("min","0");

plugs.setAttribute("position","SOUTH");

plugs.setAttribute("positionMode","CENTRIC");

Element socket = doc.createElement("sockets");

socket.setAttribute("min","0");

socket.setAttribute("position","NORTH");

socket.setAttribute("positionMode","CENTRIC");

Element OCNode = doc.createElement("type");

OCNode.setAttribute("name","OCNode");

OCNode.setAttribute("inherits","OCNodeBase");

Element OCNodeShape = doc.createElement("shape");

Element OCNodeSize = doc.createElement("size");

OCNodeSize.setAttribute("pack","true");

Element OClayout = doc.createElement("layout");

OClayout.setAttribute("type","OCLayout");

Element OCNodeArrowUp = doc.createElement("type");

OCNodeArrowUp.setAttribute("name","OCNodeArrowUp");

OCNodeArrowUp.setAttribute("inherits","OCNodeBase");

Element OCNodeArrowShape = doc.createElement("shape");

Element OcNodeArrowSize = doc.createElement("size");

Element OcNodeArrowLabel = doc.createElement("label");

Element OcNodeArrowicon = doc.createElement("icon");

Element OcNodeArrowHalign = doc.createElement("halign");

Element OCNodeArrowDown = doc.createElement("type");

OCNodeArrowDown.setAttribute("name","OCNodeArrowDown");

OCNodeArrowDown.setAttribute("inherits","OCNodeArrowUp");

Element OCNodeArrowDownLabel = doc.createElement("label");

Element OcNodeArrowDownIcon = doc.createElement("icon");

Element NodeGraph = doc.createElement("Graph");

Element OCGraph = doc.createElement("type");

OCGraph.setAttribute("name","OCGraph");

Element direction = doc.createElement("direction");

Element components = doc.createElement("components");

Element OCGraphLayouts = doc.createElement("layouts");

Element types = doc.createElement("types");

Element OCGraphlayout = doc.createElement("layout");

OCGraphlayout.setAttribute("type","TREE");

Element property1 = doc.createElement("property");

property1.setAttribute("name","STYLE");

property1.setAttribute("value","VARIABLE_SIZE");

Element property2 = doc.createElement("property");

property2.setAttribute("name","OFFS_X");

property2.setAttribute("value","50");

Element property3 = doc.createElement("property");

property3.setAttribute("name","OFFS_Y");

property3.setAttribute("value","30");

Element Graph = doc.createElement("Graph");

Graph.setAttribute("type","OCGraph");

Graph.setAttribute("version","1.0");

Element layouts = doc.createElement("layouts");

layouts.setAttribute("onLoad","TREE");

Element view = doc.createElement("view");

Element grid = doc.createElement("grid");

Text TextGrid = doc.createTextNode("80,80");

Element UserInterface = doc.createElement("userInterface");

UserInterface.setAttribute("version","1.0");

Element mode = doc.createElement("mode");

label.appendChild(typeLabel1);

typeLabel1.appendChild(colorLabel);

typeLabel1.appendChild(font1);

font1.appendChild(size1);

size1.appendChild(textSize1);

typeLabel1.appendChild(multiLine);

multiLine.appendChild(textMultiLine);

typeLabel1.appendChild(hAlign);

hAlign.appendChild(textHalign);

typeLabel1.appendChild(hAlignText);

hAlignText.appendChild(textHalignText);

typeLabel1.appendChild(border1);

border1.appendChild(insets1);

label.appendChild(typeLabel2);

typeLabel2.appendChild(colorLabel2);

typeLabel2.appendChild(fillColorLabel2);

typeLabel2.appendChild(font2);

font2.appendChild(style2);

style2.appendChild(textStyle2);

typeLabel2.appendChild(border2);

border2.appendChild(thickness);

thickness.appendChild(textThickness);

border2.appendChild(Side);

Side.appendChild(textSide);

label.appendChild(typeLabel4);

typeLabel4.appendChild(font4);

font4.appendChild(style4);

style4.appendChild(doc.createTextNode("BOLD"));

typeLabel4.appendChild(border4);

border4.appendChild(insets4);

label.appendChild(typeLabel3);

typeLabel3.appendChild(colorLabel3);

typeLabel3.appendChild(size3);

size3.appendChild(textSize3);

typeLabel3.appendChild(halign3);

halign3.appendChild(textHalign3);

typeLabel3.appendChild(multiLine3);

multiLine3.appendChild(textMultiLine3);

typeLabel3.appendChild(border3);

border3.appendChild(Thickness3);

Thickness3.appendChild(textThickness3);

border3.appendChild(insets3);

insets3.setAttribute("top","0");

border3.appendChild(Sides3);

Sides3.appendChild(textSides3);

typeRepository.appendChild(edgeT);

edgeT.appendChild(typeEdge);

typeEdge.appendChild(Shape);

Shape.appendChild(doc.createTextNode("BENT"));

typeEdge.appendChild(ThickNess);

ThickNess.appendChild(doc.createTextNode("1"));

typeEdge.appendChild(targetDeco);

typeRepository.appendChild(nodeT);

nodeT.appendChild(typeNode);

typeNode.appendChild(shape);

shape.appendChild(fillColor);

shape.appendChild(borderNode);

borderNode.appendChild(styleNode);

styleNode.appendChild(doc.createTextNode("RAISED"));

typeNode.appendChild(plugs);

typeNode.appendChild(socket);

nodeT.appendChild(OCNode);

OCNode.appendChild(OCNodeShape);

OCNodeShape.appendChild(OCNodeSize);

OCNodeSize.appendChild(doc.createTextNode("150,0"));

OCNode.appendChild(OClayout);

nodeT.appendChild(OCNodeArrowUp);

OCNodeArrowUp.appendChild(OCNodeArrowShape);

OCNodeArrowShape.appendChild(OcNodeArrowSize);

OcNodeArrowSize.appendChild(doc.createTextNode("22,21"));

OCNodeArrowUp.appendChild(OcNodeArrowLabel);

OcNodeArrowLabel.appendChild(OcNodeArrowicon);

OcNodeArrowicon.appendChild(doc.createTextNode("apps/orgchart/arrow-up.gif"));

OcNodeArrowLabel.appendChild(OcNodeArrowHalign);

OcNodeArrowHalign.appendChild(doc.createTextNode("CENTER"));

nodeT.appendChild(OCNodeArrowDown);

OCNodeArrowDown.appendChild(OCNodeArrowDownLabel);

OCNodeArrowDownLabel.appendChild(OcNodeArrowDownIcon);

OcNodeArrowDownIcon.appendChild(doc.createTextNode("apps/orgchart/arrow-down.gif"));

typeRepository.appendChild(NodeGraph);

NodeGraph.appendChild(OCGraph);

OCGraph.appendChild(direction);

direction.appendChild(doc.createTextNode("TOP_BOTTOM"));

OCGraph.appendChild(components);

components.appendChild(doc.createTextNode("OCNode"));

OCGraph.appendChild(OCGraphLayouts);

OCGraphLayouts.appendChild(types);

types.appendChild(doc.createTextNode("TREE"));

OCGraphLayouts.appendChild(OCGraphlayout);

OCGraphlayout.appendChild(property1);

OCGraphlayout.appendChild(property2);

OCGraphlayout.appendChild(property3);

SapJNETData.appendChild(UserInterface);

UserInterface.appendChild(mode);

mode.appendChild(doc.createTextNode("SELECTONLY"));

SapJNETData.appendChild(Graph);

Graph.appendChild(layouts);

Graph.appendChild(view);

view.appendChild(grid);

grid.appendChild(TextGrid);

for (int i=0; i<wdContext.nodeZhr_Rfc_Employees2().size(); i++) {

IPublicOrgTree.IEmpElement Emp = wdContext.nodeEmp().createEmpElement();

IPublicOrgTree.IZhr_Rfc_Employees2Element curEmp = wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i);

Element node = doc.createElement("node");

node.setAttribute("id",curEmp.getEmp_Pernr());

node.setAttribute("type","OCNode");

Element label1 = doc.createElement("label");

label1.setAttribute("type","OCLabelOrgUnit");

Text TextLabel1 = doc.createTextNode(curEmp.getEmp_Name());

Element label2 = doc.createElement("label");

label2.setAttribute("type","OCLabelChief");

Text TextLabel2 = doc.createTextNode(curEmp.getEmp_Pernr());

Graph.appendChild(node);

node.appendChild(label1);

label1.appendChild(TextLabel1);

node.appendChild(label2);

label2.appendChild(TextLabel2);

wdContext.nodeEmp().addElement(Emp);

}

for (int i=0; i<wdContext.nodeZhr_Rfc_Employees2().size()-1; i++) {

IPublicOrgTree.IEmpElement Emp = wdContext.nodeEmp().createEmpElement();

IPublicOrgTree.IZhr_Rfc_Employees2Element curEmp = wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i);

for (int j=i1; j<wdContext.nodeZhr_Rfc_Employees2().size(); j+)

if (wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(i).getEmp_Pernr().equals(wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(j).getEmp_Manager()))

{

Element edge = doc.createElement("edge");

edge.setAttribute("type","OCLink");

Element from = doc.createElement("from");

from.setAttribute("node",curEmp.getEmp_Pernr());

Element to = doc.createElement("to");

to.setAttribute("node",wdContext.nodeZhr_Rfc_Employees2().getZhr_Rfc_Employees2ElementAt(j).getEmp_Pernr());

Graph.appendChild(edge);

edge.appendChild(from);

edge.appendChild(to);

}

}

// typeLabel3.appendChild()

// Element font = doc.createElement("font");

// .appendChild(color);

// type1.appendChild(rgb1);

//create a comment and put it in the root element

// Comment comment = doc.createComment("Just a thought");

// type1.appendChild(comment);

//create child element, add an attribute, and add to root

// Element child = doc.createElement("child");

//child.setAttribute("name", "value");

//type.appendChild(child);

//add a text element to the child

/////////////////

//Output the XML

//set up a transformer

TransformerFactory transfac = TransformerFactory.newInstance();

Transformer trans = transfac.newTransformer();

trans.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-8");

trans.setOutputProperty(OutputKeys.INDENT, "yes");

//create string from xml tree

StringWriter sw = new StringWriter();

StreamResult result = new StreamResult(file);

DOMSource source = new DOMSource(doc);

trans.transform(source, result);

wdContext.currentContextElement().setXmlString(sw.toString());

} catch (DOMException e) {

wdComponentAPI.getMessageManager().reportException("2-"+e.getMessage(),true);

} catch (TransformerConfigurationException e) {

wdComponentAPI.getMessageManager().reportException("3-"+e.getMessage(),true);

} catch (IllegalArgumentException e) {

wdComponentAPI.getMessageManager().reportException("4-"+e.getMessage(),true);

} catch (FactoryConfigurationError e) {

wdComponentAPI.getMessageManager().reportException("5-"+e.getMessage(),true);

} catch (ParserConfigurationException e) {

wdComponentAPI.getMessageManager().reportException("6-"+e.getMessage(),true);

} catch (TransformerFactoryConfigurationError e) {

wdComponentAPI.getMessageManager().reportException("7-"+e.getMessage(),true);

} catch (TransformerException e) {

wdComponentAPI.getMessageManager().reportException("8!-"+e.getMessage(),true);

}

catch (WDDynamicRFCExecuteException e) {

wdComponentAPI.getMessageManager().reportException("9!-"+e.getMessage(),true);

}

catch (WDAliasResolvingException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

// catch (IOException e) {

// wdComponentAPI.getMessageManager().reportException("10-"+e.getMessage(),true);

//

// }

// catch (SAXException e) {

// // TODO Auto-generated catch block

// e.printStackTrace();

// }

//@@end

}

//@@begin javadoc:supplySource(IWDNode,IWDNodeElement)

/**

  • Declared supply function for IPrivateOrgTree.ISourceNode.

  • This method is called when the node is invalid and the collection is

  • requested. This may occur during any phase, even at the beginning to

  • initialize the node. The method is expected to fill the node

  • collection using IWDNode.bind(Collection) or

  • IWDNode.addElement(IWDNodeElement).

*

  • @param node the node that is to be filled

  • @param parentElement The element that this node is a child of. May be

  • <code>null</code> if there is none.

  • @see com.sap.tc.webdynpro.progmodel.api.IWDNode#bind(Collection)

  • @see com.sap.tc.webdynpro.progmodel.api.IWDNode#bind(IWDNodeElement)

*/

//@@end

public void supplySource(IPrivateOrgTree.ISourceNode node, IPrivateOrgTree.IContextElement parentElement)

{

//@@begin supplySource(IWDNode,IWDNodeElement)

IPublicOrgTree.ISourceElement element =node.createSourceElement();

node.addElement(element);

try{

String orgChart =WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "//tmp//tipex.xml");

String demo =WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "orgchart.xml");

FileInputStream is = new FileInputStream(demo);

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

}

// handle exceptions properly ifthis were not a demo app

catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

catch (WDAliasResolvingException e)

{

wdComponentAPI.getMessageManager().reportWarning("");

}

catch (IOException e){}

// catch (WDAliasResolvingException e)

catch (NullPointerException e)

{

wdComponentAPI.getMessageManager().reportWarning("xx");

}

//@@end

}

/*

  • The following code section can be used for any Java code that is

  • not to be visible to other controllers/views or that contains constructs

  • currently not supported directly by Web Dynpro (such as inner classes or

  • member variables etc.). </p>

*

  • Note: The content of this section is in no way managed/controlled

  • by the Web Dynpro Designtime or the Web Dynpro Runtime.

*/

//@@begin others

//@@end

}

// -


content of obsolete user coding area(s) -


//@@begin obsolete:CreateXML()

//@@end

//@@begin obsolete:javadoc:getTree()

// /** Declared method. */

//@@end

//@@begin obsolete:javadoc:CreateXML()

// /** Declared method. */

//@@end

//@@begin obsolete:javadoc:getFile()

// /** Declared method. */

//@@end

//@@begin obsolete:getTree()

//

//

//

//

//@@end

//@@begin obsolete:getFile()

////

//@@end

can you fix the errors?

10x

yossi

Former Member
0 Kudos

do you have idea about solution

best regards

Yossi