Author: chris.laprun(a)jboss.com
Date: 2009-10-07 20:07:46 -0400 (Wed, 07 Oct 2009)
New Revision: 313
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java
Log:
- Changed WSRPTypeFactory.createPortletDescription to use a PortletContext instead of a
portlet handle directly so that portlet handle creation can be encapsulated.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java 2009-10-07
20:23:38 UTC (rev 312)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java 2009-10-08
00:07:46 UTC (rev 313)
@@ -303,9 +303,9 @@
*
* @return
*/
- public static PortletDescription createPortletDescription(String portletHandle,
List<MarkupType> markupTypes)
+ public static PortletDescription
createPortletDescription(org.gatein.pc.api.PortletContext portletContext,
List<MarkupType> markupTypes)
{
- checkPortletHandle(portletHandle);
+ PortletContext context = WSRPUtils.convertToWSRPPortletContext(portletContext);
ParameterValidation.throwIllegalArgExceptionIfNull(markupTypes,
"MarkupType");
if (markupTypes.isEmpty())
@@ -314,7 +314,7 @@
}
PortletDescription portletDescription = new PortletDescription();
- portletDescription.setPortletHandle(portletHandle);
+ portletDescription.setPortletHandle(context.getPortletHandle());
portletDescription.getMarkupTypes().addAll(markupTypes);
return portletDescription;
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2009-10-07
20:23:38 UTC (rev 312)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2009-10-08
00:07:46 UTC (rev 313)
@@ -23,17 +23,17 @@
package org.gatein.wsrp;
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.WindowState;
import org.gatein.common.i18n.LocaleFormat;
import org.gatein.common.util.ConversionException;
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.ActionURL;
+import org.gatein.pc.api.Mode;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.PortletURL;
import org.gatein.pc.api.RenderURL;
import org.gatein.pc.api.StatefulPortletContext;
+import org.gatein.pc.api.WindowState;
import org.gatein.pc.api.state.AccessMode;
import org.gatein.wsrp.registration.LocalizedString;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java 2009-10-07
20:23:38 UTC (rev 312)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ServiceDescriptionHandler.java 2009-10-08
00:07:46 UTC (rev 313)
@@ -191,9 +191,9 @@
*/
PortletDescription getPortletDescription(Portlet portlet, List<String>
desiredLocales)
{
- String id = portlet.getContext().getId();
+ org.gatein.pc.api.PortletContext context = portlet.getContext();
PortletInfo info = portlet.getInfo();
- log.debug("Constructing portlet description for: " + id);
+ log.debug("Constructing portlet description for: " + context.getId());
CapabilitiesInfo capInfo = info.getCapabilities();
Collection<MediaType> allMediaTypes = capInfo.getMediaTypes();
@@ -206,10 +206,10 @@
markupTypes.add(markupType);
}
- //todo generate a valid and better portlet handle
- PortletDescription desc = WSRPTypeFactory.createPortletDescription(id,
markupTypes);
+ PortletDescription desc = WSRPTypeFactory.createPortletDescription(context,
markupTypes);
- // todo: group ID
+ // group ID
+ desc.setGroupID(info.getApplicationName());
MetaInfo metaInfo = info.getMeta();
Show replies by date