org.apache.jetspeed.portal.portlets.viewprocessor
Class XSLViewProcessor

java.lang.Object
  extended byorg.apache.jetspeed.portal.portlets.viewprocessor.XSLViewProcessor
All Implemented Interfaces:
ViewProcessor
Direct Known Subclasses:
RSSViewProcessor

public class XSLViewProcessor
extends java.lang.Object
implements ViewProcessor

Simple ViewProcessor which does a basic XSLT transform with the stylesheet parameter and the given URL.

Since:
1.4b4
Version:
$Id: $
Author:
tkuebler@cisco.com

Field Summary
protected  org.w3c.dom.Document document
           
static java.lang.String ERROR_NOT_VALID
           
static java.lang.String INVALID_TYPE
           
protected  java.util.Hashtable stylesheets
           
 
Constructor Summary
XSLViewProcessor()
           
 
Method Summary
protected  java.io.Reader cleanse(java.lang.String content)
          Given a URL to some content, clean the content to Xerces can handle it better.
protected  org.w3c.dom.Node getNode(org.w3c.dom.Node start, java.lang.String name)
          Utility method for traversing the document parsed DOM tree and retrieving a Node by tagname
 void init(Portlet portlet)
          This method loads the init parameters and parse the document tied to this portlet
 java.lang.Object processView(GenericMVCContext context)
          This methods outputs the content of the portlet for a given request.
 boolean supportsType(MimeType mimeType)
          This portlet supports has many types as those it has stylesheets defined for in its parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_NOT_VALID

public static final java.lang.String ERROR_NOT_VALID
See Also:
Constant Field Values

INVALID_TYPE

public static final java.lang.String INVALID_TYPE
See Also:
Constant Field Values

document

protected org.w3c.dom.Document document

stylesheets

protected java.util.Hashtable stylesheets
Constructor Detail

XSLViewProcessor

public XSLViewProcessor()
Method Detail

init

public void init(Portlet portlet)
          throws PortletException
This method loads the init parameters and parse the document tied to this portlet

Specified by:
init in interface ViewProcessor
Parameters:
portlet -
Throws:
PortletException

processView

public java.lang.Object processView(GenericMVCContext context)
This methods outputs the content of the portlet for a given request.

Specified by:
processView in interface ViewProcessor
Parameters:
context -
Returns:
the content to be displayed to the user-agent

supportsType

public boolean supportsType(MimeType mimeType)
This portlet supports has many types as those it has stylesheets defined for in its parameters

Parameters:
mimeType - the MIME type queried
Returns:
true if the portlet knows how to display content for mimeType
See Also:
Portlet.supportsType(org.apache.jetspeed.util.MimeType)

getNode

protected org.w3c.dom.Node getNode(org.w3c.dom.Node start,
                                   java.lang.String name)
Utility method for traversing the document parsed DOM tree and retrieving a Node by tagname

Parameters:
start - the parent node for the search
name - the tag name to be searched for
Returns:
the first child node of start whose tagname is name

cleanse

protected java.io.Reader cleanse(java.lang.String content)
                          throws java.io.IOException
Given a URL to some content, clean the content to Xerces can handle it better. Right now this involves:

Parameters:
content -
Returns:
Throws:
java.io.IOException


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