com.raritantechnologies.utils.tagging
Class GetFormHyperlinkTagWriter

java.lang.Object
  extended bycom.raritantechnologies.utils.tagging.GetFormHyperlinkTagWriter
All Implemented Interfaces:
IConfigurable, ITagWriter

public class GetFormHyperlinkTagWriter
extends java.lang.Object
implements ITagWriter

Generates a hyperlink tag containing an HTTP get request.

Contains a hash map of source words --> parameter sets. When source words are identified in text to be tagged, inserts a hyperlink that looks like:

This allows different word sets to be routed differently depending on the http parameter settings.

   <a href="theActionURL?type=sourceWordType&word=sourceWord&param1=parm1val&param2=param2val" >sourceWord</a>
  
XML Configuration Template:
  <TagWriter taggingClass="com.raritantechnologies.utils.tagging.GetFormHyperlinkTagWriter" 
                action="theActionURL"
                target="newWin"  >

    <SourceWord type="someSourceWordType" >
      <!-- Set ov valid word values for this word type -->
      <ValidValues>
        <Value>some sourceWordVal</Value>
        <Value>another sourcewordVal</Value>
      </ValidValues>

      <!-- Parameters to be added to the HTTP request for these words -->
      <Params>
        <Param name="paramName" value="paramVal" />
        <Param name="paramName2" value="paramVal2" />
      </Params>
    </SourceWord>

    <!-- Alternatively can get source words from a flat file -->
    <SourceWord type="someOtherSourceWordType" >  
      <ValidValues fileName="AFileName" delimiter=" .(-:|" />
    </SourceWord>
  </TagWriter>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.tagging.ITagWriter
TEMPLATE
 
Constructor Summary
GetFormHyperlinkTagWriter()
           
 
Method Summary
 void addTag(java.lang.String tagWord, java.lang.Object tagReference)
          tagReference is tag type.
 void clearTags()
           
 void initialize(org.w3c.dom.Element elem)
          Initialize TagWriter from an XML configuation element.
 void setMatchCase(java.lang.String matchCase)
           
 java.lang.String tagWord(java.lang.String sessionID, java.lang.String sourceWord)
          returns a "tagged" version of the source word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetFormHyperlinkTagWriter

public GetFormHyperlinkTagWriter()
Method Detail

setMatchCase

public void setMatchCase(java.lang.String matchCase)
Specified by:
setMatchCase in interface ITagWriter

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: ITagWriter
Initialize TagWriter from an XML configuation element.

Specified by:
initialize in interface ITagWriter

addTag

public void addTag(java.lang.String tagWord,
                   java.lang.Object tagReference)
tagReference is tag type.

Specified by:
addTag in interface ITagWriter

clearTags

public void clearTags()
Specified by:
clearTags in interface ITagWriter

tagWord

public java.lang.String tagWord(java.lang.String sessionID,
                                java.lang.String sourceWord)
Description copied from interface: ITagWriter
returns a "tagged" version of the source word.

Specified by:
tagWord in interface ITagWriter