KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openbravo > erpCommon > utility > WindowTreeUtilityClient


1 /*
2  *************************************************************************
3  * The contents of this file are subject to the Openbravo Public License
4  * Version 1.0 (the "License"), being the Mozilla Public License
5  * Version 1.1 with a permitted attribution clause; you may not use this
6  * file except in compliance with the License. You may obtain a copy of
7  * the License at http://www.openbravo.com/legal/license.html
8  * Software distributed under the License is distributed on an "AS IS"
9  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10  * License for the specific language governing rights and limitations
11  * under the License.
12  * The Original Code is Openbravo ERP.
13  * The Initial Developer of the Original Code is Openbravo SL
14  * All portions are Copyright (C) 2001-2006 Openbravo SL
15  * All Rights Reserved.
16  * Contributor(s): ______________________________________.
17  ************************************************************************
18 */

19 package org.openbravo.erpCommon.utility;
20
21 import org.openbravo.database.ConnectionProvider;
22 import org.openbravo.base.secureApp.*;
23 import javax.servlet.*;
24 import org.openbravo.data.FieldProvider;
25 import org.apache.log4j.Logger ;
26
27
28 public class WindowTreeUtilityClient {
29   static Logger log4j = Logger.getLogger(WindowTreeUtilityClient.class);
30   
31   public static String JavaDoc getTreeType(String JavaDoc keyColumnName) {
32     if (log4j.isDebugEnabled()) log4j.debug("WindowTreeUtilityClient.getTreeID() - key Column: " + keyColumnName);
33     String JavaDoc TreeType = "";
34     if(keyColumnName.equals("AT_Test_ID")) TreeType = "II";
35     else if(keyColumnName == null || keyColumnName.length() == 0) return "";
36     return TreeType;
37   }
38
39   public static FieldProvider[] getTree(ConnectionProvider conn, VariablesSecureApp vars, String JavaDoc TreeType, String JavaDoc TreeID, boolean editable, String JavaDoc strParentID, String JavaDoc strNodeId, String JavaDoc strTabID) throws ServletException {
40     if (log4j.isDebugEnabled()) log4j.debug("WindowTreeUtilityClient.getTree() - TreeID: " + TreeID);
41     FieldProvider[] data = null;
42     String JavaDoc strEditable = (editable?"editable":"");
43     boolean isBaseLanguage = vars.getLanguage().equals("en_US");
44     if (TreeType.equals("II")) data = WindowTreeUtilityClientData.selectInstructions(conn, strEditable, strParentID, strNodeId, vars.getUser(), TreeID);
45     if (data==null) throw new ServletException("WindowTreeUtilityClient.getTree - Unknown TreeType=" + TreeType);
46     return data;
47   }
48
49
50   public static String JavaDoc windowType(String JavaDoc type) {
51     if (log4j.isDebugEnabled()) log4j.debug("WindowTreeUtilityClient.windowType() - type: " + type);
52     if (type==null || type.equals("")) return "";
53     else return "";
54   }
55
56   public static String JavaDoc windowTypeNico(String JavaDoc tipo) {
57     if (log4j.isDebugEnabled()) log4j.debug("WindowTreeUtilityClient.windowTypeNico() - type: " + tipo);
58     if (tipo==null) return "";
59     else return "";
60   }
61 }
62
Popular Tags