org.kuali.kfs.sys.document.web
Class DefaultAccountingLineGroupImpl

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.DefaultAccountingLineGroupImpl
All Implemented Interfaces:
AccountingLineGroup
Direct Known Subclasses:
CollectionAccountingLineGroupImpl, SecAccountingLineGroupImpl

public class DefaultAccountingLineGroupImpl
extends Object
implements AccountingLineGroup

This represents an accounting line group in renderable state


Field Summary
protected  AccountingDocument accountingDocument
           
protected  int arbitrarilyHighIndex
           
protected  boolean canEdit
           
protected  int cellCount
           
protected  String collectionItemPropertyName
           
protected  String collectionPropertyName
           
protected  List<RenderableAccountingLineContainer> containers
           
protected  Map<String,Object> displayedErrors
           
protected  Map<String,Object> displayedInfo
           
protected  Map<String,Object> displayedWarnings
           
protected  List errorKeys
           
protected  AccountingLineGroupDefinition groupDefinition
           
protected  javax.servlet.jsp.tagext.JspFragment importLineOverride
           
 
Constructor Summary
DefaultAccountingLineGroupImpl()
          Constructs a DefaultAccountingLineGroupImpl
 
Method Summary
 AccountingDocument getAccountingDocument()
           
 String getCollectionItemPropertyName()
          Gets the collectionItemPropertyName attribute.
 String getCollectionPropertyName()
          Gets the collectionPropertyName attribute.
 Map getDisplayedErrors()
          Gets the displayedErrors attribute.
 Map getDisplayedInfo()
          Gets the displayedInfo attribute.
 Map getDisplayedWarnings()
          Gets the displayedWarnings attribute.
 List getErrorKeys()
          Gets the errorKeys attribute.
protected  GroupErrorsRenderer getErrorRenderer()
           
 AccountingLineGroupDefinition getGroupDefinition()
          Gets the groupDefinition attribute.
protected  int getRepresentedColumnNumber(String propertyName)
          get the column number of the tabel cell with the given property name in an accounting line table
 int getWidthInCells()
          Finds the maximum number of cells in the accounting line table row
protected  boolean hasEnoughAccountingLinesForDelete()
          Determines if there are enough accounting lines in this group for delete buttons to be present
 void initialize(AccountingLineGroupDefinition groupDefinition, AccountingDocument accountingDocument, List<RenderableAccountingLineContainer> containers, String collectionPropertyName, String collectionItemPropertyName, Map<String,Object> displayedErrors, Map<String,Object> displayedWarnings, Map<String,Object> displayedInfo, boolean canEdit)
          Initializes the DefaultAccountingLineGroupImpl
protected  void moveListToMap(List<String> theList, Map theMap)
          Moves all of the members of theList into theMap as a key with the value always being the String "true"
