<%-- ================================================================================ 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. ================================================================================ --%> <%-- Name: wizard_chart.jsp Use : This JSP is invoked when chart tab is selected. This is used for creating chart configuration for the report. Change Log ========== 12-Aug-2009 : Version 8.5 (Sundar); 29-Jun-2009 : Version 8.4 (Sundar); 23-Jun-2009 : Version 8.4 (Sundar); 22-Jun-2009 : Version 8.4 (Sundar); --%> <%@page import="org.openecomp.portalsdk.analytics.model.runtime.FormField"%> <%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportFormFields"%> <%@page import="org.openecomp.portalsdk.analytics.model.runtime.ReportRuntime"%> <%@page import="org.openecomp.portalsdk.analytics.model.base.IdNameValue"%> <%@page import="org.openecomp.portalsdk.analytics.model.DataCache"%> <%@page import="org.openecomp.portalsdk.analytics.model.ReportHandler"%> <%@page import="java.util.Vector"%> <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Iterator" %> <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %> <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %> <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %> <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %> <%@ page import="org.openecomp.portalsdk.analytics.system.Globals" %> <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %> <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.Reports"%> <% ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION); WizardSequence ws = rdef.getWizardSequence(); boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB); boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED) || rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED_DATAMIN); String legendColId = null; String valueColId = null; //String firstColId = null; //String firstNumColId = null; List reportCols = rdef.getAllColumns(); List chartValueCols = rdef.getChartValueColumnsList(AppConstants.CHART_ALL_COLUMNS, null); ArrayList unusedNumCols = new ArrayList(reportCols.size()); int numColsCount = 0; for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) { DataColumnType dct = (DataColumnType) iter.next(); if(nvl(dct.getColOnChart()).equals(AppConstants.GC_LEGEND)) legendColId = dct.getColId(); if(isSQLBased||nvl(dct.getColType()).equals(AppConstants.CT_NUMBER)) { numColsCount++; if(nvl(dct.getColOnChart()).length()==0) //dct.getChartSeq()<0) unusedNumCols.add(dct); } // if /* if(dct.getChartSeq()>0) valueColId = dct.getColId(); if(firstColId==null) firstColId = dct.getColId(); if(firstNumColId==null) if(isSQLBased) firstNumColId = dct.getColId(); else if(nvl(dct.getColType()).equals(AppConstants.CT_NUMBER)) firstNumColId = dct.getColId();*/ } // for String chartType = nvl(rdef.getChartType()); %>
<% if(numColsCount==0) { %> <% } else { %> <% if(chartValueCols.size()==0) { %> <% } else { int count = 1; String colIdx = ""; for(Iterator iterV=chartValueCols.iterator(); iterV.hasNext(); count++) { colIdx = ""; DataColumnType dctV = (DataColumnType) iterV.next(); colIdx = dctV.getColId(); int colAxisIdx = 0; boolean newChart = false; try { colAxisIdx = Integer.parseInt(dctV.getColOnChart()); } catch(Exception e) {} newChart = (dctV.isCreateInNewChart()!=null)?dctV.isCreateInNewChart().booleanValue():false; %> <% } // for } // else (chartValueCols.size()==0) if(unusedNumCols.size()>0) { %> <% } // if(unusedNumCols.size()==0) if(chartValueCols.size()>1 || rdef.hasSeriesColumn()) { %> <% } // if(chartValueCols.size()>1) %>
Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %>
No numeric columns found - chart not available
Chart Type: >  Do NOT allow user to change chart type at runtime
Chart Width (px): " size="10" maxlength="4">
Chart Height (px): " size="10" maxlength="4">
Domain Axis:
Category:
last Category display As Line Chart >
last Category display As Bar Chart >
Multi Series 0? (AppUtils.getRequestNvlValue(request, "multiSeries").equals("Y")? " checked ":""): (rdef.isMultiSeries() ? " checked ":" checked ")) %>>Yes 0? (AppUtils.getRequestNvlValue(request, "multiSeries").equals("N")? " checked ":""): (!rdef.isMultiSeries() ? " checked":"")) %>>No
Range Axis: <% String sValue = ""; %>
Range Axis <%= count %>: <% if(count>1) { %>   <% } %>   <% String chartGroupOrg = dctV.getChartGroup(); String yAxisGroup = dctV.getYAxis(); String chartGroup = (chartGroupOrg!=null && chartGroupOrg.length()>0 && chartGroupOrg.indexOf("|")!= -1)?chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|")):""; String yAxis = (yAxisGroup!=null && yAxisGroup.length()>0 && yAxisGroup.indexOf("|")!= -1)?yAxisGroup.substring(0,yAxisGroup.lastIndexOf("|")):""; %>
Chart Title:"/> YAxis:"/>
<% String sValue = nvl(dctV.getChartColor()); %> <% if(count>1) { %>
>  Create in New Chart
0)?" checked":"" %>>  Use secondary axis (Line chart only) <% } %>  
Add Values Column: <% String sValue = ""; %>  Use secondary axis (Line chart only)
Primary Axis Label:  (Multi-series Chart Only)
Secondary Axis Label:  (Multi-series Chart Only)
  Note: Some chart types (like Pie) will only display Series 1 Values.