From: Chris L. <chr...@jb...> - 2006-04-28 22:43:09
|
User: claprun Date: 06/04/28 18:43:02 Modified: wsrp/src/main/org/jboss/portal/wsrp WSRPTypeFactory.java Log: - Implemented support for remotable in jboss-portlet.xml descriptor. [JBPORTAL-843] - WSRP Producer now only exposes remotable portlets and adapted code accordingly. - Improvements to ServiceDescriptionHandler and WSRPTypeFactory. - Javadoc improvements. Revision Changes Path 1.4 +33 -1 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java (In the diff below, changes in quantity of whitespace are not shown.) Index: WSRPTypeFactory.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- WSRPTypeFactory.java 26 Apr 2006 17:48:37 -0000 1.3 +++ WSRPTypeFactory.java 28 Apr 2006 22:43:02 -0000 1.4 @@ -27,8 +27,10 @@ import org.jboss.portal.wsrp.core.GetServiceDescription; import org.jboss.portal.wsrp.core.InteractionParams; import org.jboss.portal.wsrp.core.MarkupParams; +import org.jboss.portal.wsrp.core.MarkupType; import org.jboss.portal.wsrp.core.PerformBlockingInteraction; import org.jboss.portal.wsrp.core.PortletContext; +import org.jboss.portal.wsrp.core.PortletDescription; import org.jboss.portal.wsrp.core.RuntimeContext; import org.jboss.portal.wsrp.core.StateChange; import org.jboss.portal.wsrp.core.UpdateResponse; @@ -39,7 +41,7 @@ * See <a href="http://jira.jboss.com/jira/browse/JBPORTAL-808">JBPORTAL-808</a> for more information. * * @author <a href="mailto:chr...@jb...">Chris Laprun</a> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @since 2.4 */ public class WSRPTypeFactory @@ -251,4 +253,34 @@ { return new UpdateResponse(); } + + /** + * portletHandle(xsd:string), markupTypes(MarkupType)+, groupID(xsd:string)?, description(LocalizedString)?, + * shortTitle(LocalizedString)?, title(LocalizedString)?, displayName(LocalizedString)?, + * keywords(LocalizedString)*, userCategories(xsd:string)*, userProfileItems(xsd:string)*, + * usesMethodGet(xsd:boolean[false])?, defaultMarkupSecure(xsd:boolean[false])?, + * onlySecure(xsd:boolean[false])?, userContextStoredInSession(xsd:boolean[false])?, + * templatesStoredInSession(xsd:boolean[false])?, hasUserSpecificState(xsd:boolean[false])?, + * doesUrlTemplateProcessing(xsd:boolean[false])?, extensions(Extension)* + * + * @return + */ + public static PortletDescription createPortletDescription(String portletHandle, MarkupType[] markupTypes) + { + if (portletHandle == null || portletHandle.length() == 0) + { + throw new IllegalArgumentException("PortletDescription requires a valid portlet handle. " + + "Was given: >" + portletHandle + "<"); + } + + if (markupTypes == null || markupTypes.length == 0) + { + throw new IllegalArgumentException("PortletDescription requires at least one MarkupType."); + } + + PortletDescription portletDescription = new PortletDescription(); + portletDescription.setPortletHandle(portletHandle); + portletDescription.setMarkupTypes(markupTypes); + return portletDescription; + } } |