org.kuali.kfs.sys.document.web.renderers
Class GroupErrorsRenderer

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.renderers.GroupErrorsRenderer
All Implemented Interfaces:
Renderer

public class GroupErrorsRenderer
extends Object
implements Renderer

Renders any errors associated with an accounting line group


Constructor Summary
GroupErrorsRenderer()
           
 
Method Summary
protected  String buildKeyComment(String matchingKey, String sectionGraphicAlt)
          Builds an HTML comment, useful for debugging, which dumps out the message key being displayed
protected  String buildSectionTitle(String titleConstant, String sectionMarkGraphicName, String sectionGraphicAlt)
          Builds the HTML String for a section title
protected  String buildTableRowAndCellClosing()
           
protected  String buildTableRowAndCellOpening()
           
protected  void cleanUpErrorTag()
          Cleans up the ErrorTag
 void clear()
          Cleans up the errorPropertyList, the sectionTitle, the errorsRendered (so you'd better read that first), and the ErrorTag used to display the errors
protected  boolean foundKeyMatch(String key, String keyToMatch)
          Determines if the given error key matches the keyToMatch - either because the two keys are equal, or if the keyToMatch is a wildcard key and would wildcard match the key
 int getColSpan()
          Gets the colSpan attribute.
 String getErrorKeyMatch()
          Gets the errorKeyMatch attribute.
 List getErrorPropertyList(javax.servlet.jsp.PageContext pageContext)
          Looks up the InfoPropertyList from the generating request
 List<String> getErrorsRendered()
          Gets the errorsRendered attribute.
protected  List getInfoPropertyList(javax.servlet.jsp.PageContext pageContext)
          Looks up the InfoPropertyList from the generating request
 List<String> getInfoRendered()
          Gets the infoRendered attribute.
protected  String[] getKeysToMatch()
           
protected  List<String> getMatchingKeys(List messagePropertyList, String[] keysToMatch)
          Returns a list of all error keys that should be rendered
protected  List getWarningPropertyList(javax.servlet.jsp.PageContext pageContext)
          Looks up the InfoPropertyList from the generating request
 List<String> getWarningsRendered()
          Gets the warningsRendered attribute.
protected  boolean matchesGroup(String key, String[] keysToMatch)
          Determines if the given key matches any error key associated with this group
 void render(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the errors, warnings, and messages for this page
protected  void renderMessages(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, String titleConstant, List propertyList, String sectionMarkGraphicName, String sectionGraphicAlt, List<String> keysRendered)
          Renders a group of messages
 void setColSpan(int colSpan)
          Sets the colSpan attribute value.
 void setErrorKeyMatch(String errorKeyMatch)
          Sets the errorKeyMatch attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupErrorsRenderer

public GroupErrorsRenderer()
Method Detail

clear

public void clear()
Cleans up the errorPropertyList, the sectionTitle, the errorsRendered (so you'd better read that first), and the ErrorTag used to display the errors

Specified by:
clear in interface Renderer
See Also:
Renderer.clear()

cleanUpErrorTag

protected void cleanUpErrorTag()
Cleans up the ErrorTag


render

public void render(javax.servlet.jsp.PageContext pageContext,
                   javax.servlet.jsp.tagext.Tag parentTag)
            throws javax.servlet.jsp.JspException
Renders the errors, warnings, and messages for this page

Specified by:
render in interface Renderer
Parameters:
pageContext - the JSP page context to render to
parentTag - the tag that is the "parent" of this rendering
Throws:
javax.servlet.jsp.JspException
See Also:
Renderer.render(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)

renderMessages

protected void renderMessages(javax.servlet.jsp.PageContext pageContext,
                              javax.servlet.jsp.tagext.Tag parentTag,
                              String titleConstant,
                              List propertyList,
                              String sectionMarkGraphicName,
                              String sectionGraphicAlt,
                              List<String> keysRendered)
                       throws javax.servlet.jsp.JspException
Renders a group of messages

Parameters:
pageContext - the page context to render to
parentTag - the name of the parent tag requesting this rendering
titleConstant - the Key Constant to text for the title
propertyList - the list of properties to display
sectionMarkGraphicName - the file name of the mark graphic to display
sectionGraphicAlt - the wording to be used in the "alt" section of the mark graphic
Throws:
javax.servlet.jsp.JspException - thrown if rendering cannot be successfully completed

buildSectionTitle

protected String buildSectionTitle(String titleConstant,
                                   String sectionMarkGraphicName,
                                   String sectionGraphicAlt)
Builds the HTML String for a section title

Parameters:
titleConstant - the Key Constant to find the text for the title
sectionMarkGraphicName - the name of the graphic file to use
sectionGraphicAlt - the alt for the graphic
Returns:
the String to output as HTML for the section title

buildKeyComment

protected String buildKeyComment(String matchingKey,
                                 String sectionGraphicAlt)
Builds an HTML comment, useful for debugging, which dumps out the message key being displayed

Parameters:
matchingKey - the key to display
sectionGraphicAlt - the alt for this section, we'll reuse it for the comments
Returns:
the String to output for the key comment

buildTableRowAndCellOpening

protected String buildTableRowAndCellOpening()
Returns:
the HTML for the table row and cell and div to open the error display

buildTableRowAndCellClosing

protected String buildTableRowAndCellClosing()
Returns:
the HTML for the table row and cell and div which closes the error display

getMatchingKeys

protected List<String> getMatchingKeys(List messagePropertyList,
                                       String[] keysToMatch)
Returns a list of all error keys that should be rendered

Parameters:
keysToMatch - the keys that this group will match
Returns:
a List of all error keys this group will match

getKeysToMatch

protected String[] getKeysToMatch()
Returns:
the list of individual keys or wildcard keys that this group will match

foundKeyMatch

protected boolean foundKeyMatch(String key,
                                String keyToMatch)
Determines if the given error key matches the keyToMatch - either because the two keys are equal, or if the keyToMatch is a wildcard key and would wildcard match the key

Parameters:
key - the error key to match
keyToMatch - one of the error keys this group will display
Returns:
true if the keys match, false if not

matchesGroup

protected boolean matchesGroup(String key,
                               String[] keysToMatch)
Determines if the given key matches any error key associated with this group

Parameters:
key - the error key that may or may not be displayed here
keysToMatch - the keys that this group will match against
Returns:
true if this group can display the given key, false otherwise

getErrorPropertyList

public List getErrorPropertyList(javax.servlet.jsp.PageContext pageContext)
Looks up the InfoPropertyList from the generating request

Parameters:
pageContext - the pageContext which this tag is rendering to
Returns:
the ErrorPropertyList from the request

getWarningPropertyList

protected List getWarningPropertyList(javax.servlet.jsp.PageContext pageContext)
Looks up the InfoPropertyList from the generating request

Parameters:
pageContext - the pageContext which this tag is rendering to
Returns:
the WarningPropertyList from the request

getInfoPropertyList

protected List getInfoPropertyList(javax.servlet.jsp.PageContext pageContext)
Looks up the InfoPropertyList from the generating request

Parameters:
pageContext - the pageContext which this tag is rendering to
Returns:
the InfoPropertyList from the request

getErrorsRendered

public List<String> getErrorsRendered()
Gets the errorsRendered attribute.

Returns:
Returns the errorsRendered.

getWarningsRendered

public List<String> getWarningsRendered()
Gets the warningsRendered attribute.

Returns:
Returns the warningsRendered.

getInfoRendered

public List<String> getInfoRendered()
Gets the infoRendered attribute.

Returns:
Returns the infoRendered.

getErrorKeyMatch

public String getErrorKeyMatch()
Gets the errorKeyMatch attribute.

Returns:
Returns the errorKeyMatch.

setErrorKeyMatch

public void setErrorKeyMatch(String errorKeyMatch)
Sets the errorKeyMatch attribute value.

Parameters:
errorKeyMatch - The errorKeyMatch to set.

getColSpan

public int getColSpan()
Gets the colSpan attribute.

Returns:
Returns the colSpan.

setColSpan

public void setColSpan(int colSpan)
Sets the colSpan attribute value.

Parameters:
colSpan - The colSpan to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.