org.apache.cocoon.portal.wsrp.consumer
Class PortletDriverImpl

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.portal.wsrp.consumer.PortletDriverImpl
All Implemented Interfaces:
LogEnabled, org.apache.wsrp4j.consumer.PortletDriver, RequiresConsumerEnvironment, RequiresPortalService

public class PortletDriverImpl
extends AbstractLogEnabled
implements org.apache.wsrp4j.consumer.PortletDriver, RequiresConsumerEnvironment, RequiresPortalService

This class implements a portlet driver.

Version:
$Id: PortletDriverImpl.java 322475 2005-10-16 14:26:44Z cziegeler $

Field Summary
protected  org.apache.wsrp4j.consumer.ConsumerEnvironment consumerEnv
           
protected  oasis.names.tc.wsrp.v1.types.PortletDescription desc
           
protected  oasis.names.tc.wsrp.v1.types.CookieProtocol initCookie
           
protected  org.apache.wsrp4j.log.Logger logger
          Our logger.
protected  oasis.names.tc.wsrp.v1.intf.WSRP_v1_Markup_PortType markupPort
           
protected  org.apache.wsrp4j.util.ParameterChecker parameterChecker
           
protected  org.apache.wsrp4j.consumer.WSRPPortlet portlet
           
protected  oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType portletPort
           
protected  org.apache.wsrp4j.consumer.Producer producer
           
protected  PortalService service
          The portal service.
 
Constructor Summary
PortletDriverImpl()
           
 
Method Summary
protected  void checkInitCookie(String userID)
           
 oasis.names.tc.wsrp.v1.types.PortletContext clonePortlet(String userID)
          Clone the portlet
 oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse destroyPortlets(String[] portletHandles, String userID)
          Destroy the producer portlets specified in the entiyHandles array.
 void enableLogging(Logger arg0)
           
protected  oasis.names.tc.wsrp.v1.types.InteractionParams getInteractionParams(org.apache.wsrp4j.consumer.InteractionRequest actionRequest)
           
 oasis.names.tc.wsrp.v1.types.MarkupResponse getMarkup(org.apache.wsrp4j.consumer.MarkupRequest markupRequest, String userID)
          This method is used to retrieve the markup generated by the portlet instance.
protected  oasis.names.tc.wsrp.v1.types.MarkupParams getMarkupParams(org.apache.wsrp4j.consumer.WSRPBaseRequest request)
           
protected  oasis.names.tc.wsrp.v1.types.Extension[] getMarkupParamsExtensions()
          Get the extensions for the MarkupContext.
 org.apache.wsrp4j.consumer.WSRPPortlet getPortlet()
          Get the portlet this driver is bind to.
 oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse getPortletDescription(String userID, String[] desiredLocales)
          Fetches information about the portlet from the producer.
 oasis.names.tc.wsrp.v1.types.PropertyList getPortletProperties(String[] names, String userID)
          Get the current values of the properties with the given names.
 oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse getPortletPropertyDescription(String userID)
          Fetches all published properties of an remote portlet.
protected  oasis.names.tc.wsrp.v1.types.RuntimeContext getRuntimeContext(org.apache.wsrp4j.consumer.WSRPBaseRequest request)
          Create the runtime context for the current request.
protected  oasis.names.tc.wsrp.v1.types.UserContext getUserContext(String userID)
           
protected  String[] getValidValues(String[] supported, String[] allowed)
          Calculate the valid values for modes and window states.
 void init(org.apache.wsrp4j.consumer.WSRPPortlet portlet)
          Set the wsrp portlet and initialize this component.
 void initCookie()
          Actual WSRP initCookie() call
 oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse performBlockingInteraction(org.apache.wsrp4j.consumer.InteractionRequest actionRequest, String userID)
          This method is used to perform a blocking interaction on the portlet instance.
 oasis.names.tc.wsrp.v1.types.ReturnAny releaseSessions(String[] sessionIDs, String userID)
          Inform the producer that the sessions specified in the sessionIDs array will no longer be used by the consumer and can therefor be released.
