Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / wizard_schedule_only_from_search.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.util.*" %>
21 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.*" %>
22 <%@ page import="org.openecomp.portalsdk.analytics.model.*" %>
23 <%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %>
24 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %>
25 <%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %>
26 <%@ page import="org.openecomp.portalsdk.analytics.controller.*" %>
27 <%@ page import="org.openecomp.portalsdk.analytics.system.*" %>
28 <%@ page import="org.openecomp.portalsdk.analytics.util.*" %>
29
30 <%@ page errorPage="error_page.jsp" %>
31
32
33
34 <%      ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION);
35         
36         String reportID   = rdef.getReportID();
37         
38
39     
40         String dbInfo = null;
41         dbInfo = rdef.getDBInfo();
42         int sessionflag = 0;
43         if(dbInfo == null  || dbInfo.length() == 0) {
44            dbInfo = (String) session.getAttribute("remoteDB");
45        sessionflag = 1; 
46         }
47        session.setAttribute("remoteDB", dbInfo);
48         if((dbInfo == null) && (request.getParameter("dataSource")!=null)) 
49            session.setAttribute("remoteDB", request.getParameter("dataSource"));
50
51         StringBuffer title = new StringBuffer("");
52         title.append(Globals.getBaseTitle()+" > "+(reportID.equals("-1")?"Create Report":"Schedule Report"));
53         title.append(" > "+rdef.getReportName());
54         
55         boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB);
56         boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED); 
57 %>
58 <!--  Set All variable to request, to enable included jsp to access it -->      
59 <%
60         request.setAttribute(AppConstants.SI_REPORT_DEFINITION,rdef);
61 %>      
62
63  <jsp:include page="header.jsp" flush="true" />
64  <!-- <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css">-->
65 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/raptor.js"></script>
66  
67
68 <jsp:include page="error_include.jsp" flush="true" />
69
70 <table width="100%" >
71 <tr><td id="folderTreeContainer" width="1%" height='300' valign='top' ><table>
72                 <!--<jsp:include page="tree/folderNav.jsp" flush="true" >       
73                 <jsp:param name="doCollapseTree" value="Y" />
74         </jsp:include>-->
75         </table>
76 </td>
77 <td id="searchContentContainer" valign='top' >
78 <div id="contentDiv" style="position:relative;overflow:auto;">
79 <form name="forma" action="<%= AppUtils.getBaseURL() %>" method="post">
80         <input type="hidden" name="action" value="raptor">
81         <input type="hidden" name="<%= AppConstants.RI_ACTION %>" value="report.schedule.submit_from_search">
82         <input type="hidden" name="<%= AppConstants.RI_REPORT_ID %>" value="<%= reportID %>">
83         <input type="hidden" name="<%= AppConstants.RI_DETAIL_ID %>" value="<%= AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID) %>">
84         <input type="hidden" name="<%= AppConstants.RI_GO_TO_STEP %>" value="">
85         <input type="hidden" name="<%= AppConstants.RI_WIZARD_ACTION %>" value="<%= AppConstants.WA_BACK %>">
86         <input type="hidden" name="<%= AppConstants.RI_SCHEDULE_ID %>" value="<%= AppUtils.getRequestNvlValue(request, AppConstants.RI_SCHEDULE_ID) %>">
87
88
89 <table width="94%" class="tableBorder" cellspacing="0" cellpadding="0" align=center>
90 <tr><td>
91         <table width="100%" border="0" cellspacing="0" cellpadding="3">
92                 <% if(request.getAttribute("message")!=null) { %>
93                 <tr >
94                         <td valign="Middle"><b class=rerrortext><%= (String) request.getAttribute("message") %></b></td>
95                 </tr>
96                 <% } %>
97                 <tr class=rbg1>
98                         <td valign="Middle"><b class=rtableheader><%= title.toString() %></b></td>
99                 </tr>
100                 
101         </table>
102 </td></tr><tr><td>
103                  <jsp:include page="wizard_adhoc_schedule.jsp"/>
104 </td></tr><tr><td>
105         <table width="100%" border="0" cellspacing="1" cellpadding="3">
106                 <tr>
107                         <td width="10%" align="right">
108                                 &nbsp;
109                         </td>
110                         <td align=center>
111                                         <input type=submit class="button" border="0" value="Submit" width="71" height="28" onClick="if(! dataValidate()) return false;  document.forma.<%= AppConstants.RI_ACTION %>.value='report.schedule.submit_from_search';">
112                                         <%--<input type=submit class="button" border="0" value="Report Search Page" width="71" height="28" onClick="document.forma.<%= AppConstants.RI_ACTION %>.value='report.search.public.container';">--%>
113                                         
114                         </td>
115                 </tr>
116         </table>        
117 </td></tr>
118 </table>        
119 </form>
120
121  <jsp:include page="footer.jsp" flush="true" />
122 </div>
123 </td>
124 </tr>
125 </table>
126 <%--<jsp:include page="disclaimer.jsp" flush="true" />--%>
127 <script>
128         //document.getElementById('loadingMessageDiv').style.display='none';
129     //adding the bread crumb on the folder tree
130         if (window.parent && window.parent.addBreadCrumb)
131                 window.parent.addBreadCrumb(true, "000<%=rdef.getReportID()%>");
132         //displayTree("000<%=rdef.getReportID()%>");
133         <%
134                 String isTreeHidden = "true";
135                 if(request.getSession().getAttribute("isTreeHidden") != null && ((String)request.getSession().getAttribute("isTreeHidden")).equals("true")){
136                         isTreeHidden = "true";
137                 }else{
138                         isTreeHidden = "false";
139                 }
140         %>
141         //if ("<%=isTreeHidden%>" == "true"){
142         //      hideTree();
143         //}
144         //document.getElementById('contentDiv').style.height=document.body.offsetHeight - 50;
145 </script>
146 <%!     private String HTMLEncode(String value) {
147                 StringBuffer sb = new StringBuffer(value);
148                 
149                 for(int i=0; i<sb.length(); i++)
150                         if(sb.charAt(i)=='<')
151                                 sb.replace(i, i+1, "&lt;");
152                         else if(sb.charAt(i)=='>')
153                                 sb.replace(i, i+1, "&gt;");
154                         else if(sb.charAt(i)=='"')
155                                 sb.replace(i, i+1, "&quot;");
156                 
157                 return sb.toString();
158         }   // HTMLEncode
159         
160         private String clearSpaces(String value) {
161                 StringBuffer sb = new StringBuffer(value);
162                 
163                 for(int i=0; i<sb.length(); i++)
164                         if(sb.charAt(i)==' ')
165                                 sb.replace(i, i+1, "&nbsp;");
166                 
167                 return sb.toString();
168         }   // clearSpaces
169         
170         private String nvl(String s)                  { return (s==null)?"":s; }
171         private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %>
172
173