<%-- IBM Confidential OCO Source Material --%> <%-- 5724-J34 (C) COPYRIGHT International Business Machines Corp. 2004, 2010 --%> <%-- The source code for this program is not published or otherwise divested --%> <%-- of its trade secrets, irrespective of what has been deposited with the --%> <%-- U.S. Copyright Office. --%> <%@ page language="java" import="java.util.Collection,java.lang.reflect.*,com.ibm.ws.util.XDConstants,com.ibm.ws.console.healthconfig.util.Constants,com.ibm.ws.console.healthconfig.form.HealthClassDetailForm"%> <%@ page import="java.beans.*"%> <%@ page import="org.apache.struts.util.MessageResources"%> <%@ page import="org.apache.struts.action.*"%> <%@ page errorPage="/error.jsp"%> <%@ page import="com.ibm.websphere.management.authorizer.AdminAuthorizer"%> <%@ page import="com.ibm.websphere.management.authorizer.AdminAuthorizerFactory"%> <%@ page import="com.ibm.ws.sm.workspace.*"%> <%@ page import="com.ibm.ws.workspace.query.*"%> <%@ page import="com.ibm.ws.console.core.*"%> <%@ page import="java.util.*,com.ibm.ws.security.core.SecurityContext,com.ibm.websphere.product.*"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %> <%@ taglib uri="/WEB-INF/ibmcommon.tld" prefix="ibmcommon" %> <% String contextId = (String)request.getAttribute("contextId"); AdminAuthorizer adminAuthorizer = AdminAuthorizerFactory.getAdminAuthorizer(); String contextUri = ConfigFileHelper.decodeContextUri((String)contextId); String healthCondition = ""; HealthClassDetailForm testForm = (HealthClassDetailForm)session.getAttribute("HealthClassDetailForm"); String renderReadOnlyView = "no"; if( (readOnlyView != null) && (readOnlyView.equalsIgnoreCase("yes")) ) { renderReadOnlyView = "yes"; } else if (SecurityContext.isSecurityEnabled()) { renderReadOnlyView = "yes"; if (adminAuthorizer.checkAccess(contextUri, "administrator")) { renderReadOnlyView = "no"; } else if (adminAuthorizer.checkAccess(contextUri, "configurator")) { renderReadOnlyView = "no"; } } //Boolean descriptionsOn = (Boolean) session.getAttribute("descriptionsOn"); String numberOfColumns = "3"; //if (descriptionsOn.booleanValue() == false) // numberOfColumns = "2"; String fieldLevelHelpTopic = "HealthClass.detail."; String topicKey = fieldLevelHelpTopic; int fields = 0; String healthConditionType = testForm.getType(); %> <% if (renderReadOnlyView.equalsIgnoreCase("yes")) { %> <% } %> <% if (renderReadOnlyView.equalsIgnoreCase("no")) { %>

<% String fieldLevelHelpAttribute = item.getAttribute(); if (fieldLevelHelpAttribute.equals(" ") || fieldLevelHelpAttribute.equals("")) fieldLevelHelpTopic = item.getLabel(); else fieldLevelHelpTopic = topicKey + fieldLevelHelpAttribute; %> <% String isRequired = item.getRequired(); String strType = item.getType(); String isReadOnly = item.getReadOnly(); %> <% if (strType.equalsIgnoreCase("Text")) { %> <% fields++; } %> <% if (strType.equalsIgnoreCase("TextArea")) { %> <% fields++; } %> <% if (strType.equalsIgnoreCase("Select")) { try { session.removeAttribute("valueVector"); session.removeAttribute("descVector"); } catch (Exception e) { } StringTokenizer st1 = new StringTokenizer(item.getEnumDesc(), ","); Vector descVector = new Vector(); while(st1.hasMoreTokens()) { String enumDesc = st1.nextToken(); descVector.addElement(enumDesc); } StringTokenizer st = new StringTokenizer(item.getEnumValues(), ","); Vector valueVector = new Vector(); while(st.hasMoreTokens()) { String str = st.nextToken(); valueVector.addElement(str); } session.setAttribute("descVector", descVector); session.setAttribute("valueVector", valueVector); %> <% if (item.getAttribute().equalsIgnoreCase("type")) { %> <%} else { %> <% } fields++; } %> <% //The last thing was the health condition, so here we wil put in the Health Condition attributes if (testForm.getType().equalsIgnoreCase("AGE")) { %> <% } else if (testForm.getType().equalsIgnoreCase("WORKLOAD")) {%> <% } else if (testForm.getType().equalsIgnoreCase("MEMORY")) {%> <% } else if (testForm.getType().equalsIgnoreCase("RESPONSE")) {%> <% } else if (testForm.getType().equalsIgnoreCase("STUCKREQUEST")) {%> <% } else if (testForm.getType().equalsIgnoreCase("STORMDRAIN")) {%> <% } else if (testForm.getType().equalsIgnoreCase("MEMORYLEAK")) {%> <% } else if (testForm.getType().equalsIgnoreCase("GCPERCENTAGE")) {%> <% } else if (testForm.getType().equalsIgnoreCase("CUSTOM")) { %> <% } MessageResources messages = (MessageResources)application.getAttribute(Action.MESSAGES_KEY); java.util.Locale locale = request.getLocale(); ArrayList availableMembers = (ArrayList)testForm.getAvailableNames(); ArrayList selectedNodesBean = (ArrayList)testForm.getCurrentMembership(messages, locale); //Do the dropdown with the member types Collection memberTypes = new ArrayList(); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.none"),String.valueOf(Constants.MEMBER_TYPE_NONE))); if (testForm.getType().equalsIgnoreCase("STORMDRAIN")) { memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.dynamiccluster"),String.valueOf(XDConstants.DYNAMICCLUSTER_MEMBER))); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.cell"),String.valueOf(XDConstants.CELL_MEMBER))); // // defect 305139 // commented out GSC support for now, will add this back in XD 7.0 // and also GSCs would have applied to more policy types other than RESPONSE // // } else if (testForm.getType().equalsIgnoreCase("RESPONSE")) { // memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.appserver"),String.valueOf(XDConstants.APPSERVER_MEMBER))); // memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.cluster"),String.valueOf(XDConstants.CLUSTER_MEMBER))); // memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.dynamiccluster"),String.valueOf(XDConstants.DYNAMICCLUSTER_MEMBER))); // memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.cell"),String.valueOf(XDConstants.CELL_MEMBER))); // memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.genericservercluster"),String.valueOf(XDConstants.GENERICSERVERCLUSTER_MEMBER))); } else { memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.appserver"),String.valueOf(XDConstants.APPSERVER_MEMBER))); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.cluster"),String.valueOf(XDConstants.CLUSTER_MEMBER))); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.odr"),String.valueOf(XDConstants.ODR_MEMBER))); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.dynamiccluster"),String.valueOf(XDConstants.DYNAMICCLUSTER_MEMBER))); memberTypes.add(new org.apache.struts.util.LabelValueBean(messages.getMessage(locale,"member.type.cell"),String.valueOf(XDConstants.CELL_MEMBER))); } //To make the boxes stay at a specific minimum size, we are going to add one at the bottom to provide a minimum size if (!selectedNodesBean.contains("-------------------------------------------")) selectedNodesBean.add(selectedNodesBean.size(),"-------------------------------------------"); if (!availableMembers.contains("-------------------------------------------")) availableMembers.add(availableMembers.size(),"-------------------------------------------"); String hcName = testForm.getRefId(); String selectedTypeString = testForm.getSelectedType(); //this is already translated pageContext.setAttribute("availableNodesBean", availableMembers); pageContext.setAttribute("selectedNodesBean", selectedNodesBean); pageContext.setAttribute("appNamesBean", memberTypes); String availNodesSelectChange = "initVariables(); setSelectedNodes(selectedAvailableNodes, availNodes)"; String currNodesSelectChange = "initVariables();setSelectedNodes(selectedCurrentNodes, currentNodes)"; String removeButtonClicked = "initVariables();removeClicked(selectedCurrentNodes)"; String addButtonClicked = "initVariables();addClicked(selectedAvailableNodes)"; String memberTypeChanged = "initVariables();memberTypeChange()"; %> <% int numMembershipColumns = Integer.parseInt(numberOfColumns); if (numMembershipColumns > 0) numMembershipColumns--; fieldLevelHelpTopic = topicKey + "membership"; %>
<% String initVars = "initVariables();"; String applyClick = initVars + " submitIt()"; String resetClick = initVars + " resetForm()"; %>

 

">



">



">



">





<bean:message key="/>
">




">



">



">



">



">



">





">





<bean:message key="/>
">





">



">






">



">



">
   <%String memberTypeTitle = messages.getMessage(locale,"member.type"); %>

 
<%String availableTitle = messages.getMessage(locale,"healthclass.details.availableMembers"); %>

<%String selectedMemberTitle = messages.getMessage(locale,"healthclass.details.members"); %>
" class="buttons_navigation" onclick="<%=applyClick%>" > " class="buttons_navigation" onclick="<%=applyClick%>" > " class="buttons_navigation" onClick="<%=resetClick%>" > " class="buttons_navigation">
<%} %>