diff options
author | Lorraine Welch <lb2391@att.com> | 2020-05-20 22:03:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-05-20 22:03:07 +0000 |
commit | a052afbf3562493369ae63baf6e1529608933c58 (patch) | |
tree | 88a92161122d16dd09235566e4fc212c4ca14599 /ecomp-sdk | |
parent | db7c2a9d4045c6a120a7ad81ed95106d8a424b96 (diff) | |
parent | cae3232fa6e9290b0368eace5b07a1e45476055a (diff) |
Merge "removed unwanted codes in FormField comp"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java | 76 |
1 files changed, 1 insertions, 75 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java index f3633a67..49ed35b3 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/FormField.java @@ -142,9 +142,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme public static final String FFT_TEXTAREA = "TEXT"; -// Changed to "TEXT" -// public static final String FFT_TEXTAREA = "TEXTAREA"; - public static final String FFT_COMBO_BOX = "COMBO_BOX"; public static final String FFT_LIST_BOX = "LIST_BOX"; @@ -186,7 +183,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme boolean required, String defaultValue, String helpText, boolean visible, String dependsOn, Calendar rangeStartDate, Calendar rangeEndDate, String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { - // super(); this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); setVisible(visible); @@ -251,7 +247,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme String rangeStartDateSQL, String rangeEndDateSQL, String multiSelectListSize) { this(fieldName, fieldDisplayName, fieldType, validationType, required, defaultValue, helpText, dependsOn, rangeStartDate, rangeEndDate, rangeStartDateSQL, rangeEndDateSQL, multiSelectListSize); - // if(dependsOn !=null){ this.dependsOn = dependsOn; }else { this.dependsOn = "" if (defaultValue != null && defaultValue.length() > 10 && defaultValue.substring(0, 10).trim().toLowerCase().startsWith("select")) { setFieldDefaultSQL(defaultValue); @@ -388,14 +383,7 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } public String getHelpLink(String fieldName) { - // return "<a href=\"#\" onclick=\"javascript:ShowContent('" + fieldName + - // "_div')\"><img src=\""+AppUtils.getBaseFolderURL()+"images/quickhelp_dk.gif\" - // width=\"12\" height=\"12\" alt=\"\" border=\"0\" class=\"qh-element\" - // /></a>"; return ((getHelpText() != null && getHelpText().length() > 0) ? "tooltipText=\"" + getHelpText() + "\">" : ">"); - // return ((getHelpText()!=null && getHelpText().length()>0)? "<img - // src=\"static/fusion/raptor/images/quickhelp_lt.gif\" tooltipText=\""+ - // getHelpText() + "\"/>": ""); } public String getCallableAfterChainingJavascript(String fieldName, ReportRuntime rr) { @@ -459,7 +447,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } if (fieldType.equals(FFT_COMBO_BOX)) { StringBuffer sb = new StringBuffer(); - // System.out.println("COMBO BOX " + fieldName); String oldSQL = ""; if (!required) sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); @@ -467,18 +454,10 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme IdNameList lookup = getLookupList(); try { if (!hasPredefinedList) { - // if(dependsOn != null && dependsOn != "") { - // if(dependsOn != null && dependsOn != "" ) { IdNameSql lu = (IdNameSql) lookup; String SQL = ""; SQL = lu.getSql(); - /* - * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = - * lu.getBaseSQLForPDFExcel(false); - */ - // System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); oldSQL = lu.getSql(); - // SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); if (formValues != null) { Set set = formValues.entrySet(); String value = ""; @@ -502,10 +481,7 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); } - // } lookupList = lookup; - - // } try { lookup.loadUserData(0, "", getDbInfo(), getUserId()); } catch (Exception e) { @@ -519,12 +495,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); if (value != null && value.getId() != null && value.getName() != null) { - /* - * if (count == 0 && required) { selectedValue = value.getId(); count++; } else - * if (nvl(fieldValue).length()>0){ if (fieldValue != null && - * fieldValue.equals(value.getId())){ selectedValue = value.getId(); } count++; - * } else { count++; } - */ if (count == 0) { if (required) { selectedValue = value.getId(); @@ -550,14 +520,12 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } formValues.put(fieldDisplayName, selectedValue); } catch (Exception e) { - // throw new RaptorRuntimeException(e); } if (!hasPredefinedList) { if (oldSQL != null && !oldSQL.equals("")) { ((IdNameSql) lookup).setSQL(oldSQL); } } - // System.out.println("FORMFIELD 6666667 " + ((IdNameSql)lookup).getSql()); if (isVisible()) return sb.toString(); else @@ -570,16 +538,9 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme IdNameList lookup = getLookupList(); try { if (!hasPredefinedList) { - // if(dependsOn != null && dependsOn != "") { - // if(dependsOn != null && dependsOn != "" ) { IdNameSql lu = (IdNameSql) lookup; String SQL = ""; SQL = lu.getSql(); - /* - * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = - * lu.getBaseSQLForPDFExcel(false); SQL = Utils.replaceInString(SQL, "[VALUE]", - * fieldValue); - */ oldSQL = lu.getSql(); if (formValues != null) { Set set = formValues.entrySet(); @@ -633,7 +594,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme else return ""; } else if (fieldType.equals(FFT_TEXT_W_POPUP)) { - // System.out.println("TEXT POPUP " + fieldName); String oldSQL = ""; IdNameValue idNamevalue = null; String fieldDefValue = ""; @@ -661,7 +621,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } } SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); - // if(SQL.indexOf("'"+"["+entry.getKey()+"]"+"'")!=-1) { if (SQL.indexOf("'" + "[" + entry.getKey() + "]" + "'") != -1 || SQL.indexOf("'" + "[" + entry.getKey()) != -1 || SQL.indexOf(entry.getKey() + "]" + "'") != -1 @@ -698,7 +657,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme lookup = new IdNameSql(-1, SQL, null); } } - // lookupList = lookup; if (getFieldDefaultSQL() != null && (fieldValue == null || fieldValue.trim().equalsIgnoreCase("null") || fieldValue.trim().length() <= 0)) { @@ -739,7 +697,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } } catch (Exception e) { - // throw new RaptorRuntimeException(e); } // ----- END ---// @@ -757,16 +714,9 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } } - } catch (Exception e) { // throw new RaptorRuntimeException(e); + } catch (Exception e) { } if (isVisible()) { - /* - * return "<input type=text class=\"text\" size=30 maxlength=50 id=\"" + - * fieldName +"\" name=\"" + fieldName + "\" value=\"" + nvl(fieldDefValue) + - * "\">\n" + "<a href=\"javascript:showArgPopupNew('" + fieldName + - * "', 'document.formd." + fieldName + "')\"><img border=0 src=\"" + - * AppUtils.getImgFolderURL() + "shareicon.gif\" " + getHelpLink(fieldName); - */ return "obj.value=\"" + Utils.singleQuoteEncode(nvl(fieldDefValue)) + "\";"; } else @@ -776,11 +726,8 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme String oldSQL = ""; try { IdNameList lookup = getLookupList(); - // if(dependsOn != null && dependsOn != "") { - // if(dependsOn != null && dependsOn != "" ) { IdNameSql lu = (IdNameSql) lookup; String SQL = lu.getSql(); - // System.out.println("SQL HIDDEN 1 " + SQL); oldSQL = lu.getSql(); if (formValues != null) { Set set = formValues.entrySet(); @@ -798,14 +745,11 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme } } - // System.out.println("HIDDEN " + "["+entry.getKey()+"]" + "-" + value); SQL = Utils.replaceInString(SQL, "[" + entry.getKey() + "]", value); } lookup = new IdNameSql(-1, SQL, lu.getDefaultSQL()); } - // System.out.println("SQL HIDDEN 2 " + SQL); - // } lookupList = lookup; // } if (nvl(fieldValue).length() > 0 && (dependsOn == null || dependsOn.length() <= 0)) { @@ -815,7 +759,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme int iCnt = 0; for (lookup.resetNext(); lookup.hasNext(); iCnt++) { IdNameValue value = lookup.getNext(); - // System.out.println("HIDDEN " + value.getId() + " " + value.getName()); sb.append((value != null) ? "obj.value=\"" + nvl(value.getId()) + "\";" : ""); if (value.isReadOnly()) sb.append("obj.disabled=true;"); @@ -834,15 +777,12 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme if (oldSQL != null && !oldSQL.equals("")) { ((IdNameSql) lookup).setSQL(oldSQL); } - // lookup.clearData(); } catch (Exception e) { - // throw new RaptorRuntimeException(e); } // if(isVisible()) return sb.toString(); } else if (fieldType.equals(FFT_LIST_BOX)) { StringBuffer sb = new StringBuffer(); - // System.out.println("COMBO BOX " + fieldName); String oldSQL = ""; if (!required) sb.append("obj.options[obj.options.length] = new Option('-->select value<--','');"); @@ -850,18 +790,10 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme IdNameList lookup = getLookupList(); try { if (!hasPredefinedList) { - // if(dependsOn != null && dependsOn != "") { - // if(dependsOn != null && dependsOn != "" ) { IdNameSql lu = (IdNameSql) lookup; String SQL = ""; SQL = lu.getSql(); - /* - * if(nvl(fieldValue,"").length()<=0) SQL = lu.getSql(); else SQL = - * lu.getBaseSQLForPDFExcel(false); - */ - // System.out.println("FORMFIELD 6666667 First" + ((IdNameSql)lookup).getSql()); oldSQL = lu.getSql(); - // SQL = Utils.replaceInString(SQL, "[VALUE]", fieldValue); if (formValues != null) { Set set = formValues.entrySet(); String value = ""; @@ -903,12 +835,6 @@ public class FormField extends org.onap.portalsdk.analytics.RaptorObject impleme for (lookup.resetNext(); lookup.hasNext();) { IdNameValue value = lookup.getNext(); if (value != null && value.getId() != null && value.getName() != null) { - /* - * if (count == 0 && required) { selectedValue = value.getId(); count++; } else - * if (nvl(fieldValue).length()>0){ if (fieldValue != null && - * fieldValue.equals(value.getId())){ selectedValue = value.getId(); } count++; - * } else { count++; } - */ if (count == 0) { if (required) { selectedValue = value.getId(); |