Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / popup_testrun_sql.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="java.io.*" %>
21 <%@ page import="java.util.*" %>
22
23 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.system.*" %>
25 <%@ page import="org.openecomp.portalsdk.analytics.util.*" %>
26
27 <%      Exception ex = (Exception) request.getAttribute(AppConstants.RI_EXCEPTION);
28         DataSet   ds = (DataSet)   request.getAttribute(AppConstants.RI_DATA_SET); %>
29
30 <html>
31 <head>
32 <title>SQL Statement Test Run</title>
33 <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css">
34 <script language="JavaScript">
35 <!--
36 function setOpenerConfirm() {
37 <%      if(AppUtils.getRequestNvlValue(request, AppConstants.RI_CHK_FIELD_SQL).equals("Y")&&ex==null) { %>
38         window.opener.setVerifyFlag();
39 <%      } %>
40 }       // setOpenerConfirm
41 //-->
42 </script>
43 </head>
44 <body onLoad="setOpenerConfirm()">
45 <table class="mTAB" width="94%"  class="tableBorder" border="0" cellspacing="1" cellpadding="3" align=center>
46         <tr>
47                 <td class=rbg1 width="100%" valign="Middle"<%= (ds==null)?"":(" colspan="+(ds.getColumnCount()+1)) %>>
48                         <b class=rtableheader>SQL Execution <%= (ex==null)?"Result - Success":"Generated Exception" %></b>
49                 </td>
50         </tr>
51 <% if(ex!=null) { %>
52         <tr>
53                 <td class=rbg2>
54                         <br>
55                         <font class=rtabletext><%= nvl(ex.getMessage(), "&nbsp;") %></font>
56                         <br><br>
57 <!-------------------------------------------------------
58 EXCEPTION [<%= ex.getMessage() %>]
59 <%              ex.printStackTrace(new PrintWriter(out)); %>
60 -------------------------------------------------------->
61                 </td>
62         </tr>
63 <% } else if(ds!=null) { %>
64         <tr class=rbg1>
65                 <td>&nbsp;</td>
66         <%      for(int c=0; c<ds.getColumnCount(); c++) { %>
67                 <td align="center" valign="Middle"><b class=rtabletext><%= ds.getColumnName(c) %></b></td>
68         <%      } %>
69         </tr>
70         <%      for(int r=0; r<Math.min(ds.getRowCount(), Globals.getDefaultPageSize()); r++) { %>
71         <tr<%= (r%2==0)?" class=rowalt1":" class=rowalt2" %>>
72                 <td align="center" valign="Middle"><font class=rtabletext><%= (r+1) %></font></td>
73                 <%      for(int c=0; c<ds.getColumnCount(); c++) { %>
74                 <td valign="Middle"><font class=rtabletext><%= nvl(ds.getString(r, c), "&nbsp;") %></font></td>
75                 <%      } %>
76         </tr>
77         <%      }       // for r 
78                 if(ds.getRowCount()>Globals.getDefaultPageSize()) {     %>
79         <tr<%= (Globals.getDefaultPageSize()%2==0)?" class=rowalt1":" class=rowalt2" %>>
80                 <td align="center" valign="Middle"><font class=rtabletext><%= (Globals.getDefaultPageSize()+1) %></font></td>
81                 <td align="left" valign="Middle" colspan="<%= ds.getColumnCount() %>"><font class=rtabletext>...</font></td>
82         </tr>
83         <%      } else if(ds.getRowCount()==0) { %>
84         <tr class=rbg3>
85                 <td align="center" valign="Middle" colspan="<%= ds.getColumnCount()+1 %>"><font class=rtabletext>No data found</font></td>
86         </tr>
87         <%      }       // else if
88         }       // else if 
89 %>
90         <tr>
91                 <td align="center"<%= (ds==null)?"":(" colspan="+(ds.getColumnCount()+1)) %>>
92                         <br>
93                         <input type="Submit" class=button value="Close" onClick="window.close();">
94                 </td>
95         </tr>
96 </table>
97 <br>
98 </body>
99 </html>
100
101 <%!     private String nvl(String s)                  { return (s==null)?"":s; }
102         private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %>
103