Author: thomas.heute(a)jboss.com
Date: 2008-07-30 14:29:36 -0400 (Wed, 30 Jul 2008)
New Revision: 11658
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
Log:
Suddenly JSF+Facelets doesn't like Collections anymore...
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-07-30
16:08:41 UTC (rev 11657)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2008-07-30
18:29:36 UTC (rev 11658)
@@ -47,8 +47,10 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.info.EventInfo;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.security.AuthorizationDomainRegistry;
@@ -63,6 +65,8 @@
import javax.faces.context.FacesContext;
import javax.faces.el.PropertyResolver;
import javax.faces.model.SelectItem;
+import javax.xml.namespace.QName;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -236,6 +240,70 @@
}
}
});
+ portletDecorator.setProperty("preferenceKeys", new
AbstractPropertyDecorator(List.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ Set<String> pk = portlet.getInfo().getPreferences().getKeys();
+ if (pk != null)
+ {
+ return new ArrayList<String>(pk);
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+ });
+ portletDecorator.setProperty("publicParameters", new
AbstractPropertyDecorator(List.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ Collection<? extends ParameterInfo> pp =
portlet.getInfo().getNavigation().getPublicParameters();
+ if (pp != null)
+ {
+ return new ArrayList<ParameterInfo>(pp);
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+ });
+ portletDecorator.setProperty("consumedEvents", new
AbstractPropertyDecorator(List.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ Map<QName, ? extends EventInfo> ce =
portlet.getInfo().getEventing().getConsumedEvents();
+ if (ce != null)
+ {
+ return new ArrayList<EventInfo>(ce.values());
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+ });
+ portletDecorator.setProperty("producedEvents", new
AbstractPropertyDecorator(List.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ Map<QName, ? extends EventInfo> pe =
portlet.getInfo().getEventing().getProducedEvents();
+ if (pe != null)
+ {
+ return new ArrayList<EventInfo>(pe.values());
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+ });
portletDecorator.setProperty("smallIconLocation", new
PortletIconPropertyDecorator(PortletIconInfo.SMALL));
portletDecorator.setProperty("largeIconLocation", new
PortletIconPropertyDecorator(PortletIconInfo.LARGE));
registerDecorator(Portlet.class, portletDecorator);
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-07-30
16:08:41 UTC (rev 11657)
+++
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2008-07-30
18:29:36 UTC (rev 11658)
@@ -98,7 +98,7 @@
<portal:box class="whiteWithLtGreyHeader meta-box">
<h3>#{bundle.PREFERENCES}</h3>
<dl>
- <c:forEach var="preferenceKey"
items="#{portlet.info.preferences.keys}">
+ <c:forEach var="preferenceKey"
items="#{portlet.preferenceKeys}">
<dt>
#{preferenceKey}
</dt>
@@ -111,12 +111,12 @@
<portal:box class="whiteWithLtGreyHeader meta-box">
<h3>#{bundle.COMMON_PUBLIC_RENDER_PARAMETERS}</h3>
<dl>
- <c:forEach var="publicParam"
items="#{portlet.info.navigation.publicParameters}">
+ <c:forEach var="publicParam"
items="#{portlet.publicParameters}">
<dt>
#{publicParam.name}
</dt>
<dd>
- <span><label>#{bundle.COMMON_ID}:
</label>#{publicParam.id}</span> <span><label>#{bundle.COMMON_DESCRIPTION}:
</label>#{publicParam.description}</span>
+ <span><label>#{bundle.COMMON_ID}:
</label>#{publicParam.id}</span> <span><label>#{bundle.COMMON_DESCRIPTION}:
</label>#{publicParam.description.defaultString}</span>
</dd>
</c:forEach>
</dl>
@@ -201,9 +201,9 @@
<h3>#{bundle.COMMON_PRODUCED_EVENTS}</h3>
<dl>
- <c:forEach var="producedEvent"
items="#{portlet.info.eventing.producedEvents}">
+ <c:forEach var="producedEvent"
items="#{portlet.producedEvents}">
<dt>
- #{producedEvent.value}
+ #{producedEvent.displayName.defaultString}
</dt>
<dd>
@@ -214,9 +214,9 @@
<portal:box class="whiteWithLtGreyHeader meta-box">
<h3>#{bundle.COMMON_CONSUMED_EVENTS}</h3>
<dl>
- <c:forEach var="consumedEvent"
items="#{portlet.info.eventing.consumedEvents}">
+ <c:forEach var="consumedEvent"
items="#{portlet.consumedEvents}">
<dt>
- #{consumedEvent.value}
+ #{consumedEvent.displayName.defaultString}
</dt>
<dd>