01: /**
02: * Jedes Selectstatement erhaelt eine eigene Klasse
03: */package com.teamkonzept.field.db;
04:
05: import com.teamkonzept.db.*;
06: import com.teamkonzept.lib.*;
07: import com.teamkonzept.field.db.*;
08: import com.teamkonzept.field.db.queries.*;
09:
10: import java.sql.*;
11:
12: public class TKContentPathes {
13:
14: /************************************************************************
15: /**
16: * Erzeugt eine Hashtabelle mit Pfadnamen im Contenttree ...
17: *
18: * @param
19: */
20: public static TKHashtable getContentPathes() throws Throwable {
21: TKQuery q = TKDBManager.newQuery(TKDBContentTreeDir.class);
22: q.execute();
23: ResultSet rs = q.fetchResultSet();
24:
25: TKHashtable pathes = new TKHashtable();
26:
27: while (rs.next()) {
28:
29: int leftNr = rs.getInt("LEFT_NR");
30: int rightNr = rs.getInt("RIGHT_NR");
31:
32: int contentNodeId = rs.getInt("CONTENT_NODE_ID");
33: int contentNodeParent = rs.getInt("CONTENT_NODE_PARENT");
34: int formId = rs.getInt("CONTENT_FORM");
35: int nodeType = rs.getInt("CONTENT_NODE_TYPE");
36:
37: String nodeName = rs.getString("CONTENT_NODE_NAME");
38: String nodeShortName = rs
39: .getString("CONTENT_NODE_SHORTNAME");
40:
41: if (nodeShortName == null) {
42:
43: continue;
44: }
45:
46: if (contentNodeParent <= 0) {
47: pathes.put(new Integer(contentNodeId), nodeShortName);
48: } else {
49:
50: String pstr = (String) pathes.get(new Integer(
51: contentNodeParent));
52: if (pstr == null) {
53: continue;
54: }
55:
56: pathes.put(new Integer(contentNodeId), pstr + "/"
57: + nodeShortName);
58: }
59: }
60:
61: return pathes;
62: }
63: }
|