<%-- IBM Confidential OCO Source Material --%> <%-- 5724-J34 (C) COPYRIGHT International Business Machines Corp. 2004 --%> <%-- 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.console.policyconfiguration.form.ServiceClassDetailForm"%> <%@ page import="java.beans.*"%> <%@ page errorPage="/error.jsp"%> <%@ 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" %> <% try { System.err.println("in ServiceClassCustomPropsLayout.jsp");%> <% String renderReadOnlyView = "no"; if( (readOnlyView != null) && (readOnlyView.equalsIgnoreCase("yes")) ) { renderReadOnlyView = "yes"; } else if (SecurityContext.isSecurityEnabled()) { renderReadOnlyView = "yes"; if (request.isUserInRole("administrator")) { renderReadOnlyView = "no"; } else if (request.isUserInRole("configurator")) { renderReadOnlyView = "no"; } } ServiceClassDetailForm testForm = (ServiceClassDetailForm)session.getAttribute("ServiceClassDetailForm"); Boolean descriptionsOn = (Boolean) session.getAttribute("descriptionsOn"); String numberOfColumns = "3"; if (descriptionsOn.booleanValue() == false) numberOfColumns = "2"; WASDirectory directory = new WASDirectory(); %> <% String fieldLevelHelpTopic = ""; String fieldLevelHelpAttribute = ""; String DETAILFORM = "DetailForm"; String objectType = ""; int index = formType.lastIndexOf ('.'); if (index > 0) { String fType = formType.substring (index+1); if (fType.endsWith (DETAILFORM)) objectType = fType.substring (0, fType.length()-DETAILFORM.length()); else objectType = fType; } fieldLevelHelpTopic = objectType+".detail."; String topicKey = fieldLevelHelpTopic; %> <% if (renderReadOnlyView.equalsIgnoreCase("yes")) { String goalType = testForm.getGoalType(); int fields = 1; %> <% boolean displayField = true; fieldLevelHelpAttribute = item.getAttribute(); if (fieldLevelHelpAttribute.equals(" ") || fieldLevelHelpAttribute.equals("")) fieldLevelHelpTopic = item.getLabel(); else fieldLevelHelpTopic = topicKey + fieldLevelHelpAttribute; //this code gets productId from icon attribute of PropertyItem //and checks if product is installed // If product is installed , then make row visible String productId = item.getIcon(); boolean productEnabled = true; if ( (productId == null) || (productId !=null && productId.equals("")) ) { productId = "BASE"; } else if (productId.equals("ND") && directory.isThisProductInstalled(productId)) { WorkSpaceQueryUtil util = WorkSpaceQueryUtilFactory.getUtil(); RepositoryContext cellContext = (RepositoryContext)session.getAttribute(Constants.CURRENTCELLCTXT_KEY); try { if (util.isStandAloneCell(cellContext)) { productEnabled = false; } else { productEnabled = true; } } catch (Exception e) { System.out.println("exception in util.isStandAloneCell " + e.toString()); productEnabled = false; } } else if (productId.equals("PME") && directory.isThisProductInstalled(productId)) { productEnabled = true; } else { productEnabled = false; } if (productEnabled) { if (item.getType().equalsIgnoreCase("Select")) { if ((item.getAttribute().equalsIgnoreCase("importance")) && (goalType.equals("GOAL_TYPE_DISCRETIONARY"))) { displayField = false; } else { 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); %> <% } } else if (item.getType().equalsIgnoreCase("Password")) { %> <% } else { if (item.getAttribute().equalsIgnoreCase("goalValue")) { if (!goalType.equals("GOAL_TYPE_DISCRETIONARY") ) { String key = testForm.getTimeInterval(); %> <% } else { displayField = false; } } else if (item.getAttribute().equalsIgnoreCase("goalPercent")) { if (goalType.equals("GOAL_TYPE_PCT_RESPONSE_TIME")) { %> <% } else { displayField = false; } } else { %> <% } } %> <% if ((descriptionsOn.booleanValue() == true) && (displayField)) { %> <% } if (displayField) { fields++; %> <% } %> <% }%> <% Collection selectedNodesBean = testForm.getTCNames(); String scName = testForm.getRefId(); pageContext.setAttribute("selectedNodesBean", selectedNodesBean); String currNodesSelectChange = "initROVars(this);setSelectedNodes(selectedCurrentNodes, currentNodes)"; String viewButtonClicked = "initROVars(this);viewClicked(selectedCurrentNodes)"; %> <% int numMembershipColumns = Integer.parseInt(numberOfColumns); if (numMembershipColumns > 0) numMembershipColumns--; fieldLevelHelpTopic = topicKey + "membership"; %>
******
<% if (descriptionsOn.booleanValue() == true) { %>
<% } %>


" class="buttons" id="navigation">
<% } %> <% if (renderReadOnlyView.equalsIgnoreCase("no")) { %> <%int fields = 1; %> <% fieldLevelHelpAttribute = item.getAttribute(); if (fieldLevelHelpAttribute.equals(" ") || fieldLevelHelpAttribute.equals("")) fieldLevelHelpTopic = item.getLabel(); else fieldLevelHelpTopic = topicKey + fieldLevelHelpAttribute; //this code gets productId from icon attribute of PropertyItem //and checks if product is installed // If product is installed , then make row visible String productId = item.getIcon(); boolean productEnabled = true; if ( (productId == null) || (productId !=null && productId.equals("")) ) { productId = "BASE"; } else if (productId.equals("ND") && directory.isThisProductInstalled(productId)) { WorkSpaceQueryUtil util = WorkSpaceQueryUtilFactory.getUtil(); RepositoryContext cellContext = (RepositoryContext)session.getAttribute(Constants.CURRENTCELLCTXT_KEY); try { if (util.isStandAloneCell(cellContext)) { productEnabled = false; } else { productEnabled = true; } } catch (Exception e) { System.out.println("exception in util.isStandAloneCell " + e.toString()); productEnabled = false; } } else if (productId.equals("PME") && directory.isThisProductInstalled(productId)) { productEnabled = true; } else { productEnabled = false; } if (productEnabled) { %> <% String isRequired = item.getRequired(); String strType = item.getType(); String isReadOnly = item.getReadOnly(); %> <% if (strType.equalsIgnoreCase("Text")) { if (item.getAttribute().equalsIgnoreCase("goalValue")) { 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); %> <% fields++; } else if (item.getAttribute().equalsIgnoreCase("goalPercent")) { %> <% fields++; } else { %> <% fields++; } } %> <% if (strType.equalsIgnoreCase("TextArea")) { %> <% fields++; } %> <% if (strType.equalsIgnoreCase("checkbox")) { %> <% 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); %> <% fields++; } %> <% if (descriptionsOn.booleanValue() == true) { %> <% } //end descriptions on %> <% } //end product enabled %> <% Collection selectedNodesBean = testForm.getTCNames(); String scName = testForm.getRefId(); pageContext.setAttribute("selectedNodesBean", selectedNodesBean); String currNodesSelectChange = "initVars(this, " + fields + ");setSelectedNodes(selectedCurrentNodes, currentNodes)"; String removeButtonClicked = "initVars(this, " + fields + ");removeClicked(selectedCurrentNodes)"; String addButtonClicked = "initVars(this, " + fields + ");addClicked(selectedAvailableNodes)"; String moveButtonClicked = "initVars(this, " + fields + ");moveClicked(selectedCurrentNodes)"; String modifyButtonClicked = "initVars(this, " + fields + ");modifyClicked(selectedCurrentNodes)"; %> <% int numMembershipColumns = Integer.parseInt(numberOfColumns); if (numMembershipColumns > 0) numMembershipColumns--; fieldLevelHelpTopic = topicKey + "membership"; %> <% String initVars = "initVars(this, " + fields + ");"; String applyClick = initVars + " submitIt()"; String resetClick = initVars + " resetForm()"; %>
<% if (descriptionsOn.booleanValue() == true) { %>
<% } %>



" class="buttons" id="navigation" onclick="<%=applyClick%>"> " class="buttons" id="navigation" onclick="<%=applyClick%>"> " class="buttons" id="navigation" onclick="<%=resetClick%>"> " class="buttons" id="navigation">
<%} } //try catch (Exception e) { e.printStackTrace(); }%>