org.jafer.portlets.xslt
Class XSLTPortletRequestDispatcher

java.lang.Object
  extended by org.jafer.portlets.xslt.XSLTPortletRequestDispatcher
All Implemented Interfaces:
javax.portlet.PortletRequestDispatcher

public class XSLTPortletRequestDispatcher
extends java.lang.Object
implements javax.portlet.PortletRequestDispatcher


Field Summary
private  javax.portlet.PortletContext context
           
private static javax.xml.parsers.DocumentBuilder domBuilder
           
private  java.util.Map localeResources
           
private  javax.xml.transform.Templates templates
           
private static java.util.Map templatesMap
           
private static javax.xml.transform.TransformerFactory transformerFactory
           
 
Constructor Summary
XSLTPortletRequestDispatcher(javax.portlet.PortletContext context, java.lang.String xslUrl)
          Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ...
XSLTPortletRequestDispatcher(javax.portlet.PortletContext context, java.lang.String xslUrl, java.lang.String resource)
          Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ...
XSLTPortletRequestDispatcher(javax.portlet.PortletContext context, java.lang.String xslUrl, java.lang.String resource, java.util.Locale locale)
          Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ...
XSLTPortletRequestDispatcher(javax.portlet.PortletContext context, java.lang.String xslUrl, java.lang.String resource, java.lang.String locale)
          Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ...
 
Method Summary
private  void constructor(javax.portlet.PortletContext context, java.lang.String xslUrl, java.lang.String resource, java.util.Locale locale)
          Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ...
private  java.util.Map getLocaleResources(java.lang.String resourceName, java.util.Locale locale)
           
 void include(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse)
          Passes the portletServlet to dispatch via an XSLT transform the renderRequest should have the following attributes set (by using renderRequest.setAttribute) org.jafer.portlets.xslt.xmlDocument - XML input to XSLT Transform (as a DOM Document) org.jafer.portlets.xslt.xslParams - Map of parameters to pass to the XSLT transform org.jafer.portlets.xslt.urlParams - Map of parameters to add to portlet action and renderUrls
private  void processXSLT(javax.portlet.RenderResponse response, org.w3c.dom.Document xml, java.util.Map xslParams, java.util.Map urlParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformerFactory

private static javax.xml.transform.TransformerFactory transformerFactory

domBuilder

private static javax.xml.parsers.DocumentBuilder domBuilder

templatesMap

private static java.util.Map templatesMap

context

private javax.portlet.PortletContext context

localeResources

private java.util.Map localeResources

templates

private javax.xml.transform.Templates templates
Constructor Detail

XSLTPortletRequestDispatcher

public XSLTPortletRequestDispatcher(javax.portlet.PortletContext context,
                                    java.lang.String xslUrl)
                             throws javax.xml.transform.TransformerConfigurationException
Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ... </form>
the dispatcher handles encoding these and any other URLs in the generated fragment according to JSR168/WSRP

Parameters:
context - PortletContext
xslUrl - String
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTPortletRequestDispatcher

public XSLTPortletRequestDispatcher(javax.portlet.PortletContext context,
                                    java.lang.String xslUrl,
                                    java.lang.String resource)
                             throws javax.xml.transform.TransformerConfigurationException
Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ... </form>
the dispatcher handles encoding these and any other URLs in the generated fragment according to JSR168/WSRP

Parameters:
context - PortletContext
xslUrl - String
resource - String
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTPortletRequestDispatcher

public XSLTPortletRequestDispatcher(javax.portlet.PortletContext context,
                                    java.lang.String xslUrl,
                                    java.lang.String resource,
                                    java.lang.String locale)
                             throws javax.xml.transform.TransformerConfigurationException
Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ... </form>
the dispatcher handles encoding these and any other URLs in the generated fragment according to JSR168/WSRP

Parameters:
context - PortletContext
xslUrl - String
resource - String
locale - String
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTPortletRequestDispatcher

public XSLTPortletRequestDispatcher(javax.portlet.PortletContext context,
                                    java.lang.String xslUrl,
                                    java.lang.String resource,
                                    java.util.Locale locale)
                             throws javax.xml.transform.TransformerConfigurationException
Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ... </form>
the dispatcher handles encoding these and any other URLs in the generated fragment according to JSR168/WSRP

Parameters:
context - PortletContext
xslUrl - String
resource - String
locale - Locale
Throws:
javax.xml.transform.TransformerConfigurationException
Method Detail

constructor

private void constructor(javax.portlet.PortletContext context,
                         java.lang.String xslUrl,
                         java.lang.String resource,
                         java.util.Locale locale)
                  throws javax.xml.transform.TransformerConfigurationException
Creates a XSLT based Dispatcher using the specified XSLT transform file note: for render Urls generate XML of the following form:
<a href="renderURL"> <portlet:param name="action" value="item" /> </a>
and for action Urls generate XML of the following form:
<form name="form" method="post" action="actionURL"> ... </form>
the dispatcher handles encoding these and any other URLs in the generated fragment according to JSR168/WSRP

Parameters:
context - PortletContext
xslUrl - String
resource - String
locale - Locale
Throws:
javax.xml.transform.TransformerConfigurationException

include

public void include(javax.portlet.RenderRequest renderRequest,
                    javax.portlet.RenderResponse renderResponse)
             throws javax.portlet.PortletException,
                    java.io.IOException
Passes the portletServlet to dispatch via an XSLT transform the renderRequest should have the following attributes set (by using renderRequest.setAttribute) org.jafer.portlets.xslt.xmlDocument - XML input to XSLT Transform (as a DOM Document) org.jafer.portlets.xslt.xslParams - Map of parameters to pass to the XSLT transform org.jafer.portlets.xslt.urlParams - Map of parameters to add to portlet action and renderUrls

Specified by:
include in interface javax.portlet.PortletRequestDispatcher
Parameters:
renderRequest - RenderRequest
renderResponse - RenderResponse
Throws:
javax.portlet.PortletException
java.io.IOException

getLocaleResources

private java.util.Map getLocaleResources(java.lang.String resourceName,
                                         java.util.Locale locale)

processXSLT

private void processXSLT(javax.portlet.RenderResponse response,
                         org.w3c.dom.Document xml,
                         java.util.Map xslParams,
                         java.util.Map urlParams)
                  throws java.lang.Exception
Throws:
java.lang.Exception