Author: thomas.heute(a)jboss.com
Date: 2007-05-21 09:44:21 -0400 (Mon, 21 May 2007)
New Revision: 7294
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
Log:
JBPORTAL-1451: If the portlet instance has no Preferences, do not show the Preferences
link for it.
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-05-21
13:30:40 UTC (rev 7293)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-05-21
13:44:21 UTC (rev 7294)
@@ -26,6 +26,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -39,6 +40,7 @@
import org.jboss.portal.common.value.Value;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
import org.jboss.portal.core.model.instance.NoSuchInstanceException;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -250,6 +252,27 @@
return list.subList(selectedFrom, to);
}
+ /** Return an array of all instances known in this container. */
+ public Map getSelectedInstancesPrefs()
+ {
+ Map map = new HashMap();
+ Collection instances = getSelectedInstances();
+ Iterator it = instances.iterator();
+
+ while (it.hasNext())
+ {
+ InstanceDefinition instanceDef = (InstanceDefinition)it.next();
+ try {
+ map.put(instanceDef.getId(), instanceDef.getProperties());
+ } catch (PortletInvokerException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ return map;
+ }
+
public int getInstanceCount()
{
return getInstances().size();
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-05-21
13:30:40 UTC (rev 7293)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-05-21
13:44:21 UTC (rev 7294)
@@ -30,16 +30,15 @@
<f:param name="plugin"
value="info"/>
</h:commandLink>
</td>
- <td>
- <h:commandLink
action="#{instancemgr.selectInstance}">
- <h:outputText value="Preferences"/>
- <f:param name="id"
value="#{instance.id}"/>
- <f:param name="plugin"
value="preferences"/>
- </h:commandLink> | <h:commandLink
action="#{instancemgr.selectInstance}">
+ <td><h:commandLink
action="#{instancemgr.selectInstance}">
<h:outputText value="Security"/>
<f:param name="id"
value="#{instance.id}"/>
<f:param name="plugin"
value="security"/>
- </h:commandLink> | <h:commandLink
action="#{instancemgr.deleteInstance}">
+ </h:commandLink> | <h:panelGroup rendered="#{!
empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink
action="#{instancemgr.selectInstance}">
+ <h:outputText value="Preferences"/>
+ <f:param name="id"
value="#{instance.id}"/>
+ <f:param name="plugin"
value="preferences"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink
action="#{instancemgr.deleteInstance}">
<h:outputText value="Destroy"/>
<f:param name="id"
value="#{instance.id}"/>
</h:commandLink>
Show replies by date