2 ================================================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property
6 ================================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ================================================================================
20 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.DataColumnType" %>
21 <%@ page import="org.openecomp.portalsdk.analytics.util.AppConstants" %>
22 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.ReportDefinition" %>
23 <%@ page import="org.openecomp.portalsdk.analytics.system.AppUtils" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.controller.WizardSequence" %>
25 <%@ page import="java.util.List" %>
26 <%@ page import="java.util.Iterator" %>
28 ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
29 WizardSequence ws = rdef.getWizardSequence();
30 String curSubStep = ws.getCurrentSubStep();
31 boolean isEdit = curSubStep.equals(AppConstants.WSS_EDIT);
32 DataColumnType currColumn = null;
34 currColumn = rdef.getColumnById(AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID)); %>
36 <table width="100%" class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
38 <td class=rbg1 colspan=2 valign="Middle"><b class=rtableheader>Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %><%= curSubStep.equals(AppConstants.WSS_EDIT)?"Edit Sorting":(curSubStep.equals(AppConstants.WSS_ADD)?"Add Sorting":"") %></b></td>
41 <td class=rbg2 align="right" width="25%" height="30" style="background-image:url(<%= AppUtils.getImgFolderURL() %>required.gif); background-position:top right; background-repeat:no-repeat;">
42 <font class=rtabletext>Sort By Column: </font>
44 <td class=rbg3 align="left" width="50%"><font class=rtabletext>
46 <%= currColumn.getDisplayName() %>
48 <select name="sortColId">
50 List reportCols = rdef.getAllColumns();
51 for(Iterator iter=reportCols.iterator(); iter.hasNext(); ) {
52 DataColumnType dct = (DataColumnType) iter.next();
53 if(dct.getOrderBySeq()<=0) { %>
54 <option value="<%= dct.getColId() %>"<%= ((iCount++)==0)?" selected":"" %>><%= dct.getDisplayName() %>
64 <td class=rbg2 align="right" width="25%" height="30"><font class=rtabletext>Sort Type: </font></td>
65 <td class=rbg3 align="left" width="50%"><font class=rtabletext>
66 <select name="sortAscDesc">
67 <option value="<%= AppConstants.SO_ASC %>" <%= (isEdit&&nvl(currColumn.getOrderByAscDesc(), AppConstants.SO_ASC).equals(AppConstants.SO_DESC))?"":" selected" %>>Ascending
68 <option value="<%= AppConstants.SO_DESC %>"<%= (isEdit&&nvl(currColumn.getOrderByAscDesc(), AppConstants.SO_ASC).equals(AppConstants.SO_DESC))?" selected":"" %>>Descending
75 <script language="JavaScript">
77 function dataValidate() {
84 private String nvl(String s) { return (s==null)?"":s; }
85 private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; }