%-- IBM Confidential OCO Source Material --%>
<%-- 5724-I63, 5724-H88, 5655-N02, 5733-W70 (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 language="java" import="org.apache.struts.util.MessageResources,org.apache.struts.action.Action,com.ibm.ws.security.core.SecurityContext"%>
<%@ page errorPage="/error.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ 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.*"%>
<%@ page import="com.ibm.wsspi.*"%>
<%@ page import="com.ibm.ws.console.core.item.CollectionItem"%>
<%@ page import="com.ibm.ws.console.core.selector.*"%>
<%@ page import="com.ibm.ws.console.core.ConfigFileHelper"%>
<%@ page import="com.ibm.ws.console.core.Constants"%>
<%@ page import="com.ibm.ws.console.core.form.AbstractCollectionForm"%>
<%@ page import="com.ibm.ws.console.core.form.ContextScopeForm"%>
<%@ page import="com.ibm.ws.xd.admin.utils.ConfigUtils"%>
<%@ 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" %>
<%
int chkcounter = 0;
try {
%>
<%
int wasVersion = ConfigUtils.getWASVersionInts()[0];
if(treatAdminSecurityManagerRoleAsMonitor==null) {
treatAdminSecurityManagerRoleAsMonitor="true";
}
org.apache.struts.util.MessageResources messages = (org.apache.struts.util.MessageResources)pageContext.getServletContext().getAttribute(org.apache.struts.action.Action.MESSAGES_KEY);
String contextType=(String)request.getAttribute("contextType");
AdminAuthorizer adminAuthorizer = AdminAuthorizerFactory.getAdminAuthorizer();
java.util.Properties props= null;
String encoding = response.getCharacterEncoding();
if(encoding==null) encoding = "UTF-8";
java.util.ArrayList collectionList_ext = new java.util.ArrayList();
for(int i=0;i0) || (extensions_preferences!=null && extensions_preferences.length>0)){
if(contextId!=null && contextId!="nocontext"){
props = ConfigFileHelper.getNodeMetadataProperties((String)contextId); //213515
}
props = ConfigFileHelper.getAdditionalAdaptiveProperties(request, props, formName);
}
if(extensions!=null && extensions.length>0){
collectionList_ext = CollectionItemSelector.getCollectionItems(extensions,collectionList_ext,props);
}
pageContext.setAttribute("collectionList_ext",collectionList_ext);
boolean isWASDynamicCluster = false;
com.ibm.ws.console.dynamiccluster.form.DynamicClusterDetailForm dcDetailForm = (com.ibm.ws.console.dynamiccluster.form.DynamicClusterDetailForm) session.getAttribute("DynamicClusterDetailForm");
if (dcDetailForm != null) {
String serverType = dcDetailForm.getServerType();
if (serverType != null && (serverType.equals(com.ibm.ws.xd.util.MiddlewareServerConstants.APPLICATION_SERVER) ||
(serverType.equals(com.ibm.ws.xd.util.MiddlewareServerConstants.ONDEMAND_ROUTER)))) {
isWASDynamicCluster = true;
}
}
%>
<%
if(extensions_preferences!=null && extensions_preferences.length>0){
collectionPreferenceList_ext = PreferenceSelector.getPreferences(extensions_preferences,collectionPreferenceList_ext,props);
}
%>
<%-- Generate a map of roles--%>
<%
Map contextToRolesMap = new HashMap();
if (wasVersion >= 7) {
%>
<%String contextId_detail = null;%>
<%contextId_detail = contextId_new;%>
<%
contextId_detail = ConfigFileHelper.encodeContextUri(contextId_detail);
if(contextId_detail==null)
contextId_detail=contextId;
if (wasVersion >= 7)
contextToRolesMap.put(contextId_detail, ConfigFileHelper.getRoles(contextId_detail));
%>
<%-- We need to get ALL items in the collection so that we can display the correct values in the PreferenceFilter --%>
<%-- It would be nice if there was a more efficient way to do that without looking through every item. (417407) --%>
<%String contextId_detail = null;%>
<%contextId_detail = contextId_new;%>
<%
contextId_detail = ConfigFileHelper.encodeContextUri(contextId_detail);
if(contextId_detail==null)
contextId_detail=contextId;
contextToRolesMap.put(contextId_detail, ConfigFileHelper.getRoles(contextId_detail));
%>
<%
//The goal is to populate contextToRolesMap with
// 1. The valid roles of all items in collection table
// 2. The valid roles for current scope (if selected), or else for all possible scopes if "All Scopes" is selected
if (contextId != null) {
if (contextId.equals("none") || contextId.equals(Constants.ALLSCOPES)) {
//try to get a list of scopes from a scope form
ContextScopeForm scopeForm = (ContextScopeForm) session.getAttribute("contextScopeForm");
List allScopes = scopeForm.getAllscopes();
for (Iterator i = allScopes.iterator(); i.hasNext(); ) {
String scopeContextId = (String) i.next();
contextToRolesMap.put(scopeContextId, ConfigFileHelper.getRoles(ConfigFileHelper.decodeContextUri(scopeContextId)));
}
} else if (contextId.equals("CONTEXT_NOT_SET")) { //This happens when using AbstractController
ContextScopeForm scopeForm = (ContextScopeForm) session.getAttribute("contextScopeForm");
if (scopeForm.getCurrentScope().equals("All Scopes")) {
List allScopes = scopeForm.getAllscopes();
for (Iterator i = allScopes.iterator(); i.hasNext(); ) {
String scopeContextId = (String) i.next();
contextToRolesMap.put(scopeContextId, ConfigFileHelper.getRoles(ConfigFileHelper.decodeContextUri(scopeContextId)));
}
} else {
contextToRolesMap.put(scopeForm.getCurrentScope(), ConfigFileHelper.getRoles(ConfigFileHelper.decodeContextUri(scopeForm.getCurrentScope())));
}
} else {
//context is set to a single scope--use that
contextToRolesMap.put(contextId, ConfigFileHelper.getRoles(ConfigFileHelper.decodeContextUri(contextId)));
}
}
}
%>
<%--
NOTES:
The sorting icons are specified in defaultIconList. The icons are assumed to be located in the images folder.
Checkboxes are NOT displayed for all objects whose refIds start with "builtin_"
--%>
<%@ include file="filterSetup.jspf" %>
<% session.removeAttribute("preferences"); %>
<% for (Iterator i = collectionPreferenceList_ext.iterator(); i.hasNext();) {
preferences.add(i.next());
}%>
<% if (request.getAttribute("role.filtering.disabled") == null) { %>
<% } %>
<% if (request.getAttribute("role.filtering.disabled") == null) { %>
<% } %>
<%
String hideCheckBoxes = (String) request.getAttribute("hide.check.boxes");
if(hideCheckBoxes!= null && hideCheckBoxes.equals("true")){
showCheckBoxes = "false";
}
%>
<%@ include file="tableControlsLayout.jspf" %>
<% } catch (Exception e) {e.printStackTrace();
} %>
<%
ServletContext servletContext = (ServletContext)pageContext.getServletContext();
MessageResources messages = (MessageResources)servletContext.getAttribute(Action.MESSAGES_KEY);
String nonefound = messages.getMessage(request.getLocale(),"Persistence.none");
if (chkcounter == 0) {
out.println("