1 19 package org.openbravo.erpCommon.businessUtility; 20 21 import org.openbravo.database.ConnectionProvider; 22 import java.io.*; 23 import javax.servlet.*; 24 import org.apache.log4j.Logger ; 25 26 27 public class Tree { 28 static Logger log4jTree = Logger.getLogger(Tree.class); 29 30 public static String getMembers (ConnectionProvider conn, String treeId, String parentNodeId) throws IOException,ServletException { 31 log4jTree.debug("Tree.getMembers"); 32 TreeData[] data = TreeData.select(conn, treeId, parentNodeId); 33 34 boolean bolFirstLine = true; 35 String strText = ""; 36 for (int i = 0; i < data.length; i++) { 37 if (bolFirstLine){ 38 bolFirstLine = false; 39 strText = data[i].id; 40 } 41 else{ 42 strText = data[i].id + "," + strText ; 43 } 44 } 45 return strText; 46 } 47 48 public static String getTreeOrgs (ConnectionProvider conn, String client) throws IOException,ServletException { 49 log4jTree.debug("Tree.getTreeOrg"); 50 TreeData[] data = TreeData.getTreeOrgs(conn, client); 51 52 boolean bolFirstLine = true; 53 String strText = ""; 54 for (int i = 0; i < data.length; i++) { 55 if (bolFirstLine){ 56 bolFirstLine = false; 57 strText = data[i].id; 58 } 59 else{ 60 strText = data[i].id + "," + strText ; 61 } 62 } 63 return strText; 64 } 65 66 public static String getTreeAccounts (ConnectionProvider conn, String client) throws IOException,ServletException { 67 log4jTree.debug("Tree.getTreeOrg"); 68 TreeData[] data = TreeData.getTreeAccounts(conn, client); 69 70 boolean bolFirstLine = true; 71 String strText = ""; 72 for (int i = 0; i < data.length; i++) { 73 if (bolFirstLine){ 74 bolFirstLine = false; 75 strText = data[i].id; 76 } 77 else{ 78 strText = data[i].id + "," + strText ; 79 } 80 } 81 return strText; 82 } 83 } 84 | Popular Tags |