File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes java code using prize Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "java code using prize Tags" Watch "java code using prize Tags" New topic
Author

java code using prize Tags

sanjib kumar mandal
Greenhorn

Joined: Jul 20, 2005
Posts: 8
Dear All,
Please help me for java coding using Prize Tags. Below i have written the java code that i have used in jsp page.

In this below code the the tree is already build in the ontology object and we are retrieving the tree. Let the tree be in the form like the rootnode is "thing" and child nodes are A,B,C,D. Suppose we want to create achild A1 with in node A and then we want to create a child A2 within the node A1. When we have created child A1 we are getting the parent A using session where the A stored for first case similarly we are obtaining A1, A and thing nodes(these are parent nodes) by using ITreeNode and ITree interface methods. But i want to highligt the parent under which i want to create the child for that i have used
select() method ,suppose i want to create a child with in A ie A1 for this i want to highlight the node A and for this i have used the method select(A) but the node A is not being highlighted insted the root node which is "thing" is being higligted.


if(session.getAttribute("tree.modelWb") == null && session.getAttribute("ontologyWb")!=null)
{
OWLOntology ontology = (OWLOntology)session.getAttribute("ontologyWb");
ITree tree = TreeBuilder.getTree(ontology);
//tree.unSelectAll();
System.out.println("The parent is "+(String)session.getAttribute("selectedParent"));
ITreeNode nodeName= tree.findNode((String)session.getAttribute("selectedParent"));
String assgnParent=(String)session.getAttribute("selectedParent");

String parentName="";
if(nodeName !=null){
parentName=nodeName.getName();
tree.expand(parentName);
ITreeNode parentNode;
ITreeNode parentNodeName=nodeName;
while(!parentName.equals("Thing"))
{
parentNode=parentNodeName.getParent();
String parenNam=parentNode.getName();
tree.expand(parenNam);
parentNodeName=parentNode;
parentName=parenNam;
}
tree.expand("Thing");
tree.unSelectAll();
}
//tree.unSelectAll();
//tree.select(parentName);
if(session.getAttribute("selectedParent") !=null)
{
tree.setSingleSelectionMode(true);
tree.select((String)session.getAttribute("selectedParent"));
System.out.println("++++++ the selected node is :+++++++" +(String)session.getAttribute("selectedParent"));
}

session.setAttribute("tree.modelWb", tree);
}




With Regards
sanjeev
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java code using prize Tags