edu.wisc.my.webproxy.beans.filtering
Class AbsoluteUrlFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by edu.wisc.my.webproxy.beans.filtering.ChainingSaxFilter
          extended by edu.wisc.my.webproxy.beans.filtering.BaseUrlFilter
              extended by edu.wisc.my.webproxy.beans.filtering.AbsoluteUrlFilter
All Implemented Interfaces:
ProxyComponent, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader

public class AbsoluteUrlFilter
extends BaseUrlFilter

A filter that will re-write relative URLs to absolute URLs. This is required so the portlet can either proxy the URL correctly or if it is not proxied so the URL works correctly.

Version:
$Id: AbsoluteUrlFilter.java 21818 2010-09-29 19:43:17Z edalquist $
Author:
dgrimwood

Constructor Summary
AbsoluteUrlFilter()
          The default constructor
AbsoluteUrlFilter(XMLReader parent)
          Constructor that takes XMLReader object as argument
 
Method Summary
 void characters(char[] ch, int start, int len)
           
 void clearData()
          Called at the end of a request that the component was used in.
 String getName()
          Returns a displayable name for the component.
 String rewriteUrl(String urlFragment, boolean passThrough)
          Rewrites a relative url to an absolute url
 void setActionData(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          This method is called on a component that is being used by the portlet at the begining of the action request it will be used in.
 void setRenderData(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          This method is called on a component that is being used by the portlet at the begining of the render request it will be used in.
 
Methods inherited from class edu.wisc.my.webproxy.beans.filtering.BaseUrlFilter
endElement, makeCaseInsensitive, setElements, setPassThroughElements, startElement
 
Methods inherited from class edu.wisc.my.webproxy.beans.filtering.ChainingSaxFilter
comment, endCDATA, endDTD, endEntity, getLexicalHandler, parse, parse, setLexicalHandler, setParent, startCDATA, startDTD, startEntity
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsoluteUrlFilter

public AbsoluteUrlFilter()
The default constructor


AbsoluteUrlFilter

public AbsoluteUrlFilter(XMLReader parent)
Constructor that takes XMLReader object as argument

Parameters:
parent - the (@link XMLReader) object
Method Detail

rewriteUrl

public String rewriteUrl(String urlFragment,
                         boolean passThrough)
Rewrites a relative url to an absolute url

Specified by:
rewriteUrl in class BaseUrlFilter
Parameters:
urlFragment - the relative url as String
Returns:
urlFragment the absolute url as String

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class BaseUrlFilter
Throws:
SAXException
See Also:
XMLFilterImpl.characters(char[], int, int)

getName

public String getName()
Description copied from interface: ProxyComponent
Returns a displayable name for the component.


setRenderData

public void setRenderData(javax.portlet.RenderRequest request,
                          javax.portlet.RenderResponse response)
Description copied from interface: ProxyComponent
This method is called on a component that is being used by the portlet at the begining of the render request it will be used in. It provides the component with a reference to the request and response objects to use.

Specified by:
setRenderData in interface ProxyComponent
Overrides:
setRenderData in class ChainingSaxFilter

setActionData

public void setActionData(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
Description copied from interface: ProxyComponent
This method is called on a component that is being used by the portlet at the begining of the action request it will be used in. It provides the component with a reference to the request and response objects to use.

Specified by:
setActionData in interface ProxyComponent
Overrides:
setActionData in class ChainingSaxFilter

clearData

public void clearData()
Description copied from interface: ProxyComponent
Called at the end of a request that the component was used in. It clears the references to the request and response objects. It should be called from a finally block to ensure its execution.

Specified by:
clearData in interface ProxyComponent
Overrides:
clearData in class BaseUrlFilter
See Also:
ProxyComponent.clearData()


Copyright © 2010 Jasig. All Rights Reserved.