org.apache.jetspeed.portlet
Class WebContentPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.portals.bridges.common.GenericServletPortlet
          extended by org.apache.portals.bridges.velocity.GenericVelocityPortlet
              extended by org.apache.jetspeed.portlet.WebContentPortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig
Direct Known Subclasses:
SSOWebContentPortlet

public class WebContentPortlet
extends org.apache.portals.bridges.velocity.GenericVelocityPortlet

WebContentPortlet TODO: Preferences, cache stream instead of URL *

Version:
$Id: WebContentPortlet.java 605431 2007-12-19 05:11:40Z taylor $
Author:
Roger Ruttimann

Field Summary
(package private) static int BLOCK_SIZE
           
static String BROWSER_ACTION_NEXT_PAGE
           
static String BROWSER_ACTION_PARAM
           
static String BROWSER_ACTION_PREVIOUS_PAGE
           
static String BROWSER_ACTION_REFRESH_PAGE
           
static String defaultEncoding
           
static String EDIT_SOURCE_PARAM
           
static String FORM_GET_METHOD
           
static String FORM_MULTIPART_METHOD
           
static String FORM_POST_METHOD
           
static String HISTORY
          Action Parameter
static String HTTP_STATE
           
protected static org.apache.commons.logging.Log log
           
private  org.apache.jetspeed.rewriter.RewriterController rewriteController
           
private  org.apache.jetspeed.rewriter.RulesetRewriter rewriter
           
static String VIEW_SOURCE_PARAM
          Configuration constants.
 
Fields inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
PORTLET_BRIDGE_CONTEXT
 
Fields inherited from class org.apache.portals.bridges.common.GenericServletPortlet
PARAM_ACTION_PAGE, PARAM_ALLOW_PREFERENCES, PARAM_CUSTOM_PAGE, PARAM_EDIT_PAGE, PARAM_HELP_PAGE, PARAM_MAX_PAGE, PARAM_VIEW_PAGE
 
Constructor Summary
WebContentPortlet()
           
 
Method Summary
 void doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  byte[] doHttpWebContent(org.apache.commons.httpclient.HttpClient httpClient, org.apache.commons.httpclient.HttpMethod httpMethod, int retryCount, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  byte[] doPreemptiveAuthentication(org.apache.commons.httpclient.HttpClient clent, org.apache.commons.httpclient.HttpMethod method, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  boolean doRequestedAuthentication(org.apache.commons.httpclient.HttpClient clent, org.apache.commons.httpclient.HttpMethod method, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          doView Renders the URL in the following order 1) SESSION_PARAMETER 2)cached version 3) defined for preference SRC
