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

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.FieldTableJoining
      extended by org.kuali.kfs.sys.document.web.FieldTableJoiningWithHeader
          extended by org.kuali.kfs.sys.document.web.AccountingLineViewField
All Implemented Interfaces:
ElementNamable, HeaderLabelPopulating, ReadOnlyable, RenderableElement, TableJoining, TableJoiningWithHeader
Direct Known Subclasses:
PurapAccountingLineViewField

public class AccountingLineViewField
extends FieldTableJoiningWithHeader
implements HeaderLabelPopulating, ReadOnlyable

Represents a field (plus, optionally, a dynamic name field) to be rendered as part of an accounting line.


Field Summary
static String ACCOUNTING_LINE_NAME_PREFIX_PLACE_HOLDER
           
 
Constructor Summary
AccountingLineViewField()
           
 
Method Summary
 void appendFields(List<org.kuali.rice.kns.web.ui.Field> fields)
          Adds the wrapped field to the list; adds any override fields this field encapsulates as well
 HeaderLabel createHeaderLabel()
          Returns the property of the accounting line business object that can be used to find the label for the given renderable element
protected  AccountingLineTableCell createHeaderLabelTableCell()
          Overridden to allow for colspan override
protected  AccountingLineTableCell createTableCell()
          Overridden to allow for colspan override
protected  String escapeAccountingLineName(String propertyName, String accountingLinePrefix)
          Escapes the String ${accountingLineName} within a field and replaces it with the actual prefix of an accounting line
protected  boolean fieldInError(List errors)
          Determines if this field is among the fields that are in error
 int getColSpanOverride()
           
 AccountingLineViewFieldDefinition getDefinition()
          Gets the definition attribute.
protected  String getDynamicNameLabelDisplayedValue(AccountingLine accountingLine)
          Gets the value from the accounting line to display as the field value
 org.kuali.rice.kns.web.ui.Field getField()
          Gets the field attribute.
 String getHeaderLabelProperty()
           
 String getName()
          Returns the name(s) of this table joining element; some table joining elements are compound
 List<AccountingLineViewOverrideField> getOverrideFields()
          Gets the overrideFields attribute.
protected  org.kuali.rice.kns.service.PersistenceStructureService getPersistenceStructureService()
          Lazily retrieves the persistence structure service
 boolean isHidden()
          Checks the field to see if the field itself is hidden
 boolean isReadOnly()
          Asks the wrapped field if it is read only (dynamic fields are, of course, always read only and therefore don't count in this determination)
protected  boolean isRenderingInquiry(AccountingDocument document, AccountingLine line)
          Determines whether to render the inquiry for this field
 void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations, AccountingLine accountingLine, Map unconvertedValues)
          Performs a transformations on any fields this TableJoining layout element knows about
protected  void populateFieldForLookupAndInquiry(AccountingDocument accountingDocument, AccountingLine accountingLine, List<String> fieldNames, String accountingLinePrefix)
          Updates the field so that it can have a quickfinder and inquiry link if need be
 void populateHeaderLabel(HeaderLabel headerLabel, AccountingLineRenderingContext renderingContext)
          Asks that the HeaderLabelPopulating implementor populate the header label
 void populateWithTabIndexIfRequested(int reallyHighIndex)
          Allows the arbitrarily high tab index to be set for controls
protected  void prepareFieldRenderer(FieldRenderer fieldRenderer, org.kuali.rice.kns.web.ui.Field field, AccountingDocument document, AccountingLine accountingLine, String accountingLineProperty, List<String> fieldNames)
          Does some initial set up on the field renderer - sets the field and the business object being rendered
 void readOnlyize()
          Sets any renderable element within this table joining block to be read only
protected  void renderDynamicNameLabel(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, AccountingLineRenderingContext renderingContext)
          Renders a dynamic field label
 void renderElement(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, AccountingLineRenderingContext renderingContext)
          Renders this element
protected  void renderField(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, AccountingLineRenderingContext renderingContext)
          Renders the field portion of this tag
 void renderOverrideFields(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, AccountingLineRenderingContext renderingContext)
          Renders the override fields for the line
 void setDefinition(AccountingLineViewFieldDefinition definition)
          Sets the definition attribute value.
 void setEditable()
          Sets any renderable element within this table joining block to be editable
 void setField(org.kuali.rice.kns.web.ui.Field field)
          Sets the field attribute value.
 void setOverrideFields(List<AccountingLineViewOverrideField> overrideFields)
          Sets the overrideFields attribute value.
protected  boolean shouldRenderDynamicFeldLabel()
          Determines if a dynamic field label should be rendered for the given field
protected  void transformOverrideFields(AccountingLineFieldRenderingTransformation fieldTransformation, AccountingLine accountingLine, Map unconvertedValues)
          Runs a field transformation against all the overrides encapsulated within this field
protected  void updateTableCellWithColSpanOverride(AccountingLineTableCell cell)
          If the field definition had an override col span greater than 1 and it doesn't seem as if the given cell had its colspan lengthened already, this method will increase the colspan of the table cell to whatever is listed
 
Methods inherited from class org.kuali.kfs.sys.document.web.FieldTableJoiningWithHeader
getRequestedRowCount, joinRow, joinTable
 
Methods inherited from class org.kuali.kfs.sys.document.web.FieldTableJoining
isActionBlock, isEmpty, readOnlyizeReadOnlyBlocks, removeAllActionBlocks, removeUnviewableBlocks, setEditableBlocks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.kfs.sys.document.web.TableJoining
readOnlyizeReadOnlyBlocks, removeAllActionBlocks, removeUnviewableBlocks, setEditableBlocks
 

Field Detail

ACCOUNTING_LINE_NAME_PREFIX_PLACE_HOLDER

public static final String ACCOUNTING_LINE_NAME_PREFIX_PLACE_HOLDER
See Also:
Constant Field Values
Constructor Detail

AccountingLineViewField

public AccountingLineViewField()
Method Detail

getDefinition

public AccountingLineViewFieldDefinition getDefinition()
Gets the definition attribute.

Returns:
Returns the definition.

setDefinition

public void setDefinition(AccountingLineViewFieldDefinition definition)
Sets the definition attribute value.

Parameters:
definition - The definition to set.

getField

public org.kuali.rice.kns.web.ui.Field getField()
Gets the field attribute.

Returns:
Returns the field.

setField

public void setField(org.kuali.rice.kns.web.ui.Field field)
Sets the field attribute value.

Parameters:
field - The field to set.

getOverrideFields

public List<AccountingLineViewOverrideField> getOverrideFields()
Gets the overrideFields attribute.

Returns:
Returns the overrideFields.

setOverrideFields

public void setOverrideFields(List<AccountingLineViewOverrideField> overrideFields)
Sets the overrideFields attribute value.

Parameters:
overrideFields - The overrideFields to set.

isHidden

public boolean isHidden()
Checks the field to see if the field itself is hidden

Specified by:
isHidden in interface RenderableElement
Specified by:
isHidden in interface TableJoiningWithHeader
Overrides:
isHidden in class FieldTableJoining
Returns:
true if hidden, false otherwise
See Also:
org.kuali.kfs.sys.document.web.AccountingLineViewRenderableElementField#isHidden()

isReadOnly

