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="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.*" %>
30 <%@ page errorPage="error_page.jsp" %>
32 class ValueComparator implements Comparator {
33 public int compare(Object o1, Object o2) {
34 Map.Entry e1 = (Map.Entry) o1;
35 Map.Entry e2 = (Map.Entry) o2;
36 Comparable c1 = (Comparable)e1.getValue();
37 Comparable c2 = (Comparable)e2.getValue();
38 return c1.compareTo(c2);
43 HashMap hashMap = ReportLoader.loadReportsToSchedule(request);
44 ReportDefinition rdef = (ReportDefinition) request.getAttribute(AppConstants.SI_REPORT_DEFINITION);
45 if(rdef ==null) rdef = (ReportDefinition) request.getSession().getAttribute(AppConstants.SI_REPORT_DEFINITION);
46 Set mapSet = hashMap.entrySet();
47 List entrylist = new ArrayList(mapSet);
48 Collections.sort(entrylist, new ValueComparator());
50 session.removeAttribute(AppConstants.SI_REPORT_SCHEDULE);
51 session.removeAttribute(AppConstants.SI_REPORT_DEFINITION);
52 ReportSchedule reportSchedule = (ReportSchedule) session.getAttribute(AppConstants.SI_REPORT_SCHEDULE);
54 <jsp:include page="header.jsp" flush="true" />
55 <!-- <link rel="stylesheet" type="text/css" href="<%= AppUtils.getBaseFolderURL() %>css/raptor.css">-->
56 <script language="JavaScript" src="<%= AppUtils.getBaseFolderURL() %>js/raptor.js"></script>
59 <jsp:include page="error_include.jsp" flush="true" />
61 <% if (rdef == null || request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE) == null) {%>
63 <form name="formb" action="<%= AppUtils.getBaseURL() %>" method="post">
64 <input type="hidden" name="action" value="raptor">
65 <input type="hidden" name="<%= AppConstants.RI_ACTION %>" value="report.schedule.multiple">
68 <table width="94%" class="tableBorder" border="0" cellspacing="0" cellpadding="0" align=center valign="center">
70 <table width="100%" border="0" cellspacing="0" cellpadding="3">
73 <td valign="Middle"><b class=rtableheader><%= "Scheduling Report" %></b></td>
75 <% if(request.getAttribute("message")!=null) { %>
77 <td valign="Middle"><b class=rtableheader><%= (String) request.getAttribute("message") %></b></td>
82 <tr> <td> <font class=rtabletext> Reports: </font></td><td height="30" align="center">
83 <% if (rdef !=null && request.getSession().getAttribute(AppConstants.SI_REPORT_SCHEDULE) != null ) {%>
84 <font class=rtabletext><%= rdef.getReportName()%></font>
86 <select name="schedule_reports" onChange="document.formb.<%= AppConstants.RI_ACTION %>.value='report.schedule.report.submit'; document.formb.submit();">
87 <option value="-1" selected> -->select report <-- </option>
88 <% for (Iterator iter = entrylist.iterator(); iter.hasNext();) {
89 me=(Map.Entry)iter.next();
91 <% if (rdef !=null && rdef.getReportID().equals((String)me.getKey())) {%>
92 <option value="<%=(String) me.getKey()%>" selected> <%=(String) me.getValue()%> </option>
94 <option value="<%=(String) me.getKey()%>"> <%=(String) me.getValue()%> </option>
105 <% if(reportSchedule!=null) { %>
106 <jsp:include page="wizard_schedule_only.jsp" flush="true"/>
108 <jsp:include page="footer.jsp" flush="true" />
113 <%--<jsp:include page="disclaimer.jsp" flush="true" />--%>
115 //document.getElementById('loadingMessageDiv').style.display='none';
116 //adding the bread crumb on the folder tree
118 String isTreeHidden = "true";
119 if(request.getSession().getAttribute("isTreeHidden") != null && ((String)request.getSession().getAttribute("isTreeHidden")).equals("true")){
120 isTreeHidden = "true";
122 isTreeHidden = "false";
125 //if ("<%=isTreeHidden%>" == "true"){
128 //document.getElementById('contentDiv').style.height=document.body.offsetHeight - 50;
130 <%! private String HTMLEncode(String value) {
131 StringBuffer sb = new StringBuffer(value);
133 for(int i=0; i<sb.length(); i++)
134 if(sb.charAt(i)=='<')
135 sb.replace(i, i+1, "<");
136 else if(sb.charAt(i)=='>')
137 sb.replace(i, i+1, ">");
138 else if(sb.charAt(i)=='"')
139 sb.replace(i, i+1, """);
141 return sb.toString();
144 private String clearSpaces(String value) {
145 StringBuffer sb = new StringBuffer(value);
147 for(int i=0; i<sb.length(); i++)
148 if(sb.charAt(i)==' ')
149 sb.replace(i, i+1, " ");
151 return sb.toString();
154 private String nvl(String s) { return (s==null)?"":s; }
155 private String nvl(String s, String sDefault) { return nvl(s).equals("")?sDefault:s; } %>