org.apache.jetspeed.portlet
Class WebContentPortlet

java.lang.Object
  extended byjavax.portlet.GenericPortlet
      extended byorg.apache.portals.bridges.common.GenericServletPortlet
          extended byorg.apache.portals.bridges.velocity.GenericVelocityPortlet
              extended byorg.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 190811 2005-06-15 21:22:20Z shinsuke $
Author:
Roger Ruttimann

Field Summary
(package private) static int BLOCK_SIZE
           
static String CACHE
           
static String CURRENT_URL
          WebContent Messages TODO: this is a simple implementation until we introduce a more sophisticated caching algorithm
private  String defaultEditSource
           
 String defaultEncoding
          Default encoding
private  String defaultViewSource
          Default WebContent source attribute members.
static String EDIT_SOURCE_PARAM
           
(package private)  boolean isSSOEnabled
           
static String LAST_STATE
           
static String LAST_URL
           
(package private)  org.apache.jetspeed.rewriter.RewriterController rewriteController
           
(package 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
 
Fields inherited from class javax.portlet.GenericPortlet
 
Constructor Summary
WebContentPortlet()
           
 
Method Summary
 void doEdit(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(javax.portlet.RenderRequest request, String sourceAttr, javax.portlet.RenderResponse response)
           
private  void drain(InputStream reader, OutputStream writer)
           
private  void drain(Reader r, OutputStream os)
           
private  void drain(Reader r, Writer w)
           
private  String getContentCharSet(InputStream is)
           
private  org.apache.jetspeed.rewriter.RewriterController getController(String contextPath)
           
protected  Reader getReader(String url)
           
private  Reader getRemoteReader(String uri)
           
private  String getSourcePreference(javax.portlet.RenderRequest request, String name, String defaultValue)
           
 String getURLSource(String source, 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, 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

defaultViewSource

private String defaultViewSource
Default WebContent source attribute members.


defaultEditSource

private String defaultEditSource

CURRENT_URL

public static final String CURRENT_URL
WebContent Messages TODO: this is a simple implementation until we introduce a more sophisticated caching algorithm

See Also:
Constant Field Values

LAST_URL

public static final String LAST_URL
See Also:
Constant Field Values

LAST_STATE

public static final String LAST_STATE
See Also:
Constant Field Values

CACHE

public static final String CACHE
See Also:
Constant Field Values

defaultEncoding

public String defaultEncoding
Default encoding


isSSOEnabled

boolean isSSOEnabled

rewriter

org.apache.jetspeed.rewriter.RulesetRewriter rewriter

rewriteController

org.apache.jetspeed.rewriter.RewriterController rewriteController

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.

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

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

Throws:
javax.portlet.PortletException
IOException

doEdit

public void doEdit(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
Throws:
javax.portlet.PortletException
IOException

doWebContent

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

getURLSource

public String getURLSource(String source,
                           javax.portlet.RenderRequest request,
                           javax.portlet.RenderResponse response)

getSourcePreference

private String getSourcePreference(javax.portlet.RenderRequest request,
                                   String name,
                                   String defaultValue)

getController

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

getReader

protected Reader getReader(String url)
                    throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

drain

private void drain(InputStream reader,
                   OutputStream writer)
            throws IOException
Throws:
IOException

drain

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

drain

private void drain(Reader r,
                   OutputStream os)
            throws IOException
Throws:
IOException

getRemoteReader

private Reader getRemoteReader(String uri)
                        throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

getContentCharSet

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


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