Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / wizard_columns_order_all.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
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
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
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   ================================================================================
19   --%>
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" %>
27 <%
28     ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
29     WizardSequence ws = rdef.getWizardSequence();
30     String curSubStep = ws.getCurrentSubStep();
31         boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB);
32         boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED);    
33 %>
34
35 <table width="100%"  class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
36         <tr>
37                 <td class=rbg1 colspan=4 valign="Middle"><b class=rtableheader>Step <%= ws.getCurrentStepIndex() %> of <%= ws.getStepCount() %> - Report <%= ws.getCurrentStep() %> - <%= curSubStep %></b></td>
38         </tr>
39         <tr class=rbg1>
40                 <td align="center" valign="Middle" width="7%" height="30"><b class=rtableheader>&nbsp;&nbsp;No&nbsp;&nbsp;</b></td>
41                 <td align="center" valign="Middle" width="65%"><b class=rtableheader>Column</b></td>
42                 <td align="center" valign="Middle" width="14%"><b class=rtableheader>Re-order To<br>Position</b></td>
43         </tr>
44 <%  int icnt = 0;
45         for(Iterator iter=rdef.getAllColumns().iterator(); iter.hasNext(); icnt++) { 
46                 DataColumnType dct = (DataColumnType) iter.next(); %>
47         <tr<%= (icnt%2==0)?" class=rbg8":"" %>>
48                 <td align="center" height="30"><font class=rtabletext><%= icnt+1 %></font></td>
49                 <td><font class=rtabletext><%= dct.getDisplayName() %></font></td>
50                 <td align="center" valign="middle">
51                         <input type="hidden" name="colId" value="<%= dct.getColId() %>">
52                         <input type="text" size="5" maxlength="5" name="colOrder" value="<%= dct.getOrderSeq() %>">
53                 </td>
54         </tr>
55 <%      }   // for 
56 %>
57 </table>
58                         <input type="hidden" name="colOrder" value="">
59                         <input type="hidden" name="colOrder" value="">
60 <br>
61
62 <script language="JavaScript">
63 <!--
64 var colNames = new Array(<%= rdef.getAllColumns().size() %>);
65 <%      for(int i=0; i<rdef.getAllColumns().size(); i++) { 
66                 DataColumnType dct = (DataColumnType) rdef.getAllColumns().get(i); %>
67 colNames[<%= i %>] = "<%= dct.getDisplayName() %>";
68 <%      } %>
69
70 function dataValidate() {
71         var val = "";
72         for(var i=0; i<document.forma.colOrder.length; i++) {
73                 val = document.forma.colOrder[i].value;
74                 if(val!="")
75                         if(! checkPositiveInteger(val)) {
76                                 alert("Order Position for column "+colNames[i]+" should be a positive integer.\nPlease enter a valid value.");
77                                 document.forma.colOrder[i].focus();
78                                 document.forma.colOrder[i].select();
79                                 
80                                 return false;
81                         }       // if
82         }       // for
83         
84         return true;
85 }   // dataValidate
86 //-->
87 </script>
88