public boolean isReadOnly()
Asks the wrapped field if it is read only (dynamic fields are, of course, always read only and therefore don't count in this determination)

Specified by:
isReadOnly in interface ReadOnlyable
Returns:
true if the entire element is read only; false otherwise
See Also:
org.kuali.kfs.sys.document.web.AccountingLineViewRenderableElementField#isReadOnly()

getName

public String getName()
Description copied from interface: ElementNamable
Returns the name(s) of this table joining element; some table joining elements are compound

Specified by:
getName in interface ElementNamable
Returns:
the names of this table joining element
See Also:
ElementNamable.getName()

readOnlyize

public void readOnlyize()
Description copied from interface: ReadOnlyable
Sets any renderable element within this table joining block to be read only

Specified by:
readOnlyize in interface ReadOnlyable
See Also:
org.kuali.kfs.sys.document.web.TableJoining#readOnlyize()

getHeaderLabelProperty

public String getHeaderLabelProperty()
See Also:
org.kuali.kfs.sys.document.web.TableJoiningWithHeader#getHeaderLabelProperty()

renderElement

public void renderElement(javax.servlet.jsp.PageContext pageContext,
                          javax.servlet.jsp.tagext.Tag parentTag,
                          AccountingLineRenderingContext renderingContext)
                   throws javax.servlet.jsp.JspException
Description copied from interface: RenderableElement
Renders this element

Specified by:
renderElement in interface RenderableElement
Parameters:
pageContext - the context to render to
parentTag - the parent tag that is requesting this rendering
renderingContext - the context about the accounting line that this element would end up rendering
Throws:
javax.servlet.jsp.JspException
See Also:
org.kuali.kfs.sys.document.web.RenderableElement#renderElement(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)

renderField

protected void renderField(javax.servlet.jsp.PageContext pageContext,
                           javax.servlet.jsp.tagext.Tag parentTag,
                           AccountingLineRenderingContext renderingContext)
                    throws javax.servlet.jsp.JspException
Renders the field portion of this tag

Parameters:
pageContext - the page context to render to
parentTag - the tag requesting rendering
renderingContext - the rendering context of the accounting line
Throws:
javax.servlet.jsp.JspException - thrown if something goes wrong

populateFieldForLookupAndInquiry

protected void populateFieldForLookupAndInquiry(AccountingDocument accountingDocument,
                                                AccountingLine accountingLine,
                                                List<String> fieldNames,
                                                String accountingLinePrefix)
Updates the field so that it can have a quickfinder and inquiry link if need be

Parameters:
accountingDocument - the accounting document the accounting line the field will render part of is on or will at some point be on
accountingLine - the accounting line that is being rendered
fieldNames - the list of all fields being displayed on this accounting line
accountingLinePrefix - the prefix of all field names in the accounting line

getPersistenceStructureService

protected org.kuali.rice.kns.service.PersistenceStructureService getPersistenceStructureService()
Lazily retrieves the persistence structure service

Returns:
an implementation of PersistenceStructureService

prepareFieldRenderer

protected void prepareFieldRenderer(FieldRenderer fieldRenderer,
                                    org.kuali.rice.kns.web.ui.Field field,
                                    AccountingDocument document,
                                    AccountingLine accountingLine,
                                    String accountingLineProperty,
                                    List<String> fieldNames)
Does some initial set up on the field renderer - sets the field and the business object being rendered

Parameters:
fieldRenderer - the field renderer to prepare
accountingLine - the accounting line being rendered
accountingLineProperty - the property to get the accounting line from the form
fieldNames - the names of all the fields that will be rendered as part of this accounting line

shouldRenderDynamicFeldLabel

protected boolean shouldRenderDynamicFeldLabel()
Determines if a dynamic field label should be rendered for the given field

Returns:
true if a dynamic field label should be rendered, false otherwise

performFieldTransformations

public void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations,
                                        AccountingLine accountingLine,
                                        Map unconvertedValues)
Description copied from interface: TableJoining
Performs a transformations on any fields this TableJoining layout element knows about

Specified by:
performFieldTransformations in interface TableJoining
Overrides:
performFieldTransformations in class FieldTableJoining
accountingLine - the accounting line which is being rendering during the transformation
unconvertedValues - any unconverted values from the form
See Also:
org.kuali.kfs.sys.document.web.TableJoining#performFieldTransformation(org.kuali.kfs.sys.document.service.AccountingLineFieldRenderingTransformation, org.kuali.kfs.sys.businessobject.AccountingLine, java.util.Map, java.util.Map)

transformOverrideFields

protected void transformOverrideFields(AccountingLineFieldRenderingTransformation fieldTransformation,
                                       AccountingLine accountingLine,
                                       Map unconvertedValues)
Runs a field transformation against all the overrides encapsulated within this field

Parameters:
fieldTransformation - the field transformation which will utterly change our fields
accountingLine - the accounting line being rendered
editModes - the current document edit modes
unconvertedValues - a Map of unconvertedValues

renderOverrideFields

public void renderOverrideFields(javax.servlet.jsp.PageContext pageContext,
                                 javax.servlet.jsp.tagext.Tag parentTag,
                                 AccountingLineRenderingContext renderingContext)
                          throws javax.servlet.jsp.JspException
Renders the override fields for the line

Parameters:
pageContext - the page context to render to
parentTag - the tag requesting all this rendering
accountingLine - the accounting line we're rendering
accountingLinePropertyPath - the path to get to that accounting
Throws:
javax.servlet.jsp.JspException - thrown if rendering fails

renderDynamicNameLabel

protected void renderDynamicNameLabel(javax.servlet.jsp.PageContext pageContext,
                                      javax.servlet.jsp.tagext.Tag parentTag,
                                      AccountingLineRenderingContext renderingContext)
                               throws javax.servlet.jsp.JspException
Renders a dynamic field label