protected  void renderAccountingLineContainers(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the accounting line containers
protected  void renderErrors(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders any errors for the group
 void renderEverything(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the whole of this accounting line group
protected  void renderGroupHeader(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the group header/import line for the accounting line group.
protected  void renderTotals(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders all of the totals required by the group total definition
 void setAccountingDocument(AccountingDocument accountingDocument)
           
 void setArbitrarilyHighIndex(int arbitrarilyHighIndex)
          Sets the form's arbitrarily high tab index
 void setCellCount(int cellCount)
          Sets the cellCount attribute value.
 void setCollectionItemPropertyName(String collectionItemPropertyName)
          Sets the collectionItemPropertyName attribute value.
 void setCollectionPropertyName(String collectionPropertyName)
          Sets the collectionPropertyName attribute value.
 void setDisplayedErrors(Map displayedErrors)
          Sets the displayedErrors attribute value.
 void setErrorKeys(List errorKeys)
          Sets the errorKeys attribute value.
 void setGroupDefinition(AccountingLineGroupDefinition groupDefinition)
          Sets the groupDefinition attribute value.
 void setImportLineOverride(javax.servlet.jsp.tagext.JspFragment importLineOverride)
          Sets the importLineOverride attribute value.
 void updateDeletabilityOfAllLines()
          Determines if there is more than one editable line in this group; if so, then it allows deleting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupDefinition

protected AccountingLineGroupDefinition groupDefinition

importLineOverride

protected javax.servlet.jsp.tagext.JspFragment importLineOverride

collectionPropertyName

protected String collectionPropertyName

containers

protected List<RenderableAccountingLineContainer> containers

accountingDocument

protected AccountingDocument accountingDocument

cellCount

protected int cellCount

arbitrarilyHighIndex

protected int arbitrarilyHighIndex

displayedErrors

protected Map<String,Object> displayedErrors

displayedWarnings

protected Map<String,Object> displayedWarnings

displayedInfo

protected Map<String,Object> displayedInfo

canEdit

protected boolean canEdit

collectionItemPropertyName

protected String collectionItemPropertyName

errorKeys

protected List errorKeys
Constructor Detail

DefaultAccountingLineGroupImpl

public DefaultAccountingLineGroupImpl()
Constructs a DefaultAccountingLineGroupImpl

Method Detail

initialize

public void initialize(AccountingLineGroupDefinition groupDefinition,
                       AccountingDocument accountingDocument,
                       List<RenderableAccountingLineContainer> containers,
                       String collectionPropertyName,
                       String collectionItemPropertyName,
                       Map<String,Object> displayedErrors,
                       Map<String,Object> displayedWarnings,
                       Map<String,Object> displayedInfo,
                       boolean canEdit)
Initializes the DefaultAccountingLineGroupImpl

Parameters:
groupDefinition - the data dictionary group definition for this accounting line group
accountingDocument - the document which owns or will own the accounting line being rendered
containers - the containers within this group
collectionPropertyName - the property name of the collection of accounting lines owned by this group
errors - a List of errors keys for errors on the page
displayedErrors - a Map of errors that have already been displayed
canEdit - determines if the page can be edited or not

renderEverything

public void renderEverything(javax.servlet.jsp.PageContext pageContext,
                             javax.servlet.jsp.tagext.Tag parentTag)
                      throws javax.servlet.jsp.JspException
Renders the whole of this accounting line group

Specified by:
renderEverything in interface AccountingLineGroup
Parameters:
pageContext - the page context to render to
parentTag - the AccountingLinesTag that is requesting this rendering
Throws:
javax.servlet.jsp.JspException

getWidthInCells

public int getWidthInCells()
Finds the maximum number of cells in the accounting line table row

Specified by:
getWidthInCells in interface AccountingLineGroup
Parameters:
rows - the rows which are being rendered
Returns:
the maximum number of cells to render

renderGroupHeader

protected void renderGroupHeader(javax.servlet.jsp.PageContext pageContext,
                                 javax.servlet.jsp.tagext.Tag parentTag)
                          throws javax.servlet.jsp.JspException
Renders the group header/import line for the accounting line group. Renders importLineOverride if present; otherwise, uses ImportLineRenderer to do its dirty work

Parameters:
accountingLineGroupDefinition - the accounting line group definition
rows - the rows to render
Throws:
javax.servlet.jsp.JspException - thrown if something goes wrong in rendering the header

renderErrors

protected void renderErrors(javax.servlet.jsp.PageContext pageContext,
                            javax.servlet.jsp.tagext.Tag parentTag)
                     throws javax.servlet.jsp.JspException
Renders any errors for the group

Parameters:
pageContext - the page context where the errors will be rendered on
parentTag - the parent tag requesting the rendering
Throws:
javax.servlet.jsp.JspException

moveListToMap

protected void moveListToMap(List<String> theList,
                             Map theMap)
Moves all of the members of theList into theMap as a key with the value always being the String "true"

Parameters:
theList - the List of Strings to be keys
theMap - the Map of keys and values

getErrorRenderer

protected GroupErrorsRenderer getErrorRenderer()
Returns:
get a GroupErrorsRenderer in a way which can be overridden

renderAccountingLineContainers

protected void renderAccountingLineContainers(javax.servlet.jsp.PageContext pageContext,
                                              javax.servlet.jsp.tagext.Tag parentTag)
                                       throws javax.servlet.jsp.JspException
Renders the accounting line containers

Parameters:
containers - the containers to render
Throws:
javax.servlet.jsp.JspException - thrown if rendering goes badly

renderTotals

protected void renderTotals(javax.servlet.jsp.PageContext pageContext,
                            javax.servlet.jsp.tagext.Tag parentTag)
                     throws javax.servlet.jsp.JspException
Renders all of the totals required by the group total definition

Parameters:
groupDefinition - the accounting line view group definition
lines - the lines that will be rendered - so we can count how many cells we're rendering
Throws:
javax.servlet.jsp.JspException - thrown if something goes wrong

getRepresentedColumnNumber

protected int getRepresentedColumnNumber(String propertyName)
get the column number of the tabel cell with the given property name in an accounting line table

Parameters:
propertyName - the given property name that is associated with the column
Returns:
the column number of the tabel cell with the given property name in an accounting line table

setCellCount

public void setCellCount(int cellCount)
Sets the cellCount attribute value.

Specified by:
setCellCount in interface AccountingLineGroup
Parameters:
cellCount - The cellCount to set.

setImportLineOverride

public void setImportLineOverride(javax.servlet.jsp.tagext.JspFragment importLineOverride)
Sets the importLineOverride attribute value.

Specified by:
setImportLineOverride in interface AccountingLineGroup
Parameters:
importLineOverride - The importLineOverride to set.

setArbitrarilyHighIndex

public void setArbitrarilyHighIndex(int arbitrarilyHighIndex)
Sets the form's arbitrarily high tab index

Specified by:
setArbitrarilyHighIndex in interface AccountingLineGroup
Parameters:
arbitrarilyHighIndex - the index to set

getDisplayedWarnings

public Map getDisplayedWarnings()
Gets the displayedWarnings attribute.

Returns:
Returns the displayedWarnings.

getDisplayedInfo

public Map getDisplayedInfo()
Gets the displayedInfo attribute.

Returns:
Returns the displayedInfo.

getErrorKeys

public List getErrorKeys()
Gets the errorKeys attribute.

Specified by:
getErrorKeys in interface AccountingLineGroup
Returns:
Returns the errorKeys.

setErrorKeys

public void setErrorKeys(List errorKeys)
Sets the errorKeys attribute value.

Specified by:
setErrorKeys in interface AccountingLineGroup
Parameters:
errorKeys - The errorKeys to set.

updateDeletabilityOfAllLines

public void updateDeletabilityOfAllLines()
Determines if there is more than one editable line in this group; if so, then it allows deleting

Specified by:
updateDeletabilityOfAllLines in interface AccountingLineGroup

hasEnoughAccountingLinesForDelete

protected boolean hasEnoughAccountingLinesForDelete()
Determines if there are enough accounting lines in this group for delete buttons to be present

Returns:
true if there are enough accounting lines for a delete, false otherwise

getCollectionItemPropertyName

public String getCollectionItemPropertyName()
Gets the collectionItemPropertyName attribute.

Specified by:
getCollectionItemPropertyName in interface AccountingLineGroup
Returns:
Returns the collectionItemPropertyName.

getGroupDefinition

public AccountingLineGroupDefinition getGroupDefinition()
Gets the groupDefinition attribute.

Returns:
Returns the groupDefinition.

setGroupDefinition

public void setGroupDefinition(AccountingLineGroupDefinition groupDefinition)
Sets the groupDefinition attribute value.

Parameters:
groupDefinition - The groupDefinition to set.

getDisplayedErrors

public Map getDisplayedErrors()
Gets the displayedErrors attribute.

Returns:
Returns the displayedErrors.

setDisplayedErrors

public void setDisplayedErrors(Map displayedErrors)
Sets the displayedErrors attribute value.

Parameters:
displayedErrors - The displayedErrors to set.

getCollectionPropertyName

public String getCollectionPropertyName()
Gets the collectionPropertyName attribute.

Returns:
Returns the collectionPropertyName.

setCollectionPropertyName

public void setCollectionPropertyName(String collectionPropertyName)
Sets the collectionPropertyName attribute value.

Parameters:
collectionPropertyName - The collectionPropertyName to set.

setCollectionItemPropertyName

public void setCollectionItemPropertyName(String collectionItemPropertyName)
Sets the collectionItemPropertyName attribute value.

Parameters:
collectionItemPropertyName - The collectionItemPropertyName to set.

getAccountingDocument

public AccountingDocument getAccountingDocument()

setAccountingDocument

public void setAccountingDocument(AccountingDocument accountingDocument)


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