protected  void resetInitCookie(String userID)
           
 void setConsumerEnvironment(org.apache.wsrp4j.consumer.ConsumerEnvironment env)
           
 void setPortalService(PortalService service)
           
 oasis.names.tc.wsrp.v1.types.PortletContext setPortletProperties(oasis.names.tc.wsrp.v1.types.PropertyList properties, String userID)
          Set the portlet properties specified in the property list
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

portlet

protected org.apache.wsrp4j.consumer.WSRPPortlet portlet

markupPort

protected oasis.names.tc.wsrp.v1.intf.WSRP_v1_Markup_PortType markupPort

portletPort

protected oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType portletPort

consumerEnv

protected org.apache.wsrp4j.consumer.ConsumerEnvironment consumerEnv

producer

protected org.apache.wsrp4j.consumer.Producer producer

parameterChecker

protected org.apache.wsrp4j.util.ParameterChecker parameterChecker

initCookie

protected oasis.names.tc.wsrp.v1.types.CookieProtocol initCookie

desc

protected oasis.names.tc.wsrp.v1.types.PortletDescription desc

logger

protected org.apache.wsrp4j.log.Logger logger
Our logger.


service

protected PortalService service
The portal service.

Constructor Detail

PortletDriverImpl

public PortletDriverImpl()
Method Detail

enableLogging

public void enableLogging(Logger arg0)
Specified by:
enableLogging in interface LogEnabled
See Also:
LogEnabled.enableLogging(org.apache.avalon.framework.logger.Logger)

setConsumerEnvironment

public void setConsumerEnvironment(org.apache.wsrp4j.consumer.ConsumerEnvironment env)
Specified by:
setConsumerEnvironment in interface RequiresConsumerEnvironment
See Also:
RequiresConsumerEnvironment.setConsumerEnvironment(org.apache.wsrp4j.consumer.ConsumerEnvironment)

setPortalService

public void setPortalService(PortalService service)
Specified by:
setPortalService in interface RequiresPortalService
See Also:
RequiresPortalService.setPortalService(org.apache.cocoon.portal.PortalService)

init

public void init(org.apache.wsrp4j.consumer.WSRPPortlet portlet)
          throws org.apache.wsrp4j.exception.WSRPException
Set the wsrp portlet and initialize this component.

Parameters:
portlet -
Throws:
org.apache.wsrp4j.exception.WSRPException

getPortlet

public org.apache.wsrp4j.consumer.WSRPPortlet getPortlet()
Get the portlet this driver is bind to.

Specified by:
getPortlet in interface org.apache.wsrp4j.consumer.PortletDriver
Returns:
The enity

resetInitCookie

protected void resetInitCookie(String userID)
                        throws org.apache.wsrp4j.exception.WSRPException
Throws:
org.apache.wsrp4j.exception.WSRPException

checkInitCookie

protected void checkInitCookie(String userID)
                        throws org.apache.wsrp4j.exception.WSRPException
Throws:
org.apache.wsrp4j.exception.WSRPException

getMarkupParams

protected oasis.names.tc.wsrp.v1.types.MarkupParams getMarkupParams(org.apache.wsrp4j.consumer.WSRPBaseRequest request)

getValidValues

protected String[] getValidValues(String[] supported,
                                  String[] allowed)
Calculate the valid values for modes and window states.

Parameters:
supported - The values supported by the consumer.
allowed - The values allowed by the producer.
Returns:
The valid values.

getRuntimeContext

protected oasis.names.tc.wsrp.v1.types.RuntimeContext getRuntimeContext(org.apache.wsrp4j.consumer.WSRPBaseRequest request)
Create the runtime context for the current request.


getUserContext

protected oasis.names.tc.wsrp.v1.types.UserContext getUserContext(String userID)

getInteractionParams

protected oasis.names.tc.wsrp.v1.types.InteractionParams getInteractionParams(org.apache.wsrp4j.consumer.InteractionRequest actionRequest)

getMarkup

public oasis.names.tc.wsrp.v1.types.MarkupResponse getMarkup(org.apache.wsrp4j.consumer.MarkupRequest markupRequest,
                                                             String userID)
                                                      throws org.apache.wsrp4j.exception.WSRPException
This method is used to retrieve the markup generated by the portlet instance.

Specified by:
getMarkup in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
markupRequest -
userID -
Returns:
The markup response generated by the portlet
Throws:
org.apache.wsrp4j.exception.WSRPException

performBlockingInteraction

public oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse performBlockingInteraction(org.apache.wsrp4j.consumer.InteractionRequest actionRequest,
                                                                                           String userID)
                                                                                    throws org.apache.wsrp4j.exception.WSRPException
This method is used to perform a blocking interaction on the portlet instance.

Specified by:
performBlockingInteraction in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
actionRequest -
Throws:
org.apache.wsrp4j.exception.WSRPException

clonePortlet

public oasis.names.tc.wsrp.v1.types.PortletContext clonePortlet(String userID)
                                                         throws org.apache.wsrp4j.exception.WSRPException
Clone the portlet

Specified by:
clonePortlet in interface org.apache.wsrp4j.consumer.PortletDriver
Returns:
The new portlet context
Throws:
org.apache.wsrp4j.exception.WSRPException

destroyPortlets

public oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse destroyPortlets(String[] portletHandles,
                                                                            String userID)
                                                                     throws org.apache.wsrp4j.exception.WSRPException
Destroy the producer portlets specified in the entiyHandles array.

Specified by:
destroyPortlets in interface org.apache.wsrp4j.consumer.PortletDriver
Throws:
org.apache.wsrp4j.exception.WSRPException

releaseSessions

public oasis.names.tc.wsrp.v1.types.ReturnAny releaseSessions(String[] sessionIDs,
                                                              String userID)
                                                       throws org.apache.wsrp4j.exception.WSRPException
Inform the producer that the sessions specified in the sessionIDs array will no longer be used by the consumer and can therefor be released.

Specified by:
releaseSessions in interface org.apache.wsrp4j.consumer.PortletDriver
Throws:
org.apache.wsrp4j.exception.WSRPException

initCookie

public void initCookie()
                throws org.apache.wsrp4j.exception.WSRPException
Actual WSRP initCookie() call

Specified by:
initCookie in interface org.apache.wsrp4j.consumer.PortletDriver
Throws:
org.apache.wsrp4j.exception.WSRPException

getPortletDescription

public oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse getPortletDescription(String userID,
                                                                                     String[] desiredLocales)
                                                                              throws org.apache.wsrp4j.exception.WSRPException
Fetches information about the portlet from the producer.

Specified by:
getPortletDescription in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
userID - is used to get the user context of the user from the user registry
desiredLocales - Array of locales the description should be provided
Returns:
The response to the getPortletDescription call.
Throws:
org.apache.wsrp4j.exception.WSRPException

getPortletPropertyDescription

public oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse getPortletPropertyDescription(String userID)
                                                                                              throws org.apache.wsrp4j.exception.WSRPException
Fetches all published properties of an remote portlet.

Specified by:
getPortletPropertyDescription in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
userID - The ID of the user this request is done for
Returns:
The portlet property description response from the producer
Throws:
org.apache.wsrp4j.exception.WSRPException

getPortletProperties

public oasis.names.tc.wsrp.v1.types.PropertyList getPortletProperties(String[] names,
                                                                      String userID)
                                                               throws org.apache.wsrp4j.exception.WSRPException
Get the current values of the properties with the given names.

Specified by:
getPortletProperties in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
names - The names of the properties
userID - The ID of the user is used to get the user context
Returns:
A list of properties containing the values and names of the properties.
Throws:
org.apache.wsrp4j.exception.WSRPException

setPortletProperties

public oasis.names.tc.wsrp.v1.types.PortletContext setPortletProperties(oasis.names.tc.wsrp.v1.types.PropertyList properties,
                                                                        String userID)
                                                                 throws org.apache.wsrp4j.exception.WSRPException
Set the portlet properties specified in the property list

Specified by:
setPortletProperties in interface org.apache.wsrp4j.consumer.PortletDriver
Parameters:
properties - List of properties to be set.
userID - The ID of the user is used to get the user context
Throws:
org.apache.wsrp4j.exception.WSRPException

getMarkupParamsExtensions

protected oasis.names.tc.wsrp.v1.types.Extension[] getMarkupParamsExtensions()
Get the extensions for the MarkupContext.



Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.