com.mkdoc.tag
Class QueryBuilderTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.mkdoc.tag.AbstractXhtmlTag
              |
              +--com.mkdoc.tag.AbstractApplicationProfileTag
                    |
                    +--com.mkdoc.tag.AbstractQueryTag
                          |
                          +--com.mkdoc.tag.QueryBuilderTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class QueryBuilderTag
extends AbstractQueryTag

A JSP tag that dynamically modifies a search form with advanced fields.

Version:
1.0 2005-11-22
Author:
Philip Shaw
See Also:
Serialized Form
To do:
Make the application profile configurable through the tag library descriptor and a new init method.

Field Summary
 
Fields inherited from class com.mkdoc.tag.AbstractQueryTag
manager
 
Fields inherited from class com.mkdoc.tag.AbstractApplicationProfileTag
profile
 
Fields inherited from class com.mkdoc.tag.AbstractXhtmlTag
END_ATTR_TAG, OPEN_TD, OPEN_TH, OPEN_TR, SHUT_LABEL, SHUT_TD, SHUT_TH, SHUT_TR
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
QueryBuilderTag()
           
 
Method Summary
 int doStartTag()
          Make an open form tag with encoded URL.
 java.lang.String getBuilderUrl()
          Get the builder URL attribute.
 java.lang.String getParameterValues(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Get a space separated list of parameter values by name.
protected  void printAddedField(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out, java.util.List selected, boolean visible)
          Print any additional search or build field.
protected  void printBuilderForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.jsp.JspWriter out)
          Print the builder form to the JSP output.
protected  void printPrimaryField(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out, java.util.List selected, boolean visible)
          Print the primary search or build field.
protected  void printQueryForm(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out)
          Print the query form to the JSP output.
protected  void printSecondaryFields(javax.servlet.http.HttpServletRequest request, javax.servlet.jsp.JspWriter out, java.util.List selected, boolean visible)
          Print the secondary search or build fields.
 void setBuilderUrl(java.lang.String url)
          Encode the builder URL attribute.
 
Methods inherited from class com.mkdoc.tag.AbstractQueryTag
configureStoreManager, getQueryUrl, setQueryUrl
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBuilderTag

public QueryBuilderTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Make an open form tag with encoded URL.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
The skip body signal.
Throws:
javax.servlet.jsp.JspException - If there is a problem writing to the servlet output stream.
Since:
Version 0.1 2005-05-18

printQueryForm

protected final void printQueryForm(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.jsp.JspWriter out)
                             throws java.io.IOException
Print the query form to the JSP output.

Parameters:
request - The servlet request object.
out - The JSP output stream.
Throws:
java.io.IOException - If there is a problem writing to the JSP output stream.
Since:
Version 0.3 2005-06-29

printBuilderForm

protected final void printBuilderForm(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      javax.servlet.jsp.JspWriter out)
                               throws java.io.IOException
Print the builder form to the JSP output.

Parameters:
request - The servlet request object.
response - The servlet response object.
out - The JSP output stream.
Throws:
java.io.IOException - If there is a problem writing to the JSP output stream.
Since:
Version 0.3 2005-06-29

printPrimaryField

protected final void printPrimaryField(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.jsp.JspWriter out,
                                       java.util.List selected,
                                       boolean visible)
                                throws java.io.IOException
Print the primary search or build field.

Parameters:
request - The servlet request object.
out - The JSP output stream.
selected - The list of selected parameter names.
visible - Whether this is part of the visible query form or hidden builder form.
Throws:
java.io.IOException - If there is a problem writing to the JSP output stream.
Since:
Version 0.3 2005-06-29

printSecondaryFields

protected final void printSecondaryFields(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.jsp.JspWriter out,
                                          java.util.List selected,
                                          boolean visible)
                                   throws java.io.IOException
Print the secondary search or build fields.

Parameters:
request - The servlet request object.
out - The JSP output stream.
selected - The list of selected parameter names.
visible - Whether this is part of the visible query form or hidden builder form.
Throws:
java.io.IOException - If there is a problem writing to the JSP output stream.
Since:
Version 0.3 2005-06-29

printAddedField

protected final void printAddedField(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.jsp.JspWriter out,
                                     java.util.List selected,
                                     boolean visible)
                              throws java.io.IOException
Print any additional search or build field.

Parameters:
request - The servlet request object.
out - The JSP output stream.
selected - The list of selected parameter names.
visible - Whether this is part of the visible query form or hidden builder form.
Throws:
java.io.IOException - If there is a problem writing to the JSP output stream.
Since:
Version 0.3 2005-06-29

getParameterValues

public final java.lang.String getParameterValues(javax.servlet.http.HttpServletRequest request,
                                                 java.lang.String name)
Get a space separated list of parameter values by name.

Parameters:
request - The JSP request object.
name - The parameter name.
Returns:
A space separated list of parameter names, or the empty string.

setBuilderUrl

public final void setBuilderUrl(java.lang.String url)
Encode the builder URL attribute.

Parameters:
url - A builder URL for the form, relative to the server root.
Since:
Version 0.8 2005-09-12

getBuilderUrl

public final java.lang.String getBuilderUrl()
Get the builder URL attribute.

Returns:
An encoded builder URL for the request.
Since:
Version 0.8 2005-09-12