diff options
author | TATTAVARADA <statta@research.att.com> | 2017-04-27 07:53:18 -0400 |
---|---|---|
committer | st782s <statta@research.att.com> | 2017-04-27 08:31:27 -0400 |
commit | 6beb446925c967aca92f5513adf36c5db77c00d6 (patch) | |
tree | 9392057ed0739de2445c5b2a2a8bee6dcdacbcf7 /ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp | |
parent | 246b225194e3e8dc1926294de591a94fd9787fa7 (diff) |
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects
abstraction of components
Change-Id: Ia1efa4deacdc5701e6205104ac021a6c80ed60ba
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp new file mode 100644 index 00000000..9dec6a53 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/WEB-INF/fusion/raptor/popup_table_cols.jsp @@ -0,0 +1,171 @@ +<%-- + ================================================================================ + eCOMP Portal SDK + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ================================================================================ + --%> +<%@ page import="java.util.*" %> + +<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.*" %> +<%@ page import="org.openecomp.portalsdk.analytics.model.*" %> +<%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %> +<%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %> +<%@ page import="org.openecomp.portalsdk.analytics.system.*" %> +<%@ page import="org.openecomp.portalsdk.analytics.util.*" %> + +<% String tableName = AppUtils.getRequestValue(request, AppConstants.RI_TABLE_NAME); + String remoteDbPrefix = (String) session.getAttribute("remoteDB"); + Vector tableSources = null; + Vector dbColumns = null; + if(tableName==null) { + tableSources = DataCache.getReportTableSources(remoteDbPrefix); + if(tableSources.size()>0) + tableName = ((TableSource) DataCache.getReportTableSources(remoteDbPrefix).get(0)).getTableName(); + } + if(tableName!=null) + dbColumns = DataCache.getReportTableDbColumns(tableName.toUpperCase(),remoteDbPrefix); + + + boolean isSingleValueChoice = AppUtils.getRequestFlag(request, "single_value"); + boolean includeTableNameInResult = AppUtils.getRequestFlag(request, "return_table_name"); + boolean includeColTypeInResult = AppUtils.getRequestFlag(request, "return_col_type"); %> + +<html> +<head> + <title>Table Columns</title> + <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css"> + <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/ral.css"> + +<script language=JavaScript> +<!-- + function setValue(newValue) { + window.opener.addText(newValue); + window.close(); + } // setValue + + function clearValue() { + window.opener.clearText(); + window.close(); + } // clearValue +//--> +</script> + +</head> +<body> + +<% if(! isSingleValueChoice) { %> +<script language=JavaScript> +<!-- + function getSelection() { + var selList = ""; + <% if(dbColumns!=null) { %> + for(var i=0; i<<%= dbColumns.size() %>; i++) + if(document.dataform.dataChk[i].checked) + selList += ((selList=="")?"":", ")+document.dataform.dataChk[i].value; + <% } %> + + setValue(selList); + + return false; + } // getSelection +//--> +</script> +<% } // if +%> + + +<form name="dataform" action="<%= AppUtils.getBaseURL() %>" method="post"> + <input type="hidden" name="action" value="raptor"> + <input type="hidden" name="<%= AppConstants.RI_ACTION %>" value="report.popup.table.cols"> +<% if(isSingleValueChoice) { %> + <input type="hidden" name="single_value" value="Y"> +<% } %> +<% if(includeTableNameInResult) { %> + <input type="hidden" name="return_table_name" value="Y"> +<% } %> +<% if(includeColTypeInResult) { %> + <input type="hidden" name="return_col_type" value="Y"> +<% } %> + +<table class="mTAB" width=94% border=0 cellspacing=1 align=center> + <tr class=rbg1> + <td align="center" valign="middle" height="30"> + <% if(! isSingleValueChoice) { %> + <input type=image src='<%= AppUtils.getImgFolderURL() %>downloadicon.gif' alt='Store selection' width=12 height=12 border=0 onClick="return getSelection()"> + <% } %> + </td> + <td colspan="2" valign="middle" nowrap> + <select name="<%= AppConstants.RI_TABLE_NAME %>" onChange="document.dataform.submit()"> + <% for(Iterator iter=DataCache.getReportTableSources(remoteDbPrefix).iterator(); iter.hasNext(); ) { + String iTableName = ((TableSource) iter.next()).getTableName(); %> + <option value="<%= iTableName %>"<%= iTableName.equals(tableName)?" selected":"" %>><%= iTableName %> + <% } // for + %> + </select> + <b class=rtableheader> DB Table Columns</b> + </td> + </tr> + <% int rNum = 0; + if(dbColumns!=null) + for(rNum=0; rNum<dbColumns.size(); rNum++) { + DBColumnInfo dbCol = (DBColumnInfo) dbColumns.get(rNum); + String sValue = (includeTableNameInResult?(tableName+"."):"")+dbCol.getColName()+(includeColTypeInResult?("|"+dbCol.getColType()):""); + String sDisplay = "["+tableName+"]."+dbCol.getColName(); %> + <tr<%= (rNum%2==0)?" class=rowalt1":" class=rowalt2" %>> + <td align="center" height="30"><font class=rtabletext><%= (rNum+1) %></font></td> + <% if(isSingleValueChoice) { %> + <td colspan="2"><font class=rtabletext><a href="javascript:setValue('<%= sValue %>')"><%= sDisplay %></a></font></td> + <% } else { %> + <td align="center" valign="middle"> + <input type="checkbox" name="dataChk" value="<%= sValue %>"> + </td> + <td><font class=rtabletext><%= sDisplay %></font></td> + <% } // else + %> + </tr> + <% } // for + if(rNum==0) { %> + <tr class=rbg3> + <td align="center" height="30" colspan="3"><font class=rtabletext>No columns found for table [<%= tableName %>]</font></td> + </tr> + <% } else { // if + %> + <tr class=rbg3> + <td colspan="3"><font class=rtabletext><a href="javascript:clearValue()"><%= "CLEAR VALUE" %></a></font></td> + </tr> + <% + } + %> + <tr class=rbg1> + <td align="center" valign="middle" height="30"> + <% if(! isSingleValueChoice) { %> + <input type=image src='<%= AppUtils.getImgFolderURL() %>downloadicon.gif' alt='Store selection' width=12 height=12 border=0 onClick="return getSelection()"> + <% } %> + </td> + <td colspan="2"> </td> + </tr> +</table> + + <input type="hidden" name="dataChk" value=""> + <input type="hidden" name="dataChk" value=""> +</form> + +</body> +</html> + +<%! private String nvl(String s) { return (s==null)?"":s; } + private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %> + |