uPortal 3 WSRP Consumer
Archived Content
The UP3 space contains documentation related to the next-generation portal exploration work that JA-SIG has now archived. Documentation related to uPortal, including active development for future releases, can be found in the uPortal space.
Active uPortal 3 documentation is also available in the uPortal space.
The WSRP consumer in uPortal 3 is based on the WSRP4J consumer.
A few classes have been rewritten to adapt the consumer to uPortal's needs:
- org.jasig.portal.wsrp.consumer.WsrpProxyPortlet
is the modified version of WSRP4J's PortletProxy that includes
uPortal3 logging, error handling and uses the uPortal-specific implementation of WSRP4J ConsumerEnvironment interface. - org.jasig.portal.wsrp.consumer.WsrpConsumerEnvironmentImpl
is an extension of WSRP4J's GenericConsumerEnvironment that works with uPortal's producer registry. - org.jasig.portal.wsrp.consumer.WsrpProducerRegistryImpl is an implementation of WSRP4J ProducerRegistry interface.
The WsrpProxyPortlet is the WSRP consumer's portlet that has to be defined in uPortal's web.xml like in the following example:
<web-app> ... <servlet> <servlet-name>WsrpProxyPortlet</servlet-name> <display-name>WSRP Consumer</display-name> <description>WSRP Portlet Wrapper</description> <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class> <init-param> <param-name>portlet-class</param-name> <param-value>org.jasig.portal.wsrp.consumer.WsrpProxyPortlet</param-value> </init-param> <init-param> <param-name>portlet-guid</param-name> <param-value>uP3.WsrpProxyPortlet</param-value> </init-param> </servlet> <servlet> <servlet-name>ResourceProxy</servlet-name> <servlet-class>org.apache.wsrp4j.consumer.portlet.impl.ResourceProxy</servlet-class> </servlet> ... <servlet-mapping> <servlet-name>WsrpProxyPortlet</servlet-name> <url-pattern>/WsrpProxyPortlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ResourceProxy</servlet-name> <url-pattern>/ResourceProxy/*</url-pattern> </servlet-mapping> ... </web-app>
Resource Links
WSRP4J's ResourceProxy portlet is used to provide correct links to remote resources.
Resource links have to be absolute URIs.
The portlet.xml with the initial parameter consumer.environment.class pointing to the consumer environment class and the user attributes should also be created in uPortal's WEB-INF directory:
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"> <portlet> <portlet-name>WsrpProxyPortlet</portlet-name> <display-name>uPortal 3 WSRP Proxy Portlet</display-name> <portlet-class>org.jasig.portal.wsrp.consumer.WsrpProxyPortlet</portlet-class> <init-param> <name>consumer.environment.class</name> <value>org.jasig.portal.wsrp.consumer.WsrpConsumerEnvironmentImpl</value> </init-param> <expiration-cache>-1</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> <portlet-mode>EDIT</portlet-mode> <portlet-mode>HELP</portlet-mode> </supports> <supported-locale>en</supported-locale> <portlet-info> <title>WsrpProxyPortlet</title> <short-title>Proxy</short-title> <keywords>WSRP, Consumer, ProxyPortlet</keywords> </portlet-info> </portlet> <user-attribute> <description>User Prefix</description> <name>user.name.prefix</name> </user-attribute> <user-attribute> <description>User Given Name</description> <name>user.name.given</name> </user-attribute> <user-attribute> <description>User Family Name</description> <name>user.name.family</name> </user-attribute> <user-attribute> <description>User Middle Name</description> <name>user.name.middle</name> </user-attribute> <user-attribute> <description>User Suffix</description> <name>user.name.suffix</name> </user-attribute> <user-attribute> <description>User Nickname</description> <name>user.name.nickName</name> </user-attribute> </portlet-app>
To create a portlet entity associated with the remote portlet on the WSRP producer side you need to make sure that:
- The portlet application uP3.WsrpProxyPortlet is published. See the section "Portlet publishing" in uPortal 3.0.0-M1 Portlet Publishing and Subscribing.
- The new portlet entity and portlet window are created (see "Portlet subscribing" in uPortal 3.0.0-M1 Portlet Publishing and Subscribing) with the following portlet entity preferences:
wsrp_portlet_handle – a portlet enity ID in uPortal 3 or a portlet definition ID in the WSRP4J.
wsrp_producer_id – the unique identificator of the WSRP producer.
wsrp_service_desc_url – the WSRP service description service URL.
wsrp_markup_url – the WSRP base (markup) service URL.
wsrp_reg_url – the WSRP registration service URL.
wsrp_portlet_mgmt_url – the WSRP portlet management service URL.
Here is the example of the WSRP consumer portlet entity preferences configured to work with the local uPortal 3 WSRP producer and the portlet entity ID = 1:
wsrp_portlet_handle = 1 wsrp_producer_id = uP3_wsrp_producer wsrp_service_desc_url = http://localhost:8080/uP3/wsrp/WSRPServiceDescriptionService wsrp_markup_url = http://localhost:8080/uP3/wsrp/WSRPBaseService wsrp_reg_url = http://localhost:8080/uP3/wsrp/WSRPRegistrationService wsrp_portlet_mgmt_url = http://localhost:8080/uP3/wsrp/WSRPPortletManagementService