private boolean _jspx_meth_c_if_1(javax.servlet.jsp.PageContext pageContext) throws Throwable { JspWriter out = pageContext.getOut(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); /* ---- c:if ---- */ org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_if_1 = (org.apache.taglibs.standard.tag.el.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.el.core.IfTag.class); _jspx_th_c_if_1.setPageContext(pageContext); _jspx_th_c_if_1.setParent(null); _jspx_th_c_if_1.setTest("${param.orgAdminPopup}"); int _jspx_eval_c_if_1 = _jspx_th_c_if_1.doStartTag(); if (_jspx_eval_c_if_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n "); JspRuntimeLibrary.include( request, response, "/includes/orgAdmin_header.jsp" + "?" + "help=" + "monitoringadmin%2Fusers%2FWTHelp_User.html", out, false); out.write("\n"); int evalDoAfterBody = _jspx_th_c_if_1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_if_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_1); return false; }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; javax.servlet.jsp.PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("\n\n"); // Get the current user's ac WTAccountCredentials ac = WTAccountCredentials.current(); SecureInfoManagerImpl sim = new SecureInfoManagerImpl(); // Setup for permission checking boolean editInterfaces = false; if (sim.canEditEntity(ProtectedResourceConstants.PR_INTERFACES, ac)) editInterfaces = true; pageContext.setAttribute("editInterfaces", new Boolean(editInterfaces)); out.write(" \n"); String hostIP = null; try { hostIP = InetAddress.getLocalHost().getHostAddress(); // out.print(hostIP); } catch (UnknownHostException ex) { throw new Exception("Could not determine the local host address", ex); } out.write("\n\nvar javaScriptVar=\""); out.print(hostIP); out.write("\";\nvar javaScriptVar2=\""); out.print(editInterfaces); out.write("\";\n"); } catch (Throwable t) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (pageContext != null) pageContext.handlePageException(t); } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; javax.servlet.jsp.PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); User user = null; UserFactory userFactory = UserFactory.getInstance(); String userID = request.getParameter("userID"); try { UserFactory.init(); user = userFactory.getUser(userID); } catch (Exception e) { throw new ServletException("Could not find user " + userID + " in user factory.", e); } out.write("\n"); out.write("<html>\n"); out.write("<head>\n "); out.write("<title>WebTelemetry - | User Management | User Detail"); out.write("</title>\n "); out.write("<base HREF=\""); out.print(org.opennms.web.Util.calculateUrlBase(request)); out.write("\" />\n "); out.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/wt-portal/css/default.css\" />\n\t"); out.write("<script type=\"text/javascript\" src=\"/wt-portal/javascript/WTtools.js\">"); out.write("</script>\n"); out.write("</head>\n"); out.write("<body>\n"); String title = " User Management - Detail Summary for: " + userID; out.write("\n"); /* ---- c:if ---- */ org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_if_0 = (org.apache.taglibs.standard.tag.el.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.el.core.IfTag.class); _jspx_th_c_if_0.setPageContext(pageContext); _jspx_th_c_if_0.setParent(null); _jspx_th_c_if_0.setTest("${not param.orgAdminPopup}"); int _jspx_eval_c_if_0 = _jspx_th_c_if_0.doStartTag(); if (_jspx_eval_c_if_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n "); JspRuntimeLibrary.include( request, response, "/includes/header.jsp" + "?" + "title=" + java.net.URLEncoder.encode("" + title) + "&" + "help=" + "monitoringadmin%2Fusers%2FWTHelp_User.html", out, false); out.write("\n"); int evalDoAfterBody = _jspx_th_c_if_0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_if_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return; _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_0); out.write("\n"); if (_jspx_meth_c_if_1(pageContext)) return; out.write("\n\n"); out.write("<!-- BEGIN FRAMING TABLE:open tags, keep at 100%-->\n"); out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t"); out.write("<tr>\n\t\t"); out.write("<td width=\"10\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"1\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n\t\t"); out.write("<td>\n"); out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">User Information"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Full Name:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">"); out.print(user.getFullName()); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Comments:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(user.getUserComments()); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); out.write("<br>\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Notification Information"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Email:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">"); out.print(userFactory.getEmail(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Pager Email:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getPagerEmail(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Numerical Service:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getNumericPage(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Numerical Pin:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getNumericPin(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Text Service:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getTextPage(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Text Pin:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getTextPin(userID)); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); out.write("<br>\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Duty Schedules"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write("<br />\n "); out.write("<!-- weekly schedule -->\n "); out.write( "<table width=\"50%\" border=\"1\" bordercolor=\"#999999\" cellspacing=\"0\" cellpadding=\"2\" >\n\t\t\t"); Collection dutySchedules = user.getDutyScheduleCollection(); out.write("\n "); int i = 0; Iterator iter = dutySchedules.iterator(); while (iter.hasNext()) { DutySchedule tmp = new DutySchedule((String) iter.next()); Vector curSched = tmp.getAsVector(); i++; out.write("\n "); out.write("<tr>\n "); ChoiceFormat days = new ChoiceFormat("0#Mo|1#Tu|2#We|3#Th|4#Fr|5#Sa|6#Su"); for (int j = 0; j < 7; j++) { Boolean curDay = (Boolean) curSched.get(j); out.write("\n "); out.write("<td width=\"5%\">\n "); out.print((curDay.booleanValue() ? days.format(j) : "X")); out.write("\n "); out.write("</td>\n "); } out.write("\n "); out.write("<td width=\"5%\">\n "); out.print(curSched.get(7)); out.write("\n "); out.write("</td>\n "); out.write("<td width=\"5%\">\n "); out.print(curSched.get(8)); out.write("\n "); out.write("</td>\n "); out.write("</tr>\n "); } out.write("\n "); out.write("</table>\n "); out.write("<!-- end weekly schedule --> \n "); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n "); out.write("</tr> \n"); out.write("</table>\n"); out.write("<br>"); out.write("<br>\n"); out.write("<b>Member of the Following Organizations & Groups:"); out.write("</b>\n"); out.write("<!-- BEGIN: NEW ASSIGNED GROUPS TABLE -->\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\n "); // Get the user's orgs WTOrganizationDAO orgDAO = DAOImpl.OrgDAO; WTOrganization[] orgs = orgDAO.getWTOrganization(); if (orgs != null) { // Loop thru orgs for (int idx = 0; idx < orgs.length; idx++) { out.write("\n\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Organization Name: "); out.print(orgs[idx].getName()); out.write("</td>\n\t"); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Assigned Groups:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">\n "); // Get the orgs groups WTGroupManager grpMgr = ManagersImpl.GroupManager; int[] orgids = {orgs[idx].getID()}; List groups = grpMgr.getUserGroups(user.getUserId(), orgids); if (groups != null) { // Loop thru the groups for (Iterator iterGrps = groups.iterator(); iterGrps.hasNext(); ) { WTGroup group = (WTGroup) iterGrps.next(); WTRole role = (group.getRoles() == null ? null : (WTRole) group.getRoles().get(0)); out.write("\n "); out.print(group.getName()); out.write(" ("); out.print((role == null ? "" : role.getName())); out.write(")"); out.write("<br/>\n "); } } out.write("\n\n "); out.write("</td>\n\t"); out.write("</tr>\n\n "); } } out.write("\n\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n "); out.write("</tr> \n"); out.write("</table>\n"); out.write("<!-- END: NEW ASSIGNED GROUPS TABLE -->\n\n\n"); out.write("<!-- BEGIN FRAMING TABLE:close tags-->\n\t\t"); out.write("</td>\n\t"); out.write("</tr>\n"); out.write("</table>\n"); out.write("<!-- END FRAMING TABLE:close tags-->\n"); out.write("<br>\n\n"); JspRuntimeLibrary.include(request, response, "/includes/footer.jsp", out, false); out.write("\n"); out.write("</body>\n"); out.write("</html>\n\n"); } catch (Throwable t) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (pageContext != null) pageContext.handlePageException(t); } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; javax.servlet.jsp.PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n\r\n"); out.write("\r\n\r\n"); String strIp = (String) request.getParameter("ip"); String strCommunityString = (String) request.getParameter("cs"); String strPort = (String) request.getParameter("port"); String strTimeout = (String) request.getParameter("timeout"); String strRetries = (String) request.getParameter("retries"); String strNodeLabel = (String) request.getParameter("node"); String strNodeId = request.getParameter("nodeId"); String strFirstTime = (String) request.getParameter("firsttime"); String strWindowId = (String) request.getParameter("windowid"); // Create the querier and make the request. QueryFactory factory = new QueryFactory(); Querier querier = (Querier) factory.createQuerier(WinPagePerfSnmpQuerier.QUERIER_NAME); DeviceCommunicator deviceCommunicator = new DeviceCommunicator(); deviceCommunicator.sendQuery(querier, strIp); // Error processing if (querier.getErrorStatus() == -1) { RequestDispatcher rd = getServletContext() .getRequestDispatcher("/jsp/WTerror-handler.jsp?error=SnmpCommError"); rd.forward(request, response); return; } if (querier.getErrorStatus() == -2) { RequestDispatcher rd = getServletContext() .getRequestDispatcher("/jsp/WTerror-handler.jsp?error=NoPerfmibSnmpError"); rd.forward(request, response); return; } if (querier.getErrorStatus() != 0) { RequestDispatcher rd = getServletContext().getRequestDispatcher("/jsp/WTerror-handler.jsp?error=SnmpError"); rd.forward(request, response); return; } Map calcs = querier.getCalculations(); long[] results = (long[]) calcs.get(WinPagePerfSnmpQuerier.PAGE_RESULTS); if (results[0] < 0 || results[1] < 0 || results[2] < 0 || results[3] < 0 || results[4] < 0 || results[5] < 0 || results[6] < 0 || results[7] < 0 || results[8] < 0 || results[9] < 0) { RequestDispatcher rd = getServletContext().getRequestDispatcher("/jsp/WTerror-handler.jsp?error=SnmpError"); rd.forward(request, response); return; } Vector vPageStats = null; if (strFirstTime == null) { // Not the first time, so get the previous polled data from the session vPageStats = (Vector) session.getAttribute("vPageStats" + strWindowId); } else { // This is the first time in this JSP, so create the Vector which will contain the // polled data Random random = new Random(); strWindowId = String.valueOf(random.nextInt()); vPageStats = new Vector(); } vPageStats.add(results); session.setAttribute("vPageStats" + strWindowId, vPageStats); // This random number is used to prevent the brower from caching the IMG tags Random random = new Random(); int randomInt = random.nextInt(); out.write("\r\n\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n "); out.write("<title>WebTelemetry - Graphs | Real-Time | Windows Page Performance Monitoring"); out.write("</title>\r\n "); out.write("<META HTTP-EQUIV=\"refresh\" CONTENT=\""); out.print(WTProperties.getMonitorUIRefreshRate()); out.write("; URL="); out.print(WTTools.getJspURL(request)); out.write("WTwin-page-monitor.jsp?cs="); out.print(URLEncoder.encode(strCommunityString, "UTF-8")); out.write("&ip="); out.print(strIp); out.write("&port="); out.print(strPort); out.write("&timeout="); out.print(strTimeout); out.write("&retries="); out.print(strRetries); out.write("&node="); out.print(URLEncoder.encode(strNodeLabel, "UTF-8")); out.write("&windowid="); out.print(strWindowId); out.write("&nodeId="); out.print(strNodeId); out.write("\">\r\n "); out.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/wt-portal/css/default.css\" />\r\n "); out.write("<script type=\"text/javascript\" src=\"/wt-portal/javascript/WTtools.js\">"); out.write("</script>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); String title = "Graphs - Real-Time - Windows Page Performance Monitoring for Node: " + strNodeLabel; out.write("\r\n"); request.setAttribute("title", title); request.setAttribute("nodeJsp", "/wt-monitor/element/node.jsp?node=" + strNodeId); out.write("\r\n"); /* ---- c:import ---- */ org.apache.taglibs.standard.tag.el.core.ImportTag _jspx_th_c_import_0 = (org.apache.taglibs.standard.tag.el.core.ImportTag) _jspx_tagPool_c_import_url_context.get( org.apache.taglibs.standard.tag.el.core.ImportTag.class); _jspx_th_c_import_0.setPageContext(pageContext); _jspx_th_c_import_0.setParent(null); _jspx_th_c_import_0.setContext("/wt-monitor"); _jspx_th_c_import_0.setUrl("/includes/header.jsp"); int[] _jspx_push_body_count_c_import_0 = new int[] {0}; try { int _jspx_eval_c_import_0 = _jspx_th_c_import_0.doStartTag(); if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) { javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody(); _jspx_push_body_count_c_import_0[0]++; out = _bc; _jspx_th_c_import_0.setBodyContent(_bc); _jspx_th_c_import_0.doInitBody(); } do { out.write("\r\n\t"); if (_jspx_meth_c_param_0( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\r\n\t"); if (_jspx_meth_c_param_1( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\r\n\t"); if (_jspx_meth_c_param_2( _jspx_th_c_import_0, pageContext, _jspx_push_body_count_c_import_0)) return; out.write("\r\n"); int evalDoAfterBody = _jspx_th_c_import_0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); if (_jspx_eval_c_import_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) out = pageContext.popBody(); _jspx_push_body_count_c_import_0[0]--; } if (_jspx_th_c_import_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return; } catch (Throwable _jspx_exception) { while (_jspx_push_body_count_c_import_0[0]-- > 0) out = pageContext.popBody(); _jspx_th_c_import_0.doCatch(_jspx_exception); } finally { _jspx_th_c_import_0.doFinally(); _jspx_tagPool_c_import_url_context.reuse(_jspx_th_c_import_0); } out.write("\t\r\n\t"); out.write("\r\n"); out.write("<div align=\"center\">\r\n"); out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t"); out.write("<tr>\r\n\t\t"); out.write("<td align=\"right\">"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagefaultchart&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t\t"); out.write("<td>"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"1\" width=\"20\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\r\n\t\t"); out.write("<td>"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagefaultseries&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t"); out.write("</tr>\r\n\t"); out.write("<tr>\r\n\t\t"); out.write("<td align=\"right\">"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagenumchart&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t\t"); out.write("<td> "); out.write("</td>\r\n\t\t"); out.write("<td>"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagenumseries&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t"); out.write("</tr>\r\n\t"); out.write("<tr>\r\n\t\t"); out.write("<td align=\"right\">"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagetimeschart&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t\t"); out.write("<td> "); out.write("</td>\r\n\t\t"); out.write("<td>"); out.write("<IMG SRC=\""); out.print(WTTools.getServletURL(request)); out.write("WTsnmpRealTimeGraphs?chart=winpagetimesseries&random="); out.print(randomInt); out.write("&windowid="); out.print(strWindowId); out.write("\" BORDER=0>"); out.write("</td>\r\n\t"); out.write("</tr>\r\n"); out.write("</table>\r\n"); out.write("</div>\r\n"); out.write("<br>\r\n\r\n"); /* ---- c:import ---- */ org.apache.taglibs.standard.tag.el.core.ImportTag _jspx_th_c_import_1 = (org.apache.taglibs.standard.tag.el.core.ImportTag) _jspx_tagPool_c_import_url_context_nobody.get( org.apache.taglibs.standard.tag.el.core.ImportTag.class); _jspx_th_c_import_1.setPageContext(pageContext); _jspx_th_c_import_1.setParent(null); _jspx_th_c_import_1.setContext("/wt-monitor"); _jspx_th_c_import_1.setUrl("/includes/footer.jsp"); int[] _jspx_push_body_count_c_import_1 = new int[] {0}; try { int _jspx_eval_c_import_1 = _jspx_th_c_import_1.doStartTag(); if (_jspx_th_c_import_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return; } catch (Throwable _jspx_exception) { while (_jspx_push_body_count_c_import_1[0]-- > 0) out = pageContext.popBody(); _jspx_th_c_import_1.doCatch(_jspx_exception); } finally { _jspx_th_c_import_1.doFinally(); _jspx_tagPool_c_import_url_context_nobody.reuse(_jspx_th_c_import_1); } out.write("\r\n\t\r\n"); out.write("</body>\r\n"); out.write("</html>"); } catch (Throwable t) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (pageContext != null) pageContext.handlePageException(t); } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; javax.servlet.jsp.PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n\n"); out.write("\n\n"); PollerConfiguration pollconfig = getPollerConfiguration(); org.opennms.netmgt.config.poller.Package pkg = null; int pkgIdx = -1; String pkgIdxStr = (String) request.getParameter("pkgidx"); if (pkgIdxStr != null && pkgIdxStr.trim().length() > 0) { try { pkgIdx = Integer.parseInt(pkgIdxStr); if (pkgIdx >= 0) { if (pollconfig != null) { pkg = pollconfig.getPackage(pkgIdx); } } } catch (NumberFormatException ne) { ne.printStackTrace(); } } if (pkg == null) { if ((org.opennms.netmgt.config.poller.Package) request.getSession().getAttribute("pkg") != null) { pkg = (org.opennms.netmgt.config.poller.Package) request.getSession().getAttribute("pkg"); } } if (pkgIdx == -1) { pkgIdxStr = (String) request.getSession().getAttribute("pkgidx"); if (pkgIdxStr != null && pkgIdxStr.trim().length() > 0) { try { pkgIdx = Integer.parseInt(pkgIdxStr); } catch (NumberFormatException ne) { ne.printStackTrace(); } } } request.getSession().setAttribute("pkg", pkg); request.getSession().setAttribute("pkgidx", String.valueOf(pkgIdx)); String title = " Poller Package Downtime Model"; if (pkg != null) { title = " Poller Package - Downtime Model for: " + pkg.getName(); } out.write("\n\n"); out.write("<html>\n"); out.write("<head>\n "); out.write("<title>"); out.print(title); out.write("</title>\n "); out.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/wt-portal/css/default.css\" />\n "); out.write("<script type=\"text/javascript\" src=\"/wt-portal/javascript/WTtools.js\">"); out.write("</script>\n\n"); out.write( "<script language=javascript>\nfunction confirmDelete(msg)\n{\n\tvar agree=confirm(msg);\n\tif (agree)\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\nfunction addDowntime()\n{\n var msg = \"\";\n var error = false;\n var begin = 0;\n var end = 0;\n var interval = 0;\n\n dtbeginday = parseInt(document.downtime.dtbeginday.value) * 24 * 60 * 60 * 1000;\n dtbeginhour = parseInt(document.downtime.dtbeginhour.value) * 60 * 60 * 1000;\n dtbeginminute = parseInt(document.downtime.dtbeginminute.value) * 60 * 1000;\n dtbeginsecond = parseInt(document.downtime.dtbeginsecond.value) * 1000;\n dtbeginmillisecond = parseInt(document.downtime.dtbeginmillisecond.value);\n\n dtendday = parseInt(document.downtime.dtendday.value) * 24 * 60 * 60 * 1000;\n dtendhour = parseInt(document.downtime.dtendhour.value) * 60 * 60 * 1000;\n dtendminute = parseInt(document.downtime.dtendminute.value) * 60 * 1000;\n dtendsecond = parseInt(document.downtime.dtendsecond.value) * 1000;\n dtendmillisecond = parseInt(document.downtime.dtendmillisecond.value);\n"); out.write( "\n dtintervalday = parseInt(document.downtime.dtintervalday.value) * 24 * 60 * 60 * 1000;\n dtintervalhour = parseInt(document.downtime.dtintervalhour.value) * 60 * 60 * 1000;\n dtintervalminute = parseInt(document.downtime.dtintervalminute.value) * 60 * 1000;\n dtintervalsecond = parseInt(document.downtime.dtintervalsecond.value) * 1000;\n dtintervalmillisecond = parseInt(document.downtime.dtintervalmillisecond.value);\n\n document.downtime.dtbegin.value = dtbeginday + dtbeginhour + dtbeginminute + dtbeginsecond + dtbeginmillisecond;\n document.downtime.dtend.value = dtendday + dtendhour + dtendminute + dtendsecond + dtendmillisecond;\n document.downtime.dtinterval.value = dtintervalday + dtintervalhour + dtintervalminute + dtintervalsecond + dtintervalmillisecond;\n\n\tvar beginVal = trim(document.downtime.dtbegin.value);\n\tvar endVal = trim(document.downtime.dtend.value);\n\tvar intervalVal = trim(document.downtime.dtinterval.value);\n\n if (beginVal == \"\") {\n error = true;\n msg += \"Must enter a numeric time value for \\\"begin\\\".\\n\";\n"); out.write( " }\n if (endVal == \"\") {\n error = true;\n msg += \"\\nMust enter a numeric time value for \\\"end\\\".\\n\";\n }\n if (intervalVal == \"\") {\n error = true;\n msg += \"\\nMust enter a numeric time value for \\\"interval\\\".\\n\";\n }\n if (isNaN(beginVal)) {\n error = true;\n msg += \"\\nMust enter a numeric time value for \\\"begin\\\".\\n\";\n }\n if (isNaN(endVal)) {\n error = true;\n msg += \"\\nMust enter a numeric time value for \\\"end\\\".\\n\";\n }\n if (isNaN(intervalVal)) {\n error = true;\n msg += \"\\nMust enter a numeric time value for \\\"interval\\\".\\n\";\n }\n\n if (!error) {\n begin = parseInt(beginVal);\n end = parseInt(endVal);\n interval = parseInt(intervalVal);\n \n if (!(end > 0)) {\n error = true;\n msg = \"The end time must be greater than zero.\\n\";\n }\n if (!(interval > 0)) {\n error = true;\n msg += \"\\nThe 'interval' value must be greater than zero.\\n\";\n }\n"); out.write( " if (!((end - begin) > 0)) {\n error = true;\n msg += \"\\nThe 'end' time must be greater than the 'begin'.\\n\";\n }\n if (!(interval "); out.write( "<= (end - begin))) {\n error = true;\n msg += \"\\nThe 'interval' time must be less than the difference of the 'begin' and the 'end'.\\n\";\n }\n }\n\n if (error) {\n alert (msg);\n return;\n }\n else\n {\n document.downtime.target = \"pollerDetailFrame\";\n \tdocument.downtime.action.value = 'adddt';\n \tdocument.downtime.submit();\n }\n}\n\nfunction removeDowntime(dtidx)\n{\n if (confirmDelete('Are you sure you want to delete this downtime model?')) {\n document.downtime.target = \"pollerDetailFrame\";\n document.downtime.action.value = 'removedt';\n document.downtime.dtidx.value = dtidx;\n \tdocument.downtime.submit();\n }\n}\n\nfunction updateDowntime()\n{\n document.downtime.target = \"_parent\";\n document.downtime.action.value = 'updatedt';\n\tdocument.downtime.submit();\n}\n\nfunction restoreDefaultDowntime()\n{\n if (confirmDelete('Are you sure you want to restore the default downtime model? All your changes will be lost.')) {\n document.downtime.target = \"pollerDetailFrame\";\n"); out.write( " document.downtime.action.value = 'restoredt';\n \tdocument.downtime.submit();\n }\n}\n"); out.write("</script>\n"); out.write("</head>\n"); out.write("<body>\n\n\t"); String breadcrumb1 = "<a href='admin/index.jsp'></a>"; out.write("\n\t"); String breadcrumb2 = "Poller Packages"; out.write("\n\t"); JspRuntimeLibrary.include( request, response, "/includes/header.jsp" + "?" + "title=" + java.net.URLEncoder.encode("" + title) + "&" + "location=" + "admin" + "&" + "help=" + "monitoringadmin%2Fpolling%2FWTHelp_PollerPackageDowntimeModel.html" + "&" + "noPopOut=" + "true" + "&" + "breadcrumb=" + java.net.URLEncoder.encode("" + breadcrumb1) + "&" + "breadcrumb=" + java.net.URLEncoder.encode("" + breadcrumb2), out, false); out.write("\n"); out.write("<!-- BEGIN FRAMING TABLE:open tags, keep at 100%-->\n"); out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t"); out.write("<tr>\n\t\t"); out.write("<td width=\"10\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"1\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n\t\t"); out.write("<td>\n"); out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n\t"); out.write("<form action=\""); out.print(WTTools.getMonServletURL(request)); out.write("WTPollerPackages\" method=\"post\" name=\"downtime\" target=\"_parent\">\n\t "); out.write("<input type=\"hidden\" name=\"action\" value=\"\">\n\t "); out.write("<input type=\"hidden\" name=\"pkgidx\" value=\"\">\n\t "); out.write("<input type=\"hidden\" name=\"dtidx\" value=\"\">\n\t "); out.write("<input type=\"hidden\" name=\"dtbegin\" value=\"\">\n\t "); out.write("<input type=\"hidden\" name=\"dtend\" value=\"\">\n\t "); out.write("<input type=\"hidden\" name=\"dtinterval\" value=\"\">\n\n"); out.write("<table width=\"98%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr>\n "); out.write("<td colspan=\"4\">"); out.write("<b>Downtime Model:"); out.write("</b>"); out.write("<a class=\"tt\" href=\"javascript: towerTip("); out.print(WTTips.TIP_POLLER_MON_SERVICE); out.write(");\" title=\"Telemetry Tip\">"); out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">"); out.write("</a>"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" width=\"25%\">Begin Time"); out.write("<a class=\"tt\" href=\"javascript: towerTip("); out.print(WTTips.TIP_POLLER_DT_BEGIN); out.write(");\" title=\"Telemetry Tip\">"); out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">"); out.write("</a>"); out.write("</td>\n "); out.write("<td class=\"tableHeader\" width=\"25%\">End Time"); out.write("<a class=\"tt\" href=\"javascript: towerTip("); out.print(WTTips.TIP_POLLER_DT_END); out.write(");\" title=\"Telemetry Tip\">"); out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">"); out.write("</a>"); out.write("</td>\n "); out.write("<td class=\"tableHeader\" width=\"25%\">Polling Interval"); out.write("<a class=\"tt\" href=\"javascript: towerTip("); out.print(WTTips.TIP_POLLER_DT_INTERVAL); out.write(");\" title=\"Telemetry Tip\">"); out.write("<img src=\"/wt-portal/images/icons/tower_tips.gif\" border=\"0\">"); out.write("</a>"); out.write("</td>\n "); out.write("<td class=\"tableHeader\" width=\"25%\">Action"); out.write("</td>\n "); out.write("</tr>\n "); long daymilli = 24 * 60 * 60 * 1000; // 86400000 long hourmlli = 60 * 60 * 1000; // 3600000; long minutemilli = 60 * 1000; // 60000; long secondmilli = 1000; String pattern2digit = "00"; DecimalFormat df2digit = new DecimalFormat(pattern2digit); String pattern3digit = "000"; DecimalFormat df3digit = new DecimalFormat(pattern3digit); long begin = 0; long end = 0; long interval = 0; String delete = null; long addbegin = 0; if (pkg != null) { Downtime[] ds = pkg.getDowntime(); if (ds != null) { for (int i = 0; i < ds.length; i++) { Downtime d = ds[i]; begin = d.getBegin(); end = d.getEnd(); interval = d.getInterval(); delete = d.getDelete(); long dtbegin = begin; long dtend = end; long dtinterval = interval; addbegin = begin; long dtbeginday = 0; long dtbeginhour = 0; long dtbeginminute = 0; long dtbeginsecond = 0; long dtbeginmillisecond = 0; long dtendday = 0; long dtendhour = 0; long dtendminute = 0; long dtendsecond = 0; long dtendmillisecond = 0; long dtintervalday = 0; long dtintervalhour = 0; long dtintervalminute = 0; long dtintervalsecond = 0; long dtintervalmillisecond = 0; if (dtbegin > 0) { dtbeginday = dtbegin / daymilli; dtbegin -= (dtbeginday * daymilli); } if (dtbegin > 0) { dtbeginhour = dtbegin / hourmlli; dtbegin -= (dtbeginhour * hourmlli); } if (dtbegin > 0) { dtbeginminute = dtbegin / minutemilli; dtbegin -= (dtbeginminute * minutemilli); } if (dtbegin > 0) { dtbeginsecond = dtbegin / secondmilli; dtbegin -= (dtbeginsecond * secondmilli); } if (dtbegin > 0) { dtbeginmillisecond = dtbegin; } if (dtend > 0) { dtendday = dtend / daymilli; dtend -= (dtendday * daymilli); } if (dtend > 0) { dtendhour = dtend / hourmlli; dtend -= (dtendhour * hourmlli); } if (dtend > 0) { dtendminute = dtend / minutemilli; dtend -= (dtendminute * minutemilli); } if (dtend > 0) { dtendsecond = dtend / secondmilli; dtend -= (dtendsecond * secondmilli); } if (dtend > 0) { dtendmillisecond = dtend; } if (dtinterval > 0) { dtintervalday = dtinterval / daymilli; dtinterval -= (dtintervalday * daymilli); } if (dtinterval > 0) { dtintervalhour = dtinterval / hourmlli; dtinterval -= (dtintervalhour * hourmlli); } if (dtinterval > 0) { dtintervalminute = dtinterval / minutemilli; dtinterval -= (dtintervalminute * minutemilli); } if (dtinterval > 0) { dtintervalsecond = dtinterval / secondmilli; dtinterval -= (dtintervalsecond * secondmilli); } if (dtinterval > 0) { dtintervalmillisecond = dtinterval; } out.write("\n "); out.write("<!--\n \t\t"); out.write("<TR>\n \t\t"); out.write("<TD align=\"center\">\n \t\t"); out.write("<INPUT name=\"dtbegin_"); out.print(String.valueOf(i)); out.write("\" type=\"text\" value=\""); out.print(begin); out.write("\" disabled>\n \t\t"); out.write("</TD>\n \t\t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtend_"); out.print(String.valueOf(i)); out.write("\" type=\"text\" value=\""); out.print(end); out.write("\" disabled>"); out.write("</TD>\n \t\t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtinterval_"); out.print(String.valueOf(i)); out.write("\" type=\"text\" value=\""); out.print(interval); out.write("\" disabled>"); out.write("</TD>\n \t\t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtdel_"); out.print(String.valueOf(i)); out.write("\" type=\"checkbox\" value=\"true\" "); if (delete != null && delete.equals("true")) { out.write("checked"); } out.write(" disabled>"); out.write("</TD>\n \t\t"); out.write("<TD align=\"center\">\n "); if ((i + 2) == ds.length) { out.write("\n "); out.write("<a HREF=\"javascript:removeDowntime('"); out.print(i); out.write("')\" title=\"Remove Downtime Model\">Remove"); out.write("</a>\n "); } else { out.write("\n \n "); } out.write("\n "); out.write("</TD>\n \t\t"); out.write("</TR>\n \t\t-->\n\n \t\t"); if (i < (ds.length - 1)) { out.write("\n "); out.write("<tr class=\""); out.print(((i % 2) == 0) ? "tableRowLIght" : "tableRowDark"); out.write("\">\n \t\t"); out.write("<td class=\"tableText\">\n \t\t"); out.print(dtbeginday); out.write(" days "); out.print(df2digit.format(dtbeginhour)); out.write(":"); out.print(df2digit.format(dtbeginminute)); out.write(":"); out.print(df2digit.format(dtbeginsecond)); out.write(":"); out.print(df3digit.format(dtbeginmillisecond)); out.write("\n "); out.write("</td>\n \t\t"); out.write("<td class=\"tableText\">\n \t\t "); out.print(dtendday); out.write(" days "); out.print(df2digit.format(dtendhour)); out.write(":"); out.print(df2digit.format(dtendminute)); out.write(":"); out.print(df2digit.format(dtendsecond)); out.write(":"); out.print(df3digit.format(dtendmillisecond)); out.write("\n "); out.write("</td>\n \t\t"); out.write("<td class=\"tableText\">\n \t\t"); out.print(dtintervalday); out.write(" days "); out.print(df2digit.format(dtintervalhour)); out.write(":"); out.print(df2digit.format(dtintervalminute)); out.write(":"); out.print(df2digit.format(dtintervalsecond)); out.write(":"); out.print(df3digit.format(dtintervalmillisecond)); out.write("\n "); out.write("</td>\n "); out.write("<td class=\"tableText\">\n "); if (i == (ds.length - 2)) { out.write("\n "); out.write("<a href=\"javascript:removeDowntime('"); out.print(i); out.write("')\" title=\"Remove Downtime Model\">Remove"); out.write("</a>"); out.write("</td>\n "); } out.write("\n "); out.write("</td>\n \t\t"); } else { out.write("\n\t\t\t\t\t\t"); out.write("<tr>"); out.write("<td colspan=\"3\"> "); out.write("</td>"); out.write("</tr>\n "); out.write("<tr class=\"tableHeader\">\n \t\t"); out.write("<td class=\"tableHeader\" colspan=\"3\">\n "); if ((delete == null || !delete.equals("true")) && end == 0 && interval > 0) { out.write("\n \t\tAfter\n \t\t"); out.write("<b>\n \t\t "); if (dtbeginday > 0) { out.print(dtbeginday); out.write(" days"); } out.write("\n \t\t "); if (dtbeginhour > 0) { out.print(dtbeginhour); out.write(" hr"); } out.write("\n \t\t "); if (dtbeginminute > 0) { out.print(dtbeginminute); out.write(" min"); } out.write("\n \t\t "); if (dtbeginsecond > 0) { out.print(dtbeginsecond); out.write(" sec"); } out.write("\n \t\t "); if (dtbeginmillisecond > 0) { out.print(dtbeginmillisecond); out.write(" ms"); } out.write("\n \t\t"); out.write( "</b>\n \t\tthe system will continue to poll downed nodes at a\n \t\t"); out.write("<b>\n \t\t "); if (dtintervalday > 0) { out.print(dtintervalday); out.write(" day"); } out.write("\n \t\t "); if (dtintervalhour > 0) { out.print(dtintervalhour); out.write(" hr"); } out.write("\n \t\t "); if (dtintervalminute > 0) { out.print(dtintervalminute); out.write(" min"); } out.write("\n \t\t "); if (dtintervalsecond > 0) { out.print(dtintervalsecond); out.write(" sec"); } out.write("\n \t\t "); if (dtintervalmillisecond > 0) { out.print(dtintervalmillisecond); out.write(" ms"); } out.write("\n "); out.write( "</b>\n interval.\n "); } out.write("\n "); out.write("</td>\n "); if (i == (ds.length - 2)) { out.write("\n "); } else { out.write("\n "); out.write("<td class=\"tableHeader\"> "); out.write("</td>\n "); } out.write("\n \t\t"); } out.write("\n \t\t"); out.write("</tr>\n \t\t"); } } } out.write("\n "); out.write("<!--\n \t"); out.write("<TR>\n \t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtbegin\" type=\"text\" value=\""); out.print(begin); out.write("\" readonly>"); out.write("</TD>\n \t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtend\" type=\"text\" value=\"\">"); out.write("</TD>\n \t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtinterval\" type=\"text\" value=\"\">"); out.write("</TD>\n \t"); out.write("<TD align=\"center\">"); out.write("<INPUT name=\"dtdel\" type=\"checkbox\" value=\"true\" disabled>"); out.write("</TD>\n \t"); out.write("<TD align=\"center\">"); out.write("<a HREF=\"javascript:addDowntime()\" title=\"Add Downtime Model\">Add Downtime"); out.write("</a>"); out.write("</TD>\n \t"); out.write("</TR>\n \t-->\n \t"); long dtbeginday = 0; long dtbeginhour = 0; long dtbeginminute = 0; long dtbeginsecond = 0; long dtbeginmillisecond = 0; long dtendday = 0; long dtendhour = 0; long dtendminute = 0; long dtendsecond = 0; long dtendmillisecond = 0; long dtintervalday = 0; long dtintervalhour = 0; long dtintervalminute = 0; long dtintervalsecond = 0; long dtintervalmillisecond = 0; if (addbegin > 0) { dtbeginday = addbegin / daymilli; addbegin = addbegin - (dtbeginday * daymilli); } if (addbegin > 0) { dtbeginhour = addbegin / hourmlli; addbegin = addbegin - (dtbeginhour * hourmlli); } if (addbegin > 0) { dtbeginminute = addbegin / minutemilli; addbegin = addbegin - (dtbeginminute * minutemilli); } if (addbegin > 0) { dtbeginsecond = addbegin / secondmilli; addbegin = addbegin - (dtbeginsecond * secondmilli); } if (addbegin > 0) { dtbeginmillisecond = addbegin; } out.write("\n \t"); out.write("<tr class=\"tableRowLight\">\n \t"); out.write("<td>\n \t "); out.write("<input type=\"hidden\" name=\"dtbeginday\" value=\""); out.print(dtbeginday); out.write("\">\n \t "); out.write("<input type=\"hidden\" name=\"dtbeginhour\" value=\""); out.print(dtbeginhour); out.write("\">\n \t "); out.write("<input type=\"hidden\" name=\"dtbeginminute\" value=\""); out.print(dtbeginminute); out.write("\">\n \t "); out.write("<input type=\"hidden\" name=\"dtbeginsecond\" value=\""); out.print(dtbeginsecond); out.write("\">\n \t "); out.write("<input type=\"hidden\" name=\"dtbeginmillisecond\" value=\""); out.print(dtbeginmillisecond); out.write("\">\n \t "); out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Days: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.print(dtbeginday); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Hours: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.print(dtbeginhour); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Minutes: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.print(dtbeginminute); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Seconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.print(dtbeginsecond); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Milliseconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.print(dtbeginmillisecond); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("</table>\n \t"); out.write("</td>\n \t"); out.write("<td>\n \t "); out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Days: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtendday\">\n\t\t "); for (int i = 0; i <= 365; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtendday == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Hours: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtendhour\">\n\t\t "); for (int i = 0; i < 24; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtendhour == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Minutes: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtendminute\">\n\t\t "); for (int i = 0; i < 60; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtendminute == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Seconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtendsecond\">\n\t\t "); for (int i = 0; i < 60; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtendsecond == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Milliseconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtendmillisecond\">\n\t\t "); for (int i = 0; i < 1000; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtendmillisecond == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("</table>\n\n \t"); out.write("</td>\n \t"); out.write("<td>\n \t "); out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Days: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtintervalday\">\n\t\t "); for (int i = 0; i <= 365; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtintervalday == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Hours: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtintervalhour\">\n\t\t "); for (int i = 0; i < 24; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtintervalhour == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Minutes: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtintervalminute\">\n\t\t "); for (int i = 0; i < 60; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtintervalminute == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Seconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtintervalsecond\">\n\t\t "); for (int i = 0; i < 60; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtintervalsecond == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("<tr class=\"tableRowLight\">\n \t "); out.write("<td nowrap>Milliseconds: "); out.write("</td>\n \t "); out.write("<td nowrap>"); out.write("<select name=\"dtintervalmillisecond\">\n\t\t "); for (int i = 0; i < 1000; i++) { out.write("\n\t\t "); out.write("<option value="); out.print(i); out.write(" "); if (dtintervalmillisecond == i) { out.write("selected"); } out.write(">"); out.print(df3digit.format(i)); out.write("\n "); } out.write("\n\t\t "); out.write("</select>"); out.write("</td>\n \t "); out.write("</tr>\n \t "); out.write("</table>\n \t"); out.write("</td>\n \t"); out.write("<!--\n \t"); out.write("<TD align=\"center\">\n \t"); out.write("<INPUT name=\"dtdel\" type=\"checkbox\" value=\"true\" disabled>\n \t"); out.write("</TD>\n \t-->\n \t"); out.write("<td align=\"center\" nowrap>"); out.write("<a href=\"javascript:addDowntime()\" title=\"Add Downtime Model\">Add Downtime"); out.write("</a>"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"4\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr>\n "); out.write("<td colspan=\"4\">"); out.write("<br />\n "); out.write("<a href=\"javascript:restoreDefaultDowntime()\">"); out.write( "<img src=\"/wt-portal/images/buttons/btn_restore_defaults.gif\" border=\"0\" alt=\"Restore Defaults\">"); out.write("</a>\n \n "); out.write("<!--"); out.write( "<input type=\"submit\" name=\"button\" onclick=\"return restoreDefaultDowntime()\" value=\"Restore Defaults\" title=\"Restore Downtime Model Defaults\">-->"); out.write("<br />\n "); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); out.write("</form>\n"); out.write("<!-- BEGIN FRAMING TABLE:close tags-->\n\t\t"); out.write("</td>\n\t"); out.write("</tr>\n"); out.write("</table>\n"); out.write("<!-- END FRAMING TABLE:close tags-->\n"); out.write("<p>\n"); JspRuntimeLibrary.include( request, response, "/includes/footer.jsp" + "?" + "location=" + "admin", out, false); out.write("\n\n "); out.write("</body>\n"); out.write("</html>\n"); } catch (Throwable t) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (pageContext != null) pageContext.handlePageException(t); } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; _jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("<!DOCTYPE html>\n"); out.write("<html>\n"); out.write(" <head>\n"); out.write( " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); out.write(" <title>Fine</title>\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"> \n"); out.write("\n"); out.write(" </head>\n"); out.write(" <body style = \"background-image: url(lib2.jpg)\"> \n"); out.write(" <center>\n"); out.write(" <h1>Update Fines information</h1>\n"); out.write(" <form name=\"Update\" action=\"Fines_upd.jsp\">\n"); out.write(" <table border=\"0\" width=\"3\" cellspacing=\"2\">\n"); out.write(" <thead>\n"); out.write(" <tr>\n"); out.write(" <th>Update Fines</th>\n"); out.write(" <th></th>\n"); out.write(" </tr>\n"); out.write(" </thead>\n"); out.write(" <tbody>\n"); out.write(" <tr>\n"); out.write(" <td>Update Fine table with todays Data</td>\n"); out.write( " <td><input type=\"submit\" value=\"Update / View Fines\" name=\"SUBMIT\"/></td>\n"); out.write(" </tr>\n"); out.write(" </tbody>\n"); out.write(" </table> \n"); out.write(" </form>\n"); out.write(" <h1>Check your Fines Here</h1>\n"); out.write(" <form name=\"Fines\" action=\"Fines.jsp\">\n"); out.write(" <table border=\"0\" width=\"3\" cellspacing=\"2\">\n"); out.write(" <thead>\n"); out.write(" <tr>\n"); out.write(" <th>Get Fine Details</th>\n"); out.write(" <th></th>\n"); out.write(" </tr>\n"); out.write(" </thead>\n"); out.write(" <tbody>\n"); out.write(" <tr>\n"); out.write(" <td>Card No</td>\n"); out.write( " <td><input type=\"text\" name=\"Card_no\" value=\"\"/></td>\n"); out.write(" </tr>\n"); out.write(" <tr>\n"); out.write(" <td></td>\n"); out.write( " <td><input type=\"submit\" value=\"Get Fines\" name=\"SUBMIT\" /></td>\n"); out.write(" </tr>\n"); out.write(" </tbody>\n"); out.write(" </table> \n"); out.write(" "); Connection con = null; String[] selected_Checkboxes = request.getParameterValues("chk"); PreparedStatement pst = null; ResultSet result = null; ResultSet resUpd = null; con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/lbms_db?zeroDateTimeBehavior=convertToNull", "root", "admin12"); String Card_no = request.getParameter("Card_no"); String button = null; Date dt = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); String current_date = sdf.format(dt); if (Card_no != null && selected_Checkboxes == null) { String selSql = "SELECT l.card_no, SUM(f.fine_amt) AS total_fine, f.paid " + "FROM book_loans l, fines f " + "WHERE l.loan_id = f.loan_id AND " + "l.card_no = " + Card_no + " " + "GROUP BY l.card_no"; pst = con.prepareStatement(selSql); result = pst.executeQuery(); String box = null; String paid; String pay; Boolean chk = false; out.println("<table>"); pay = "<form action='Fines.jsp'>"; out.println(pay); out.println("<tr>"); out.println("<th>Card No</th>"); out.println("<th>Fine_Amt</th>"); out.println("<th>Paid OR Not</th>"); out.println("</tr>"); while (result.next()) { chk = true; paid = "No"; if (result.getBoolean("f.paid")) { paid = "Yes"; } out.println("<tr>"); out.println( "<td>" + result.getInt("l.card_no") + "</td><td>" + result.getString("total_fine") + "</td><td>" + paid + "</td>"); out.print("<td>"); box = "<input name='chk' value=" + result.getInt("l.card_no") + " type='checkbox'>"; out.print(box); out.print("</td>"); out.print("</tr>"); } if (chk == true) { out.println("<tr>"); out.print("<td>"); button = "<input type='submit' value='Pay Fine' name='Pay'>"; out.print(button); out.print("</td>"); out.println("</tr>"); } else { out.write( "<dialog open> <font color = 'green'>No Fine information. You owe nothing! Thank You</font> </dialog>"); } out.println("</form>"); out.println("</table>"); } else if (selected_Checkboxes != null) { String sqlLoan = null; ResultSet resultLoan = null; String sqlUpdFine = null; PreparedStatement pstUpd = null; String sqlBook = null; ResultSet rsltBook = null; char chkouts = 'N'; int length_chk = selected_Checkboxes.length; for (int i = 0; i < length_chk; i++) { // Check whether the Book is returned before paying the fine. sqlBook = "SELECT COUNT(loan_id) AS no_chkouts FROM book_loans WHERE card_no = " + selected_Checkboxes[i] + " AND date_in = '0000-00-00' AND due_date < " + current_date + ""; pst = con.prepareStatement(sqlBook); rsltBook = pst.executeQuery(); while (rsltBook.next()) { if (rsltBook.getInt("no_chkouts") > 0) { chkouts = 'Y'; } } if (chkouts == 'Y') { out.write( "<dialog open> <font color = 'red'>You have outstanding due checkouts!. Please return the books and then Pay the fine</font> </dialog>"); } // Get the corresponding loan_Ids for each customer from Fines table sqlLoan = "SELECT loan_id FROM book_loans WHERE card_no = " + selected_Checkboxes[i] + " AND date_in IS NOT NULL AND due_date < date_in"; pst = con.prepareStatement(sqlLoan); resultLoan = pst.executeQuery(); while (resultLoan.next()) { sqlUpdFine = "UPDATE fines SET paid = true WHERE loan_id = " + resultLoan.getInt("loan_id") + ""; pstUpd = con.prepareStatement(sqlUpdFine); pstUpd.executeUpdate(); out.println("Payment Updated Successfully"); } } } out.write("\n"); out.write(" </form> \n"); out.write(" </center>\n"); out.write("</body>\n"); out.write("</html>\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }