com.openmarket.Satellite.portlet
Class BasePortlet

java.lang.Object
  extended by GenericPortlet
      extended by com.openmarket.Satellite.portlet.BasePortlet
Direct Known Subclasses:
Satellite

public abstract class BasePortlet
extends GenericPortlet

Abstract implementation of a portlet class that invokes Satellite Server functionality. Application lifecycle is managed by this portlet's init and destroy methods.

Since:
16-May-2005 11:32:12 AM

Constructor Summary
BasePortlet()
           
 
Method Summary
protected abstract  Application constructApp(java.lang.String tempFolder)
          Return a concrete implementation of a Satellite Server application.
 void destroy()
          Destroys the portlet.
protected abstract  java.lang.String getContentType()
          Return the content type to be used for the response if available.
protected  SSRenderParams getSSRenderParams(RenderRequest req)
          Get the SSRenderParams object that holds all request parameters that are sent by Satellite Server to Content Server.
 void init(PortletConfig config)
          Initializes the portlet.
 void processAction(ActionRequest req, ActionResponse res)
          It's not possible to override ProcessAction in the satellite portlet.
 void render(RenderRequest req, RenderResponse res)
          Render method is called to render the portlet.
protected  void ssProcessAction(ActionRequest request, ActionResponse response)
          This method is called by BasePortlet.processAction(ActionRequest, ActionResponse) and allows for custom logic to occur at the portlet level prior to the execution of the Satellite Server logic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePortlet

public BasePortlet()
Method Detail

constructApp

protected abstract Application constructApp(java.lang.String tempFolder)
                                     throws ConfigurationException
Return a concrete implementation of a Satellite Server application. This portlet will hold on to the application for its lifecycle.

Parameters:
tempFolder - The temporary folder accessible to this application
Returns:
application instance
Throws:
ConfigurationException - if application construction fails

init

public void init(PortletConfig config)
          throws PortletException
Initializes the portlet. Overriding classes must call this method for proper operation with Satellite Server.

Parameters:
config - input Portlet Config object.
Throws:
PortletException

destroy

public void destroy()
Destroys the portlet. Overriding classes must call this method for proper operation of Satellite Server.


processAction

public final void processAction(ActionRequest req,
                                ActionResponse res)
It's not possible to override ProcessAction in the satellite portlet. However, this portlet provides default processing for preference setting. Parameters named according to com.fatwire.satellite.param.preference.NAME with the value VALUE will set a portlet preference of name NAME to the value VALUE.

Parameters:
req - the portlet ActionRequest
res - the portlet ActionResponse
See Also:
BasePortlet.ssProcessAction(ActionRequest, ActionResponse)

ssProcessAction

protected void ssProcessAction(ActionRequest request,
                               ActionResponse response)
This method is called by BasePortlet.processAction(ActionRequest, ActionResponse) and allows for custom logic to occur at the portlet level prior to the execution of the Satellite Server logic.

Parameters:
request - ActionRequest
response - ActionResponse

getSSRenderParams

protected final SSRenderParams getSSRenderParams(RenderRequest req)
Get the SSRenderParams object that holds all request parameters that are sent by Satellite Server to Content Server. This method can be used, in conjunction with the SSRenderParams#addParameter method in order to set arbitrary parameters such as context parameters, portal user information and other server-specific information into the request object for the use of Content Server when the portlet is rendered.

Parameters:
req - RenderRequest object
Returns:
SSRenderParams object

render

public final void render(RenderRequest req,
                         RenderResponse res)
                  throws PortletException,
                         java.io.IOException
Render method is called to render the portlet. This implementation sets up the Satellite Server application and dispatches control to super#render for regular operation of the portlet. Overriding classes may not override this specific method, but may override #doView, #doHelp, etc. instead.

Parameters:
req - render request
res - render response
Throws:
PortletException
java.io.IOException

getContentType

protected abstract java.lang.String getContentType()
Return the content type to be used for the response if available. Some portlets always know their content type in advance, while others only find out part-way through the execution.

Returns:
content type or null