com.raritantechnologies.quickstart.taglibrary
Class XSLResultRenderer

java.lang.Object
  extended bycom.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
      extended bycom.raritantechnologies.quickstart.taglibrary.XSLResultRenderer
All Implemented Interfaces:
IConfigurable, IPreferencesBeanInfo, IResultRenderer

public class XSLResultRenderer
extends BasicResultRenderer
implements IResultRenderer

IResult Renderer which uses an XSLT transform to convert the entire Result XML to an output or a single XML field in the Result.

The XSLT transform that is used can be switched depending on the SearchSource from which the result was acquired. The XML can either be acquired from the IResult.getXML( ) method or from a specific result field that has an XML value.

XML Configuration Template:
   <ResultRenderer 
        rendererClass="com.raritantechnologies.quickstart.taglibrary.XSLResultRenderer" >

    <!-- This example uses a specific result field to obtain the XML for rendering -->
    <Source name="[sourceName]" 
               xslFile="[the XSLT xform File path]" 
               xmlFieldID="[optional fieldID that has XML]" >

      <!-- XSL parameters that will be set on the XSLTransform. -->
      <!-- Can be static or derived from result field values (dynamic) -->
      <params>
        <param name="XSLParamName" value="paramValue" /> <!-- static parameter -->
        <param name="XSLParamName" fieldID="resultFieldID" /> <!-- dynamic parameter -->
      </params>

    </Source>

    <!-- This example renders the entire result XML -->
    <Source name="[anotherSource]" xslFile="[another XSLT File]" />

    <!-- This example uses a post-processing StringFilter -->
    <Source name="[anotherSource]" xslFile="[another XSLT File]" >
      <OutputFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter" >

      </OutputFilter>
    </Source>

   </ResultRenderer>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
enabled, name, prefBeanName, prefCompareValue, prefEnableIfInChecklist, prefEnableIfInYesno
 
Fields inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
TEMPLATE
 
Constructor Summary
XSLResultRenderer()
           
XSLResultRenderer(java.lang.String xslTransformFile)
           
 
Method Summary
protected  java.lang.String doRenderResult(IResult result, int firstResult, int lastResult, int resultNum, RaritanPageContext pageContext)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 void initialize(org.w3c.dom.Element elem)
          IResultRenderers are XML configurable.
 
Methods inherited from class com.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
getPrefBeanName, getPrefCompareValue, getPrefEnableIfInChecklist, getPrefEnableIfInYesno, getRenderer, isEnabled, renderResult, setEnable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
getRenderer, isEnabled, renderResult, setEnable
 

Constructor Detail

XSLResultRenderer

public XSLResultRenderer()

XSLResultRenderer

public XSLResultRenderer(java.lang.String xslTransformFile)
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultRenderer
IResultRenderers are XML configurable.

Specified by:
initialize in interface IResultRenderer
Overrides:
initialize in class BasicResultRenderer

doRenderResult

protected java.lang.String doRenderResult(IResult result,
                                          int firstResult,
                                          int lastResult,
                                          int resultNum,
                                          RaritanPageContext pageContext)
Specified by:
doRenderResult in class BasicResultRenderer

getConfigurationXML

public void getConfigurationXML(java.io.Writer writer)
                         throws java.io.IOException
Throws:
java.io.IOException

getConfigurationXML

public java.lang.String getConfigurationXML()
Specified by:
getConfigurationXML in interface IResultRenderer

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
Specified by:
getConfigurationXML in interface IResultRenderer