org.jafer.portlets
Class AbstractXSLTPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.jafer.portlets.AbstractXSLTPortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig
Direct Known Subclasses:
XsltSearchPortlet

public abstract class AbstractXSLTPortlet
extends javax.portlet.GenericPortlet


Field Summary
protected static javax.xml.parsers.DocumentBuilder domBuilder
           
private  java.lang.String[][] vTableAction
           
private  java.lang.String[][] vTableEdit
           
private  java.lang.String[][] vTableHelp
           
private  java.lang.String[][] vTableView
           
 
Constructor Summary
AbstractXSLTPortlet()
           
 
Method Summary
private  java.lang.String dispatchVTable(javax.portlet.PortletRequest request, java.lang.String[][] vTable, java.lang.String action, org.w3c.dom.Document[] xml)
           
protected  void doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  void doHelp(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected abstract  java.lang.String[][] getVTableAction()
          Get the Action dispatch table for processing JSR-168 action requests
protected abstract  java.lang.String[][] getVTableEdit()
          Get the Edit dispatch table for processing JSR-168 Edit requests
protected abstract  java.lang.String[][] getVTableHelp()
          Get the Help dispatch table for processing JSR-168 Help requests
protected abstract  java.lang.String[][] getVTableView()
          Get the View dispatch table for processing JSR-168 View requests
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
private  void render(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, java.lang.String[][] vTable)
           
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init, init, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domBuilder

protected static javax.xml.parsers.DocumentBuilder domBuilder

vTableAction

private java.lang.String[][] vTableAction

vTableEdit

private java.lang.String[][] vTableEdit

vTableHelp

private java.lang.String[][] vTableHelp

vTableView

private java.lang.String[][] vTableView
Constructor Detail

AbstractXSLTPortlet

public AbstractXSLTPortlet()
Method Detail

getVTableAction

protected abstract java.lang.String[][] getVTableAction()
Get the Action dispatch table for processing JSR-168 action requests

Each row should be of the form:

action parameter value, java method, next action parameter

where action parameter value is the Action parameter passed by the portlet (first row used if no Action parameter present)
java method is a java method in the class of the form public void ...(ActionRequest request) to handle the action
next action parameter is the Action parameter to set for the subsequent renderRequest

Returns:
String[][]

getVTableView

protected abstract java.lang.String[][] getVTableView()
Get the View dispatch table for processing JSR-168 View requests

Each row should be of the form:

action parameter value, java method, xslt path

where action parameter value is the Action parameter passed by the portlet (first row used if no Action parameter present)
java method is a java method in the class of the form public Document ...(RenderRequest request) throws PortletException which should return the required XML
xslt path is the relative path to an XSLT tranform to take the XML into a HTML fragment

Returns:
String[][]

getVTableHelp

protected abstract java.lang.String[][] getVTableHelp()
Get the Help dispatch table for processing JSR-168 Help requests

Each row should be of the form:

action parameter value, java method, xslt path

where action parameter value is the Action parameter passed by the portlet (first row used if no Action parameter present)
java method is a java method in the class of the form public Document ...(RenderRequest request) throws PortletException which should return the required XML
xslt path is the relative path to an XSLT tranform to take the XML into a HTML fragment

Returns:
String[][]

getVTableEdit

protected abstract java.lang.String[][] getVTableEdit()
Get the Edit dispatch table for processing JSR-168 Edit requests

Each row should be of the form:

action parameter value, java method, xslt path

where action parameter value is the Action parameter passed by the portlet (first row used if no Action parameter present)
java method is a java method in the class of the form public Document ...(RenderRequest request) throws PortletException which should return the required XML
xslt path is the relative path to an XSLT tranform to take the XML into a HTML fragment

Returns:
String[][]

dispatchVTable

private java.lang.String dispatchVTable(javax.portlet.PortletRequest request,
                                        java.lang.String[][] vTable,
                                        java.lang.String action,
                                        org.w3c.dom.Document[] xml)
                                 throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

render

private void render(javax.portlet.RenderRequest request,
                    javax.portlet.RenderResponse response,
                    java.lang.String[][] vTable)
             throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

processAction

public void processAction(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                   throws javax.portlet.PortletException,
                          java.io.IOException
Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

doHelp

protected void doHelp(javax.portlet.RenderRequest request,
                      javax.portlet.RenderResponse response)
               throws javax.portlet.PortletException,
                      java.io.IOException
Overrides:
doHelp in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

doEdit

protected void doEdit(javax.portlet.RenderRequest request,
                      javax.portlet.RenderResponse response)
               throws javax.portlet.PortletException,
                      java.io.IOException
Overrides:
doEdit in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

doView

protected void doView(javax.portlet.RenderRequest request,
                      javax.portlet.RenderResponse response)
               throws javax.portlet.PortletException,
                      java.io.IOException
Overrides:
doView in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException