Generate Tree Structure from DB - XSQL??
We have a table that contains a tree structure using Parent/Child fields. We use "Connect By" to extract this in normal applications to show in a tree control.
We now want this in XML format output by our web server, where a client side app running in the browser can load this.
I have looked at XSQL utility but it looks to only generate a simple flat structure.
Anyone have an idea of how to automatically create a tree structure straight from the DB?
Thanks
Rob
You downloaded the wrong XML Parser!
XSQL requires Java Parser. Well, there's a copy included with the XSQL package so you actually don't need to do another download.
You really don't need XSQL if you just want a XML file from DB, you just needed a XML SQL Utility. Download that and run the samples.
Similar Messages
-
How to populate Tree structure from BAPI while tree grows or shrinks
Hi All
Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc) updating successfully& correctly into the BAPI, no issues.
Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
Thanks in advance
Regards
Kalki Reddy
Edited by: KalkiReddy on Nov 29, 2009 3:48 PMBapi output node:
Value | Text | HLevel
01 | A | 1
0101 | AA | 2
010101 | AAA | 3
01010B | AAB | 3
0102 | AB | 2
02 | B | 1
0201 | BA | 2
This code is used to build the tree in wdDoInit method
IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
int size = catalogueNode.size();
ICatalogoElement level1elem = null;
for (int i = 0; i < size; i ++)
IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
if (catalogueElem.getLevel().equals("1"))
// 1 Livello
level1elem = wdContext.createCatalogoElement();
level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
level1elem.setCODE(catalogueElem.getCode());
level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
wdContext.nodeCatalogo().addElement(level1elem);
for (int j = i + 1; j < size; j ++)
IE_T_CatalogueElement catalogueElem2level =
catalogueNode.getE_T_CatalogueElementAt( j );
String level2 = catalogueElem2level.getLevel();
if (level2.equals("2"))
ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
level2elem.setCODE(catalogueElem2level.getCode());
level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
level1elem.nodeChild().addElement(level2elem);
for (int k = j + 1; k < size; k ++)
IE_T_CatalogueElement catalogueElem3level =
catalogueNode.getE_T_CatalogueElementAt( k );
String level3 = catalogueElem3level.getLevel();
if (level3.equals("3"))
ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
level3elem.setCODE(catalogueElem3level.getCode());
level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
level3elem.setDESCR(catalogueElem3level.getCode_Descr());
level2elem.nodeChild().addElement(level3elem);
Damiano -
How to Show floders and documents as a tree structure from path only
sir,
I am doing system side project using Java..
so i want to know how to show folders and documents as tree structure format..
plz give your idea regarding this?See for example Tree taglib in Coldtags suite:
http://www.servletsuite.com/jsp.htm -
Loading in tree structure from arraylist
Hi,
I have a ArrayList contains xml file path like
ArrayList al={"/folder1/sub1/sub11/1.xml",
"/folder1/sub1/2.xml,
"/folder1/test1/3.xml",
"/folder2/sub2/4.xml",
"/folder2/sub2/sub3/5.xml"}
Note: 1.This arraylist objects are dynamically loaded.
2.The objects in array list are not file system directory path like (e.g., C:/folder1/sub1/.....). Its string added in arraylist.
using this arraylist i want to load it in jsp tree structure, like
folder1
|___sub1
| |_sub11
| | |__1.xml
| |_2.xml
|___test1
|_3.xml
folder2
|
|_sub2
|___4.xml
|___sub3
|___5.xml
Can any one help me with logic or predefined function in java to iterate each string array object and split parent and sub child folder and load it in tree.
Edited by: manjunath_2284 on Aug 11, 2009 6:04 AMCreate a Node class that has a name and Map<String, Node> as children.
Iterate over the list, split each entry on "/", and place the parts that you get into the Node structure. -
Rendering Tree Structure from nested Iterators
I am attempting to create a master-detail tree structure using nested iterators using JDeveloper 11.1.1.6.0. I have my data control set up and the master - child relation is set up using a view link.
The intent is to be able to have a form that results in the following basic design:
------------------|
parent 1 details
-child 1 details and operations
-child 2 details and operations
------------------|
parent 2 details
-child 3 details and operations
------------------|
Thus far when I've tried nested iterators using the data control, I instead get the following:
------------------|
parent 1 details
-child 1 details and operations
-child 2 details and operations
-child 3 details and operations
------------------|
parent 2 details
------------------|
-child 1 details and operations
-child 2 details and operations
-child 3 details and operations
------------------|
I've attempted to get this to work by using two completely seperate binding iterators, each tied to a different af:iterator in the following structure:
<af:iterator id="i1" value="#{bindings.parent.collectionModel} var="row" rows="#{bindings.parentIterator.rangeSize}">
<af:panelBox text="#{row.bindings.detail.inputValue}">
<af:iterator id="i2" value="#{bindings.child.collectionModel}" var="row2" rows="#{bindings.childIterator.rangeSize}">
<af:outputText value="#{row2.bindings.detail.inputValue}"/>
</af:iterator>
</af:panelBox>
</af:iterator>However, this renders the above situation. I have not been ablue to figure out how to have the second iterator's values be dependant on the current row of the first iterator. I can get the organizational structure to work using an af:tree element and my data control. However, I cannot modify the look of the af:tree elements to match what is required by the customer, nor do I beleive that I could create the required functionality using it. Does anyone have any suggestions on how to get this to work?
Thank you
Edited by: user13468716 on May 15, 2012 6:23 AMYou can't use collectionModel for both the iterators. You will either need to create a treeBinding with a tree level rule and refer the first one as +#{bindings.<TreeBindingName>.treeModel}+ name it as row
and refer to the next iterator as #{row.<TreeLevelRuleName>}.
This will atleast create the stamping of the rows properly.Something like this -
<af:iterator id="i1" value="#{bindings.parent.treeModel} var="row" rows="#{bindings.parentIterator.rangeSize}">
<af:panelBox text="#{row.bindings.detail.inputValue}">
<af:iterator id="i2" value="#{row.child}" var="row2" rows="#{bindings.childIterator.rangeSize}">
<af:outputText value="#{row2.bindings.detail.inputValue}"/>
</af:iterator>
</af:panelBox>
</af:iterator>where +parent+ is a treeBinding having +child+ as a tree level rule
Edited by: Sudipto Desmukh on May 15, 2012 6:57 PM -
How to get tree structure from file list?
I have got following rows from my select query presenting a folder structure:
PATH
/KING/JONES/SCOTT
/KING/JONES/SCOTT/ADAMS
/KING/JONES/FORD
/KING/JONES/FORD/SMITH
/KING/BLAKE
/KING/BLAKE/ALLEN
/KING/BLAKE/WARD
/KING/BLAKE/MARTIN
/KING/BLAKE/TURNER
/KING/BLAKE/JAMES
/KING/CLARK
/KING/CLARK/MILLER
/PALO/TEMP
On base of this data I need to build tree in my application by effecient way.
Therefore i would like to achieve data (SELECT with two columns) as bellow:
FOLDER PARENTFOLDER
KING NULL
JONES KING
SCOTT KING/JONES
ADAMS KING/JONES/SCOTT
FORD KING/JONES
SMITH KING/JONES/FORD
BLAKE KING
ALLEN KING/BLAKE
WARD KING/BLAKE
MARTIN KING/BLAKE
TURNER KING/BLAKE
JAMES KING/BLAKE
CLARK KING
MILLER KING/CLARK
PALO NULL
TEMP PALOIs this possible to do it on SQL level(not PL SQL)?
ThanksPerhaps something like this?
SQL> ed
Wrote file afiedt.buf
1 with t as (select '/KING/JONES/SCOTT' as path from dual union all
2 select '/KING/JONES/SCOTT/ADAMS' from dual union all
3 select '/KING/JONES/FORD' from dual union all
4 select '/KING/JONES/FORD/SMITH' from dual union all
5 select '/KING/BLAKE' from dual union all
6 select '/KING/BLAKE/ALLEN' from dual union all
7 select '/KING/BLAKE/WARD' from dual union all
8 select '/KING/BLAKE/MARTIN' from dual union all
9 select '/KING/BLAKE/TURNER' from dual union all
10 select '/KING/BLAKE/JAMES' from dual union all
11 select '/KING/CLARK' from dual union all
12 select '/KING/CLARK/MILLER' from dual union all
13 select '/PALO/TEMP' from dual
14 )
15 --
16 -- END OF TEST DATA
17 --
18 select distinct substr(path,instr(path,'/',1,rn)+1,decode(instr(path,'/',1,rn+1),0,length(path)+1,instr(path,'/',1,rn+1))-instr(path,'/',1,rn)-1) as folder, substr(path,2,instr(path,'/',1,rn)-2) as parent
19 from t
20 cross join (select rownum rn from dual connect by rownum <= (select max(length(regexp_replace(path,'[^/]'))) from t)) x
21* where instr(path,'/',1,rn) > 0
SQL> /
FOLDER PARENT
BLAKE KING
SCOTT KING/JONES
JAMES KING/BLAKE
MARTIN KING/BLAKE
SMITH KING/JONES/FORD
KING
WARD KING/BLAKE
ADAMS KING/JONES/SCOTT
FORD KING/JONES
TURNER KING/BLAKE
MILLER KING/CLARK
PALO
TEMP PALO
JONES KING
CLARK KING
ALLEN KING/BLAKE
16 rows selected.
SQL> -
Tree movement from Peoplesoft to Hyperion
Hi all,
I'm new to DRM and presently working on implementing a project where DRM would be used to manage the Hierarchies and Peoplesoft would be the main application which would send tree structures to DRM on an adhoc basis. My Question is,
1. What are are ways to move tree structures from P.S into DRM ?
One thing is to take exports from P.S ,then manipulate it to a DRM readable format and then import it into DRM (and then Blend with the existing tree). But what are the other options available here?
2. Also, how to set up Hyperion DRM initially with the P.S tree structures?
Regards,
SuviHave you seen this one: http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/hyperion_hps.chm
Cheers,
Mehmet -
How do I read text from specific rows and columns in a tree structure?
How do I read text from specific rows and columns in a tree structure? In a table you can specify the cell to read from but I have not been able to figure out how to do this with a tree structure.
You need to set two properties to activate the correct cell and then you can read it's string property.
The positioning properties are the "ActiveItemTag" and
"ActiveColNum" properties. With them you select the tree item by it's tag and the active column. The string can then be read from the "Cell String" property.
MTO -
Create a Tree Node Structure from XML
Hi
We have a requirement where we have an XML file we want to create the Tree Node structure from the XML can anyone help out on this
We are referring to the following blog but in that it is coming from KM content and we require the tree structure to form from a XML file
http://wiki.sdn.sap.com/wiki/display/Snippets/SmartNavigationTreeforKM+Folders
Can anyone help me
Regards
JMHi,
Could you elaborate a litle more exacly what you need to do?
I found the link http://help.sap.com/saphelp_470/helpdata/en/86/8280db12d511d5991b00508b6b8b11/content.htm that maybe assist you.
Please remember to evaluate the replays, this incentive the SDN to keep growing,
regards,
Fabio -
Is there a property node somewhere that can retrieve the tags of all the children of an "active" parent tag in a tree structure? If I click on the parent tag, I want to be able to show what child tags are under that parent tag.
There is not a property or method that I have been able to find, however I wrote this VI that given a parent tag returns all the children.
Evan Collier
Attachments:
Get_1_Lv_of_children.vi 59 KB -
Hi,
I have to generate a tree kind of list(nodes collapsable and expandable)based on a table.
My table is containing 3 fields relevent to this task.
one field(F1) contains nodes, second field(f2) contains the parent node of node in F1, the third field(f3) contains one of its child node.
-> A NODE IN F1 HAVING F2 AS EMPTY WILL BE A ROOT NODE WHICH COMES IN THE UPPERMOST LEVEL.
->A NODE MAY HAVE MULTIPLE CHILD NODES, i.e. DIFFERENT F3 ENTRIES WILL EXIST FOR A COMBINATION OF F1 AND F2.
My requirement is... Can anyone tell me the relevant FUNCTION MODULE which takes these fields as input and generate me tree structure(nodes collapseble and expandable) in list...???hi,
check the sample code...
REPORT ZTEST_TREE.
TABLES: KNVH.
TYPES: BEGIN OF WORKTYPE,
LEVEL(2),
HKUNNR LIKE KNVH-KUNNR,
KUNNR LIKE KNVH-HKUNNR,
END OF WORKTYPE.
DATA: IT_KNVH TYPE TABLE OF WORKTYPE,
WA_KNVH LIKE LINE OF IT_KNVH,
IT_TEMP TYPE TABLE OF WORKTYPE,
WA_TEMP LIKE LINE OF IT_TEMP,
IT_WORK TYPE TABLE OF WORKTYPE,
WA_WORK LIKE LINE OF IT_WORK.
DATA : BEGIN OF IT_NODES OCCURS 0.
INCLUDE STRUCTURE SNODETEXT.
DATA : END OF IT_NODES.
CONSTANTS: NUMBER_OF_LEVELS TYPE I VALUE 6.
PARAMETER: P_HKUNNR LIKE KNVH-HKUNNR.
START-OF-SELECTION.
* Parent = 1. hierarchy node
WA_TEMP-KUNNR = P_HKUNNR.
APPEND WA_TEMP TO IT_TEMP.
WA_WORK-KUNNR = WA_TEMP-KUNNR.
WA_WORK-LEVEL = 1.
APPEND WA_WORK TO IT_WORK.
* Reading customer hierarchy (max. 6 level)
DO NUMBER_OF_LEVELS TIMES.
CHECK NOT IT_TEMP IS INITIAL.
SELECT KUNNR HKUNNR
FROM KNVH
INTO CORRESPONDING FIELDS OF TABLE IT_KNVH
FOR ALL ENTRIES IN IT_TEMP
WHERE HKUNNR = IT_TEMP-KUNNR.
LOOP AT IT_KNVH INTO WA_KNVH.
WA_KNVH-LEVEL = SY-INDEX + 1.
APPEND WA_KNVH TO IT_WORK.
ENDLOOP.
IT_TEMP[] = IT_KNVH[].
ENDDO.
* Hierarchy nodes -> tree control
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 1.
PERFORM MAKE_NODE.
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 2 AND
HKUNNR = WA_WORK-KUNNR.
PERFORM MAKE_NODE.
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 3 AND
HKUNNR = WA_WORK-KUNNR.
PERFORM MAKE_NODE.
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 4 AND
HKUNNR = WA_WORK-KUNNR.
PERFORM MAKE_NODE.
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 5 AND
HKUNNR = WA_WORK-KUNNR.
PERFORM MAKE_NODE.
LOOP AT IT_WORK INTO WA_WORK WHERE LEVEL = 6 AND
HKUNNR = WA_WORK-KUNNR.
PERFORM MAKE_NODE.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDLOOP.
* Making the tree control
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
NODETAB = IT_NODES
EXCEPTIONS
TREE_FAILURE = 1.
* Display the tree control
DATA : F15 TYPE C.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
CALLBACK_PROGRAM = SY-REPID
IMPORTING
F15 = F15 .
FORM MAKE_NODE.
IT_NODES-NAME = 'test'.
IT_NODES-COLOR = 1.
IT_NODES-INTENSIV = 1.
IT_NODES-TEXT = WA_WORK-KUNNR.
IT_NODES-TLENGTH = 16.
IT_NODES-TLEVEL = WA_WORK-LEVEL.
IT_NODES-TCOLOR = 1.
IT_NODES-TINTENSIV = 1.
APPEND IT_NODES.
ENDFORM.
Regards
vijay -
layout:treeview Closed tree structure?
HI,
I'm able to generate the tree view structure
but the problem is, when close & open the window , it is showing open tree structure
i want it to be close tree view
<layout:treeview expandedLevelsAtFirst="-1" >
<logic:present name="agrovoc" >
<logic:iterate id="agrovoc" name="agrovoc" scope="session">
<c:set var="term" value="${agrovoc.AGTerm}" />
<c:set var="bterm" value="${agrovoc.AGBTerm}" />
<c:set var="nterm" value="${agrovoc.AGNTerm}" />
<c:set var="rterm" value="${agrovoc.AGRTerm}" />
<layout:menuItem key="${agrovoc.AGURI}" link="#" >
<logic:notEmpty name="bterm">
<layout:menuItem key="BroaderTerms">
<layout:menuItem key="${agrovoc.AGBURI}" link="#"/>
</layout:menuItem>
</logic:notEmpty>
<logic:notEmpty name="nterm">
<layout:menuItem key="NarrowerTerms">
<layout:menuItem key="${agrovoc.AGNURI}" link="#" />
</layout:menuItem>
</logic:notEmpty>
<logic:notEmpty name="rterm">
<layout:menuItem key="RelatedTerms">
<layout:menuItem key="${agrovoc.AGRURI}" link="#" />
</layout:menuItem>
</logic:notEmpty>
</layout:menuItem>
</logic:iterate>
</logic:present>
</layout:treeview>I'm using the above code, the tree structure in turn call the java script for tits operations
i even cleared the session object also, but no use..
how to solve this..?Thanks a lot for the help so far, I've created a method to check the basePanel for any components it holds and try to create a JTree display from it. The code I currently have is :
public void updateObjectSelector()
// Setup the tree viewer
DefaultMutableTreeNode root = new DefaultMutableTreeNode(basePanel.getClass());
addChildren(root, basePanel);
tree = new JTree(root);
public void addChildren(DefaultMutableTreeNode root, JPanel parent)
Component [] children = parent.getComponents();
for(int i = 0; i < children.length; i++)
DefaultMutableTreeNode child = new DefaultMutableTreeNode(children.getClass());
try
addChildren(child, (JPanel) children[i]);
catch(ClassCastException e)
root.add(child);
basePanel and tree are both global variables. basePanel is the root Panel to which everything is added to.
I am calling "updateObjectSelector()" every time a component is added to the basePanel but at the moment all I can get displayed by the JTree is the getClass() of the basePanel, none of its children are being displayed. Can anyone see what I have done wrong here?
Many thanks again for all your help so far. -
Tree Structure generation in content management
Hi,
I am new to Oracle portals.I have a task of generating a default
tree structure based on say somes values from database eg: DEALS1,DEALS2, DEALS3 displayed, when I create or click any of these it should open a dynamic folder structure depending on users security level.One of the examples oracle uses is when you create a content area, by default portal generates Folders
folder , Category folder, Navigation bar folders , etc.
2. Is it possible to achieve tree similar to the one Oracle Portal displays when we open a default content page and click Content Area Map on top left , i.e with folders expands and closes on each click to Icon.
Thanks
MorozovIs it feasible in your scenario to simply set the unwanted folders to "hidden" or is it completely ACL-based? With the regular end-user explorers (e.g. ConsumerExplorer), hidden folders won't be shown (this is a setting of the corresponding collection renderer). Administrative Explorers (e.g. Admin Explorer) do show hidden files, though. Note that you can only modify the hidden state with such an administrative explorer. This makes sure that you have at least one way to reset that state and to not hide it in an explorer that afterwards does not show the file and thus would not allow you to reverse that step (in principle this means that users with no administrative accesses whatsoever will never be able to hide resources).
Regards, /-/ans-Juergen -
How to create a form on a tree structured table
Hi,
I have a table that is designed to do a tree structure like:
Table Name: test
Fields:
ID
ParentID
Description
I created a browser (IR) (page 1) that calls a form (page 2)
The form has the editing fields and at the bottom layer I have a reports region where I display the children records using a query like:
select * from test where ParentID = :P2_ID
I need at the region level to add a button to call a form to edit the child record (which is the same table) and when done, to return to the form again but to the parent record.
How can I do that successfully? Is there any example:?
Thank youMaybe this can help:
http://apex.oracle.com/pls/otn/f?p=31517:157
using instead of trigger on a view.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
How to get Tree structure in JSP page?
Hi,
I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
can any one help me out by sending any example code?
thanks in advance.
Regards,
ReddyOnce you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
<html>
<style>
li
list-style-type:none;
</style>
<body>
<form>
<ul>
<li>
<input type="checkbox">Check 1</input>
<ul>
<li>
<input type="checkbox">Check 1A</input>
</li>
<li>
<input type="checkbox">Check 1B</input>
</li>
</ul>
</li>
<li>
<input type="checkbox">Check 2</input>
<ul>
<li>
<input type="checkbox">Check 2A</input>
</li>
</ul>
</li>
<li>
<input type="checkbox">Check 3</input>
</li>
</ul>
</form>
</body>
</html>
Maybe you are looking for
-
Can no longer print a web page. I use the drop down "fie" menu and the "print" command the HP4180 series appears to recognize the command but delivers only a blank page
-
Where can high-power video cards be installed on a first-gen Mac Pro?
I have a first-gen Mac Pro with a Radeon X1900 XT in Slot-1 and a Geforce 7300 GT in Slot-4. The x1900 XT powers a 30" monitor and the 7300GT powers 2 x 20" monitors. The 7300GT card died and is being replaced with an 8800 GT. Now it seems fairly obv
-
Trading partner updation in the accounting document
Dear All, We have updated the trading partner in the vendor master. While MIRO I find the same is getting updated in the vendot line items but it is not getting updated in the other line itmes of the accounting document. Please suggest hot to populat
-
G4 533mhz and 10.4.3
Why is it that i cant seem to upgrade to 10.4.3 from (MacOSXUpdateCombo10.4.3.dmg) I'm now using 10.4.1 but for some video camera support i would like to be able to upgrade and it's not letting me ? i have read most the documentation and it sais ever
-
HI gurus, When we run APP for payment vendor invoice and generate the accounting doc like, Vendor A/C Dr. To Bank A/C. This Bank a/c is Bank Sub A/C( means GL A/C) but my moto is the balance allso should effect bank main a/c. for this we need to p