KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > field > db > TKContentPathes


1 /**
2  * Jedes Selectstatement erhaelt eine eigene Klasse
3  */

4 package com.teamkonzept.field.db;
5
6 import com.teamkonzept.db.*;
7 import com.teamkonzept.lib.*;
8 import com.teamkonzept.field.db.*;
9 import com.teamkonzept.field.db.queries.*;
10
11 import java.sql.*;
12
13 public class TKContentPathes {
14
15     /************************************************************************
16     /**
17      * Erzeugt eine Hashtabelle mit Pfadnamen im Contenttree ...
18      *
19      * @param
20      */

21     public static TKHashtable getContentPathes () throws Throwable JavaDoc
22     {
23         TKQuery q = TKDBManager.newQuery(TKDBContentTreeDir.class);
24         q.execute();
25         ResultSet rs = q.fetchResultSet();
26
27         TKHashtable pathes = new TKHashtable();
28
29         while( rs.next() ) {
30
31             int leftNr = rs.getInt( "LEFT_NR" );
32             int rightNr = rs.getInt( "RIGHT_NR" );
33
34             int contentNodeId = rs.getInt( "CONTENT_NODE_ID" );
35             int contentNodeParent = rs.getInt( "CONTENT_NODE_PARENT" );
36             int formId = rs.getInt( "CONTENT_FORM" );
37             int nodeType = rs.getInt( "CONTENT_NODE_TYPE" );
38
39             String JavaDoc nodeName = rs.getString( "CONTENT_NODE_NAME" );
40             String JavaDoc nodeShortName = rs.getString( "CONTENT_NODE_SHORTNAME" );
41
42             if (nodeShortName == null) {
43
44                 continue;
45             }
46
47             if (contentNodeParent <= 0) {
48                 pathes.put (new Integer JavaDoc (contentNodeId),nodeShortName);
49             } else {
50
51                 String JavaDoc pstr = (String JavaDoc) pathes.get (new Integer JavaDoc (contentNodeParent));
52                 if (pstr == null) {
53                     continue;
54                 }
55
56                 pathes.put (new Integer JavaDoc (contentNodeId),pstr+"/"+nodeShortName);
57             }
58         }
59
60         return pathes;
61     }
62 }
63
Popular Tags