Parameters:
pageContext - the page context to render to
parentTag - the parent tag requesting this rendering
accountingLine - the line which owns the field being rendered
accountingLinePropertyPath - the path from the form to the accounting line
Throws:
javax.servlet.jsp.JspException

getDynamicNameLabelDisplayedValue

protected String getDynamicNameLabelDisplayedValue(AccountingLine accountingLine)
Gets the value from the accounting line to display as the field value

Parameters:
accountingLine - the accounting line to get the value from
Returns:
the value to display for the dynamic name label

createHeaderLabel

public HeaderLabel createHeaderLabel()
Description copied from interface: TableJoiningWithHeader
Returns the property of the accounting line business object that can be used to find the label for the given renderable element

Specified by:
createHeaderLabel in interface TableJoiningWithHeader
Returns:
the property to lookup the label in the data dictionary
See Also:
TableJoiningWithHeader.createHeaderLabel()

updateTableCellWithColSpanOverride

protected void updateTableCellWithColSpanOverride(AccountingLineTableCell cell)
If the field definition had an override col span greater than 1 and it doesn't seem as if the given cell had its colspan lengthened already, this method will increase the colspan of the table cell to whatever is listed

Parameters:
cell - the cell to possibly lengthen

createHeaderLabelTableCell

protected AccountingLineTableCell createHeaderLabelTableCell()
Overridden to allow for colspan override

Overrides:
createHeaderLabelTableCell in class FieldTableJoiningWithHeader
Returns:
a table cell holding the header label to render
See Also:
FieldTableJoiningWithHeader.createHeaderLabelTableCell()

createTableCell

protected AccountingLineTableCell createTableCell()
Overridden to allow for colspan override

Overrides:
createTableCell in class FieldTableJoining
Returns:
the created table cell
See Also:
FieldTableJoining.createTableCell()

getColSpanOverride

public int getColSpanOverride()
Returns:
the colspan override of this field

populateHeaderLabel

public void populateHeaderLabel(HeaderLabel headerLabel,
                                AccountingLineRenderingContext renderingContext)
Description copied from interface: HeaderLabelPopulating
Asks that the HeaderLabelPopulating implementor populate the header label

Specified by:
populateHeaderLabel in interface HeaderLabelPopulating
Parameters:
headerLabel - the header label to populate
renderingContext - the rendering context the label will be populated in
See Also:
HeaderLabelPopulating.populateHeaderLabel(org.kuali.kfs.sys.document.web.HeaderLabel, org.kuali.kfs.sys.document.web.AccountingLineRenderingContext)

appendFields

public void appendFields(List<org.kuali.rice.kns.web.ui.Field> fields)
Adds the wrapped field to the list; adds any override fields this field encapsulates as well

Specified by:
appendFields in interface RenderableElement
See Also:
org.kuali.kfs.sys.document.web.RenderableElement#appendFieldNames(java.util.List)

populateWithTabIndexIfRequested

public void populateWithTabIndexIfRequested(int reallyHighIndex)
Description copied from interface: RenderableElement
Allows the arbitrarily high tab index to be set for controls

Specified by:
populateWithTabIndexIfRequested in interface RenderableElement
Parameters:
reallyHighIndex - a really high index for elements who should not be tabbed to
See Also:
org.kuali.kfs.sys.document.web.RenderableElement#populateWithTabIndexIfRequested(int[], int)

fieldInError

protected boolean fieldInError(List errors)
Determines if this field is among the fields that are in error

Parameters:
errors - the errors on the form
Returns:
true if this field is in error, false otherwise

setEditable

public void setEditable()
Description copied from interface: ReadOnlyable
Sets any renderable element within this table joining block to be editable

Specified by:
setEditable in interface ReadOnlyable
See Also:
ReadOnlyable.setEditable()

isRenderingInquiry

protected boolean isRenderingInquiry(AccountingDocument document,
                                     AccountingLine line)
Determines whether to render the inquiry for this field

Parameters:
document - the document which the accounting line is part of or hopefully sometime will be part of
line - the accounting line being rendered
Returns:
true if inquiry links should be rendered, false otherwise

escapeAccountingLineName

protected String escapeAccountingLineName(String propertyName,
                                          String accountingLinePrefix)
Escapes the String ${accountingLineName} within a field and replaces it with the actual prefix of an accounting line

Parameters:
propertyName - the name of the property to escape the special string ${accountingLineName} out of
accountingLinePrefix - the actual accounting line prefix
Returns:
the property name with the correct accounting line prefix


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