<%-- 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.TransactionClassDetailForm"%> <%@ 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" %> <% 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"; } } %> <% 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; %> <% try { %> <% if (renderReadOnlyView.equalsIgnoreCase("yes")) { %> <% 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("Custom")) { %> <% } else if (item.getType().equalsIgnoreCase("jsp")) { %> <% } else if (item.getType().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); %> <% } else if (item.getType().equalsIgnoreCase("DynamicSelect")) { try { session.removeAttribute("valueVector"); session.removeAttribute("descVector"); } catch (Exception e) { } Vector valVector = (Vector) session.getAttribute(item.getEnumValues()); Vector descriptVector = (Vector) session.getAttribute(item.getEnumDesc()); session.setAttribute("descVector", descriptVector); session.setAttribute("valueVector", valVector); %> <% } else if (item.getType().equalsIgnoreCase("Password")) { %> <% } else { %> <% } %> <% if (descriptionsOn.booleanValue() == true) { %> <% } %> <% }%> <% TransactionClassDetailForm testForm = (TransactionClassDetailForm)session.getAttribute("TransactionClassDetailForm"); String tcName = testForm.getRefId(); ArrayList selectedNodesBean = (ArrayList)testForm.getSelectedURIs(); //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(),"-------------------------------------------"); pageContext.setAttribute("selectedNodesBean", selectedNodesBean); %> <% 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 = 0; %> <% 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("Password")) { %> <% fields++; } %> <% if (strType.equalsIgnoreCase("Custom")) { %> <% fields++; } %> <% if (strType.equalsIgnoreCase("jsp")) { %> <% 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 (strType.equalsIgnoreCase("DynamicSelect")) { try { session.removeAttribute("valueVector"); session.removeAttribute("descVector"); } catch (Exception e) { } Vector valVector = (Vector) session.getAttribute(item.getEnumValues()); Vector descriptVector = (Vector) session.getAttribute(item.getEnumDesc()); session.setAttribute("descVector", descriptVector); session.setAttribute("valueVector", valVector); %> <% fields++; } %> <% if (strType.equalsIgnoreCase("Radio")) { 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) { %> <% } %> <% } %> <% TransactionClassDetailForm testForm = (TransactionClassDetailForm)session.getAttribute("TransactionClassDetailForm"); ArrayList selectedNodesBean = (ArrayList)testForm.getSelectedURIs(); Collection appNames = testForm.getAppNamesToShow(); Collection webModNames = testForm.getWebModNamesToShow(); ArrayList uriNames = (ArrayList) testForm.getUrisToShow(); //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 (!uriNames.contains("-------------------------------------------")) uriNames.add(uriNames.size(),"-------------------------------------------"); String selectedApp = testForm.getSelectedApp(); String selectedMod = testForm.getSelectedMod(); String contextRoot = testForm.getContextRoot(); String tcName = testForm.getRefId(); pageContext.setAttribute("availableNodesBean", uriNames); pageContext.setAttribute("selectedNodesBean", selectedNodesBean); pageContext.setAttribute("appNamesBean", appNames); pageContext.setAttribute("webModNamesBean", webModNames); pageContext.setAttribute("contextRoot", contextRoot); String availNodesSelectChange = "initVars(this, " + fields + "); setSelectedNodes(selectedAvailableNodes, availNodes)"; String currNodesSelectChange = "initVars(this, " + fields + ");setSelectedNodes(selectedCurrentNodes, currentNodes)"; String removeButtonClicked = "initVars(this, " + fields + ");removeClicked(selectedCurrentNodes)"; String addButtonClicked = "initVars(this, " + fields + ");addClicked(selectedAvailableNodes)"; String addFilterButtonClicked = "initVars(this, " + fields + ");addFilterClicked()"; String appDropDownChanged = "initVars(this, " + fields + ");appNameChange()"; String modDropDownChanged = "initVars(this, " + fields + ");webModNameChange()"; %> <% int numMembershipColumns = Integer.parseInt(numberOfColumns); if (numMembershipColumns > 0) numMembershipColumns--; fieldLevelHelpTopic = topicKey + "membership"; %>
<% if (descriptionsOn.booleanValue() == true) { %>
<% } %> <% String initVars = "initVars(this, " + fields + ");"; String applyClick = initVars + " submitIt()"; String resetClick = initVars + " resetForm()"; %>
        

 




" class="buttons" id="navigation" onclick="<%=applyClick%>"> " class="buttons" id="navigation" onclick="<%=applyClick%>"> " class="buttons" id="navigation" onclick="<%=resetClick%>"> " class="buttons" id="navigation">
<%} } catch (Exception e) {System.out.println(e.toString());}%>