<% //Bug 9676: set attribute indicating tab/breadcrumb reset is ocurring session.setAttribute("xd_bc_reset", "xdops"); MessageResources msgs = (MessageResources) application.getAttribute(Action.MESSAGES_KEY); //Bug 9833: The WAS base defaultBreadcrumbHandler looks for the attribute forwardName and the string .do before registering a the request. // Because of this we need to manually set the breadcrumb for a dojo tab switch. String defaultTileDefinition = null; String defaultTabNLSLabel = null; //Bug 9143: Need to build attribute map of Tabs defind in the console defs. //System.out.println("xdOperationsTabs.jsp:defaultSelectedTab: "+defaultSelectedTab); HashMap mainTabAttributesMap = new HashMap(); for (Iterator i = tabList.iterator(); i.hasNext();) { PropertyItem propertyItem = (PropertyItem)i.next(); String label = propertyItem.getLabel(); mainTabAttributesMap.put(label, propertyItem.getAttribute()); mainTabAttributesMap.put(label+"contextType", propertyItem.getType()); //Bud 9833: getting correct tile definition to forward to. String tileDefinition = propertyItem.getRequired(); //System.out.println("xdOperationsTabs.jsp:defaultSelectedTab: "+defaultSelectedTab); //System.out.println("xdOperationsTabs.jsp:label: "+label); //System.out.println("xdOperationsTabs.jsp:tileDefinition: "+tileDefinition); if (defaultSelectedTab.equals(label)) { defaultTileDefinition = tileDefinition; defaultTabNLSLabel = msgs.getMessage(request.getLocale(), label); } //System.out.println("xdOperationsTabs.jsp:defaultTileDefinition: "+defaultTileDefinition); } %> <%! private boolean isDmgr = StatusUtils.isND(); %> <% String contextId = (String)request.getAttribute("contextId"); if (contextId == null) { contextId = "nocontext"; } AdminAuthorizer adminAuthorizer = AdminAuthorizerFactory.getAdminAuthorizer(); String contextUri = ConfigFileHelper.decodeContextUri((String)contextId); try { String pleaseWait = msgs.getMessage(request.getLocale(), "trace.tree.pleaseWaitLabel"); pleaseWait.replaceAll("'", "\\\\'"); %> <% WorkSpace workSpace = (WorkSpace)session.getAttribute(com.ibm.ws.console.core.Constants.WORKSPACE_KEY); UserPreferenceBean userBean = (UserPreferenceBean)session.getAttribute(com.ibm.ws.console.core.Constants.USER_PREFS); if (workSpace != null) { if (workSpace.getModifiedList().size() > 0) { String uri = (String)request.getAttribute("javax.servlet.forward.request_uri"); if (uri.indexOf("syncworkspace.do") == -1 && uri.indexOf("logoff.do") == -1) { java.util.Locale locale = (java.util.Locale)session.getAttribute(org.apache.struts.Globals.LOCALE_KEY); MessageResources messages = (MessageResources)application.getAttribute(org.apache.struts.Globals.MESSAGES_KEY); boolean noOverwrite = (request.getSession().getAttribute (com.ibm.ws.console.core.Constants.NO_OVERWRITE_KEY) != null); if((!com.ibm.ws.security.core.SecurityContext.isSecurityEnabled() || (adminAuthorizer.checkAccess(contextUri, "administrator") || adminAuthorizer.checkAccess (contextUri, "adminsecuritymanager") || adminAuthorizer.checkAccess(contextUri, "configurator"))) && !noOverwrite){ IBMErrorMessage errorMessage1 = IBMErrorMessages.createWarningMessage(locale, messages, "warning.config.changes.made", null); //LIDB3795-28 Added direct "Save" link and "Preferences" link under messages IBMErrorMessage errorMessage2 = null; if(userBean.getProperty("System/workspace", "syncWithNodes", "false").equalsIgnoreCase("true")) errorMessage2 = IBMErrorMessages.createMessage(locale, messages, "warning.preferences.nodesync.disabled", null); else errorMessage2 = IBMErrorMessages.createMessage(locale, messages, "warning.preferences.nodesync.enabled", null); IBMErrorMessage errorMessage3 = null; if(ConsoleUtils.requiresServerRestart(workSpace.getModifiedList())){ errorMessage3 = IBMErrorMessages.createWarningMessage(locale, messages, "info.restart.server", null); } Object obj = request.getAttribute(com.ibm.ws.console.core.Constants.IBM_ERROR_MESG_KEY); if (obj == null || !(obj instanceof IBMErrorMessage[])) { obj = new IBMErrorMessage[0]; } IBMErrorMessage[] errorArray = (IBMErrorMessage[])obj; List newErrorArray = new Vector(); newErrorArray.add(errorMessage1); if (this.isDmgr) { newErrorArray.add(errorMessage2); } if(errorMessage3!=null){ newErrorArray.add(errorMessage3); } newErrorArray.addAll(Arrays.asList(errorArray)); request.setAttribute(com.ibm.ws.console.core.Constants.IBM_ERROR_MESG_KEY, (IBMErrorMessage[]) newErrorArray.toArray(new IBMErrorMessage[newErrorArray.size()])); } } } } %>
<% int count=0; %> <% for (Iterator i = tabList.iterator(); i.hasNext();) { //System.out.println("xdOperationsTabs::count: " + count); PropertyItem propertyItem = (PropertyItem)i.next(); String label = propertyItem.getLabel(); String attribute = propertyItem.getAttribute(); //Bug 9143: add defaultSelectTab check to only get contextType from the selected nav item. if (defaultSelectedTab.equals(label) && !propertyItem.getType().equals("")) { //System.out.println("xdOperationsTabs:: type=" + propertyItem.getType()); request.setAttribute("contextType", propertyItem.getType()); } //System.out.println("xdOperationsTabs:: property=" + label + " attr=" + attribute); count++; %> <% if (defaultSelectedTab.equals(label)) { %> <% } else { %> <% } %> <% } %>
<% } catch (Exception e) {e.printStackTrace();} %> <% //Bug 9676: remove attribute indicating tab/breadcrumb reset is ocurring session.removeAttribute("xd_bc_reset"); %>