com.raritantechnologies.searchApp.taglibrary
Class PatternResultRenderer

java.lang.Object
  extended bycom.raritantechnologies.searchApp.taglibrary.PatternResultRenderer
All Implemented Interfaces:
IConfigurable, IResultRenderer

public class PatternResultRenderer
extends java.lang.Object
implements IResultRenderer

Uses a String pattern template to format a field or fields in an IResult.

The template can be any string pattern. Field values are inserted into the template at positions indicated by {fieldname} sections where "fieldname" is the name of some result field.

XML Configuration Template:
   <ResultRenderer rendererClass="com.raritantechnologies.searchApp.taglibrary.PatternResultRenderer"
                      startBraceChar="[ character to start field name block - default is '{' ]"
                      endBraceChar="[ character to start field name block - default is '}' ]" >

     <!-- =========================================================  -->
     <!-- String template that result field values will be inserted  -->
     <!-- into. If this is HTML or XML, the template block should be -->
     <!-- wrapped in a <!CDATA[  ]]> section.                        -->
     <!-- =========================================================  -->
     <Template>
        Display string with {fieldname} sections that will have result values
        inserted by the PatternResultRenderer.
     </Template>

   </ResultRenderer>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan, Kepler Gelotte

Field Summary
 
Fields inherited from interface com.raritantechnologies.searchApp.taglibrary.IResultRenderer
TEMPLATE
 
Constructor Summary
PatternResultRenderer()
           
 
Method Summary
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 IResultRenderer getRenderer(java.lang.String name)
          Provides for nested result renderers.
 void initialize(org.w3c.dom.Element elem)
          IResultRenderers are XML configurable.
 boolean isEnabled()
           
 java.lang.String renderResult(IResult result, int firstResult, int lastResult, int resultNum, RaritanPageContext pageContext)
          return an HTML fragment using the data contained within the IResult object.
 void setEnable(boolean enabled)
          provides show/hide control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternResultRenderer

public PatternResultRenderer()
Method Detail

renderResult

public java.lang.String renderResult(IResult result,
                                     int firstResult,
                                     int lastResult,
                                     int resultNum,
                                     RaritanPageContext pageContext)
Description copied from interface: IResultRenderer
return an HTML fragment using the data contained within the IResult object.

Specified by:
renderResult in interface IResultRenderer

setEnable

public void setEnable(boolean enabled)
Description copied from interface: IResultRenderer
provides show/hide control.

Specified by:
setEnable in interface IResultRenderer

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface IResultRenderer

getRenderer

public IResultRenderer getRenderer(java.lang.String name)
Description copied from interface: IResultRenderer
Provides for nested result renderers. returns an instance of IResultRenderer or null if result renderer of given name is not found.

Specified by:
getRenderer in interface IResultRenderer

initialize

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

Specified by:
initialize in interface IResultRenderer

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