1 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 21 public static TKHashtable getContentPathes () throws Throwable  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 nodeName = rs.getString( "CONTENT_NODE_NAME" ); 40 String 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 (contentNodeId),nodeShortName); 49 } else { 50 51 String pstr = (String ) pathes.get (new Integer (contentNodeParent)); 52 if (pstr == null) { 53 continue; 54 } 55 56 pathes.put (new Integer (contentNodeId),pstr+"/"+nodeShortName); 57 } 58 } 59 60 return pathes; 61 } 62 } 63 | Popular Tags |