1 23 24 package org.dbforms.taglib; 25 26 import org.apache.commons.logging.Log; 27 import org.apache.commons.logging.LogFactory; 28 29 import org.dbforms.util.Util; 30 31 import javax.servlet.jsp.tagext.*; 32 33 34 35 41 public class DbFormTagTEI extends TagExtraInfo { 42 static Log logCat = LogFactory.getLog(DbFormTagTEI.class.getName()); 44 45 52 public VariableInfo[] getVariableInfo(TagData data) { 53 StringBuffer [] varNames = { 54 new StringBuffer ("currentRow"), 55 new StringBuffer ("position"), 56 new StringBuffer ("searchFieldNames"), 57 new StringBuffer ("searchFieldModeNames"), 58 new StringBuffer ("searchFieldAlgorithmNames"), 59 new StringBuffer ("rsv") 60 }; 61 62 String table = null; 65 66 try { 67 table = data.getAttributeString("tableName"); 68 } catch (Exception e) { 69 table = null; 70 } 71 72 String parentField = null; 73 74 try { 75 parentField = data.getAttributeString("parentField"); 76 } catch (Exception e) { 77 parentField = null; 78 } 79 80 String childField = null; 81 82 try { 83 childField = data.getAttributeString("childField"); 84 } catch (Exception e) { 85 childField = null; 86 } 87 88 if (table != null) { 89 for (int i = 0; i < varNames.length; i++) { 90 varNames[i].append("_"); 91 varNames[i].append(table.replace('.', '_')); } 93 } 94 95 logCat.info("*** TEI CLASS IN ACTION ***"); 96 logCat.info("table=" + table); 97 logCat.info("varNames[0]=" + varNames[0].toString()); 98 99 int count = 0; 100 101 if (!Util.isNull(table)) { 102 count = count + 6; 103 } 104 105 if (Util.isNull(parentField) && Util.isNull(childField)) { 106 count = count + 1; 107 } 108 109 VariableInfo[] info = null; 110 111 if (count > 0) { 112 info = new VariableInfo[count]; 113 114 int i = 0; 115 116 if (!Util.isNull(table)) { 117 info[i++] = new VariableInfo(varNames[0].toString(), 118 "java.util.Map", true, 119 VariableInfo.NESTED); 120 info[i++] = new VariableInfo(varNames[1].toString(), 121 "java.lang.String", true, 122 VariableInfo.NESTED); 123 info[i++] = new VariableInfo(varNames[2].toString(), 124 "java.util.Map", true, 125 VariableInfo.NESTED); 126 info[i++] = new VariableInfo(varNames[3].toString(), 127 "java.util.Map", true, 128 VariableInfo.NESTED); 129 info[i++] = new VariableInfo(varNames[4].toString(), 130 "java.util.Map", true, 131 VariableInfo.NESTED); 132 info[i++] = new VariableInfo(varNames[5].toString(), 133 "org.dbforms.config.ResultSetVector", 134 true, VariableInfo.NESTED); 135 } 136 137 if (Util.isNull(parentField) && Util.isNull(childField)) { 138 info[i++] = new VariableInfo("dbforms", "java.util.Map", true, 139 VariableInfo.NESTED); 140 } 141 } 142 143 return info; 144 } 145 } 146 | Popular Tags |