com.raritantechnologies.quickstart.taglibrary
Class GetFormHyperlinkRenderer
java.lang.Object
com.raritantechnologies.searchApp.taglibrary.BasicResultRenderer
com.raritantechnologies.quickstart.taglibrary.GetFormHyperlinkRenderer
- All Implemented Interfaces:
- IConfigurable, IPreferencesBeanInfo, IResultRenderer
- public class GetFormHyperlinkRenderer
- extends BasicResultRenderer
- implements IResultRenderer
Renders an IResult as a hyperlink to a jsp or servlet process. Takes a set of
parameter IDs used to look up dynamic parameters, an action URL and a set of
fixed parameters (name/value pairs). Builds a hyperlink using an IResult
where the dynamic parameter values are extracted from the field values of the
IResult object.
XML Configuration Template:
<ResultRenderer
rendererClass="com.raritantechnologies.quickstart.taglibrary.GetFormHyperlinkRenderer"
target="new"
isPopup="true|false(default) - set true for new window target"
setFocus="[true|false(default) - call focus() on new window"
includeSessionID="[true|false(default)]"
includeResultNum="[true|false(default)]"
includeSourceName="[true|false(default)]"
cssClass="someClass"
defaultValue="[what to put if no result value]"
title="[anchor title - used for roll-over text]" >
<-- setting includResultNum to "true" causes the resulting link to include
the result number for the current result as the "resultNum" request
parameter (&resultNum=XX) -->
<LinkField ID="Title" /> <!-- Alternate LabelField for compatibility with FieldHyperlinkRenderer -->
<!-- Optional or Label -->
<Label value="The Label" >
<!-- OR ResultRenderer -->
<LinkRenderer rendererClass="[some result renderer]" >
<!-- FieldRenderer stuff... -->
</LinkRenderer>
<Host>http://www.somehost.com/</Host>
<Action>someActionJsp.jsp</Action>
<!-- ParamField(s) are parameters that are picked up from the Result -->
<ParamField ID="someParam" name="[ name in URL output ]" />
<ParamField ID="SomeOtherField" name="[ other Name In URL ]" default="foo" multiple="true|false(default)" />
<!-- ParamField can have an optional StringFilter -->
<ParamField ID="[result field ID ]" name="[ name in URL output ]" >
<StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
</StringFilter>
</ParamField>
<!-- SessionField(s) are picked up from the SessionData cache -->
<SessionField ID="Some cached field in SessionData map" name="name to use in URL" />
<!-- QueryField(s) are picked up from the last Query run -->
<QueryField ID="field in query map" name="name in URL" />
<!-- FixedParam(s) are added as is -->
<FixedParam name="paramName" value="paramValue" />
<!-- Fixed parameters can be conditional -->
<FixedParam name="paramName" value="paramValue" >
<!-- RequestComparator Tag: -->
<RequestComparator param="[ name of request parameter to compare ]" class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
</RequestComparator>
</FixedParam>
<SecurityManager name="secManagerName" loginURL="someURLForLogin.jsp"
failureMessage="Access denied. Consult your System administrator"
loginFailPage="[NAME of login failed page - points to name in paramMap]" >
<params>
<param name="foo" value="bar" />
</params>
</SecurityManager>
<!-- Anchor '#' field (optional) -->
<Anchor ID="[ result field that creates anchor value ]">
<StringFilter class="[ class of com.raritantechnologies.utils.filter.IStringFilter" >
</StringFilter
</Anchor>
</ResultRenderer>
ParamField tags list the parameters of the IResult that should be renderered.
- The ID attribute should map to a result field defined in the
section of the configuration XML.
- The name attribute is the name that will be used in the get request
string.
In the above example, the ParamField tags would generate the following:
&someName=[value of 'someParam' field in IResult]&otherNameInURL=[value of
'SomeOtherField']
FixedParam tags list static parameters that should be added to the get
request string. They can be used to link the GetFormHyperlinkRenderer with
other elements in the application (such as Content Handlers).
The <SecurityManager> tag is optional and is used when a login challenge
may be needed to access the hyperlink.
Can be used to set up proxy: if "action" is a proxy servlet (such as a
logging or security servlet): add action=realServlet.jsp as a static
parameter.
Developed by
Raritan Technologies Inc. .
- Author:
- Ted Sullivan, Alan Connell, Jim Nicholson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LINK_ID
public static final java.lang.String LINK_ID
- See Also:
- Constant Field Values
HOST
public static final java.lang.String HOST
- See Also:
- Constant Field Values
ACTION
public static final java.lang.String ACTION
- See Also:
- Constant Field Values
RESULTNUM_TAG
public static final java.lang.String RESULTNUM_TAG
- See Also:
- Constant Field Values
FORM_PARAM_IDS
public static final java.lang.String FORM_PARAM_IDS
- See Also:
- Constant Field Values
SOURCENAME_TAG
public static final java.lang.String SOURCENAME_TAG
- See Also:
- Constant Field Values
GetFormHyperlinkRenderer
public GetFormHyperlinkRenderer()
GetFormHyperlinkRenderer
public GetFormHyperlinkRenderer(java.lang.String linkField,
java.util.HashMap formParamIDs,
java.lang.String host,
java.lang.String action,
java.util.Map fixedParams)
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
initialize
public void initialize(java.util.Map renderParams)
doRenderResult
protected java.lang.String doRenderResult(IResult result,
int firstResult,
int lastResult,
int resultNum,
RaritanPageContext pageContext)
- Specified by:
doRenderResult in class BasicResultRenderer
setLinkLabel
public void setLinkLabel(java.lang.String linkLabel)
getLinkLabel
public java.lang.String getLinkLabel()
setLinkField
public void setLinkField(java.lang.String linkField)
getLinkField
public java.lang.String getLinkField()
setLinkRenderer
public void setLinkRenderer(IResultRenderer linkRenderer)
getLinkRenderer
public IResultRenderer getLinkRenderer()
setResultFields
public void setResultFields(BasicDataTable resultTable)
addResultField
public void addResultField(java.lang.String paramID,
java.lang.String paramName,
java.lang.String defaultValue)
getResultFields
public BasicDataTable getResultFields()
setSessionFields
public void setSessionFields(BasicDataTable sessionFieldTable)
addSessionParameter
public void addSessionParameter(java.lang.String paramID,
java.lang.String paramName)
getSessionParameters
public BasicDataTable getSessionParameters()
setQueryFields
public void setQueryFields(BasicDataTable queryFieldTable)
addQueryParameter
public void addQueryParameter(java.lang.String paramID,
java.lang.String paramName)
getQueryParameters
public BasicDataTable getQueryParameters()
setHost
public void setHost(java.lang.String host)
getHost
public java.lang.String getHost()
setAction
public void setAction(java.lang.String action)
getAction
public java.lang.String getAction()
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
getDefaultValue
public java.lang.String getDefaultValue()
setTarget
public void setTarget(java.lang.String target)
getTarget
public java.lang.String getTarget()
setWindowOptions
public void setWindowOptions(java.lang.String window_options)
getWindowOptions
public java.lang.String getWindowOptions()
setCssClass
public void setCssClass(java.lang.String clazz)
getCssClass
public java.lang.String getCssClass(java.lang.String clazz)
setIncludeSessionID
public void setIncludeSessionID(boolean includeSessionID)
getIncludeSessionID
public boolean getIncludeSessionID()
setTitle
public void setTitle(java.lang.String title)
getTitle
public java.lang.String getTitle()
addStaticParameter
public void addStaticParameter(java.lang.String paramName,
java.lang.String paramValue)
setIncludeResultNumInLink
public void setIncludeResultNumInLink(boolean includeResultNumInLink)
getIncludeResultNumInLink
public boolean getIncludeResultNumInLink()
setSecurityManagerName
public void setSecurityManagerName(java.lang.String securityManagerName)
getSecurityManagerName
public java.lang.String getSecurityManagerName()
setShouldChallenge
public void setShouldChallenge(boolean shouldChallenge)
getShouldChallenge
public boolean getShouldChallenge()
setIsPopup
public void setIsPopup(boolean isPopup)
getIsPopup
public boolean getIsPopup()
setLoginURL
public void setLoginURL(java.lang.String loginURL)
getLoginURL
public java.lang.String getLoginURL()
setFailureMessage
public void setFailureMessage(java.lang.String failureMessage)
getFailureMessage
public java.lang.String getFailureMessage()
setLoginFailPage
public void setLoginFailPage(java.lang.String loginFailPage)
getLoginFailPage
public java.lang.String getLoginFailPage()
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