%-- IBM Confidential OCO Source Material --%> <%-- 5724-J34 (C) COPYRIGHT International Business Machines Corp. 1997, 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 import="com.ibm.ws.sm.workspace.*"%> <%@ page import="com.ibm.ws.workspace.query.*"%> <%@ page import="com.ibm.ws.console.core.*"%> <%@ page import="com.ibm.ws.console.core.ConfigFileHelper"%> <%-- LIDB2303A --%> <%@ page import="java.util.*,com.ibm.ws.security.core.SecurityContext,com.ibm.websphere.product.*"%> <%@ page import="com.ibm.websphere.management.authorizer.AdminAuthorizer"%> <%@ page import="com.ibm.websphere.management.authorizer.AdminAuthorizerFactory"%> <%@ page import="com.ibm.websphere.management.metadata.ManagedObjectMetadataAccessor"%> <%@ page import="com.ibm.websphere.management.metadata.ManagedObjectMetadataAccessorFactory"%> <%@ page import="com.ibm.ws.console.core.selector.*"%> <%@ page import="com.ibm.ws.*"%> <%@ page import="com.ibm.ws.console.hmm.form.HMMDetailForm, com.ibm.ws.console.core.item.PropertyItem"%> <%@ 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{ %> <% //check to see if it's we're on a runtime tab, and it is disabled. If so, make the attributeList only contain 3 fields: saveToRepos, enabled, and a text field saying that the //controller is disabled. String t_attrName; HMMDetailForm form = (HMMDetailForm)session.getAttribute(formName); boolean enabled = form.getEnabled().equalsIgnoreCase("true"); boolean runtime = "tab.runtime".equals(form.getPerspective()); if (runtime && !enabled){ ArrayList attrList = new ArrayList(attributeList); for (Iterator iter = attrList.iterator(); iter.hasNext();){ t_attrName = ((PropertyItem)iter.next()).getAttribute(); if (!"enabled".equals(t_attrName) && !"saveToRepos".equals(t_attrName)) iter.remove(); } //now add the text field one. PropertyItem disabledText = new PropertyItem(); disabledText.setValue("controller.is.disabled:disabledText:no:disabledTextType"); attrList.add(disabledText); attributeList = attrList; } pageContext.setAttribute("tmpattributeList", attributeList); %> <%String contextId = null;%> <%contextId = contextId_new;%> <% AdminAuthorizer adminAuthorizer = AdminAuthorizerFactory.getAdminAuthorizer(); String contextUri = ConfigFileHelper.decodeContextUri(contextId); String contextType=(String)request.getAttribute("contextType"); String cellname = null; String nodename = null; String token = null; java.util.Properties props= null; java.util.ArrayList attributeList_ext = new java.util.ArrayList(); for(int i=0;i <% 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"; 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 there's no properties, don't show this section if (attributeList_ext.size() > 0) { %> <% if (renderReadOnlyView.equalsIgnoreCase("yes")) { %> <%--html:hidden property="action"/--%> <% int propCounterReadOnly = 0; String activeSubhead = ""; %> <%if (item.getCategoryId()!=null) { %> <% if ((!activeSubhead.equals(item.getCategoryId()) && (!activeSubhead.equals(""))) || ((item.getCategoryId().equalsIgnoreCase("general") && propCounterReadOnly!=0))) { %> <% } if(!item.getCategoryId().equalsIgnoreCase("general")){ activeSubhead = item.getCategoryId(); %> <%}else activeSubhead=""; } else { %> <% 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(com.ibm.ws.console.core.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("disabledTextType")){ %> <% } 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 { %> <% } %> <% propCounterReadOnly += 1;%> <% }%> <%}%> <% if (!activeSubhead.equals("")) { %> <% } %> " class="buttons_navigation"> <% } %> <% if (renderReadOnlyView.equalsIgnoreCase("no")) { %> <% int propSet = attributeList_ext.size(); int propEven = propSet%2; int propCounter = 0; String activeSubhead = ""; %> <%if (item.getCategoryId()!=null) { %> <% if ((!activeSubhead.equals(item.getCategoryId()) && (!activeSubhead.equals(""))) || ((item.getCategoryId().equalsIgnoreCase("general") && propCounter!=0))) { %> <% } if(!item.getCategoryId().equalsIgnoreCase("general")){ activeSubhead = item.getCategoryId(); %> <%}else activeSubhead=""; } else { %> <% 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(com.ibm.ws.console.core.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("disabledTextType")){ %> <%} if (strType.equalsIgnoreCase("Text")) { %> <% } %> <% if (strType.equalsIgnoreCase("TextMedium")) { %> <% } %> <% if (strType.equalsIgnoreCase("TextLong")) { %> <% } %> <% if (strType.equalsIgnoreCase("TextArea")) { %> <% } %> <% if (strType.equalsIgnoreCase("checkbox")) { %> <% } %> <% if (strType.equalsIgnoreCase("Password")) { %> <% } %> <% if (strType.equalsIgnoreCase("Custom")) { %> <% } %> <% if (strType.equalsIgnoreCase("jsp")) { %> <% } %> <% 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 (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); %> <% } %> <% 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); %> <% } %> <% } %> <% propCounter += 1;%> <%}%> <% if (!activeSubhead.equals("")) { %> <% } %> " class="buttons_navigation"> " class="buttons_navigation"> " class="buttons_navigation"> " class="buttons_navigation"> <% } %> <% } } catch(Exception e){e.printStackTrace();} %>