protected  byte[] doWebContent(String sourceAttr, Map sourceParams, boolean isPost, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
private  void drain(Reader r, Writer w)
           
private  String getContentCharSet(InputStream is)
           
private  org.apache.jetspeed.rewriter.RewriterController getController(String contextPath)
           
protected  org.apache.commons.httpclient.HttpClient getHttpClient(javax.portlet.RenderRequest request)
           
protected  org.apache.commons.httpclient.HttpMethodBase getHttpMethod(org.apache.commons.httpclient.HttpClient client, String uri, Map params, String formMethod, javax.portlet.RenderRequest request)
           
protected  String getURLSource(String source, Map params, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 void init(javax.portlet.PortletConfig config)
          Initialize portlet configuration.
 void processAction(javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse)
          processAction() Checks action initiated by the WebContent portlet which means that a user has clicked on an URL
 
Methods inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
doCustom, doHelp, doPreferencesEdit, getContext, getContext, render, setupPreferencesEdit
 
Methods inherited from class org.apache.portals.bridges.common.GenericServletPortlet
getDefaultActionPage, getDefaultCustomPage, getDefaultEditPage, getDefaultHelpPage, getDefaultViewPage, processPreferencesAction, setDefaultActionPage, setDefaultCustomPage, setDefaultEditPage, setDefaultHelpPage, setDefaultViewPage
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_SOURCE_PARAM

public static final String VIEW_SOURCE_PARAM
Configuration constants.

See Also:
Constant Field Values

EDIT_SOURCE_PARAM

public static final String EDIT_SOURCE_PARAM
See Also:
Constant Field Values

BROWSER_ACTION_PARAM

public static final String BROWSER_ACTION_PARAM
See Also:
Constant Field Values

BROWSER_ACTION_PREVIOUS_PAGE

public static final String BROWSER_ACTION_PREVIOUS_PAGE
See Also:
Constant Field Values

BROWSER_ACTION_REFRESH_PAGE

public static final String BROWSER_ACTION_REFRESH_PAGE
See Also:
Constant Field Values

BROWSER_ACTION_NEXT_PAGE

public static final String BROWSER_ACTION_NEXT_PAGE
See Also:
Constant Field Values

HISTORY

public static final String HISTORY
Action Parameter

See Also:
Constant Field Values

HTTP_STATE

public static final String HTTP_STATE
See Also:
Constant Field Values

log

protected static final org.apache.commons.logging.Log log

defaultEncoding

public static final String defaultEncoding
See Also:
Constant Field Values

rewriter

private org.apache.jetspeed.rewriter.RulesetRewriter rewriter

rewriteController

private org.apache.jetspeed.rewriter.RewriterController rewriteController

FORM_POST_METHOD

public static final String FORM_POST_METHOD
See Also:
Constant Field Values

FORM_GET_METHOD

public static final String FORM_GET_METHOD
See Also:
Constant Field Values

FORM_MULTIPART_METHOD

public static final String FORM_MULTIPART_METHOD
See Also:
Constant Field Values

BLOCK_SIZE

static final int BLOCK_SIZE
See Also:
Constant Field Values
Constructor Detail

WebContentPortlet

public WebContentPortlet()
Method Detail

init

public void init(javax.portlet.PortletConfig config)
          throws javax.portlet.PortletException
Initialize portlet configuration.

Specified by:
init in interface javax.portlet.Portlet
Overrides:
init in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException

processAction

public void processAction(javax.portlet.ActionRequest actionRequest,
                          javax.portlet.ActionResponse actionResponse)
                   throws javax.portlet.PortletException,
                          IOException
processAction() Checks action initiated by the WebContent portlet which means that a user has clicked on an URL

Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Parameters:
actionRequest -
actionResponse -
Throws:
javax.portlet.PortletException
IOException

doView

public void doView(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
doView Renders the URL in the following order 1) SESSION_PARAMETER 2)cached version 3) defined for preference SRC

Overrides:
doView in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException
IOException

doEdit

public void doEdit(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
Overrides:
doEdit in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException
IOException

doWebContent

protected byte[] doWebContent(String sourceAttr,
                              Map sourceParams,
                              boolean isPost,
                              javax.portlet.RenderRequest request,
                              javax.portlet.RenderResponse response)
                       throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

doHttpWebContent

protected byte[] doHttpWebContent(org.apache.commons.httpclient.HttpClient httpClient,
                                  org.apache.commons.httpclient.HttpMethod httpMethod,
                                  int retryCount,
                                  javax.portlet.RenderRequest request,
                                  javax.portlet.RenderResponse response)
                           throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

getURLSource

protected String getURLSource(String source,
                              Map params,
                              javax.portlet.RenderRequest request,
                              javax.portlet.RenderResponse response)

doPreemptiveAuthentication

protected byte[] doPreemptiveAuthentication(org.apache.commons.httpclient.HttpClient clent,
                                            org.apache.commons.httpclient.HttpMethod method,
                                            javax.portlet.RenderRequest request,
                                            javax.portlet.RenderResponse response)

doRequestedAuthentication

protected boolean doRequestedAuthentication(org.apache.commons.httpclient.HttpClient clent,
                                            org.apache.commons.httpclient.HttpMethod method,
                                            javax.portlet.RenderRequest request,
                                            javax.portlet.RenderResponse response)

getController

private org.apache.jetspeed.rewriter.RewriterController getController(String contextPath)
                                                               throws Exception
Throws:
Exception

getHttpClient

protected org.apache.commons.httpclient.HttpClient getHttpClient(javax.portlet.RenderRequest request)
                                                          throws IOException
Throws:
IOException

getHttpMethod

protected org.apache.commons.httpclient.HttpMethodBase getHttpMethod(org.apache.commons.httpclient.HttpClient client,
                                                                     String uri,
                                                                     Map params,
                                                                     String formMethod,
                                                                     javax.portlet.RenderRequest request)
                                                              throws IOException
Throws:
IOException

drain

private void drain(Reader r,
                   Writer w)
            throws IOException
Throws:
IOException

getContentCharSet

private String getContentCharSet(InputStream is)
                          throws IOException
Throws:
IOException


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.