%--
================================================================================
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="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %>
<%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %>
<%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %>
<%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %>
<%@ page import="org.openecomp.portalsdk.analytics.util.Utils" %>
<%@ page import="java.util.Vector" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.ReportLoader" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue" %>
<%@ page import="org.openecomp.portalsdk.analytics.xmlobj.FormFieldType" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.base.ReportWrapper" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.DataCache" %>
<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.FormField" %>
<%@ page import="java.text.SimpleDateFormat"%>
<%
ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
WizardSequence ws = rdef.getWizardSequence();
String curSubStep = ws.getCurrentSubStep();
String reportID = rdef.getReportID();
boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB);
boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED);
String dependsOnHelp = "Custom SQL can be defined";
%>
<% String[] dateFormats = { "MM/DD/YYYY", "MM/YYYY", "DD-MON-YYYY", "Month DD, YYYY", "Month, YYYY" };
String[] charFormats = { "N/A" };
boolean isEdit = curSubStep.equals(AppConstants.WSS_EDIT);
FormFieldType currField = null;
if(isEdit)
currField = rdef.getFormFieldById(AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID));
String currColId = (currField!=null)?nvl(currField.getColId()):"";
String remoteDbPrefix = (String) session.getAttribute("remoteDB");
String colTableName = null;
String colColumnName = null;
String colDisplayFormat = null;
String colDisplayName = null;
if(isSQLBased)
if(currColId.length()>0) {
colTableName = ReportWrapper.getSQLBasedFFTColTableName(currColId);
colColumnName = ReportWrapper.getSQLBasedFFTColColumnName(currColId);
colDisplayFormat = ReportWrapper.getSQLBasedFFTColDisplayFormat(currColId);
if(currColId.indexOf("|")>=0)
currColId = currColId.substring(0, currColId.indexOf('|'));
colDisplayName = colColumnName;
//colDisplayName = currColId.substring(currColId.indexOf('.')+1);
} %>
Field Name:
">
Based On Column:
<% if(isSQLBased) { %>
<% } else { %>
>--- None ---
<% int iCount = 0;
List reportCols = rdef.getAllColumns();
for(Iterator iter=reportCols.iterator(); iter.hasNext(); iCount++) {
DataColumnType dct = (DataColumnType) iter.next(); %>
><%= dct.getDisplayName() %>
<% if(currColId.equals(dct.getColId()))
colDisplayName = dct.getDisplayName();
} // for
%>
<% } // else if(isSQLBased)
if(colDisplayName!=null) { %>
<% } // if
%>
<% if(isSQLBased) {
String colType = AppConstants.CT_CHAR;
if(colTableName!=null&&colColumnName!=null)
try {
colType = nvl(DataCache.getReportTableDbColumnType(colTableName, colColumnName,((String) session.getAttribute("remoteDB"))), AppConstants.CT_CHAR);
} catch(Exception e) {}
String[] fmt;
if(colType.equals(AppConstants.CT_DATE))
fmt = dateFormats;
else
fmt = charFormats; %>
Display Format:
<% for(int i=0; i
"<%= (nvl(colDisplayFormat).toUpperCase().equals(fmt[i].toUpperCase()))?" selected":"" %>><%= fmt[i] %>
<% } %>
<% } // if
%>
Visible?
>Yes
>No
<% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
Is used in Group By Clause?
>
<% } %>
Field Type:
<% String curValue = nvl((currField!=null)?currField.getFieldType():"", FormField.FFT_TEXT_W_POPUP); %>
<%-->Text Box with Popup --%>
>Text Box
<%-- >Text Area--%>
<%-- >Drop-Down List--%>
>List Box
<%-- >Radio Buttons
>Check Boxes --%>
>Multi-select List Box
>Hidden
Visible Size:
>1
>2
>3
>4
>5
>6
>7
>8
>9
>10
Custom
<% if(currField!=null && isNumber(nvl(currField.getMultiSelectListSize())) && new Integer(nvl(currField.getMultiSelectListSize(), "0")).intValue() <= 20) {
%>
<%=nvl(currField.getMultiSelectListSize())%>
<%
}
%>
<%if(! isSQLBased) { %>
Default Value:
">
<% } else { %>
<% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
Is Default Value should be SQL
0?" checked":"" %> onClick="toggleDiv(this.checked)">
Default SQL:
<% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
<% } %>
<% } // if admin user %>
Default Value:
<% if(Globals.getAllowSQLBasedReports() || AppUtils.isAdminUser(request)) { %>
<% } %>
<% } //else %>
Verify Field Value As:
<% curValue = nvl((currField!=null)?currField.getValidationType():"", FormField.VT_NONE); %>
>--- Do Not Perform Validation ---
>Date
>TimeStamp (Hour)
>TimeStamp (Hour, Min)
>TimeStamp (Hour, Min, Sec)
>Integer
>Positive Integer
>Positive Integer, Cannot Be Zero
>Any Number
>Positive Number
>Positive Number, Cannot Be Zero
<%}else{%>style="display:none"<%}%>>
<% curValue = nvl((currField!=null)?currField.getMandatory():"", "N"); %>
>
User must provide value for this field
Field Help Text:
<% if(Globals.getAllowSQLBasedReports()||AppUtils.isAdminUser(request)) { %>
SQL Generating Custom List of Values: (overrides default list)
<% curValue = nvl((currField!=null)?currField.getDependsOn():"", "N"); %>
>
Depends on another Form Field.
<% } else { %>
">
<% } %>
<% List predefinedValues = (currField!=null&&currField.getPredefinedValueList()!=null)?currField.getPredefinedValueList().getPredefinedValue():null; %>
Provide Predefined List of Values:
<% if(predefinedValues==null||predefinedValues.size()==0) { %>
Do not use Predefined list - Generate list from database
<% } else {
String value = (String) predefinedValues.get(0); %>
<%= value %>
<% } %>
<% if(predefinedValues!=null&&predefinedValues.size()>1)
for(int i=1; i
<%= value %>
<% } // for
%>
document.forma.<%= AppConstants.RI_WIZARD_ACTION %>.value='<%= AppConstants.WA_ADD_USER %>';">