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); } }
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; javax.servlet.jsp.PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html;charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); out.write("\n"); User user = null; UserFactory userFactory = UserFactory.getInstance(); String userID = request.getParameter("userID"); try { UserFactory.init(); user = userFactory.getUser(userID); } catch (Exception e) { throw new ServletException("Could not find user " + userID + " in user factory.", e); } out.write("\n"); out.write("<html>\n"); out.write("<head>\n "); out.write("<title>WebTelemetry - | User Management | User Detail"); out.write("</title>\n "); out.write("<base HREF=\""); out.print(org.opennms.web.Util.calculateUrlBase(request)); out.write("\" />\n "); out.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/wt-portal/css/default.css\" />\n\t"); out.write("<script type=\"text/javascript\" src=\"/wt-portal/javascript/WTtools.js\">"); out.write("</script>\n"); out.write("</head>\n"); out.write("<body>\n"); String title = " User Management - Detail Summary for: " + userID; out.write("\n"); /* ---- c:if ---- */ org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_if_0 = (org.apache.taglibs.standard.tag.el.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.el.core.IfTag.class); _jspx_th_c_if_0.setPageContext(pageContext); _jspx_th_c_if_0.setParent(null); _jspx_th_c_if_0.setTest("${not param.orgAdminPopup}"); int _jspx_eval_c_if_0 = _jspx_th_c_if_0.doStartTag(); if (_jspx_eval_c_if_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n "); JspRuntimeLibrary.include( request, response, "/includes/header.jsp" + "?" + "title=" + java.net.URLEncoder.encode("" + title) + "&" + "help=" + "monitoringadmin%2Fusers%2FWTHelp_User.html", out, false); out.write("\n"); int evalDoAfterBody = _jspx_th_c_if_0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_if_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return; _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_0); out.write("\n"); if (_jspx_meth_c_if_1(pageContext)) return; out.write("\n\n"); out.write("<!-- BEGIN FRAMING TABLE:open tags, keep at 100%-->\n"); out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t"); out.write("<tr>\n\t\t"); out.write("<td width=\"10\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"1\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n\t\t"); out.write("<td>\n"); out.write("<!-- END FRAMING TABLE:open tags, keep at 100%-->\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">User Information"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Full Name:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">"); out.print(user.getFullName()); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Comments:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(user.getUserComments()); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); out.write("<br>\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Notification Information"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Email:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">"); out.print(userFactory.getEmail(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Pager Email:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getPagerEmail(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Numerical Service:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getNumericPage(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Numerical Pin:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getNumericPin(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Text Service:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getTextPage(userID)); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowDark\">\n "); out.write("<td class=\"tableText\">"); out.write("<b>Text Pin:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\">"); out.print(userFactory.getTextPin(userID)); out.write("</td>\n "); out.write("</tr>\n"); out.write("</table>\n"); out.write("<br>\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Duty Schedules"); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write("<br />\n "); out.write("<!-- weekly schedule -->\n "); out.write( "<table width=\"50%\" border=\"1\" bordercolor=\"#999999\" cellspacing=\"0\" cellpadding=\"2\" >\n\t\t\t"); Collection dutySchedules = user.getDutyScheduleCollection(); out.write("\n "); int i = 0; Iterator iter = dutySchedules.iterator(); while (iter.hasNext()) { DutySchedule tmp = new DutySchedule((String) iter.next()); Vector curSched = tmp.getAsVector(); i++; out.write("\n "); out.write("<tr>\n "); ChoiceFormat days = new ChoiceFormat("0#Mo|1#Tu|2#We|3#Th|4#Fr|5#Sa|6#Su"); for (int j = 0; j < 7; j++) { Boolean curDay = (Boolean) curSched.get(j); out.write("\n "); out.write("<td width=\"5%\">\n "); out.print((curDay.booleanValue() ? days.format(j) : "X")); out.write("\n "); out.write("</td>\n "); } out.write("\n "); out.write("<td width=\"5%\">\n "); out.print(curSched.get(7)); out.write("\n "); out.write("</td>\n "); out.write("<td width=\"5%\">\n "); out.print(curSched.get(8)); out.write("\n "); out.write("</td>\n "); out.write("</tr>\n "); } out.write("\n "); out.write("</table>\n "); out.write("<!-- end weekly schedule --> \n "); out.write("</td>\n "); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n "); out.write("</tr> \n"); out.write("</table>\n"); out.write("<br>"); out.write("<br>\n"); out.write("<b>Member of the Following Organizations & Groups:"); out.write("</b>\n"); out.write("<!-- BEGIN: NEW ASSIGNED GROUPS TABLE -->\n"); out.write("<table width=\"98%\"border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\n "); // Get the user's orgs WTOrganizationDAO orgDAO = DAOImpl.OrgDAO; WTOrganization[] orgs = orgDAO.getWTOrganization(); if (orgs != null) { // Loop thru orgs for (int idx = 0; idx < orgs.length; idx++) { out.write("\n\n "); out.write("<tr class=\"tableHeader\">\n "); out.write("<td class=\"tableHeader\" colspan=\"2\">Organization Name: "); out.print(orgs[idx].getName()); out.write("</td>\n\t"); out.write("</tr>\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" width=\"25%\">"); out.write("<b>Assigned Groups:"); out.write("</b>"); out.write("</td>\n "); out.write("<td class=\"tableText\" width=\"75%\">\n "); // Get the orgs groups WTGroupManager grpMgr = ManagersImpl.GroupManager; int[] orgids = {orgs[idx].getID()}; List groups = grpMgr.getUserGroups(user.getUserId(), orgids); if (groups != null) { // Loop thru the groups for (Iterator iterGrps = groups.iterator(); iterGrps.hasNext(); ) { WTGroup group = (WTGroup) iterGrps.next(); WTRole role = (group.getRoles() == null ? null : (WTRole) group.getRoles().get(0)); out.write("\n "); out.print(group.getName()); out.write(" ("); out.print((role == null ? "" : role.getName())); out.write(")"); out.write("<br/>\n "); } } out.write("\n\n "); out.write("</td>\n\t"); out.write("</tr>\n\n "); } } out.write("\n\n "); out.write("<tr class=\"tableRowLight\">\n "); out.write("<td class=\"tableText\" colspan=\"2\">"); out.write( "<img src=\"/wt-portal/images/spacers/spacer.gif\" height=\"4\" width=\"10\" border=\"0\" alt=\"WebTelemetry\">"); out.write("</td>\n "); out.write("</tr> \n"); out.write("</table>\n"); out.write("<!-- END: NEW ASSIGNED GROUPS TABLE -->\n\n\n"); out.write("<!-- BEGIN FRAMING TABLE:close tags-->\n\t\t"); out.write("</td>\n\t"); out.write("</tr>\n"); out.write("</table>\n"); out.write("<!-- END FRAMING TABLE:close tags-->\n"); out.write("<br>\n\n"); JspRuntimeLibrary.include(request, response, "/includes/footer.jsp", out, false); out.write("\n"); out.write("</body>\n"); out.write("</html>\n\n"); } catch (Throwable t) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (pageContext != null) pageContext.handlePageException(t); } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); } }