コード例 #1
0
  private void printFailures(
      JspWriter out, JobTracker tracker, JobID jobId, String kind, String cause)
      throws IOException {
    JobInProgress job = (JobInProgress) tracker.getJob(jobId);
    if (job == null) {
      out.print("<b>Job " + jobId + " not found.</b><br>\n");
      return;
    }

    boolean includeMap = false;
    boolean includeReduce = false;
    if (kind == null) {
      includeMap = true;
      includeReduce = true;
    } else if ("map".equals(kind)) {
      includeMap = true;
    } else if ("reduce".equals(kind)) {
      includeReduce = true;
    } else if ("all".equals(kind)) {
      includeMap = true;
      includeReduce = true;
    } else {
      out.print("<b>Kind " + kind + " not supported.</b><br>\n");
      return;
    }

    TaskStatus.State state = null;
    try {
      if (cause != null) {
        state = TaskStatus.State.valueOf(cause.toUpperCase());
        if (state != TaskStatus.State.FAILED && state != TaskStatus.State.KILLED) {
          out.print("<b>Cause '" + cause + "' is not an 'unsuccessful' state.</b><br>\n");
          return;
        }
      }
    } catch (IllegalArgumentException e) {
      out.print("<b>Cause '" + cause + "' not supported.</b><br>\n");
      return;
    }

    out.print("<table border=2 cellpadding=\"5\" cellspacing=\"2\">");
    out.print(
        "<tr><th>Attempt</th><th>Task</th><th>Machine</th><th>State</th>"
            + "<th>Error</th><th>Logs</th></tr>\n");
    if (includeMap) {
      TaskInProgress[] tips = job.getTasks(TaskType.MAP);
      for (int i = 0; i < tips.length; ++i) {
        printFailedAttempts(out, tracker, jobId, tips[i], state);
      }
    }
    if (includeReduce) {
      TaskInProgress[] tips = job.getTasks(TaskType.REDUCE);
      for (int i = 0; i < tips.length; ++i) {
        printFailedAttempts(out, tracker, jobId, tips[i], state);
      }
    }
    out.print("</table>\n");
  }
コード例 #2
0
  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);
    }
  }
コード例 #3
0
  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/xml;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");

      HttpSession user = request.getSession(true);
      Notification newNotice = (Notification) user.getAttribute("newNotice");
      List exclude = new ArrayList();
      exclude.add(NotificationWizardServlet.WT_VENDOR_NAME); // Exclude WebTelemetry

      out.print(buildTree(newNotice, exclude));
      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);
    }
  }
コード例 #4
0
  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//\n// This file is part of the OpenNMS(R) Application.\n//\n// OpenNMS(R) is Copyright (C) 2002-2003 The OpenNMS Group, Inc.  All rights reserved.\n// OpenNMS(R) is a derivative work, containing both original code, included code and modified\n// code that was published under the GNU General Public License. Copyrights for modified \n// and included code are below.\n//\n// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.\n//\n// Modifications:\n//\n// 2002 Nov 12: Added response time, based on original  performance code.\n//\n// Original code base Copyright (C) 1999-2001 Oculan Corp.  All rights reserved.\n//\n// This program is free software; you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation; either version 2 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n");
      out.write(
          "// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program; if not, write to the Free Software\n// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n//\n// For more information contact:\n//      OpenNMS Licensing       ");
      out.write(
          "<*****@*****.**>\n//      http://www.opennms.org/\n//      http://www.opennms.com/\n//\n\n-->\n\n");
      out.write("\n\n");
      out.write("\n\n");
      out.write("\n\n");

      ResponseTimeModel.QueryableNode[] nodes = this.model.getQueryableNodes();

      out.write("\n      \n");
      out.write(
          "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" bordercolor=\"black\" bgcolor=\"#cccccc\">\n  ");
      out.write("<tr>\n    ");
      out.write("<td bgcolor=\"#999999\" >");
      out.write("<b>");
      out.write("<a href=\"response/index.jsp\">Response Time");
      out.write("</a>");
      out.write("</b>");
      out.write("</td>\n  ");
      out.write("</tr>\n\n");
      if (nodes != null && nodes.length > 0) {
        out.write("\n  ");
        out.write("<tr> \n    ");
        out.write("<td>\n      ");
        out.write("<form method=\"get\" action=\"response/addIntfFromNode\" >\n        ");
        out.write(
            "<input type=\"hidden\" name=\"endUrl\" value=\"response/addReportsToUrl\" />\n        ");
        out.write("<input type=\"hidden\" name=\"relativetime\" value=\"lastday\" />\n\n        ");
        out.write(
            "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n          ");
        out.write("<tr>\n            ");
        out.write("<td>\n              ");
        out.write("<font size=\"-1\">Choose a node to query");
        out.write("</font>\n            ");
        out.write("</td>\n          ");
        out.write("</tr>\n          ");
        out.write("<tr>\n            ");
        out.write("<td>\n              ");
        out.write("<select name=\"node\" size=\"1\">\n                ");
        for (int i = 0; i < nodes.length; i++) {
          out.write("\n                   ");
          out.write("<option value=\"");
          out.print(nodes[i].nodeId);
          out.write("\">");
          out.print(nodes[i].nodeLabel);
          out.write("</option>\n                ");
        }
        out.write("\n              ");
        out.write("</select>\n            ");
        out.write("</td>\n          ");
        out.write("</tr>\n          ");
        out.write("<tr>\n            ");
        out.write("<td>\n              ");
        out.write("<input type=\"submit\" value=\"Execute Query\" />\n            ");
        out.write("</td>\n          ");
        out.write("</tr>\n        ");
        out.write("</table>\n      ");
        out.write("</form>\n    ");
        out.write("</td>\n  ");
        out.write("</tr>\n");
      } else {
        out.write("\n  ");
        out.write("<tr>\n    ");
        out.write("<td>\n      No response time data has been gathered yet\n    ");
        out.write("</td>\n  ");
        out.write("</tr>        \n");
      }
      out.write("\n");
      out.write("</table>\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);
    }
  }
コード例 #5
0
ファイル: QueryList_jsp.java プロジェクト: huaminglee/Code
  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;

      out.write("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<head>\r\n");
      out.write("<base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset= GBK \">\r\n");
      out.write("<title>成衣维修登记列表查询</title>\r\n");
      out.write("\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/themes/default/easyui.css\">\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/themes/icon.css\">\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/demo/demo.css\">\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/jquery-1.8.0.min.js\" charset=\"GBK\"></script>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/jquery.easyui.min.js\" charset=\"GBK\"></script>\r\n");
      out.write("\r\n");
      out.write("<script language=\"javascript\" >\r\n");
      out.write("\r\n");
      out.write("//下拉列表选择  店铺编码\r\n");
      out.write("$(function(){\r\n");
      out.write("\t$('#dp').combogrid({\r\n");
      out.write("\t\tpanelWidth:260,\r\n");
      out.write(" \t\tmode:'remote',\r\n");
      out.write("\t\tidField:'depotid',\r\n");
      out.write("\t\ttextField:'dname',\r\n");
      out.write("\t\turl:'rest/getFilterdp/S2',\r\n");
      out.write("\t\tmethod:'post',\r\n");
      out.write("\t \r\n");
      out.write("\t\tcolumns:[[\r\n");
      out.write("\t\t\t{field:'depotid',title:'店铺编号',width:90},\r\n");
      out.write("\t\t\t{field:'dname',title:'店铺名称',width:160},\r\n");
      out.write("\r\n");
      out.write("\t\t]]\r\n");
      out.write("\t});\r\n");
      out.write("});\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("//普通下拉2   店铺类型\r\n");
      out.write("$(function(){\r\n");
      out.write("\t\t\t$('#zt').combobox({\r\n");
      out.write("\t\t\t\turl:'rest/getFilterzt/S1',\r\n");
      out.write("\t\t\t\tmethod:'post',\r\n");
      out.write("\t\t\t\tvalueField:'bh',\r\n");
      out.write("\t\t\t\ttextField:'mc'\r\n");
      out.write("\t\t\t});\r\n");
      out.write("\t\t});\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t \r\n");
      out.write("//结果列表\r\n");
      out.write("\t$(function(){\r\n");
      out.write("\t\t$('#operateRecordGrid').datagrid({\r\n");
      out.write("\t\t//\ttitle:'DataGrid - ContextMenu',\r\n");
      out.write("\t\t\ticonCls:'icon-save',\r\n");
      out.write("\t\t\twidth:960,\r\n");
      out.write("\t\t\theight:400,\r\n");
      out.write("\t\t\tnowrap: true,\r\n");
      out.write("\t\t\tautoRowHeight: false,\r\n");
      out.write("\t\t\tstriped: true,\r\n");
      out.write("\t\t\tcollapsible:true,\r\n");
      out.write("\t\t\tloadMsg:'正在努力查找数据……',\r\n");
      out.write("\t\t\t//url:'/gclm/web/maintainregister!execute',\r\n");
      out.write("\t\t\turl:'rest/getList/'+$('#status').attr('value'),\r\n");
      out.write("\t\t\tmethod:'post',\r\n");
      out.write("\t\t\tsingleSelect:true,\r\n");
      out.write("\t\t\tonDblClickRow: function() {\r\n");
      out.write("\t\t\t\t\r\n");
      out.write("\t\t\t    var selected = $('#operateRecordGrid').datagrid('getSelected');\r\n");
      out.write("\t\t\t   \r\n");
      out.write("\t\t\t    \r\n");
      out.write("\t\t\t    if (selected){\r\n");
      out.write("\t\t\t    \t\r\n");
      out.write("\t\t\t    \t\r\n");
      out.write("\t\t\t    \twindow.parent.listDbOnclick(selected.guid,selected.zt);\r\n");
      out.write("\t\t\t  /*\r\n");
      out.write("\t\t\t    \tif(selected.zt==0){\r\n");
      out.write(
          "\t\t\t            window.open(\"cm/register/querydetail_register.jsp?guid=\"+selected.guid+\"&zt=\"+selected.zt);\r\n");
      out.write("\t\t\t    \t}else if(selected.zt==1){\r\n");
      out.write(
          "\t\t\t    \t\twindow.open(\"cm/register/querydetail_pjpd.jsp?guid=\"+selected.guid+\"&zt=\"+selected.zt);\r\n");
      out.write("\t\t\t    \t}\r\n");
      out.write("\t\t\t    \telse if(\"3,4,5\".indexOf(selected.zt)>=0){\r\n");
      out.write(
          "\t\t\t    \t\twindow.open(\"cm/register/querydetail_pjpd2.jsp?guid=\"+selected.guid+\"&zt=\"+selected.zt);\r\n");
      out.write("\t\t\t    \t}\r\n");
      out.write("\t\t\t    \telse {\r\n");
      out.write(
          "\t\t\t    \t\twindow.open(\"cm/register/querydetail_noable.jsp?guid=\"+selected.guid+\"&zt=\"+selected.zt);\r\n");
      out.write("\t\t\t    \t}\r\n");
      out.write("\t\t\t    */\t\r\n");
      out.write("\t\t\t    \r\n");
      out.write("\t\t\t   }\r\n");
      out.write("\t\t\t  }\r\n");
      out.write("\t\t\t    \t\r\n");
      out.write("\t\t\t    \t,\r\n");
      out.write("\t\t\tcolumns:[[\r\n");
      out.write("\t\t\t\t{field:'dh',title:'维修单号',width:130,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'ydh',title:'运单号',width:100,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'dpbm',title:'店铺编码',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'dpmc',title:'店铺名称',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'kh',title:'款号',width:100,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'zt',title:'状态',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'djsj',title:'登记时间',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'thrq',title:'退回日期',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'gkxm',title:'顾客姓名',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'vipkh',title:'VIP卡号',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'jjcd',title:'紧急程度',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'wxxz1',title:'维修性质1',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'wtd1',title:'问题点1',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'qy1',title:'起因1',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'xxd1',title:'现象点1',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'bwms',title:'部位描述',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'pjpdsj',title:'品检判定时间',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'zbfhBzrq',title:'总部发货时间',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'pdclfs',title:'判定处理方式',width:120,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'wxsj',title:'维修时间',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'dppj',title:'店铺满意度',width:90,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'thdh',title:'退货单号',width:130,sortable:true},\r\n");
      out.write("\t\t\t\t{field:'posthfhddzbs',title:'POS退货发货单登帐标识',width:140,sortable:true}\r\n");
      out.write("\t\t\t]],\r\n");
      out.write("\t\t\tpagination:true,\r\n");
      out.write("\t\t\trownumbers:true\r\n");
      out.write("\t\t\t   \r\n");
      out.write("        /*    toolbar:[{  \r\n");
      out.write("                id : 'btngjsearch',  \r\n");
      out.write("                text : '搜索',  \r\n");
      out.write("                iconCls : 'icon-search',  \r\n");
      out.write("                handler :searchData,  \r\n");
      out.write("        }]  \r\n");
      out.write("\t\t\t */\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t});\r\n");
      out.write("\t//$(\"div.datagrid-toolbar\").html(\"查询关键字:<input type='text' />\");\r\n");
      out.write("\t\tvar p = $('#operateRecordGrid').datagrid('getPager');\r\n");
      out.write("\t\t$(p).pagination({\r\n");
      out.write("\t\t\tonBeforeRefresh:function(){\r\n");
      out.write("\t\t\t\talert('before refresh');\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t});\r\n");
      out.write("\t});\r\n");
      out.write("\t \r\n");
      out.write("\t /*\r\n");
      out.write("    //搜索功能   \r\n");
      out.write("         function reloadgrid (keyword)  {    \r\n");
      out.write(
          "        var queryParams = $('#operateRecordGrid').datagrid('options').queryParams;    \r\n");
      out.write("         queryParams.state = keyword;    \r\n");
      out.write(
          "         $('#operateRecordGrid').datagrid('options').queryParams=queryParams;          \r\n");
      out.write("         $(\"#operateRecordGrid\").datagrid('reload');   \r\n");
      out.write("         \r\n");
      out.write("    } */\r\n");
      out.write("    function searchData(){  \r\n");
      out.write("     \tvar dh,dp,vipkh,     ydh,kh,zt,           dd1,dd2,lx;\r\n");
      out.write("    \t\r\n");
      out.write("    \tdh=document.getElementById(\"dh\").value;\r\n");
      out.write("    \tdp=$('#dp').combobox('getValue');\r\n");
      out.write("    \tvipkh = document.getElementById(\"vipkh\").value;\r\n");
      out.write("    \t\r\n");
      out.write("    \tydh=document.getElementById(\"ydh\").value;\r\n");
      out.write("    \tkh=document.getElementById(\"kh\").value;\r\n");
      out.write("    \tzt=$('#zt').combobox('getValue');\r\n");
      out.write("    \t\r\n");
      out.write("    \tdd1 = $('#dd1').datebox('getValue'); \r\n");
      out.write("    \tdd2=$('#dd2').datebox('getValue');\r\n");
      out.write("    \tlx=$('#lx').combobox('getValue');\r\n");
      out.write("    \t//alert(wxdh+\"===\"+dp+\"====\"+dd1);\r\n");
      out.write("         \r\n");
      out.write(
          "        var query={dh:dh,dp:dp,vipkh:vipkh,    ydh:ydh,kh:kh,zt:zt,           dd1:dd1,dd2:dd2,lx:lx}; //把查询条件拼接成JSON\r\n");
      out.write(" \r\n");
      out.write(
          "        $(\"#operateRecordGrid\").datagrid('options').queryParams=query; //把查询条件赋值给datagrid内部变量\r\n");
      out.write("    \t$(\"#operateRecordGrid\").datagrid('reload'); //重新加载\r\n");
      out.write("       \r\n");
      out.write("         } \r\n");
      out.write(" \r\n");
      out.write("    \r\n");
      out.write("    $(function(){\r\n");
      out.write("        $('#dd1').datebox({\r\n");
      out.write(
          "            formatter: function(date){ return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate(); },\r\n");
      out.write(
          "            parser: function(date){ return new Date(Date.parse(date.replace(/-/g,\"/\"))); }\r\n");
      out.write("            });    \r\n");
      out.write("        })\r\n");
      out.write("    $(function(){\r\n");
      out.write("        $('#dd2').datebox({\r\n");
      out.write(
          "            formatter: function(date){ return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate(); },\r\n");
      out.write(
          "            parser: function(date){ return new Date(Date.parse(date.replace(/-/g,\"/\"))); }\r\n");
      out.write("            });    \r\n");
      out.write("        })\r\n");
      out.write("    \r\n");
      out.write("    </script>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("\t<table>\r\n");
      out.write(" \r\n");
      out.write(" <tr>\r\n");
      out.write("\t<td>\r\n");
      out.write("\t</td>\r\n");
      out.write("\r\n");
      out.write("\t<td>\r\n");
      out.write("\t\r\n");
      out.write("\t<div align=\"center\">\r\n");
      out.write("\t<table>\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t<td><input id=\"status\"  type=\"hidden\" value=\"");
      out.print(request.getParameter("status"));
      out.write("\"></td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tr><td>维修单号</td><td>\r\n");
      out.write(
          "\t<input id=\"dh\"  class=\"easyui-validatebox\" validType=\"minLength[0]\"/>\r\n");
      out.write("\t \r\n");
      out.write(
          "\t</td><td>店铺</td><td><select id=\"dp\" name=\"dept\" style=\"width:135px;\"></select></td><td>客户/VIP号</td><td><input id=\"vipkh\"></input></td><td></td></tr>\r\n");
      out.write("\t\r\n");
      out.write(
          "\t<tr><td>运输单号</td><td><input id=\"ydh\"></input></td><td>款号</td><td><input id=\"kh\"></input></td><td>状态</td><td>\r\n");
      out.write(
          "\t<select id=\"zt\" class=\"easyui-combobox\" name=\"state\" style=\"width:135px;\"></select>\r\n");
      out.write(
          "\t</td><td><a id=\"button\" class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-search'\" onclick=\" searchData()\">查询</a></td></tr>\r\n");
      out.write("\t");
      out.write("\r\n");
      out.write("\t\r\n");
      out.write(
          "\t<tr><td>登记时间</td><td><input id=\"dd1\"  class=\"easyui-datebox\" style=\"width:135px;\" ></input></td><td>- -</td><td><input id=\"dd2\" class=\"easyui-datebox\" style=\"width:135px;\"></input></td>\r\n");
      out.write("\t<td>店铺类型</td>\r\n");
      out.write("\t<td>\r\n");
      out.write(
          "\t<select id=\"lx\" class=\"easyui-combobox\" name=\"state\" style=\"width:135px;height: 50px;\" data-options=\"required:true,panelHeight:'auto'\" >\r\n");
      out.write("\t\t<option value=\"0\" selected>全部</option>\r\n");
      out.write("\t\t<option value=\"1\">自营</option>\r\n");
      out.write("\t\t<option value=\"2\">加盟</option>\r\n");
      out.write("\t</select>\r\n");
      out.write("\t</td>\r\n");
      out.write("\t<td> ");
      out.write("</tr>\r\n");
      out.write("\t\r\n");
      out.write("\t</table>\r\n");
      out.write("\t</div>\r\n");
      out.write("\t<br/><br/>\r\n");
      out.write("\t  \r\n");
      out.write("\t<div>\r\n");
      out.write("\t<table id=\"operateRecordGrid\"></table>\r\n");
      out.write("\t</div>\r\n");
      out.write("\t</td>\r\n");
      out.write("\t<td>\r\n");
      out.write("\t<div align=\"right\"></div>\r\n");
      out.write("\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t</table>\r\n");
      out.write("\t\r\n");
      out.write("\t<input id=\"path\" type=\"hidden\" value=\"");
      out.print(path);
      out.write("\" />\r\n");
      out.write("\t\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #6
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      pageContext =
          _jspxFactory.getPageContext(this, request, response, "error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n\r\n\r\n\r\n\r\n");

      PresencePlugin plugin =
          (PresencePlugin) XMPPServer.getInstance().getPluginManager().getPlugin("presence");

      // Get parameters
      boolean save = request.getParameter("save") != null;
      boolean success = request.getParameter("success") != null;
      boolean presencePublic = ParamUtils.getBooleanParameter(request, "presencePublic");
      String unavailableStatus =
          ParamUtils.getParameter(request, "presenceUnavailableStatus", false);
      if (unavailableStatus == null) {
        unavailableStatus = plugin.getUnavailableStatus();
      }

      // Handle a save
      if (save) {
        plugin.setPresencePublic(presencePublic);
        plugin.setUnavailableStatus(unavailableStatus);
        response.sendRedirect("presence-service.jsp?success=true");
        return;
      }

      presencePublic = plugin.isPresencePublic();

      out.write(
          "\r\n\r\n<html>\r\n    <head>\r\n        <title>Presence Service</title>\r\n        <meta name=\"pageID\" content=\"presence-service\"/>\r\n    </head>\r\n    <body>\r\n\r\n<div class=\"information\">\r\n    ");

      String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
      int port = JiveGlobals.getXMLProperty("adminConsole.port", -1);
      int securePort = JiveGlobals.getXMLProperty("adminConsole.securePort", -1);
      boolean secureOnly = (port == -1);

      out.write("\r\n\r\n    Presence Service URL:<br>\r\n    <tt>");
      out.print(secureOnly ? "https" : "http");
      out.write(':');
      out.write('/');
      out.write('/');
      out.print(serverName);
      out.write(':');
      out.print(secureOnly ? securePort : port);
      out.write("/plugins/presence/status</tt>\r\n    <br><br>\r\n    Example:<br>\r\n    <tt>");
      out.print(secureOnly ? "https" : "http");
      out.write(':');
      out.write('/');
      out.write('/');
      out.print(serverName);
      out.write(':');
      out.print(secureOnly ? securePort : port);
      out.write("/plugins/presence/status?jid=admin@");
      out.print(serverName);
      out.write(
          "</tt>  \r\n\r\n\r\n</div>\r\n\r\n<p>\r\nUse the form below to configure user presence visibility. By default, user\r\npresence should only be visible to those users that are authorized.<br>\r\n</p>\r\n\r\n");
      if (success) {
        out.write(
            "\r\n\r\n    <div class=\"jive-success\">\r\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n    <tbody>\r\n        <tr><td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\"></td>\r\n        <td class=\"jive-icon-label\">\r\n            Presence service properties edited successfully.\r\n        </td></tr>\r\n    </tbody>\r\n    </table>\r\n    </div><br>\r\n");
      }
      out.write(
          "\r\n\r\n<form action=\"presence-service.jsp?save\" method=\"post\">\r\n\r\n<fieldset>\r\n    <legend>Presence visibility</legend>\r\n    <div>\r\n    <p>\r\n    For security reasons, users control which users are authorized to see their presence. However,\r\n    it is posible to configure the service so that anyone has access to all presence information.\r\n    Use this option with caution.\r\n    </p>\r\n    <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n    <tbody>\r\n        <tr>\r\n            <td width=\"1%\">\r\n            <input type=\"radio\" name=\"presencePublic\" value=\"true\" id=\"rb01\"\r\n             ");
      out.print(((presencePublic) ? "checked" : ""));
      out.write(
          ">\r\n            </td>\r\n            <td width=\"99%\">\r\n                <label for=\"rb01\"><b>Anyone</b> - Anyone may get presence information.</label>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n            <td width=\"1%\">\r\n            <input type=\"radio\" name=\"presencePublic\" value=\"false\" id=\"rb02\"\r\n             ");
      out.print(((!presencePublic) ? "checked" : ""));
      out.write(
          ">\r\n            </td>\r\n            <td width=\"99%\">\r\n                <label for=\"rb02\"><b>Subscribed</b> - Presence information is only visibile to authorized users.</label>\r\n            </td>\r\n        </tr>\r\n    </tbody>\r\n    </table>\r\n    </div>\r\n</fieldset>\r\n\r\n<br>\r\n    \r\n<fieldset>\r\n    <legend>Plain Text 'Unavailable' Status Message</legend>\r\n    <div>\r\n    <p>\r\n    In &quot;text&quot; mode the status message for unavailable users is &quot;Unavailable&quot;\r\n    by default. It is possible to change the unavailable status message by setting this property.\r\n    </p>\r\n    <p>\r\n        <input type=\"text\" name=\"presenceUnavailableStatus\" value=\"");
      out.print(unavailableStatus);
      out.write(
          "\">\r\n    </p>\r\n    </div>\r\n</fieldset>\r\n\r\n<br><br>\r\n\r\n<input type=\"submit\" value=\"Save Properties\">\r\n</form>\r\n\r\n</body>\r\n</html>");
    } 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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #7
0
  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.apache.jasper.runtime.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write('\n');
      out.write('\n');

      JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
      String trackerName = StringUtils.simpleHostname(tracker.getJobTrackerMachine());

      out.write('\n');
      out.write('\n');
      out.write('\n');

      String jobId = request.getParameter("jobid");
      if (jobId == null) {
        out.println("<h2>Missing 'jobid'!</h2>");
        return;
      }
      JobID jobIdObj = JobID.forName(jobId);
      String kind = request.getParameter("kind");
      String cause = request.getParameter("cause");

      out.write("\n\n<html>\n<title>Hadoop ");
      out.print(jobId);
      out.write(" failures on ");
      out.print(trackerName);
      out.write("</title>\n<body>\n<h1>Hadoop <a href=\"jobdetails.jsp?jobid=");
      out.print(jobId);
      out.write('"');
      out.write('>');
      out.print(jobId);
      out.write("</a>\nfailures on <a href=\"jobtracker.jsp\">");
      out.print(trackerName);
      out.write("</a></h1>\n\n");

      printFailures(out, tracker, jobIdObj, kind, cause);

      out.write("\n\n<hr>\n<a href=\"jobtracker.jsp\">Go back to JobTracker</a><br>\n");

      out.println(ServletUtil.htmlFooter());

      out.write('\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);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #8
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      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;

      out.write("\n\n\n\n\n\n\n\n\n\n\n\n\n");

      // Get handle on the Monitoring plugin
      MonitoringPlugin plugin =
          (MonitoringPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("monitoring");
      ConversationManager conversationManager =
          (ConversationManager) plugin.getModule(ConversationManager.class);

      XMPPServer server = XMPPServer.getInstance();
      UserManager userManager = UserManager.getInstance();

      out.write(
          "\n\n<html>\n    <head>\n        <title>Conversations</title>\n        <meta name=\"pageID\" content=\"active-conversations\"/>\n        <script src=\"/js/prototype.js\" type=\"text/javascript\"></script>\n        <script src=\"/js/scriptaculous.js\" type=\"text/javascript\"></script>\n        <script src=\"/plugins/monitoring/dwr/engine.js\" type=\"text/javascript\" ></script>\n        <script src=\"/plugins/monitoring/dwr/util.js\" type=\"text/javascript\" ></script>\n        <script src=\"/plugins/monitoring/dwr/interface/conversations.js\" type=\"text/javascript\"></script>\n    </head>\n    <body>\n\n<style type=\"text/css\">\n\t@import \"style/style.css\";\n</style>\n<script type=\"text/javascript\">\nDWREngine.setErrorHandler(handleError);\nwindow.onerror = handleError;\nfunction handleError() {\n    // swallow errors: probably caused by the server being down\n}\n\nvar peConversations = new PeriodicalExecuter(conversationUpdater, 10);\n\nfunction conversationUpdater() {\n    try {\n        conversations.getConversations(updateConversations, true);\n    } catch(err) {\n");
      out.write(
          "        // swallow errors\n    }\n}\n\nfunction updateConversations(data) {\n    conversationsTable = $('conversations');\n    rows = conversationsTable.getElementsByTagName(\"tr\");\n    // loop over existing rows in the table\n    var rowsToDelete = new Array();\n    for (i = 0; i < rows.length; i++) {\n        // is this a conversation row?\n        if (rows[i].id == 'noconversations') {\n            rowsToDelete.push(i);\n        } else if (rows[i].id != '') {\n            // does the conversation exist in update we received?\n            convID = rows[i].id.replace('conversation-', '');\n            if (data[convID] != undefined) {\n\n                row = rows[i];\n                cells = row.getElementsByTagName('td');\n                conversation = data[convID];\n                if (cells[3].innerHTML != conversation.messageCount) {\n                    users = conversation.participant1 + '<br />' + conversation.participant2;\n                    cells[0].innerHTML = users;\n                    cells[1].innerHTML = conversation.duration;\n");
      out.write(
          "                    cells[2].innerHTML = conversation.lastActivity;\n                    cells[3].innerHTML = conversation.messageCount;\n                    new Effect.Highlight(row, {duration: 3.0});\n                }\n            // doesn't exist in update, delete from table\n            } else {\n                rowsToDelete.push(i);\n            }\n        }\n    }\n\n    for (i=0; i<rowsToDelete.length; i++) {\n        conversationsTable.deleteRow(rowsToDelete[i]);\n    }\n\n\n    // then add any new conversations from the update\n    counter = 0;\n    for (var c in data) {\n        counter++;\n        // does this conversation already exist?\n        if ($('conversation-' + c) == undefined) {\n            conversation = data[c];\n            users = conversation.participant1 + '<br />' + conversation.participant2;\n            var newTR = document.createElement(\"tr\");\n            newTR.setAttribute('id', 'conversation-' + c)\n            conversationsTable.appendChild(newTR);\n            var TD = document.createElement(\"TD\");\n");
      out.write(
          "            TD.innerHTML = users;\n            newTR.appendChild(TD);\n\n            TD = document.createElement(\"TD\");\n            TD.innerHTML = conversation.duration;\n            newTR.appendChild(TD);\n\n            TD = document.createElement(\"TD\");\n            TD.innerHTML = conversation.lastActivity;\n            newTR.appendChild(TD);\n\n            TD = document.createElement(\"TD\");\n            TD.innerHTML = conversation.messageCount;\n            newTR.appendChild(TD);\n        }\n    }\n\n    // update activeConversations number\n    $('activeConversations').innerHTML = counter;\n}\n\n</script>\n\n<!-- <a href=\"#\" onclick=\"conversationUpdater(); return false;\">click me</a> -->\n<p>\n    ");
      if (_jspx_meth_fmt_message_0(_jspx_page_context)) return;
      out.write("\n    <span id=\"activeConversations\">");
      out.print(conversationManager.getConversationCount());
      out.write("</span\n</p>\n\n");

      Collection<Conversation> conversations = conversationManager.getConversations();

      out.write(
          "\n\n\n<div class=\"jive-table\">\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" id=\"conversations\">\n<thead>\n    <tr>\n        <th nowrap>");
      if (_jspx_meth_fmt_message_1(_jspx_page_context)) return;
      out.write("</th>\n        <th nowrap>");
      if (_jspx_meth_fmt_message_2(_jspx_page_context)) return;
      out.write("</th>\n        <th nowrap>");
      if (_jspx_meth_fmt_message_3(_jspx_page_context)) return;
      out.write("</th>\n        <th nowrap>");
      if (_jspx_meth_fmt_message_4(_jspx_page_context)) return;
      out.write("</th>\n    </tr>\n</thead>\n<tbody>\n    ");

      if (conversations.isEmpty()) {

        out.write(
            "\n        <tr id=\"noconversations\">\n            <td colspan=\"4\">\n                ");
        if (_jspx_meth_fmt_message_5(_jspx_page_context)) return;
        out.write("\n            </td>\n        </tr>\n\n    ");
      }
      out.write("\n    ");

      for (Conversation conversation : conversations) {
        Collection<JID> participants = conversation.getParticipants();

        out.write("\n    <tr id=\"conversation-");
        out.print(conversation.getConversationID());
        out.write("\">\n        <td>\n            ");
        if (conversation.getRoom() == null) {
          out.write("\n                ");
          for (JID jid : participants) {
            out.write("\n                    ");
            if (server.isLocal(jid) && userManager.isRegisteredUser(jid.getNode())) {
              out.write("\n                        <a href=\"/user-properties.jsp?username="******"');
              out.write('>');
              out.print(jid);
              out.write("</a><br />\n                    ");
            } else {
              out.write("\n                        ");
              out.print(jid.toBareJID());
              out.write("<br/>\n                    ");
            }
            out.write("\n                ");
          }
          out.write("\n            ");
        } else {
          out.write("\n                ");
          //  fmt:message
          org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_message_6 =
              (org.apache.taglibs.standard.tag.rt.fmt.MessageTag)
                  _jspx_tagPool_fmt_message_key.get(
                      org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
          _jspx_th_fmt_message_6.setPageContext(_jspx_page_context);
          _jspx_th_fmt_message_6.setParent(null);
          _jspx_th_fmt_message_6.setKey("archive.group_conversation");
          int _jspx_eval_fmt_message_6 = _jspx_th_fmt_message_6.doStartTag();
          if (_jspx_eval_fmt_message_6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_fmt_message_6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
              out = _jspx_page_context.pushBody();
              _jspx_th_fmt_message_6.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
              _jspx_th_fmt_message_6.doInitBody();
            }
            do {
              out.write("\n                    ");
              //  fmt:param
              org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_param_0 =
                  (org.apache.taglibs.standard.tag.rt.fmt.ParamTag)
                      _jspx_tagPool_fmt_param_value_nobody.get(
                          org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
              _jspx_th_fmt_param_0.setPageContext(_jspx_page_context);
              _jspx_th_fmt_param_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_message_6);
              _jspx_th_fmt_param_0.setValue(
                  "<a href='../../muc-room-occupants.jsp?roomJID="
                      + URLEncoder.encode(conversation.getRoom().toBareJID(), "UTF-8")
                      + "'>");
              int _jspx_eval_fmt_param_0 = _jspx_th_fmt_param_0.doStartTag();
              if (_jspx_th_fmt_param_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_0);
                return;
              }
              _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_0);
              out.write("\n                    ");
              //  fmt:param
              org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_param_1 =
                  (org.apache.taglibs.standard.tag.rt.fmt.ParamTag)
                      _jspx_tagPool_fmt_param_value_nobody.get(
                          org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
              _jspx_th_fmt_param_1.setPageContext(_jspx_page_context);
              _jspx_th_fmt_param_1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_message_6);
              _jspx_th_fmt_param_1.setValue("</a>");
              int _jspx_eval_fmt_param_1 = _jspx_th_fmt_param_1.doStartTag();
              if (_jspx_th_fmt_param_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_1);
                return;
              }
              _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_1);
              out.write("\n                ");
              int evalDoAfterBody = _jspx_th_fmt_message_6.doAfterBody();
              if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
            } while (true);
            if (_jspx_eval_fmt_message_6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
              out = _jspx_page_context.popBody();
          }
          if (_jspx_th_fmt_message_6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _jspx_tagPool_fmt_message_key.reuse(_jspx_th_fmt_message_6);
            return;
          }
          _jspx_tagPool_fmt_message_key.reuse(_jspx_th_fmt_message_6);
          out.write("\n            ");
        }
        out.write("\n        </td>\n        ");

        long duration =
            conversation.getLastActivity().getTime() - conversation.getStartDate().getTime();

        out.write("\n        <td>");
        out.print(StringUtils.getTimeFromLong(duration));
        out.write("</td>\n        <td>");
        out.print(JiveGlobals.formatTime(conversation.getLastActivity()));
        out.write("</td>\n        <td>");
        out.print(conversation.getMessageCount());
        out.write("</td>\n    </tr>\n    ");
      }
      out.write("\n</tbody>\n</table>\n</div>\n\n</body>\n</html>");
    } 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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #9
0
ファイル: hello_jsp.java プロジェクト: 360keke/peds
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=ISO-8859-1");
      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;

      out.write('\r');
      out.write('\n');

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("\t<head>\r\n");
      out.write("\t\t<base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("\t\t<title>My JSP 'hello.jsp' starting page</title>\r\n");
      out.write("\r\n");
      out.write("\t\t<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("\t\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("\t\t<meta http-equiv=\"expires\" content=\"0\">\r\n");
      out.write("\t\t<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
      out.write("\t\t<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
      out.write("\t\t<!--\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">\r\n");
      out.write("\t-->\r\n");
      out.write("\r\n");
      out.write("\t</head>\r\n");
      out.write("\r\n");
      out.write("\t<body>\r\n");
      out.write("\t\t");
      if (_jspx_meth_c_out_0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("\t</body>\r\n");
      out.write("</html>\r\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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #10
0
ファイル: viewEvents_jsp.java プロジェクト: leeray/ews
  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;

      out.write('\n');

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE html>\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<base href=\"");
      out.print(basePath);
      out.write("\">\n");
      out.write("\n");
      out.write("<title>工程师工作纪要 查看</title>\n");
      out.write("<meta http-equiv=\"pragma\" content=\"no-cache\">\n");
      out.write("<meta http-equiv=\"cache-control\" content=\"no-cache\">\n");
      out.write("<meta http-equiv=\"expires\" content=\"0\">\n");
      out.write("<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\n");
      out.write("<meta http-equiv=\"description\" content=\"This is my page\">\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\" />\n");
      out.write("<script type=\"text/javascript\" src=\"js/jquery.min.js\"></script>\n");
      out.write("<script type=\"text/javascript\" src=\"js/common.js\"></script>\n");
      out.write("</head>\n");

      WorksBean worksBean = (WorksBean) request.getAttribute("worksBean");

      if (worksBean == null) {
        return;
      }

      out.write("\n");
      out.write("<body>\n");
      out.write("\t<div class=\"container\">\n");
      out.write("\t\t<div class=\"header headermiddle\">\n");
      out.write("\t\t\t<div class=\"headermleft\"></div>\n");
      out.write("\n");
      out.write("\t\t\t<div class=\"headermright vText\" style=\" float: right\">\n");
      out.write("\t\t\t\t<div style=\"font-size:12px\">您好!欢迎您来到工程师工作纪要</div>\n");
      out.write("\t\t\t\t<div style=\"margin-top: 20px\">\n");
      out.write("\t\t\t\t");

      UserBean userBean = (UserBean) session.getAttribute("userBean");
      if (userBean == null) {

        out.write("\n");
        out.write("\t\t\t\t\t<a href=\"/login.jsp\" target=\"_blank\">登陆</a>\n");
        out.write("\t\t\t\t");

      } else {

        out.write("\n");
        out.write("\t\t\t\t\t<font class=\"fontsong17\">当前用户</font>: <font class=\"fontsong14\">");
        out.print(userBean.getName());
        out.write("</font>, &nbsp;\n");
        out.write(
            "\t\t\t\t\t<font class=\"fontsong17\"><a href=\"/login.jsp?action=logout\">退出</a></font>\n");
        out.write("\t\t\t\t");
      }

      out.write("\n");
      out.write("\t\t\t\t</div>\n");
      out.write("\t\t\t</div>\n");
      out.write("\t\t</div>\n");
      out.write("\t\t<!-- 导航 -->\n");
      out.write("\t\t<div class=\" headernav\">\n");
      out.write("\t\t\t<div class=\" nav\">\n");
      out.write("\t\t\t\t<ul>\n");
      out.write(
          "\t\t\t\t\t<li class=\"navcurrent\"><a href=\"/servlet/Works?howdo=list\">工作纪要</a></li>\n");
      out.write("\t\t\t\t\t<li><a href=\"/servlet/Customer?howdo=list\">客户管理</a></li>\n");
      out.write("\t\t\t\t\t<li><a href=\"/servlet/User?howdo=list\">帐号管理</a></li>\n");
      out.write("\t\t\t\t</ul>\n");
      out.write("\t\t\t</div>\n");
      out.write("\t\t</div>\n");
      out.write("\t\t<div class=\"titleDiv\">工作纪要查看</div>\n");
      out.write("\t\t<div class=\"titleLineDiv\"></div>\n");
      out.write("\t\t<div class=\"addContentDiv\">\n");
      out.write("\t\t\t<table class=\"addContentTable\" border=\"0\" cellspacing=\"0\"\n");
      out.write("\t\t\t\tcellpadding=\"0\">\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td width=\"120px\" align=\"right\">客户:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
      out.print(worksBean.getCustomername());
      out.write("</span></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td width=\"120px\" align=\"right\">工程师:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
      out.print(worksBean.getUsername());
      out.write("</span></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">事件属性:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
      out.print(worksBean.getLevel());
      out.write("</span>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">事件描述:</td>\n");
      out.write("\t\t\t\t\t<td><div class=\"lineDiv\">");
      out.print(worksBean.getDescribe());
      out.write("</div>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">二级单位:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px;max-width: 700px\">");
      out.print(worksBean.getErjidanwei());
      out.write("</span>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">客户联系人:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px;max-width: 700px\">");
      out.print(worksBean.getKehulianxiren());
      out.write("</span>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">联系方式:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px;max-width: 700px\">");
      out.print(worksBean.getLianxifangshi());
      out.write("</span>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">联系邮箱:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px;max-width: 700px\">");
      out.print(worksBean.getLianximail());
      out.write("</span>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">是否转800:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
      if (worksBean.isIsphonecall()) {
        out.write('是');
        out.write(' ');
      } else {
        out.write(' ');
        out.write('否');
      }
      out.write("</span></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">800 case号码:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
      out.print(worksBean.getPhonecallnumber());
      out.write("</span></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">解决办法:</td>\n");
      out.write("\t\t\t\t\t<td><div class=\"lineDiv\">");
      out.print(worksBean.getSolution());
      out.write("</div>\n");
      out.write("\t\t\t\t\t</td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">是否关闭:</td>\n");
      out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px \">");
      if (worksBean.getIsclosed() == 1) {
        out.write('关');
        out.write('闭');
        out.write(' ');
      } else {
        out.write(' ');
        out.write('开');
        out.write('启');
      }
      out.write("</span></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\">更新内容:</td>\n");
      out.write("\t\t\t\t\t<td><div class=\"lineDiv\">");
      if (worksBean.getNewcontent() != null) {
        out.write(' ');
        out.print(worksBean.getNewcontent());
        out.write(' ');
      }
      out.write("</div></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t\t");

      if (worksBean.getIsclosed() == 1 && worksBean.getClosedate() != null) {

        out.write("\n");
        out.write("\t\t\t\t<tr>\n");
        out.write("\t\t\t\t\t<td align=\"right\">关闭时间:</td>\n");
        out.write("\t\t\t\t\t<td><span style=\"margin-left: 20px\">");
        out.print(worksBean.getClosedate());
        out.write("</span></td>\n");
        out.write("\t\t\t\t</tr>\n");
        out.write("\t\t\t\t");
      }

      out.write("\n");
      out.write("\t\t\t\t<tr>\n");
      out.write("\t\t\t\t\t<td align=\"right\"></td>\n");
      out.write("\t\t\t\t\t<td>\n");
      out.write(
          "\t\t\t\t\t\t<div class=\"divBtn ml20 fl mt20\" onclick=\"window.history.back(-1);\">返回</div></td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\t\t\t</table>\n");
      out.write("\n");
      out.write("\t\t</div>\n");
      out.write("\t\t");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE html>\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("\r\n");
      out.write("<title>智友汇</title>\r\n");
      out.write("<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("<meta http-equiv=\"expires\" content=\"0\">\r\n");
      out.write("<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
      out.write("<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/css.css\" />\r\n");
      out.write("<script type=\"text/javascript\" src=\"/js/jquery.min.js\"></script>\r\n");
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("\t<div class=\"footer\">\r\n");
      out.write("\t\r\n");
      out.write("\t<div class=\"footerbottom\">\r\n");
      out.write("\t<div style=\"margin-top: 10px;margin-bottom: 30px\">Copyright&copy;2015\r\n");
      out.write("\t\t\t北京恒光数码科技有限公司 版权所有</div>\r\n");
      out.write("\t</div>\r\n");
      out.write("\t</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
      out.write("\n");
      out.write("\t\t<!-- end .container -->\n");
      out.write("\t</div>\n");
      out.write("\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)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #11
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=ISO-8859-1");
      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;

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      java.util.List resultList = null;
      synchronized (request) {
        resultList =
            (java.util.List)
                _jspx_page_context.getAttribute("resultList", PageContext.REQUEST_SCOPE);
        if (resultList == null) {
          throw new java.lang.InstantiationException("bean resultList not found within scope");
        }
      }
      out.write('\n');
      java.lang.String maxPages = null;
      synchronized (request) {
        maxPages =
            (java.lang.String)
                _jspx_page_context.getAttribute("maxPages", PageContext.REQUEST_SCOPE);
        if (maxPages == null) {
          throw new java.lang.InstantiationException("bean maxPages not found within scope");
        }
      }
      out.write('\n');
      java.lang.String currentPage = null;
      synchronized (request) {
        currentPage =
            (java.lang.String)
                _jspx_page_context.getAttribute("currentPage", PageContext.REQUEST_SCOPE);
        if (currentPage == null) {
          throw new java.lang.InstantiationException("bean currentPage not found within scope");
        }
      }
      out.write('\n');
      java.lang.String rowPerPage = null;
      synchronized (request) {
        rowPerPage =
            (java.lang.String)
                _jspx_page_context.getAttribute("rowPerPage", PageContext.REQUEST_SCOPE);
        if (rowPerPage == null) {
          throw new java.lang.InstantiationException("bean rowPerPage not found within scope");
        }
      }
      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
      out.write("\n");
      out.write("<html>\n");
      out.write("\n");
      out.write("<head>\n");
      out.write(
          "<link rel=\"stylesheet\" type=\"text/css\" href=\"/hss.web.console/style/fokus_ngni.css\">\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n");
      out.write("<title>");
      if (_jspx_meth_bean_message_0(_jspx_page_context)) return;
      out.write("</title>\n");
      out.write("\n");
      out.write("<script type=\"text/javascript\" language=\"JavaScript\">\n");
      out.write("\n");
      out.write("function submitForm(pageId){\n");
      out.write("\tdocument.DSAI_SearchForm.crtPage.value = pageId;\n");
      out.write("\tdocument.DSAI_SearchForm.submit();\n");
      out.write("}\n");
      out.write("\n");
      out.write("function rowsPerPageChanged(){\n");
      out.write("\tdocument.DSAI_SearchForm.crtPage.value = 1;\r\n");
      out.write("\t//document.DSAI_SearchForm.rowsPerPageChanged=true;\n");
      out.write("\tdocument.DSAI_SearchForm.submit();\n");
      out.write("}\n");
      out.write("</script>\n");
      out.write("</head>\n");
      out.write("\n");
      out.write("<body>\n");
      out.write("\r\n");
      out.write("\t<table id=\"title-table\" align=\"center\" weight=\"100%\" >\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td align=\"center\">\r\n");
      out.write("\t\t\t<h1> DSAI Search </h1>\r\n");
      out.write("\t\t\t<br/><br/>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\r\n");
      out.write("\t</table> <!-- title-table -->\r\n");
      out.write("\r\n");
      out.write("\t<table id=\"main-table\" align=\"center\" valign=\"middle\">\n");
      out.write("\t<tr>\n");
      out.write("\t\t<td>\n");
      out.write(
          "\t \t\t<table id=\"main-table\" class=\"as\" border=\"0\" cellspacing=\"1\" align=\"center\" style=\"border:2px solid #FF6600;\" width=\"400\">\n");
      out.write("\t\t\t\t<tr class=\"header\">\n");
      out.write("\t\t\t\t\t<td class=\"header\" width=\"50\"> ID </td>\n");
      out.write("\t\t\t\t\t<td class=\"header\"> DSAI-Tag </td>\n");
      out.write("\t\t\t\t</tr>\n");
      out.write("\n");
      out.write("\t\t\t\t");

      if (resultList != null && resultList.size() > 0) {
        DSAI dsai;
        int idx = 0;
        Iterator it = resultList.iterator();

        while (it.hasNext()) {
          dsai = (DSAI) it.next();

          out.write("\n");
          out.write("\t\t\t\t\t<tr class=\"");
          out.print(idx % 2 == 0 ? "even" : "odd");
          out.write("\">\n");
          out.write("\t\t\t\t\t\t<td>\n");
          out.write("\t\t\t\t\t\t\t");
          out.print(dsai.getId());
          out.write("\n");
          out.write("\t\t\t\t\t\t</td>\n");
          out.write("\t\t\t\t\t\t<td>\r\n");
          out.write("\t\t\t\t\t\t\t\t<a href=\"/hss.web.console/DSAI_Load.do?id=");
          out.print(dsai.getId());
          out.write("\">\n");
          out.write("\t\t\t\t\t\t\t\t");
          out.print(dsai.getDsai_tag());
          out.write("\n");
          out.write("\t\t\t\t\t\t\t</a>\n");
          out.write("\t\t\t\t\t\t</td>\n");
          out.write("\t\t\t\t\t</tr>\n");
          out.write("\t\t\t\t");

          idx++;
        } // while
      } // if
      else {

        out.write("\n");
        out.write("\t\t\t\t\t<tr>\n");
        out.write("\t\t\t\t\t\t<td>\n");
        out.write("\t\t\t\t\t\t\t");
        if (_jspx_meth_bean_message_1(_jspx_page_context)) return;
        out.write("\n");
        out.write("\t\t\t\t\t\t</td>\n");
        out.write("\t\t\t\t\t</tr>\n");
        out.write("\t\t\t\t");
      }

      out.write("\n");
      out.write("\t\t\t</table>\n");
      out.write("\t\t</td>\n");
      out.write("\t</tr>\n");
      out.write("\t<tr>\n");
      out.write("\t\t<td colspan=\"3\" class=\"header\">\n");
      out.write("\t\t\t");
      //  html:form
      org.apache.struts.taglib.html.FormTag _jspx_th_html_form_0 =
          (org.apache.struts.taglib.html.FormTag)
              _jspx_tagPool_html_form_action.get(org.apache.struts.taglib.html.FormTag.class);
      _jspx_th_html_form_0.setPageContext(_jspx_page_context);
      _jspx_th_html_form_0.setParent(null);
      _jspx_th_html_form_0.setAction("/DSAI_Search");
      int _jspx_eval_html_form_0 = _jspx_th_html_form_0.doStartTag();
      if (_jspx_eval_html_form_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        do {
          out.write("\n");
          out.write("\t\t\t\t<table align=\"center\">\n");
          out.write("\t\t\t\t\t<tr>\n");
          out.write("\t\t\t\t\t\t<td>\n");
          out.write("\t\t\t\t\t\t");

          int length = Integer.parseInt(maxPages) + 1;
          int cPage = Integer.parseInt(currentPage) + 1;
          for (int iy = 1; iy < length; iy++) {
            if (cPage != iy) {

              out.write("\n");
              out.write("\t\t\t\t\t\t\t\t\t<a href=\"javascript:submitForm(");
              out.print(String.valueOf(iy));
              out.write(");\">");
              out.print(iy);
              out.write("</a>\n");
              out.write("\t\t\t\t\t\t");

            } else {

              out.write("\n");
              out.write("\t\t\t\t\t\t\t\t\t<font style=\"color:#FF0000;font-weight: 600;\">\n");
              out.write("\t\t\t\t\t\t\t\t\t\t");
              out.print(String.valueOf(iy));
              out.write("\n");
              out.write("\t\t\t\t\t\t\t\t\t</font>\n");
              out.write("\t\t\t\t\t\t\t\t");
            }
          }

          out.write("\n");
          out.write("\t\t\t\t\t\t</td>\n");
          out.write("\t\t\t\t\t\t<td>\n");
          out.write("\t\t\t\t\t\t\t");
          if (_jspx_meth_bean_message_2(_jspx_th_html_form_0, _jspx_page_context)) return;
          out.write("<br>\n");
          out.write("\t\t\t\t\t\t\t");
          if (_jspx_meth_html_hidden_0(_jspx_th_html_form_0, _jspx_page_context)) return;
          out.write("\n");
          out.write("\t\t\t\t\t\t\t");
          //  html:select
          org.apache.struts.taglib.html.SelectTag _jspx_th_html_select_0 =
              (org.apache.struts.taglib.html.SelectTag)
                  _jspx_tagPool_html_select_property_onchange.get(
                      org.apache.struts.taglib.html.SelectTag.class);
          _jspx_th_html_select_0.setPageContext(_jspx_page_context);
          _jspx_th_html_select_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_html_form_0);
          _jspx_th_html_select_0.setProperty("rowsPerPage");
          _jspx_th_html_select_0.setOnchange("javascript:rowsPerPageChanged();");
          int _jspx_eval_html_select_0 = _jspx_th_html_select_0.doStartTag();
          if (_jspx_eval_html_select_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
            if (_jspx_eval_html_select_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
              out = _jspx_page_context.pushBody();
              _jspx_th_html_select_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
              _jspx_th_html_select_0.doInitBody();
            }
            do {
              out.write("\n");
              out.write("\t\t\t\t\t\t\t\t<option value=\"20\"\n");
              out.write("\t\t\t\t\t\t\t\t\t");
              out.print(rowPerPage.equals("20") ? "selected" : "");
              out.write(" >20 </option>\n");
              out.write("\t\t\t\t\t\t\t\t<option value=\"30\"\n");
              out.write("\t\t\t\t\t\t\t\t\t");
              out.print(rowPerPage.equals("30") ? "selected" : "");
              out.write(" >30 </option>\n");
              out.write("\t\t\t\t\t\t\t\t<option value=\"50\"\n");
              out.write("\t\t\t\t\t\t\t\t\t");
              out.print(rowPerPage.equals("50") ? "selected" : "");
              out.write(" >50</option>\n");
              out.write("\t\t\t\t\t\t\t\t<option value=\"100\"\n");
              out.write("\t\t\t\t\t\t\t\t\t");
              out.print(rowPerPage.equals("100") ? "selected" : "");
              out.write(" >100</option>\n");
              out.write("\t\t\t\t\t\t\t");
              int evalDoAfterBody = _jspx_th_html_select_0.doAfterBody();
              if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
            } while (true);
            if (_jspx_eval_html_select_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
              out = _jspx_page_context.popBody();
          }
          if (_jspx_th_html_select_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return;
          _jspx_tagPool_html_select_property_onchange.reuse(_jspx_th_html_select_0);
          out.write("\n");
          out.write("\t\t\t\t\t\t</td>\n");
          out.write("\t\t\t\t\t</tr>\n");
          out.write("\t\t\t\t</table>\n");
          out.write("\t\t\t");
          int evalDoAfterBody = _jspx_th_html_form_0.doAfterBody();
          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
        } while (true);
      }
      if (_jspx_th_html_form_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return;
      _jspx_tagPool_html_form_action.reuse(_jspx_th_html_form_0);
      out.write("\n");
      out.write("\t\t</td>\n");
      out.write("\t</tr>\n");
      out.write("\t</table>\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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #12
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      pageContext =
          _jspxFactory.getPageContext(this, request, response, "error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n\n\n\n\n\n\n\n\n");
      out.write('\n');
      org.jivesoftware.util.WebManager webManager = null;
      synchronized (_jspx_page_context) {
        webManager =
            (org.jivesoftware.util.WebManager)
                _jspx_page_context.getAttribute("webManager", PageContext.PAGE_SCOPE);
        if (webManager == null) {
          webManager = new org.jivesoftware.util.WebManager();
          _jspx_page_context.setAttribute("webManager", webManager, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\n');
      webManager.init(request, response, session, application, out);
      out.write('\n');
      out.write('\n');
      // Get paramters
      boolean doTest = request.getParameter("test") != null;
      boolean cancel = request.getParameter("cancel") != null;
      boolean sent = ParamUtils.getBooleanParameter(request, "sent");
      boolean success = ParamUtils.getBooleanParameter(request, "success");
      String from = ParamUtils.getParameter(request, "from");
      String to = ParamUtils.getParameter(request, "to");
      String subject = ParamUtils.getParameter(request, "subject");
      String body = ParamUtils.getParameter(request, "body");

      // Cancel if requested
      if (cancel) {
        response.sendRedirect("system-email.jsp");
        return;
      }

      // Variable to hold messaging exception, if one occurs
      Exception mex = null;

      // Validate input
      Map<String, String> errors = new HashMap<String, String>();
      if (doTest) {
        if (from == null) {
          errors.put("from", "");
        }
        if (to == null) {
          errors.put("to", "");
        }
        if (subject == null) {
          errors.put("subject", "");
        }
        if (body == null) {
          errors.put("body", "");
        }

        EmailService service = EmailService.getInstance();

        // Validate host - at a minimum, it needs to be set:
        String host = service.getHost();
        if (host == null) {
          errors.put("host", "");
        }

        // if no errors, continue
        if (errors.size() == 0) {
          // Create a message
          MimeMessage message = service.createMimeMessage();
          // Set the date of the message to be the current date
          SimpleDateFormat format =
              new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", java.util.Locale.US);
          format.setTimeZone(JiveGlobals.getTimeZone());
          message.setHeader("Date", format.format(new Date()));

          // Set to and from.
          message.setRecipient(Message.RecipientType.TO, new InternetAddress(to, null));
          message.setFrom(new InternetAddress(from, null));
          message.setSubject(subject);
          message.setText(body);
          // Send the message, wrap in a try/catch:
          try {
            service.sendMessagesImmediately(Collections.singletonList(message));
            // success, so indicate this:
            response.sendRedirect("system-emailtest.jsp?sent=true&success=true");
            return;
          } catch (MessagingException me) {
            me.printStackTrace();
            mex = me;
          }
        }
      }

      // Set var defaults
      Collection<JID> jids = webManager.getXMPPServer().getAdmins();
      User user = null;
      if (!jids.isEmpty()) {
        for (JID jid : jids) {
          if (webManager.getXMPPServer().isLocal(jid)) {
            user = webManager.getUserManager().getUser(jid.getNode());
            if (user.getEmail() != null) {
              break;
            }
          }
        }
      }
      if (from == null) {
        from = user.getEmail();
      }
      if (to == null) {
        to = user.getEmail();
      }
      if (subject == null) {
        subject = "Test email sent via Openfire";
      }
      if (body == null) {
        body = "This is a test message.";
      }

      out.write("\n\n<html>\n    <head>\n        <title>");
      if (_jspx_meth_fmt_message_0(_jspx_page_context)) return;
      out.write(
          "</title>\n        <meta name=\"pageID\" content=\"system-email\"/>\n    </head>\n    <body>\n\n<script language=\"JavaScript\" type=\"text/javascript\">\nvar clicked = false;\nfunction checkClick(el) {\n    if (!clicked) {\n        clicked = true;\n        return true;\n    }\n    return false;\n}\n</script>\n\n<p>\n");
      if (_jspx_meth_fmt_message_1(_jspx_page_context)) return;
      out.write("\n</p>\n\n");
      if (JiveGlobals.getProperty("mail.smtp.host") == null) {
        out.write(
            "\n\n    <div class=\"jive-error\">\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n    <tbody>\n        <tr>\n        \t<td class=\"jive-icon\"><img src=\"images/error-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\n\t        <td class=\"jive-icon-label\">\n\t\t        ");
        if (_jspx_meth_fmt_message_2(_jspx_page_context)) return;
        out.write("\n\t        </td>\n        </tr>\n    </tbody>\n    </table>\n    </div>\n\n");
      }
      out.write('\n');
      out.write('\n');
      if (doTest || sent) {
        out.write("\n\n    ");
        if (success) {
          out.write(
              "\n\n        <div class=\"jive-success\">\n        <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n        <tbody>\n            <tr>\n            \t<td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\n            \t<td class=\"jive-icon-label\">");
          if (_jspx_meth_fmt_message_3(_jspx_page_context)) return;
          out.write(
              "</td>\n            </tr>\n        </tbody>\n        </table>\n        </div>\n\n    ");
        } else {
          out.write(
              "\n\n        <div class=\"jive-error\">\n        <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n        <tbody>\n            <tr><td class=\"jive-icon\"><img src=\"images/error-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\n            <td class=\"jive-icon-label\">\n                ");
          if (_jspx_meth_fmt_message_4(_jspx_page_context)) return;
          out.write("\n                ");
          if (mex != null) {
            out.write("\n                    ");
            if (mex instanceof AuthenticationFailedException) {
              out.write("\n                    \t");
              if (_jspx_meth_fmt_message_5(_jspx_page_context)) return;
              out.write("                        \n                    ");
            } else {
              out.write("\n                        (Message: ");
              out.print(mex.getMessage());
              out.write(")\n                    ");
            }
            out.write("\n                ");
          }
          out.write(
              "\n            </td></tr>\n        </tbody>\n        </table>\n        </div>\n\n    ");
        }
        out.write("\n\n    <br>\n\n");
      }
      out.write(
          "\n\n<form action=\"system-emailtest.jsp\" method=\"post\" name=\"f\" onsubmit=\"return checkClick(this);\">\n\n<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n<tbody>\n    <tr>\n        <td>\n            ");
      if (_jspx_meth_fmt_message_6(_jspx_page_context)) return;
      out.write(":\n        </td>\n        <td>\n            ");
      String host = JiveGlobals.getProperty("mail.smtp.host");
      if (host == null) {

        out.write("\n                <i>");
        if (_jspx_meth_fmt_message_7(_jspx_page_context)) return;
        out.write("</i>\n            ");

      } else {

        out.write("\n                ");
        out.print(host);
        out.write(':');
        out.print(JiveGlobals.getIntProperty("mail.smtp.port", 25));
        out.write("\n\n                ");
        if (JiveGlobals.getBooleanProperty("mail.smtp.ssl", false)) {
          out.write("\n\n                    (");
          if (_jspx_meth_fmt_message_8(_jspx_page_context)) return;
          out.write(")\n\n                ");
        }
        out.write("\n            ");
      }
      out.write("\n        </td>\n    </tr>\n    <tr>\n        <td>\n            ");
      if (_jspx_meth_fmt_message_9(_jspx_page_context)) return;
      out.write(
          ":\n        </td>\n        <td>\n            <input type=\"hidden\" name=\"from\" value=\"");
      out.print(from);
      out.write("\">\n            ");
      out.print(StringUtils.escapeHTMLTags(from));
      out.write(
          "\n            <span class=\"jive-description\">\n            (<a href=\"user-edit-form.jsp?username="******"\">Update Address</a>)\n            </span>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            ");
      if (_jspx_meth_fmt_message_10(_jspx_page_context)) return;
      out.write(
          ":\n        </td>\n        <td>\n            <input type=\"text\" name=\"to\" value=\"");
      out.print(((to != null) ? to : ""));
      out.write(
          "\"\n             size=\"40\" maxlength=\"100\">\n        </td>\n    </tr>\n    <tr>\n        <td>\n            ");
      if (_jspx_meth_fmt_message_11(_jspx_page_context)) return;
      out.write(
          ":\n        </td>\n        <td>\n            <input type=\"text\" name=\"subject\" value=\"");
      out.print(((subject != null) ? subject : ""));
      out.write(
          "\"\n             size=\"40\" maxlength=\"100\">\n        </td>\n    </tr>\n    <tr valign=\"top\">\n        <td>\n            ");
      if (_jspx_meth_fmt_message_12(_jspx_page_context)) return;
      out.write(
          ":\n        </td>\n        <td>\n            <textarea name=\"body\" cols=\"45\" rows=\"5\" wrap=\"virtual\">");
      out.print(body);
      out.write(
          "</textarea>\n        </td>\n    </tr>\n    <tr>\n        <td colspan=\"2\">\n            <br>\n            <input type=\"submit\" name=\"test\" value=\"");
      if (_jspx_meth_fmt_message_13(_jspx_page_context)) return;
      out.write("\">\n            <input type=\"submit\" name=\"cancel\" value=\"");
      if (_jspx_meth_fmt_message_14(_jspx_page_context)) return;
      out.write(
          "\">\n        </td>\n    </tr>\n</tbody>\n</table>\n\n</form>\n\n    </body>\n</html>");
    } 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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  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                               &nbsp;\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\">&nbsp;");
              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\">&nbsp;");
                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);
    }
  }
コード例 #14
0
ファイル: board_jsp.java プロジェクト: gongnaixiao/Study
  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("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" >\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("<title>Neonat论坛</title>\r\n");
      out.write(
          "<link href=\"forum.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\">\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("<div id=\"page\">\r\n");
      out.write("  <div id=\"header\">\r\n");
      out.write("    <div class=\"clearfix\">\r\n");
      out.write("      <div style=\"padding:15px 0 10px 0;\">\r\n");
      out.write("          <div class=\"title_logo\"></div>\r\n");
      out.write("      </div>\r\n");
      out.write(
          "      <div class=\"toolbar\"><a href=\"new.jsp\"><img src=\"images/post.gif\" /></a><div style=\"float:right\">论坛发帖总数:\r\n");
      out.write("\t\t");

      BundleContext context = Activator.getContext();
      NeonatModelService ms =
          context.getService(context.getServiceReference(NeonatModelService.class));
      Board board = ms.getBoard();
      out.println(board.getTopicCount());

      out.write("\r\n");
      out.write("\t  </div></div>\r\n");
      out.write("\t  \r\n");
      out.write("\t <table id=\"forum_main\" cellspacing=\"1\">\r\n");
      out.write("        <thead>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td bgcolor=\"#477AA5\" style=\"width: 20px;\">ID</td>\r\n");
      out.write(
          "            <td colspan=\"2\" bgcolor=\"#477AA5\" style=\"border-left: 1px solid white;\">主题</td>\r\n");
      out.write("            <td bgcolor=\"#477AA5\" style=\"width: 50px;\">回复</td>\r\n");
      out.write("            <td bgcolor=\"#477AA5\" style=\"width: 100px;\">发帖时间</td>\r\n");
      out.write("            <td bgcolor=\"#477AA5\" style=\"width: 100px;\">作者</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        </thead>\r\n");
      out.write("        <tbody>\r\n");
      out.write("           ");

      for (Iterator<Entry<Integer, Topic>> i = board.getTopicsMap().entrySet().iterator();
          i.hasNext(); ) {
        Topic topic = i.next().getValue();

        out.write("\r\n");
        out.write("\t        <tr>\r\n");
        out.write("\t            <td class=\"topic_id\">");
        out.print(topic.getId());
        out.write("</td>\r\n");
        out.write("\t            <td class=\"topic_icon unread_topic\"></td>\r\n");
        out.write("\t            <td class=\"topic_title\"><a href=\"content.jsp?id=");
        out.print(topic.getId());
        out.write('"');
        out.write('>');
        out.print(topic.getTitle());
        out.write("</a></td>\r\n");
        out.write("\t            <td class=\"topic_replies\">");
        out.print(topic.getReplyTopics().size());
        out.write("</td>\r\n");
        out.write("\t            <td class=\"topic_time\">");
        out.print(topic.getDate().toLocaleString());
        out.write("</td>\r\n");
        out.write(
            "\t            <td class=\"topic_author\"><a href=\"#\" target=\"_blank\">IcyFenix</a></td>\r\n");
        out.write("\t        </tr>\r\n");
        out.write("\t        ");
      }

      out.write("\r\n");
      out.write("      </table>\r\n");
      out.write("      <br />\r\n");
      out.write(
          "      <div style=\"text-align:center\">©2011-2012 Neonat BBS All rights reserved.</div>\r\n");
      out.write("    </div>\r\n");
      out.write("  </div>\r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>");
    } 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);
    }
  }
コード例 #15
0
ファイル: Fines_jsp.java プロジェクト: malus91/LMS
  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);
    }
  }
コード例 #16
0
ファイル: input_jsp.java プロジェクト: phjy007/javaee_hw
  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=GB2312");
      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;

      out.write("<xmp>\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("  <head>\r\n");
      out.write("    <base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("    \r\n");
      out.write("    <title>计算立方</title>\r\n");
      out.write("    \r\n");
      out.write("\t<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("\t<meta http-equiv=\"expires\" content=\"0\">    \r\n");
      out.write("\t<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
      out.write("\t<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
      out.write("\t<!--\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">\r\n");
      out.write("\t-->\r\n");
      out.write("\r\n");
      out.write("  </head>\r\n");
      out.write("  \r\n");
      out.write("  <body>\r\n");
      out.write("  <h3>计算立方</h3>\r\n");
      out.write("\t<div>\r\n");
      out.write("\t\t<form action=\"./lab02/calculate.jsp\">\r\n");
      out.write("\t  \t\t<input name=\"input_number\" type=\"text\" value=\"\" size=\"13\" \r\n");
      out.write("\t  \t\t onkeyup=\"this.value=this.value.replace(/\\D/g,'')\" \r\n");
      out.write("\t  \t\t onafterpaste=\"this.value=this.value.replace(/\\D/g,'')\" /><br>\r\n");
      out.write("\t  \t\t<input type=\"reset\" value=\"重置\"> \r\n");
      out.write("\t  \t\t<input type=\"submit\" value=\"提交\">\r\n");
      out.write("\t\t</form>\r\n");
      out.write("\t</div><br/>\r\n");
      out.write("  </body>\r\n");
      out.write("</html>\r\n");
      out.write("</xmp>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  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\n");

      // Get required parameter(s)
      String nodeIdStr = request.getParameter("node");
      if (nodeIdStr == null) throw new org.opennms.web.MissingParameterException("node");
      int nodeId = Integer.parseInt(nodeIdStr);
      String nodeLabel = org.opennms.web.element.NetworkElementFactory.getNodeLabel(nodeId);
      Node node_db = NetworkElementFactory.getNode(nodeId);
      String orgName = node_db.getOrganizationName();
      Asset asset = this.model.getAsset(nodeId);
      boolean isNew = false;

      if (asset == null) {
        asset = new Asset();
        isNew = true;
      }

      Vector vCategories = WTProperties.getList("AssetCategories.list");

      out.write("\n\n");
      out.write("<html>\n");
      out.write("<head>\n\t");
      out.write("<title>WebTelemetry - Node Assets | System Info for ");
      out.print(node_db.getLabel());
      out.write("</title>\n\t");
      out.write("<base HREF=\"");
      out.print(org.opennms.web.Util.calculateUrlBase(request));
      out.write("\" />\n\t");
      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\n");
      out.write("<body>\n\t");
      out.write("<!-- Header -->\n\t");
      String title = "Asset - Vendor Info for Node: " + node_db.getLabel() + " (" + orgName + ")";
      out.write("\n\t");
      JspRuntimeLibrary.include(
          request,
          response,
          "/includes/tabheader.jsp"
              + "?"
              + "title="
              + java.net.URLEncoder.encode("" + title)
              + "&"
              + "refresh="
              + "1"
              + "&"
              + "helpURL="
              + "assetmanager%2FWTHelp_AssetManager.html"
              + "&"
              + "tabgroup="
              + "asset"
              + "&"
              + "tabselected="
              + "vendor"
              + "&"
              + "node="
              + java.net.URLEncoder.encode("" + nodeIdStr),
          out,
          false);
      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\n");
      out.write("<!-- USER-DEFINED ATTRIBUTES TABLE: was Identification -->\n      ");
      out.write("<form action=\"asset/modifyAsset\" method=\"POST\" name=\"sysInfo\">\n        ");
      out.write("<input type=\"hidden\" name=\"node\" value=\"");
      out.print(nodeId);
      out.write("\" />\n        ");
      out.write("<input type=\"hidden\" name=\"isnew\" value=\"");
      out.print(isNew);
      out.write("\" />\n        ");
      out.write("<input type=\"hidden\" name=\"view\" value=\"asset-tab-vendor\" />\n\n        ");
      if (!isNew) {
        out.write("\n        ");
        out.write("<!-- asset-tab-system -->\n        ");
        out.write("<input type=\"hidden\" name=\"category\" value=\"");
        out.print(asset.getCategory());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"serialnumber\" value=\"");
        out.print(asset.getSerialNumber());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"manufacturer\" value=\"");
        out.print(asset.getManufacturer());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"operatingsystem\" value=\"");
        out.print(asset.getOperatingSystem());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"modelnumber\" value=\"");
        out.print(asset.getModelNumber());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"assetnumber\" value=\"");
        out.print(asset.getAssetNumber());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"dateinstalled\" value=\"");
        out.print(asset.getDateInstalled());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"description\" value=\"");
        out.print(asset.getDescription());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"comments\" value=\"");
        out.print(asset.getComments());
        out.write("\" />\n\n        ");
        out.write("<!-- asset-tab-location -->\n        ");
        out.write("<input type=\"hidden\" name=\"region\" value=\"");
        out.print(asset.getRegion());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"division\" value=\"");
        out.print(asset.getDivision());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"department\" value=\"");
        out.print(asset.getDepartment());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"address1\" value=\"");
        out.print(asset.getAddress1());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"address2\" value=\"");
        out.print(asset.getAddress2());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"city\" value=\"");
        out.print(asset.getCity());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"state\" value=\"");
        out.print(asset.getState());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"zip\" value=\"");
        out.print(asset.getZip());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"building\" value=\"");
        out.print(asset.getBuilding());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"floor\" value=\"");
        out.print(asset.getFloor());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"room\" value=\"");
        out.print(asset.getRoom());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"rack\" value=\"");
        out.print(asset.getRack());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"slot\" value=\"");
        out.print(asset.getSlot());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"port\" value=\"");
        out.print(asset.getPort());
        out.write("\" />\n        ");
        out.write("<input type=\"hidden\" name=\"circuitid\" value=\"");
        out.print(asset.getCircuitId());
        out.write("\" />\n        ");
      }
      out.write("\n\n");
      out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n\t");
      out.write("<table width=\"98%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t  ");
      out.write("<tr class=\"tableHeader\">\n\t    ");
      out.write("<td colspan=\"6\" class=\"tableHeader\">Vendor");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t  ");
      out.write("<tr class=\"tableRowLight\">\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Name:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"vendor\" value=\"");
      out.print(asset.getVendor());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Phone:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"vendorphone\" value=\"");
      out.print(asset.getVendorPhone());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Fax:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"vendorfax\"  value=\"");
      out.print(asset.getVendorFax());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t  ");
      out.write("<tr class=\"tableRowLight\">\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Lease:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"lease\" value=\"");
      out.print(asset.getLease());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Lease Expires:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"leaseexpires\" value=\"");
      out.print(asset.getLeaseExpires());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Vendor Asset:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"vendorassetnumber\" value=\"");
      out.print(asset.getVendorAssetNumber());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t  ");
      out.write("<tr class=\"tableRowLight\">\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Maint Contract:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"maintcontract\" value=\"");
      out.print(asset.getMaintContract());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Contract Expires:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"maintcontractexpires\" value=\"");
      out.print(asset.getMaintContractExpires());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<span class=\"formText\">Maint Phone:");
      out.write("</span>");
      out.write("</td>\n\t    ");
      out.write("<td class=\"tableText\">");
      out.write("<input type=\"text\" name=\"supportphone\" value=\"");
      out.print(asset.getSupportPhone());
      out.write("\" size=\"20\" maxlength=\"64\"/>");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t  ");
      out.write("<tr class=\"tableRowLight\">\n\t    ");
      out.write("<td class=\"tableText\" colspan=\"6\">");
      out.write(
          "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t");
      out.write("</table>");
      out.write("<br />\n\n\t");
      out.write("<table width=\"98%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n\t  ");
      out.write("<tr>\n\t\t");
      out.write("<td colspan=\"3\">");
      out.write("<br />\n\t\t\t");
      out.write("<INPUT type=\"hidden\" name=\"button\" value=\"\">\n\t\t\t");
      out.write(
          "<INPUT type=\"image\" src=\"/wt-portal/images/buttons/btn_save_changes.gif\" onClick=\"document.sysInfo.button.value='Save Changes';\">\n\t\t\t&nbsp;&nbsp;&nbsp;\n\t\t\t");
      out.write(
          "<a href=\"javascript:document.sysInfo.reset()\" onClick=\"javascript:document.sysInfo.reset();\">");
      out.write("<img src=\"/wt-portal/images/buttons/btn_reset.gif\" border=\"0\" alt=\"Reset\">");
      out.write("</a>");
      out.write("<br />&nbsp;\n\t\t\t");
      out.write("<!-- ");
      out.write("<input type=\"submit\" value=\"Save Changes\"/>\n\t\t\t");
      out.write("<input type=\"reset\" /> -->\n\t\t");
      out.write("</td>\n\t\t");
      out.write("<td colspan=\"3\" align=\"right\" class=\"message\">");
      out.write("<br />\n\t\t\t");
      if (isNew) {
        out.write("\n\t\t\t\tNew Record\n\t\t\t");
      } else {
        out.write("\n\t\t\t\tLast Modified: ");
        out.print(WTTools.formatLocalDateToString(asset.getLastModifiedDate()));
        out.write(" by ");
        out.print(asset.getUserLastModified());
        out.write("\n\t\t\t");
      }
      out.write("\n\t\t");
      out.write("</td>\n\t  ");
      out.write("</tr>\n\t");
      out.write("</table>\n\t");
      out.write("</form>\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\n");
      out.write("<br>\n");
      JspRuntimeLibrary.include(request, response, "/includes/footer.jsp", 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);
    }
  }
コード例 #18
0
  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");

      response.setContentType("text/xml");

      int mapId = -1;

      TopologyMap map = (TopologyMap) request.getAttribute("map");

      String isRcad = "false";

      if (map == null) {
        String strMapId = request.getParameter("mapId");
        if (strMapId != null) {
          mapId = Integer.parseInt(request.getParameter("mapId"));
        }
      }
      if (map == null && mapId != 99999) {
        map = TopologyMap.getMapById(mapId);
      }
      if (map != null) {
        List centities = map.getCentityMaps();
        List connections = map.getConnections();
        List bgimages = map.getMapBgimages();

        if (WTAccountCredentials.current() == null) {
          System.out.println("NullPointerException: WTAccountCredentials.current() is null");
          return;
        }

        String user = WTAccountCredentials.current().getUserName();
        boolean admin = false;
        WTRole role = WTAccountCredentials.current().getMostPrivilegedRole();
        admin = role.isOrgAdmin() || role.isSiteAdmin();

        if (user == null) {

          out.write("<topology-map />");

          return;
        }
        boolean readOnly = !user.equals(map.getCreator());

        Integer groupId = map.getGroupId();
        String groupAttrs = "";
        if (groupId != null) {
          WTGroupManager groupMan = ManagersImpl.GroupManager;
          WTGroup group = (WTGroup) groupMan.getObject(groupId.intValue());
          groupMan.resolveReferences(group);
          groupAttrs =
              "groupName=\""
                  + URLEncoder.encode(group.getOrg().getName() + " - " + group.getName(), "UTF-8")
                  + "\" groupId=\""
                  + groupId.intValue()
                  + "\"";
        }

        isRcad = String.valueOf(map.isRca());

        out.write("\n\t");
        out.write("<topology-map mapId=\"");
        out.print(map.getMapId());
        out.write("\" name=\"");
        out.print(map.getName());
        out.write("\" mapTypeId=\"");
        out.print(map.getTypeId());
        out.write("\" \n\t zoomLevel=\"");
        out.print(map.getZoom());
        out.write("\" paneScrollX=\"");
        out.print(map.getScrollX());
        out.write("\" paneScrollY=\"");
        out.print(map.getScrollY());
        out.write("\"\n\t shared=\"");
        out.print(map.isShared());
        out.write("\" creator=\"");
        out.print(map.getCreator());
        out.write("\" iconSize=\"");
        out.print(map.getIconSize());
        out.write("\"\n\t labelsAlwaysOn=\"");
        out.print(map.isLabelsAlwaysOn());
        out.write("\" readOnly=\"");
        out.print(readOnly);
        out.write("\" ");
        out.print(groupAttrs);
        out.write(" admin=\"");
        out.print(admin);
        out.write("\" isRcad=\"");
        out.print(isRcad);
        out.write("\">\n\t\n\t\t");
        out.write("<entities>\n\t");

        for (Iterator it = centities.iterator(); it.hasNext(); ) {
          CentityMap centityMap = (CentityMap) it.next();
          StringBuffer hierarchyBuffer = new StringBuffer();
          if (centityMap.getType().equals("category")) {
            WTCategory cat =
                (WTCategory)
                    ManagersImpl.CategoryManager.getObject(
                        Integer.valueOf(centityMap.getIdForType()));
            List sectionList = ManagersImpl.CategoryManager.getAllParentSections(cat);

            for (Iterator sectionIt = sectionList.iterator(); sectionIt.hasNext(); ) {
              WTSection section = (WTSection) sectionIt.next();
              hierarchyBuffer.append(section.getName() + " / ");
            }
          }

          out.write("\n\t    ");
          out.write("<entity centityId=\"");
          out.print(centityMap.getCentityId());
          out.write("\" type=\"");
          out.print(centityMap.getType());
          out.write("\" id=\"");
          out.print(centityMap.getXmlId());
          out.write("\"\n\t     icon=\"");
          out.print(centityMap.getIcon());
          out.write("\" label=\"");
          out.print(centityMap.getLabel());
          out.write("\" hierarchy=\"");
          out.print(hierarchyBuffer.toString());
          out.write("\"\n\t      x=\"");
          out.print(centityMap.getXPlacement());
          out.write("\" y=\"");
          out.print(centityMap.getYPlacement());
          out.write("\"/>\n\t    ");
        }

        out.write("\n\t\t");
        out.write("</entities>\n\t\t");
        out.write("<connections>\n\t");

        for (Iterator it = connections.iterator(); it.hasNext(); ) {
          CentityConnection cc = (CentityConnection) it.next();
          String startType = null;
          String endType = null;
          int startId = -1;
          int endId = -1;
          if (cc.getParentNodeid() != null) {
            startType = "node";
            startId = cc.getParentNodeid();
          } else if (cc.getParentCategoryId() != null) {
            startType = "category";
            startId = cc.getParentCategoryId();
          }
          if (cc.getNodeid() != null) {
            endType = "node";
            endId = cc.getNodeid();
          } else if (cc.getCategoryId() != null) {
            endType = "category";
            endId = cc.getCategoryId();
          }

          out.write("\n\t\t\t");
          out.write("<connection startType=\"");
          out.print(startType);
          out.write("\" startId=\"");
          out.print(startId);
          out.write("\" endType=\"");
          out.print(endType);
          out.write("\" endId=\"");
          out.print(endId);
          out.write("\" />\n\t");
        }

        out.write("\n\t\t");
        out.write("</connections>\n\t\t");
        out.write("<bgimages>\n\t");

        for (Iterator it = bgimages.iterator(); it.hasNext(); ) {
          MapBgimage bgimage = (MapBgimage) it.next();

          out.write("\n\t\t\t\t");
          out.write("<bgimage mapBgimageId=\"");
          out.print(bgimage.getMapBgimageId());
          out.write("\" bgimageId=\"");
          out.print(bgimage.getBgimageId());
          out.write("\"\n\t\t\t\t creator=\"");
          out.print(bgimage.getCreator());
          out.write("\" src=\"");
          out.print(bgimage.getSrc());
          out.write("\" x=\"");
          out.print(bgimage.getXPlacement());
          out.write("\"\n\t\t\t\t  y=\"");
          out.print(bgimage.getYPlacement());
          out.write("\" zindex=\"");
          out.print(bgimage.getZIndex());
          out.write("\" xscale=\"");
          out.print(bgimage.getXScale());
          out.write("\"\n\t\t\t\t   yscale=\"");
          out.print(bgimage.getYScale());
          out.write("\" />\n\t");
        }

        out.write("\n\t\t");
        out.write("</bgimages>\n\t\t\n\t");
        out.write("</topology-map>\n");

      } else {
        out.write("\n");
        out.write(
            "<topology-map mapId=\"99999\" name=\"Topology Sample\" zoomLevel=\"10\" paneScrollX=\"0\" paneScrollY=\"0\" shared=\"true\" creator=\"admin\" iconSize=\"32\" labelsAlwaysOn=\"true\" type=\"topology\">\n\t");
        out.write("<entities>\n\t\t");
        out.write(
            "<entity centityId=\"-90\" type=\"node\" id=\"node_603\" icon=\"OS_Win2003.swf\" label=\"CARROT\" x=\"300\" y=\"200\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-91\" type=\"node\" id=\"node_653\" icon=\"OS_Win2000.swf\" label=\"RAISIN\" x=\"200\" y=\"200\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-92\" type=\"node\" id=\"node_615\" icon=\"OS_Win2003.swf\" label=\"10.100.100.88\" x=\"300\" y=\"100\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-93\" type=\"node\" id=\"node_616\" icon=\"OS_WinXP.swf\" label=\"10.100.100.241\" x=\"100\" y=\"100\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-94\" type=\"node\" id=\"node_613\" icon=\"OS_FoundryIronWare.swf\" label=\"Foundry\" x=\"200\" y=\"125\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-95\" type=\"node\" id=\"node_656\" icon=\"OS_WinXP.swf\" label=\"10.100.100.239\" x=\"225\" y=\"70\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-96\" type=\"node\" id=\"node_610\" icon=\"OS_CiscoIOS.swf\" label=\"Cittio-2621\" x=\"125\" y=\"150\"/>\n\t\t");
        out.write(
            "<entity centityId=\"-97\" type=\"node\" id=\"node_614\" icon=\"OS_Linux.swf\" label=\"Mango\" x=\"100\" y=\"200\"/>\n\n\t");
        out.write("</entities>\n\t");
        out.write("<connections>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"603\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"653\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"615\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"616\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"656\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"610\" endType=\"node\" endId=\"613\"/>\n\t\t");
        out.write(
            "<connection startType=\"node\" startId=\"614\" endType=\"node\" endId=\"610\"/>\n\t");
        out.write("</connections>\n\t");
        out.write("<bgimages />\n");
        out.write("</topology-map>\n");
      }

      out.write("\n\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);
    }
  }
コード例 #19
0
  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\n");

      try {
        this.model = ResponseTimeModel.instance();
      } catch (Exception e) {
        throw new ServletException("Could not initialize the ResponseTimeModel", e);
      }

      ResponseTimeModel.QueryableNode[] nodes = this.model.getQueryableNodes();

      out.write("\n\n");
      out.write("<html>\n");
      out.write("<head>\n  ");
      out.write("<title>Response Time");
      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=\"includes/styles.css\" />\n");
      out.write("</head>\n\n");
      out.write(
          "<script language=\"Javascript\" type=\"text/javascript\" >\n  function validateNode()\n  {\n      var isChecked = false\n      for( i = 0; i ");
      out.write(
          "< document.choose_node.node.length; i++ )\n      {\n         //make sure something is checked before proceeding\n         if (document.choose_node.node[i].selected)\n         {\n            isChecked=true;\n         }\n      }\n\n      if (!isChecked)\n      {\n          alert(\"Please check the node that you would like to report on.\");\n      }\n      return isChecked;\n  }\n\n  function validateNodeAdhoc()\n  {\n      var isChecked = false\n      for( i = 0; i ");
      out.write(
          "< document.choose_node_adhoc.node.length; i++ )\n      {\n         //make sure something is checked before proceeding\n         if (document.choose_node_adhoc.node[i].selected)\n         {\n            isChecked=true;\n         }\n      }\n\n      if (!isChecked)\n      {\n          alert(\"Please check the node that you would like to report on.\");\n      }\n      return isChecked;\n  }\n\n  function submitForm()\n  {\n      if (validateNode())\n      {\n          document.choose_node.submit();\n      }\n  }\n\n  function submitFormAdhoc()\n  {\n      if (validateNodeAdhoc())\n      {\n          document.choose_node_adhoc.submit();\n      }\n  }\n");
      out.write("</script>\n\n");
      out.write("<body>\n\n");
      String breadcrumb1 = "<a href='report/index.jsp'>Reports</a>";
      out.write("\n");
      String breadcrumb2 = "Response Time";
      out.write("\n");
      JspRuntimeLibrary.include(
          request,
          response,
          "/includes/header.jsp"
              + "?"
              + "title="
              + "Response+Time"
              + "&"
              + "location="
              + "response"
              + "&"
              + "breadcrumb="
              + java.net.URLEncoder.encode("" + breadcrumb1)
              + "&"
              + "breadcrumb="
              + java.net.URLEncoder.encode("" + breadcrumb2),
          out,
          false);
      out.write("\n\n");
      out.write("<br>\n");
      out.write("<!-- Body -->\n\n");
      out.write("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n  ");
      out.write("<tr>\n    ");
      out.write("<td>&nbsp;");
      out.write("</td>\n\n    ");
      out.write("<td valign=\"top\">\n      ");
      out.write("<h3>Standard Response Time Reports");
      out.write("</h3>\n\n      ");
      out.write(
          "<form method=\"get\" name=\"choose_node\" action=\"response/addIntfFromNode\" >\n        ");
      out.write("<p>Choose a node to generate a standard response time report on.");
      out.write("</p>\n        ");
      out.write("<p>\n          ");
      out.write(
          "<input type=\"hidden\" name=\"endUrl\" value=\"response/choosereportanddate.jsp\" />\n          ");
      out.write("<select name=\"node\" size=\"10\">\n            ");
      for (int i = 0; i < nodes.length; i++) {
        out.write("\n                ");
        out.write("<option value=\"");
        out.print(nodes[i].nodeId);
        out.write("\">");
        out.print(nodes[i].nodeLabel);
        out.write("</option>\n            ");
      }
      out.write("\n          ");
      out.write("</select>\n        ");
      out.write("</p>\n        ");
      out.write("<p>\n          ");
      out.write("<input type=\"button\" value=\"Start\" onclick=\"submitForm()\"/>\n        ");
      out.write("</p>\n      ");
      out.write("</form>\n\n      ");
      out.write("<h3>Custom Response Time Reports");
      out.write("</h3>\n\n      ");
      out.write(
          "<form method=\"get\" name=\"choose_node_adhoc\" action=\"response/adhoc.jsp\" >\n        ");
      out.write("<p>Choose a node to generate a custom response time report on.");
      out.write("</p>\n        ");
      out.write("<p>\n          ");
      out.write("<select name=\"node\" size=\"10\">\n            ");
      for (int i = 0; i < nodes.length; i++) {
        out.write("\n              ");
        out.write("<option value=\"");
        out.print(nodes[i].nodeId);
        out.write("\">");
        out.print(nodes[i].nodeLabel);
        out.write("</option>\n            ");
      }
      out.write("\n          ");
      out.write("</select>\n        ");
      out.write("</p>\n        ");
      out.write("<p>");
      out.write("<input type=\"button\" value=\"Start\" onclick=\"submitFormAdhoc()\"/>");
      out.write("</p>\n      ");
      out.write("</form>\n    ");
      out.write("</td>\n\n    ");
      out.write("<td>&nbsp;");
      out.write("</td>\n\n    ");
      out.write("<td valign=\"top\" width=\"60%\">\n      ");
      out.write("<h3>Network Response Time Data");
      out.write("</h3>\n\n      ");
      out.write("<p>The ");
      out.write("<strong>Standard Response Time Reports");
      out.write(
          "</strong> provide a stock way to\n        easily visualize the service response time data collected from managed nodes throughout\n        your network.\n      ");
      out.write("<p>\n\n      ");
      out.write("<p>");
      out.write("<strong>Custom Response Time Reports");
      out.write(
          "</strong> can be used to produce a single\n        graph that contains the data of your choice from a single interface or node.\n        You can select the timeframe, line colors, line styles, and title of the graph\n        and you can bookmark the results.\n      ");
      out.write("</p>\n    ");
      out.write("</td>\n\n    ");
      out.write("<td>&nbsp;");
      out.write("</td>\n  ");
      out.write("</tr>\n");
      out.write("</table>\n\n");
      out.write("<br>\n\n");
      JspRuntimeLibrary.include(
          request, response, "/includes/footer.jsp" + "?" + "location=" + "response", 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);
    }
  }
コード例 #20
0
ファイル: MyJsp_jsp.java プロジェクト: qq494679975/house
  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;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("  <head>\r\n");
      out.write("    <base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("    \r\n");
      out.write("    <title>我的主页</title>\r\n");
      out.write("    \r\n");
      out.write("\t<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("\t<meta http-equiv=\"expires\" content=\"0\">    \r\n");
      out.write("\t<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
      out.write("\t<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
      out.write("\r\n");
      out.write("  </head>\r\n");
      out.write("  \r\n");
      out.write("  <body>\r\n");
      out.write("  \t\t<div style=\"float: left;\">\r\n");
      out.write("       <img src=\"images/welcome.jpg\" />\r\n");
      out.write("       </div>\r\n");
      out.write("       <div style=\"float: left;color: red;font-size: large;\">\r\n");
      out.write("       \r\n");
      out.write("      \t本次登陆时间:");
      out.print(
          new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(session.getAttribute("logintime")));
      out.write("<br/><br/>\r\n");
      out.write("    \r\n");
      out.write("       \t当前用户:");
      out.print(((Tuserinfo) (session.getAttribute("LOGIN_USER"))).getUiusername());
      out.write("<br/><br/>\r\n");
      out.write("       \t\r\n");
      out.write("       \t</div>\r\n");
      out.write("  </body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #21
0
  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=GBK");
      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;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("  <head>\r\n");
      out.write("    <base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("    \r\n");
      out.write("    <title>实收新增</title>\r\n");
      out.write("    \r\n");
      out.write("\t\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(request.getContextPath());
      out.write("/ecside/css/ecside_style.css\" />\r\n");
      out.write("\t\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/ecside/js/prototype_mini.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/ecside/js/ecside_msg_utf8_cn.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/ecside/js/ecside.js\"></script>\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/themes/default/easyui.css\">\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/themes/icon.css\">\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/demo/demo.css\">\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/jquery-1.8.0.min.js\"></script>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(path);
      out.write("/jquery-easyui-1.3.1/jquery.easyui.min.js\"></script>\r\n");
      out.write("\t\r\n");
      out.write("\r\n");
      out.write("  </head>\r\n");
      out.write("  <script type=\"text/javascript\">\r\n");
      out.write("  \t\r\n");
      out.write("  \t\r\n");
      out.write("  \t\r\n");
      out.write("  \tfunction initForm(){\r\n");
      out.write("  \t\tvar rs = $('#result').attr('value');\r\n");
      out.write("  \t\t//alert(rs);\r\n");
      out.write("  \t\tif(rs=='1'){\r\n");
      out.write("  \t\t\t$.messager.alert(\"提示\",\"保存成功!\");\r\n");
      out.write("  \t\t\treturn;\r\n");
      out.write("  \t\t}else if(rs=='0'){\r\n");
      out.write("  \t\t\t$.messager.alert(\"提示\",\"保存失败!\");\r\n");
      out.write("  \t\t}else if(rs=='-1'){\r\n");
      out.write("  \t\t\t$.messager.alert(\"提示\",\"Excel解析失败!\");\r\n");
      out.write("  \t\t}\r\n");
      out.write("  \t}\r\n");
      out.write("  \tfunction importRcved(){\r\n");
      out.write("  \t\tvar fileName = $('#file').attr('value');\r\n");
      out.write("  \t\tif(fileName==null || fileName==''){\r\n");
      out.write("  \t\t\talert('请选择导入文件');\r\n");
      out.write("  \t\t\treturn;\r\n");
      out.write("  \t\t}\r\n");
      out.write("  \t\tdocument.forms[0].submit();\r\n");
      out.write("  \t}\r\n");
      out.write("  \tfunction confirm(){\r\n");
      out.write("  \t\tvar arrayTr = $('#ecTable_table tr');\r\n");
      out.write("  \t\tif(arrayTr.length<2){\r\n");
      out.write("  \t\t\talert('界面没有需要导入的记录');\r\n");
      out.write("  \t\t\treturn;\r\n");
      out.write("  \t\t}\r\n");
      out.write("  \t\tdocument.forms[1].submit();\r\n");
      out.write("  \t}\r\n");
      out.write("  </script>\r\n");
      out.write("  \r\n");
      out.write("  <body onload=\"initForm()\" >\r\n");
      out.write("    <input type=\"hidden\" id=\"result\" value=\"");
      out.print(request.getAttribute("result"));
      out.write("\">\r\n");
      out.write("    <table width=\"100%\"><tr>\r\n");
      out.write("    <td width=\"300px\">\r\n");
      out.write("    ");
      if (_jspx_meth_s_005fform_005f0(_jspx_page_context)) return;
      out.write("\t\r\n");
      out.write("    </td>\r\n");
      out.write("    <td align=\"left\">\r\n");
      out.write("    ");
      if (_jspx_meth_s_005fform_005f1(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("   \t</td> \t\r\n");
      out.write("   \t</tr> \r\n");
      out.write("   \t</table>\r\n");
      out.write("   \t  \r\n");
      out.write("   \t  \r\n");
      out.write("   \t  ");
      if (_jspx_meth_ec_005ftable_005f0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("   \t \r\n");
      out.write("  </body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #22
0
  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\n");

      // This JSP handles cross context communications from wt-monitor
      // to wt-core for use in accessing wt-core functionality that is
      // needed in WTnav-tree.jsp.

      // Assign a pooled DB connection handle
      Context ctx = new InitialContext();
      DataSource ds = (DataSource) ctx.lookup(WTConstants.WATCHTOWERDB_CONN);
      int iIndex = 6100;
      GraphViewManager graphman = new GraphViewManager(ds);
      // Vector views = graphman.getViews();

      Vector views = new Vector();
      WTOrganization[] orgs = null;

      WTAccountCredentials ac =
          (WTAccountCredentials)
              request.getSession().getAttribute(WTAccountCredentials.SESSION_ATTRIBUTE_AC);
      if (ac != null) {
        // WTOrganization[] orgs = null;
        int selectedOrg = ac.getCurrentManagedId();

        boolean siteUser = ac.getIsSiteUser();
        int userId = ac.getUserId();

        // Get list of organizations for the current user
        if (siteUser) {
          try {
            orgs = DAOImpl.OrgDAO.getWTOrganization();
          } catch (Exception e) {
            e.printStackTrace();
          }
        } else {
          if (!(userId < 0)) {
            try {
              orgs = DAOImpl.OrgDAO.getWTOrganizationsByUser(userId);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        }

        // Get the list of actively managed nodes
        if (selectedOrg == WTAccountCredentials.ALL_ORGS) {
          if (siteUser) {
            views = graphman.getViews();
          } else {
            if (orgs != null) {
              int[] orgsIds = new int[orgs.length];
              for (int i = 0; i < orgs.length; i++) {
                orgsIds[i] = orgs[i].getID();
              }
              views = graphman.getViews(orgsIds);
            }
          }
        } else {
          views = graphman.getViews(selectedOrg);
        }
      }

      // My Graph Views is an experimental feature and is commented out until all kinks are worked
      // out. LS

      String strOutput = null;
      // 	if( views.size()==0 ) {
      //		strOutput = "nav.add(6100, 6000, 'My Graph Views', '/wt-monitor/report/index.jsp', 'My
      // Customized Graph Views', 'mainContentsFrame', icon16_basedir + 'bs_chart.gif',
      // icon16_basedir + 'bs_chart.gif', '');\r\n";
      //	} else {
      //		strOutput = "nav.add(6100, 6000, 'My Graph Views', '', 'My Customized Graph Views',
      // 'mainContentsFrame', icon16_basedir + 'bs_chart.gif', icon16_basedir + 'bs_chart.gif',
      // '');\r\n";
      //	}
      //	for (int i=0; i<views.size(); i++)
      //	{
      //		iIndex++;
      //		String strViewName = ((GraphViewJB)views.elementAt(i)).getName();
      //		int strOrgId = ((GraphViewJB)views.elementAt(i)).getOrgId();
      //		String orgName = null;
      //       for(int j=0;j<orgs.length;j++){
      //	        if(orgs[j].getID() != -1 && orgs[j].getID() == strOrgId){
      //	        	orgName = orgs[j].getName();
      //	        }
      //		}
      //
      //		strOutput +="nav.add(" + iIndex +
      //		            ", 6100, '" + strViewName +
      //		            "', 'javascript:
      // PopupCenteredWindow(\\'/wt-core/jsp/sysmon/graphview/GraphView.jsp?view=" + strViewName +
      // "&orgname="+orgName +"&start=01&end=02" + "\\', \\'graphview\\', \\'yes\\', \\'yes\\',
      // \\'yes\\', \\'900\\', \\'1010\\'); location.href=\\'/wt-monitor/wt-jsp/WTnav-tree.jsp\\';',
      // 'Open " + strViewName + " Graph View', '', icon16_basedir + 'bs_chart.gif', icon16_basedir
      // + 'bs_chart.gif', '');\r\n";
      // }

      out.write("\n\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n\n");
      out.print(strOutput);
      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);
    }
  }
コード例 #23
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      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;

      out.write("\n\n\n\n\n");

      boolean exportUsers = request.getParameter("exportUsers") != null;
      boolean success = request.getParameter("success") != null;
      boolean exportToFile = ParamUtils.getBooleanParameter(request, "exporttofile", true);

      ImportExportPlugin plugin =
          (ImportExportPlugin)
              XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");

      String exportText = "";

      Map<String, String> errors = new HashMap<String, String>();
      if (exportUsers) {
        if (exportToFile) {
          String file = ParamUtils.getParameter(request, "exportFile");
          if ((file == null) || (file.length() <= 0)) {
            errors.put("missingFile", "missingFile");
          } else {
            response.sendRedirect("export-file.jsp?fileName=" + file);
          }
        } else {
          try {
            exportText = plugin.exportUsersToString();
          } catch (IOException e) {
            errors.put("IOException", "IOException");
          }
        }
      }

      out.write(
          "\n\n<html>\n    <head>\n        <title>Export User Data</title>\n        <meta name=\"pageID\" content=\"import-export-selection\"/>\n    </head>\n    <body>\n\n");
      if (errors.size() > 0) {
        out.write(
            "\n\n    <div class=\"jive-error\">\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n    <tbody>\n        <tr>\n            <td class=\"jive-icon\"><img src=\"images/error-16x16.gif\" width=\"16\" height=\"16\" border=\"0\"></td>\n            <td class=\"jive-icon-label\">\n            ");
        if (errors.containsKey("missingFile")) {
          out.write("\n                Missing or bad file name.\n            ");
        } else if (errors.containsKey("IOException") || errors.containsKey("fileNotCreated")) {
          out.write("\n                Couldn't create export file.\n            ");
        }
        out.write(
            "\n            </td>\n        </tr>\n    </tbody>\n    </table>\n    </div>\n    <br>\n\n");
      } else if (ParamUtils.getBooleanParameter(request, "success")) {
        out.write(
            "\n\n    <div class=\"jive-success\">\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n    <tbody>\n        <tr>\n            <td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\"></td>\n            <td class=\"jive-icon-label\">User data successfully exported.</td>\n        </tr>\n    </tbody>\n    </table>\n    </div>\n    <br>\n    \n");
      }
      out.write(
          "\n\n<form action=\"export-user-data.jsp?exportUsers\" method=\"post\">\n\n<div class=\"jive-contentBoxHeader\">Export Options</div>\n<div class=\"jive-contentBox\">\n    <p>\n    Select the radio button next to the desired export option and then click on the Export button.\n    </p>\n    \n    <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n    <tbody>\n        <tr>\n            <td width=\"1%\"><input type=\"radio\" name=\"exporttofile\" value=\"true\" ");
      out.print(exportToFile ? "checked" : "");
      out.write(
          " id=\"rb01\"></td>\n            <td width=\"99%\"><label for=\"rb01\"><b>To File</b></label> - Save user data to the specified file location.</td>\n        </tr>\n        <tr>\n            <td width=\"1%\">&nbsp;</td>\n            <td width=\"99%\">Export File Name:&nbsp;<input type=\"text\" size=\"30\" maxlength=\"150\" name=\"exportFile\"></td>\n        </tr>\n        <tr>\n            <td width=\"1%\"><input type=\"radio\" name=\"exporttofile\" value=\"false\" ");
      out.print(!exportToFile ? "checked" : "");
      out.write(
          " id=\"rb02\"></td>\n            <td width=\"99%\"><label for=\"rb02\"><b>To Screen</b></label> - Display user data in the text area below.</td>            \n        </tr>\n        <tr>\n            <td width=\"1%\">&nbsp;</td>\n            <td width=\"99%\"><textarea cols=\"80\" rows=\"20\" wrap=off>");
      out.print(exportText);
      out.write(
          "</textarea></td>\n        </tr>\n    </tbody>\n    </table>\n</div>\n\n<input type=\"submit\" value=\"Export\">\n</form>\n\n</body>\n</html>");
    } 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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #24
0
  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.apache.jasper.runtime.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write('\n');

      JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
      ClusterStatus status = tracker.getClusterStatus();
      String trackerName = StringUtils.simpleHostname(tracker.getJobTrackerMachine());

      out.write("\n<html>\n<head>\n<title>");
      out.print(trackerName);
      out.write(
          " Hadoop Locality Statistics</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hadoop.css\">\n</head>\n<body>\n<h1>");
      out.print(trackerName);
      out.write(" Hadoop Locality Statistics</h1>\n\n<b>State:</b> ");
      out.print(status.getJobTrackerState());
      out.write("<br>\n<b>Started:</b> ");
      out.print(new Date(tracker.getStartTime()));
      out.write("<br>\n<b>Version:</b> ");
      out.print(VersionInfo.getVersion());
      out.write(",\n                r");
      out.print(VersionInfo.getRevision());
      out.write("<br>\n<b>Compiled:</b> ");
      out.print(VersionInfo.getDate());
      out.write(" by\n                 ");
      out.print(VersionInfo.getUser());
      out.write("<br>\n<b>Identifier:</b> ");
      out.print(tracker.getTrackerIdentifier());
      out.write("<br>\n\n<hr>\n\n");

      Collection<JobInProgress> jobs = new ArrayList<JobInProgress>();
      jobs.addAll(tracker.completedJobs());
      jobs.addAll(tracker.runningJobs());
      jobs.addAll(tracker.failedJobs());
      int dataLocalMaps = 0;
      int rackLocalMaps = 0;
      int totalMaps = 0;
      int totalReduces = 0;
      for (JobInProgress job : jobs) {
        Counters counters = job.getCounters();
        dataLocalMaps += counters.getCounter(JobInProgress.Counter.DATA_LOCAL_MAPS);
        rackLocalMaps += counters.getCounter(JobInProgress.Counter.RACK_LOCAL_MAPS);
        totalMaps += counters.getCounter(JobInProgress.Counter.TOTAL_LAUNCHED_MAPS);
        totalReduces += counters.getCounter(JobInProgress.Counter.TOTAL_LAUNCHED_REDUCES);
      }
      int dataLocalMapPct = totalMaps == 0 ? 0 : (100 * dataLocalMaps) / totalMaps;
      int rackLocalMapPct = totalMaps == 0 ? 0 : (100 * rackLocalMaps) / totalMaps;
      int dataRackLocalMapPct =
          totalMaps == 0 ? 0 : (100 * (dataLocalMaps + rackLocalMaps)) / totalMaps;

      out.write("\n<p>\n<b>Data Local Maps:</b> ");
      out.print(dataLocalMaps);
      out.write(' ');
      out.write('(');
      out.print(dataLocalMapPct);
      out.write("%) <br>\n<b>Rack Local Maps:</b> ");
      out.print(rackLocalMaps);
      out.write(' ');
      out.write('(');
      out.print(rackLocalMapPct);
      out.write("%) <br>\n<b>Data or Rack Local:</b> ");
      out.print(dataLocalMaps + rackLocalMaps);
      out.write(' ');
      out.write('(');
      out.print(dataRackLocalMapPct);
      out.write("%) <br>\n<b>Total Maps:</b> ");
      out.print(totalMaps);
      out.write(" <br>\n<b>Total Reduces:</b> ");
      out.print(totalReduces);
      out.write(" <br>\n</p>\n\n");

      out.println(ServletUtil.htmlFooter());

      out.write('\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);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #25
0
  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");
      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;

      out.write("\r\n\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

      out.write('\r');
      out.write('\n');

      final AbstractItemTreeNodeChip theChip =
          (AbstractItemTreeNodeChip) request.getAttribute(AbstractChip.CHIP_KEY);

      out.write("\r\n<input type=\"hidden\" name=\"");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("\" value=\"");
      out.print(AbstractChip.FALSE);
      out.write(
          "\" />\r\n<table class=\"abstractItemTreeNodeChip\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t<tr>\r\n\t\t<td class=\"aitncIcon\">\r\n\t\t\t<div onclick=\"document.editorForm.elements['");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("'].value='");
      out.print(AbstractChip.TRUE);
      out.write("';setScrollAndSubmit();\">\r\n\t\t\t\t<img src=\"");
      out.print(theChip.getIcon());
      out.write(
          "\" border=\"0\">\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td class=\"aitncName\">\r\n\t\t\t<div onclick=\"document.editorForm.elements['");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("'].value='");
      out.print(AbstractChip.TRUE);
      out.write("';setScrollAndSubmit();\">\r\n\t\t\t\t");
      out.print(theChip.getName());
      out.write("\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t</tr>\r\n\t");

      if (theChip.isExpanded()) {
        for (final Iterator it = theChip.getAllChildren().iterator(); it.hasNext(); ) {
          final AbstractTreeNodeChip child = (AbstractTreeNodeChip) it.next();

          out.write("\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"aitncTreeIMG\" background=\"");
          out.print(it.hasNext() ? "images/vert.gif" : "");
          out.write("\">\r\n\t\t\t\t\t\t\t");

          if (child.hasChildren()) {
            if (child.isExpanded()) {

              out.write("<input type=\"hidden\" name=\"");
              out.print(child.getEventID(AbstractTreeNodeChip.COLLAPSE));
              out.write("\" value=\"");
              out.print(AbstractChip.FALSE);
              out.write("\" /><div onclick=\"document.editorForm.elements['");
              out.print(child.getEventID(AbstractTreeNodeChip.COLLAPSE));
              out.write("'].value='");
              out.print(AbstractChip.TRUE);
              out.write("';setScrollAndSubmit();\">");

              if (it.hasNext()) {

                out.write("<img src=\"images/minus.gif\"></td>");

              } else {

                out.write("<img src=\"images/minusend.gif\"></td>");
              }

              out.write("</div>");

            } else {

              out.write("<input type=\"hidden\" name=\"");
              out.print(child.getEventID(AbstractTreeNodeChip.EXPAND));
              out.write("\" value=\"");
              out.print(AbstractChip.FALSE);
              out.write("\" /><div onclick=\"document.editorForm.elements['");
              out.print(child.getEventID(AbstractTreeNodeChip.EXPAND));
              out.write("'].value='");
              out.print(AbstractChip.TRUE);
              out.write("';setScrollAndSubmit();\">");

              if (it.hasNext()) {

                out.write("<img src=\"images/plus.gif\"></td>");

              } else {

                out.write("<img src=\"images/plusend.gif\"></td>");
              }

              out.write("</div>");
            }
          } else {
            if (it.hasNext()) {

              out.write("<img src=\"images/horiz.gif\"></td>");

            } else {

              out.write("<img src=\"images/end.gif\"></td>");
            }
          }

          out.write("\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td class=\"aitncContext\">");
          child.render(pageContext);
          out.write("</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t");
        }
      }

      out.write("\r\n</table>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  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>&nbsp;");
      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>&nbsp;");
      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);
    }
  }
コード例 #27
0
  public void generateFileChunks(JspWriter out, HttpServletRequest req) throws IOException {
    long startOffset = 0;

    int chunkSizeToView = 0;

    String referrer = req.getParameter("referrer");
    boolean noLink = false;
    if (referrer == null) {
      noLink = true;
    }

    String filename = req.getParameter("filename");
    if (filename == null) {
      out.print("Invalid input (file name absent)");
      return;
    }

    String namenodeInfoPortStr = req.getParameter("namenodeInfoPort");
    int namenodeInfoPort = -1;
    if (namenodeInfoPortStr != null) namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr);

    String chunkSizeToViewStr = req.getParameter("chunkSizeToView");
    if (chunkSizeToViewStr != null && Integer.parseInt(chunkSizeToViewStr) > 0)
      chunkSizeToView = Integer.parseInt(chunkSizeToViewStr);
    else chunkSizeToView = jspHelper.defaultChunkSizeToView;

    if (!noLink) {
      out.print("<h3>Tail of File: ");
      JspHelper.printPathWithLinks(filename, out, namenodeInfoPort);
      out.print("</h3><hr>");
      out.print("<a href=\"" + referrer + "\">Go Back to File View</a><hr>");
    } else {
      out.print("<h3>" + filename + "</h3>");
    }
    out.print("<b>Chunk size to view (in bytes, up to file's DFS block size): </b>");
    out.print(
        "<input type=\"text\" name=\"chunkSizeToView\" value="
            + chunkSizeToView
            + " size=10 maxlength=10>");
    out.print("&nbsp;&nbsp;<input type=\"submit\" name=\"submit\" value=\"Refresh\"><hr>");
    out.print("<input type=\"hidden\" name=\"filename\" value=\"" + filename + "\">");
    out.print(
        "<input type=\"hidden\" name=\"namenodeInfoPort\" value=\"" + namenodeInfoPort + "\">");
    if (!noLink) out.print("<input type=\"hidden\" name=\"referrer\" value=\"" + referrer + "\">");

    // fetch the block from the datanode that has the last block for this file
    DFSClient dfs = new DFSClient(jspHelper.nameNodeAddr, jspHelper.conf);
    List<LocatedBlock> blocks =
        dfs.namenode.getBlockLocations(filename, 0, Long.MAX_VALUE).getLocatedBlocks();
    if (blocks == null || blocks.size() == 0) {
      out.print("No datanodes contain blocks of file " + filename);
      dfs.close();
      return;
    }
    LocatedBlock lastBlk = blocks.get(blocks.size() - 1);
    long blockSize = lastBlk.getBlock().getNumBytes();
    long blockId = lastBlk.getBlock().getBlockId();
    long genStamp = lastBlk.getBlock().getGenerationStamp();
    DatanodeInfo chosenNode;
    try {
      chosenNode = jspHelper.bestNode(lastBlk);
    } catch (IOException e) {
      out.print(e.toString());
      dfs.close();
      return;
    }
    InetSocketAddress addr = NetUtils.createSocketAddr(chosenNode.getName());
    // view the last chunkSizeToView bytes while Tailing
    if (blockSize >= chunkSizeToView) startOffset = blockSize - chunkSizeToView;
    else startOffset = 0;

    out.print("<textarea cols=\"100\" rows=\"25\" wrap=\"virtual\" style=\"width:100%\" READONLY>");
    jspHelper.streamBlockInAscii(
        addr, blockId, genStamp, blockSize, startOffset, chunkSizeToView, out);
    out.print("</textarea>");
    dfs.close();
  }
コード例 #28
0
  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 &amp; 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);
    }
  }
コード例 #29
0
ファイル: extension_jsp.java プロジェクト: vanjakom/base
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      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;

      out.write(
          "<!--\n Licensed to Cloudera, Inc. under one\n or more contributor license agreements.  See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership.  Cloudera, Inc. licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with the License.  You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<html><head>\n<!-- Copyright (c) 2010 Cloudera, Inc.  All rights reserved. -->\n<!-- Retro web 1.0 flume Agent configuration display -->\n\n<title>Flume Node: ");
      out.print(FlumeNode.getInstance().getPhysicalNodeName());
      out.write(
          " :: Sources and Sinks</title>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/flume.css\" />\n\n</head>\n<body>\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request, response, "menu_agent.jsp", out, false);
      out.write("\n\n<h1>Flume Node: ");
      out.print(FlumeNode.getInstance().getPhysicalNodeName());
      out.write(" :: Extensions - Sink/Source/Decorator</h1>\n\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request, response, "version.jsp", out, false);
      out.write("\n<hr>\n\n\n<div id=\"sinks\">\n<h2>Sinks</h2>\n\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getSinkNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n\n<div id=\"sources\">\n<h2>Sources</h2>\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getSourceNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n\n<div id=\"decos\">\n<h2>Decorators</h2>\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getDecoratorNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n</body></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);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
コード例 #30
0
  private void printFailedAttempts(
      JspWriter out,
      JobTracker tracker,
      JobID jobId,
      TaskInProgress tip,
      TaskStatus.State failState)
      throws IOException {
    TaskStatus[] statuses = tip.getTaskStatuses();
    TaskID tipId = tip.getTIPId();
    for (int i = 0; i < statuses.length; ++i) {
      TaskStatus.State taskState = statuses[i].getRunState();
      if ((failState == null
              && (taskState == TaskStatus.State.FAILED || taskState == TaskStatus.State.KILLED))
          || taskState == failState) {
        String taskTrackerName = statuses[i].getTaskTracker();
        TaskTrackerStatus taskTracker = tracker.getTaskTrackerStatus(taskTrackerName);
        out.print(
            "<tr><td>"
                + statuses[i].getTaskID()
                + "</td><td><a href=\"taskdetails.jsp?jobid="
                + jobId
                + "&tipid="
                + tipId
                + "\">"
                + tipId
                + "</a></td>");
        if (taskTracker == null) {
          out.print("<td>" + taskTrackerName + "</td>");
        } else {
          out.print(
              "<td><a href=\"http://"
                  + taskTracker.getHost()
                  + ":"
                  + taskTracker.getHttpPort()
                  + "\">"
                  + taskTracker.getHost()
                  + "</a></td>");
        }
        out.print("<td>" + taskState + "</td>");
        out.print("<td><pre>");
        String[] failures = tracker.getTaskDiagnostics(statuses[i].getTaskID());
        if (failures == null) {
          out.print("&nbsp;");
        } else {
          for (int j = 0; j < failures.length; j++) {
            out.print(failures[j]);
            if (j < (failures.length - 1)) {
              out.print("\n-------\n");
            }
          }
        }
        out.print("</pre></td>");

        out.print("<td>");
        String taskLogUrl = null;
        if (taskTracker != null) {
          taskLogUrl =
              TaskLogServlet.getTaskLogUrl(
                  taskTracker.getHost(),
                  String.valueOf(taskTracker.getHttpPort()),
                  statuses[i].getTaskID().toString());
        }
        if (taskLogUrl != null) {
          String tailFourKBUrl = taskLogUrl + "&start=-4097";
          String tailEightKBUrl = taskLogUrl + "&start=-8193";
          String entireLogUrl = taskLogUrl;
          out.print("<a href=\"" + tailFourKBUrl + "\">Last 4KB</a><br/>");
          out.print("<a href=\"" + tailEightKBUrl + "\">Last 8KB</a><br/>");
          out.print("<a href=\"" + entireLogUrl + "\">All</a><br/>");
        } else {
          out.print("n/a"); // task tracker was lost
        }
        out.print("</td>");

        out.print("</tr>\n");
      }
    }
  }