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 ================================================================================
21 Name: report_wizard.jsp
22 Use : Master JSP which navigates to specific JSP when different tab is selected. Default it navigates to the wizard_definition.jsp
27 22-Jun-2009 : Version 8.4 (Sundar);
30 <LI> Save button is suppressed from showing when wizard is in the last page (Run page).</LI>
31 <LI> width of the content_iframe is changed back to default one when navigated from >100% report's run page.</LI>
34 <%@ page import="java.util.*" %>
35 <%@ page import="org.openecomp.portalsdk.analytics.xmlobj.*" %>
36 <%@ page import="org.openecomp.portalsdk.analytics.model.*" %>
37 <%@ page import="org.openecomp.portalsdk.analytics.model.base.*" %>
38 <%@ page import="org.openecomp.portalsdk.analytics.model.definition.*" %>
39 <%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %>
40 <%@ page import="org.openecomp.portalsdk.analytics.controller.*" %>
41 <%@ page import="org.openecomp.portalsdk.analytics.system.*" %>
42 <%@ page import="org.openecomp.portalsdk.analytics.util.*" %>
44 <%@ page errorPage="error_page.jsp" %>
47 <script language="Javascript" src="<%= AppUtils.getBaseFolderURL() %>js/form-field-tooltip.js"></script>
48 <script language="Javascript" src="<%= AppUtils.getBaseFolderURL() %>js/other_scripts.js"></script>
56 String paramString = "";
57 Enumeration en = request.getParameterNames();
59 while (en.hasMoreElements()) {
60 String name = (String) en.nextElement();
61 String values[] = request.getParameterValues(name);
62 if (name.equals(AppConstants.RI_ACTION) == false
63 && name.equals("c_master") == false && name.equals("action") == false
65 for (int i = 0; i < values.length; i++) {
66 //values[i] = values[i].replaceAll("=", "%3d");
67 //values[i] = values[i].replaceAll("\\?", "%3f");
68 //values[i] = values[i].replaceAll("&", "%26");
69 //System.out.println(name + " (" + i + "): [" + values[i] + "]");
70 paramString = paramString + "&" + name + "=" + java.net.URLEncoder.encode(values[i],"UTF8");
77 if (window.parent.document.getElementById('content_Iframe') || window.document.getElementById('content_Iframe')){
79 //window.location="<%= AppUtils.getRaptorActionURL() %>report.create.container&c_master=<%=request.getParameter("c_master")%><%=paramString%>";
82 <% ReportDefinition rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION);
84 String reportID = rdef.getReportID();
85 WizardSequence ws = rdef.getWizardSequence();
87 String curStep = ws.getCurrentStep();
88 String curSubStep = ws.getCurrentSubStep();
91 dbInfo = rdef.getDBInfo();
93 if(dbInfo == null || dbInfo.length() == 0) {
94 dbInfo = (String) session.getAttribute("remoteDB");
97 session.setAttribute("remoteDB", dbInfo);
98 if((dbInfo == null) && (request.getParameter("dataSource")!=null))
99 session.setAttribute("remoteDB", request.getParameter("dataSource"));
101 String title = (reportID.equals("-1")?"Create Report":"Edit Report");
102 String navTitle = Globals.getBaseTitle()+" > " + title;
104 boolean isCrossTab = rdef.getReportType().equals(AppConstants.RT_CROSSTAB);
105 boolean isSQLBased = rdef.getReportDefType().equals(AppConstants.RD_SQL_BASED);
107 <!-- Set All variable to request, to enable included jsp to access it -->
109 request.setAttribute(AppConstants.SI_REPORT_DEFINITION,rdef);
112 <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css">
113 <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/ral.css">
116 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/raptor.js"></script>
118 <jsp:include page="error_include.jsp" flush="true" />
120 <table width="100%" >
121 <tr><td id="folderTreeContainer" width="1%" height='300' valign='top' ><table>
122 <!--<jsp:include page="tree/folderNav.jsp" flush="true" >
123 <jsp:param name="doCollapseTree" value="Y" />
127 <td id="searchContentContainer" valign='top' >
128 <div id="contentDiv" style="position:absoulte;overflow:auto;">
129 <jsp:include page="custom_js_include.jsp" flush="true" />
130 <form id="forma" name="forma" action="<%= AppUtils.getBaseURL() %>" method="post">
131 <input type="hidden" name="action" value="raptor">
132 <input type="hidden" name="<%= AppConstants.RI_ACTION %>" value="report.wizard">
133 <input type="hidden" name="<%= AppConstants.RI_REPORT_ID %>" value="<%= reportID %>">
134 <input type="hidden" name="<%= AppConstants.RI_DETAIL_ID %>" id="<%= AppConstants.RI_DETAIL_ID %>" value="<%= AppUtils.getRequestNvlValue(request, AppConstants.RI_DETAIL_ID) %>">
135 <input type="hidden" id="<%= AppConstants.RI_GO_TO_STEP %>" name="<%= AppConstants.RI_GO_TO_STEP %>" value="">
136 <input type="hidden" id="<%= AppConstants.RI_WIZARD_ACTION %>" name="<%= AppConstants.RI_WIZARD_ACTION %>" value="<%= AppConstants.WA_BACK %>">
137 <input type="hidden" name="<%= AppConstants.RI_JAVASCRIPT_ITEM_ID %>" value="">
139 <table width="94%" border="0" cellspacing="0" cellpadding="0" align=center>
141 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin: 0px;">
143 <% for(ws.resetNext(); ws.hasNext(); ) {
144 String sTab = ws.getNext(); %>
145 <td width="9" align="right"><img border="0" src="<%= AppUtils.getImgFolderURL() %><%= sTab.equals(curStep)?"tab_left_sel.gif":"tab_left.gif" %>" width="9" height="24"></td>
146 <td class=<%= sTab.equals(curStep)?"rbg1":"rbg1d" %> align="center" valign="middle">
147 <% if(sTab.equals(curStep)) { %>
148 <a href="javascript:document.forma.submit()" class=rtabselected onClick="document.getElementById('<%= AppConstants.RI_GO_TO_STEP %>').value='<%= sTab %>';"><%= clearSpaces(sTab) %></a>
149 <% } else if(reportID.equals("-1")) { %>
150 <b class=rtabtext><%= clearSpaces(sTab) %></b>
152 <a href="javascript:document.forma.submit()" class=rtabtext onClick="document.getElementById('<%= AppConstants.RI_GO_TO_STEP %>').value='<%= sTab %>';"><%= clearSpaces(sTab) %></a>
155 <td width="9" align="left"><img border="0" src="<%= AppUtils.getImgFolderURL() %><%= sTab.equals(curStep)?"tab_right_sel.gif":"tab_right.gif" %>" width="9" height="24"></td>
158 <td width="80%"> </td>
162 <table width="100%" border="0" cellspacing="0" cellpadding="3" style="margin: 0px;">
164 <td valign="Middle"><b class=rtableheader><%= navTitle %></b></td>
167 </td></tr><tr><td><% if(curStep.equals(AppConstants.WS_DEFINITION)) { %>
168 <% if(sessionflag == 1) dbInfo = ""; %>
169 <jsp:include page="wizard_definition.jsp"/>
170 <% } else if(curStep.equals(AppConstants.WS_SQL)) { %>
171 <jsp:include page="wizard_sql_def.jsp"/>
172 <% } else if(curStep.equals(AppConstants.WS_TABLES)&&curSubStep.equals("")) { %>
173 <jsp:include page="wizard_tables_list.jsp"/>
174 <% } else if(curStep.equals(AppConstants.WS_TABLES)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %>
175 <jsp:include page="wizard_tables_edit.jsp"/>
176 <% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals("")) { %>
177 <jsp:include page="wizard_columns_list.jsp"/>
178 <% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals(AppConstants.WSS_ADD_MULTI)) { %>
179 <jsp:include page="wizard_columns_add_multi.jsp"/>
180 <% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&curSubStep.equals(AppConstants.WSS_ORDER_ALL)) { %>
181 <jsp:include page="wizard_columns_order_all.jsp"/>
182 <% } else if(curStep.equals(AppConstants.WS_COLUMNS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT) ||curSubStep.equals(AppConstants.WA_MODIFY))) { %>
183 <jsp:include page="wizard_columns_edit.jsp"/>
184 <% } else if(curStep.equals(AppConstants.WS_FORM_FIELDS)&&curSubStep.equals("")||curSubStep.equals(AppConstants.WSS_ADD_BLANK)) { %>
185 <jsp:include page="wizard_form_fields_list.jsp"/>
186 <% } else if(curStep.equals(AppConstants.WS_FORM_FIELDS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %>
187 <jsp:include page="wizard_form_fields_edit.jsp"/>
188 <% } else if(curStep.equals(AppConstants.WS_FILTERS)&&curSubStep.equals("")) { %>
189 <jsp:include page="wizard_filters_list.jsp"/>
190 <% } else if(curStep.equals(AppConstants.WS_FILTERS)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %>
191 <jsp:include page="wizard_filters_edit.jsp"/>
192 <% } else if(curStep.equals(AppConstants.WS_SORTING)&&curSubStep.equals("")) { %>
193 <jsp:include page="wizard_sorting_list.jsp"/>
194 <% } else if(curStep.equals(AppConstants.WS_SORTING)&&curSubStep.equals(AppConstants.WSS_ORDER_ALL)) { %>
195 <jsp:include page="wizard_sorting_order_all.jsp"/>
196 <% } else if(curStep.equals(AppConstants.WS_SORTING)&&(curSubStep.equals(AppConstants.WSS_ADD)||curSubStep.equals(AppConstants.WSS_EDIT))) { %>
197 <jsp:include page="wizard_sorting_edit.jsp"/>
198 <% } else if(curStep.equals(AppConstants.WS_JAVASCRIPT)) { %>
199 <jsp:include page="wizard_javascript.jsp"/>
200 <% } else if(curStep.equals(AppConstants.WS_CHART)) { %>
201 <jsp:include page="wizard_chart.jsp"/>
202 <% } else if(curStep.equals(AppConstants.WS_USER_ACCESS)) { %>
203 <jsp:include page="wizard_user_access.jsp"/>
204 <% } else if(curStep.equals(AppConstants.WS_SCHEDULE)) { %>
205 <jsp:include page="wizard_schedule.jsp"/>
206 <% } else if(curStep.equals(AppConstants.WS_REPORT_LOG)) { %>
207 <jsp:include page="wizard_log.jsp"/>
208 <% } else if(curStep.equals(AppConstants.WS_MAP)) { %>
209 <jsp:include page="wizard_map.jsp"/>
210 <% } else if(curStep.equals(AppConstants.WS_DATA_FORECASTING)) { %>
211 <jsp:include page="wizard_data_forecasting.jsp"/>
213 <jsp:include page="wizard_run.jsp"/>
217 <table width="100%" border="0" cellspacing="1" cellpadding="3">
219 <td width="10%" align="right">
223 <% if(! ws.isInitialStep()) { %>
224 <button type="submit" onClick="document.getElementById('<%= AppConstants.RI_WIZARD_ACTION %>').value='<%= AppConstants.WA_BACK %>';document.forma.submit();" att-button btn-type="primary" size="small" title='Back'>Back</button>
227 <% if(! ws.isFinalStep()) { %>
228 <button type="submit" onClick="if(! dataValidate()) return false; document.getElementById('<%= AppConstants.RI_WIZARD_ACTION %>').value='<%= AppConstants.WA_SAVE %>';document.forma.submit();" att-button btn-type="primary" size="small" title='Save'>Save</button>
229 <button type="submit" onClick="if(! dataValidate()) return false; document.getElementById('<%= AppConstants.RI_WIZARD_ACTION %>').value='<%= AppConstants.WA_NEXT %>';document.forma.submit();" att-button btn-type="primary" size="small" title='Next'>Next</button>
239 <script type="text/javascript">
240 document.title += ' <%=title%>';
243 <jsp:include page="footer.jsp" flush="true" />
249 <%--<jsp:include page="disclaimer.jsp" flush="true" />--%>
251 //document.getElementById('loadingMessageDiv').style.display='none';
252 //adding the bread crumb on the folder tree
253 if (window.parent && window.parent.addBreadCrumb)
254 window.parent.addBreadCrumb(true, "000<%=rdef.getReportID()%>");
255 //displayTree("000<%=rdef.getReportID()%>");
257 String isTreeHidden = "true";
258 if(request.getSession().getAttribute("isTreeHidden") != null && ((String)request.getSession().getAttribute("isTreeHidden")).equals("true")){
259 isTreeHidden = "true";
261 isTreeHidden = "false";
264 //if ("<%=isTreeHidden%>" == "true"){
267 //document.getElementById('contentDiv').style.height=document.body.offsetHeight - 210;
268 function resizeDivScrollbar(){
269 var parentBody = window.parent.document.body;
270 var parentMenu = window.parent.document.getElementById("application");
271 var searchTD = document.getElementById("contentDiv");
272 var contentIframe = window.parent.document.getElementById("content_Iframe");
273 //parentBody.style.width = window.screen.size;
274 //searchTD.style.width = parentBody.clientWidth - 200;
275 //parentMenu.style.width = 1263;
276 //javascript:resizeTo(screen.availWidth,screen.availHeight);
277 if(parentMenu) parentMenu.style.width = screen.availWidth - 150;
278 if(contentIframe) contentIframe.style.width = screen.availWidth - 30;
280 resizeDivScrollbar();
282 <%! private String HTMLEncode(String value) {
283 StringBuffer sb = new StringBuffer(value);
285 for(int i=0; i<sb.length(); i++)
286 if(sb.charAt(i)=='<')
287 sb.replace(i, i+1, "<");
288 else if(sb.charAt(i)=='>')
289 sb.replace(i, i+1, ">");
290 else if(sb.charAt(i)=='"')
291 sb.replace(i, i+1, """);
293 return sb.toString();
296 private String clearSpaces(String value) {
297 StringBuffer sb = new StringBuffer(value);
299 for(int i=0; i<sb.length(); i++)
300 if(sb.charAt(i)==' ')
301 sb.replace(i, i+1, " ");
303 return sb.toString();
306 private String nvl(String s) { return (s==null)?"":s; }
307 private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %>