org.kuali.rice.kns.datadictionary
Class LookupDefinition

java.lang.Object
  extended by org.kuali.rice.kns.datadictionary.DataDictionaryDefinitionBase
      extended by org.kuali.rice.kns.datadictionary.LookupDefinition
All Implemented Interfaces:
Serializable, DataDictionaryDefinition, org.springframework.beans.factory.InitializingBean

public class LookupDefinition
extends DataDictionaryDefinitionBase

Contains lookup-related information relating to the parent BusinessObject.

The lookup element is used to specify the rules for "looking up" a business object. These specifications define the following: How to specify the search criteria used to locate a set of business objects How to display the search results

DD: See LookupDefinition.java

JSTL: The lookup element is a Map which is accessed using a key of "lookup". This map contains the following keys: lookupableID (String, optional) title (String) menubar (String, optional) defaultSort (Map, optional) lookupFields (Map) resultFields (Map) resultSetLimit (String, optional)

See LookupMapBuilder.java

Note: the setters do copious amounts of validation, to facilitate generating errors during the parsing process.

See Also:
Serialized Form

Field Summary
protected  SortDefinition defaultSort
           
protected  boolean disableSearchButtons
           
protected  String extraButtonParams
           
protected  String extraButtonSource
           
protected  HelpDefinition helpDefinition
           
protected  String helpUrl
           
protected  String lookupableID
           
protected  Map<String,FieldDefinition> lookupFieldMap
           
protected  List<FieldDefinition> lookupFields
           
protected  String menubar
           
protected  int numOfColumns
           
protected  Map<String,FieldDefinition> resultFieldMap
           
protected  List<FieldDefinition> resultFields
           
protected  Integer resultSetLimit
           
protected  String searchIconOverride
           
protected  String title
           
protected  boolean translateCodes
           
 
Fields inherited from class org.kuali.rice.kns.datadictionary.DataDictionaryDefinitionBase
id
 
Constructor Summary
LookupDefinition()
           
 
Method Summary
 void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass)
          Directly validate simple fields, call completeValidation on Definition fields.
 SortDefinition getDefaultSort()
           
 String getExtraButtonParams()
           
 String getExtraButtonSource()
           
 HelpDefinition getHelpDefinition()
           
 String getHelpUrl()
           
 String getLookupableID()
           
 FieldDefinition getLookupField(String attributeName)
           
 List getLookupFieldNames()
           
 List<FieldDefinition> getLookupFields()
           
 String getMenubar()
           
 int getNumOfColumns()
           
 FieldDefinition getResultField(String attributeName)
           
 List<String> getResultFieldNames()
           
 List<FieldDefinition> getResultFields()
           
 Integer getResultSetLimit()
          The resultSetLimit element specifies the maximum number of records that will be listed as a result of the lookup search.
 String getSearchIconOverride()
           
 String getTitle()
           
 boolean hasDefaultSort()
           
 boolean hasExtraButtonParams()
           
 boolean hasExtraButtonSource()
           
 boolean hasMenubar()
           
 boolean hasResultSetLimit()
           
 boolean hasSearchIconOverride()
           
 boolean isDisableSearchButtons()
           
 boolean isTranslateCodes()
           
 void setDefaultSort(SortDefinition defaultSort)
          The defaultSort element specifies the sequence in which the lookup search results should be displayed.
 void setDisableSearchButtons(boolean disableSearchButtons)
           
 void setExtraButtonParams(String extraButtonParams)
          The extraButton element is used to define additional buttons which will appear on the lookup screen next to the Search and Clear buttons.
 void setExtraButtonSource(String extraButtonSource)
          The extraButton element is used to define additional buttons which will appear on the lookup screen next to the Search and Clear buttons.
 void setHelpDefinition(HelpDefinition helpDefinition)
           
 void setHelpUrl(String helpUrl)
           
 void setLookupableID(String lookupableID)
          The lookupableID element identifies the name of the Spring bean which will be used to obtain the lookupable helper service for the business object.
 void setLookupFields(List<FieldDefinition> lookupFields)
          The lookupFields element defines the set of fields in which the user can enter values representing search selection criteria.
 void setMenubar(String menubar)
          The menubar element is used to add additional html code to the header line on the lookup screen.
 void setNumOfColumns(int numOfColumns)
           
 void setResultFields(List<FieldDefinition> resultFields)
          The resultFields element specifies the list of fields that are shown as a result of the lookup search.
 void setResultSetLimit(Integer resultSetLimit)
          The resultSetLimit element specifies the maximum number of records that will be listed as a result of the lookup search.
 void setSearchIconOverride(String searchIconOverride)
          The searchIconOverride element is used to define alternative icons appear on the lookup screen next to the Search and Clear buttons.
 void setTitle(String title)
          Sets title to the given value.
 void setTranslateCodes(boolean translateCodes)
           
 String toString()
           
 
Methods inherited from class org.kuali.rice.kns.datadictionary.DataDictionaryDefinitionBase
afterPropertiesSet, getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lookupableID

protected String lookupableID

title

protected String title

menubar

protected String menubar

defaultSort

protected SortDefinition defaultSort

lookupFields

protected List<FieldDefinition> lookupFields

lookupFieldMap

protected Map<String,FieldDefinition> lookupFieldMap

resultFields

protected List<FieldDefinition> resultFields

resultFieldMap

protected Map<String,FieldDefinition> resultFieldMap

resultSetLimit

protected Integer resultSetLimit

extraButtonSource

protected String extraButtonSource

extraButtonParams

protected String extraButtonParams

searchIconOverride

protected String searchIconOverride

numOfColumns

protected int numOfColumns

helpDefinition

protected HelpDefinition helpDefinition

helpUrl

protected String helpUrl

translateCodes

protected boolean translateCodes

disableSearchButtons

protected boolean disableSearchButtons
Constructor Detail

LookupDefinition

public LookupDefinition()
Method Detail

setLookupableID

public void setLookupableID(String lookupableID)
The lookupableID element identifies the name of the Spring bean which will be used to obtain the lookupable helper service for the business object. For example, the Balance.xml file has a lookupableId = "glBalanceLookupable". The KualiSpringBeansGL.xml file determines that the helper service will be an instance of BalanceLookupableHelperServiceImpl.

If this field is omitted, the default bean id used will be kualiLookupable which uses the KualiLookupableHelperServiceImpl helper service.


getLookupableID

public String getLookupableID()
Returns:
custom lookupable id

getTitle

public String getTitle()
Returns:
title

setTitle

public void setTitle(String title)
Sets title to the given value.

Parameters:
title -
Throws:
IllegalArgumentException - if the given title is blank

hasMenubar

public boolean hasMenubar()
Returns:
true if this instance has a menubar

getMenubar

public String getMenubar()
Returns:
menubar

setMenubar

public void setMenubar(String menubar)
The menubar element is used to add additional html code to the header line on the lookup screen.

For example, Account.xml uses this element to add the "create new global" button to the Account Lookup header.

Throws:
IllegalArgumentException - if the given menubar is blank

hasDefaultSort

public boolean hasDefaultSort()
Returns:
true if this instance has a default sort defined

getDefaultSort

public SortDefinition getDefaultSort()
Returns:
defaultSort

setDefaultSort

public void setDefaultSort(SortDefinition defaultSort)
The defaultSort element specifies the sequence in which the lookup search results should be displayed. It contains an ascending/descending indicator and a list of attribute names.

DD: See SortDefinition.java

JSTL: defaultSort is a Map with the following keys: sortAscending (boolean String) sortAttributes (Map)

By the time JSTL export occurs, the optional attributeName from the defaultSort tag will have been converted into the first contained sortAttribute

See LookupMapBuilder.java

Throws:
IllegalArgumentException - if the given defaultSort is blank

getLookupFieldNames

public List getLookupFieldNames()
Returns:
List of attributeNames of all lookupField FieldDefinitions associated with this LookupDefinition, in the order in which they were added

getLookupFields

public List<FieldDefinition> getLookupFields()
Returns:
Collection of all lookupField FieldDefinitions associated with this LookupDefinition, in the order in which they were added

getLookupField

public FieldDefinition getLookupField(String attributeName)
Parameters:
fieldName -
Returns:
FieldDefinition associated with the named lookup field, or null if there is none

getResultFieldNames

public List<String> getResultFieldNames()
Returns:
List of attributeNames of all resultField FieldDefinitions associated with this LookupDefinition, in the order in which they were added

getResultFields

public List<FieldDefinition> getResultFields()
Returns:
Collection of all resultField FieldDefinitions associated with this LookupDefinition, in the order in which they were added

getResultField

public FieldDefinition getResultField(String attributeName)
Parameters:
fieldName -
Returns:
FieldDefinition associated with the named result field, or null if there is none

setResultSetLimit

public void setResultSetLimit(Integer resultSetLimit)
The resultSetLimit element specifies the maximum number of records that will be listed as a result of the lookup search.


hasResultSetLimit

public boolean hasResultSetLimit()
Returns:
true if this instance has a result set limit

getResultSetLimit

public Integer getResultSetLimit()
The resultSetLimit element specifies the maximum number of records that will be listed as a result of the lookup search.


completeValidation

public void completeValidation(Class rootBusinessObjectClass,
                               Class otherBusinessObjectClass)
Directly validate simple fields, call completeValidation on Definition fields.

Parameters:
rootBusinessObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
otherBusinessObjectClass - other stuff required to complete validation
See Also:
org.kuali.rice.kns.datadictionary.DataDictionaryDefinition#completeValidation(java.lang.Class, java.lang.Object)

hasExtraButtonSource

public boolean hasExtraButtonSource()
Returns:
true if this instance has extraButtonSource

getExtraButtonSource

public String getExtraButtonSource()
Returns:
extraButtonSource

setExtraButtonSource

public void setExtraButtonSource(String extraButtonSource)
The extraButton element is used to define additional buttons which will appear on the lookup screen next to the Search and Clear buttons. You can define the image source and additional html parameters for each button.

The extraButtonSource element defines the location of an image file to use for the extra button.

Throws:
IllegalArgumentException - if the given source is blank

hasExtraButtonParams

public boolean hasExtraButtonParams()
Returns:
true if this instance has extraButtonParams

getExtraButtonParams

public String getExtraButtonParams()
Returns:
extraButtonParams

setExtraButtonParams

public void setExtraButtonParams(String extraButtonParams)
The extraButton element is used to define additional buttons which will appear on the lookup screen next to the Search and Clear buttons. You can define the image source and additional html parameters for each button.

The extraButtonParams contains extra HTML parameters that be associated with the button.


hasSearchIconOverride

public boolean hasSearchIconOverride()
Returns:
true if this instance has an alternate icon to use for lookup icon

getSearchIconOverride

public String getSearchIconOverride()
Returns:
search icon override url

setSearchIconOverride

public void setSearchIconOverride(String searchIconOverride)
The searchIconOverride element is used to define alternative icons appear on the lookup screen next to the Search and Clear buttons. You can define the image source.

Throws:
IllegalArgumentException - if the given source is blank

toString

public String toString()
Overrides:
toString in class Object

setLookupFields

public void setLookupFields(List<FieldDefinition> lookupFields)
The lookupFields element defines the set of fields in which the user can enter values representing search selection criteria. A search result record will be returned only if the criteria entered in all the lookup fields are met.

DD: See LookupDefinition.java

JSTL: lookupFields is a Map which is accessed using a key of "lookupFields". This map contains the following keys: attributeName of first lookup field attributeName of second lookup field etc. The corresponding values are lookupField Export Maps. See LookupMapBuilder.java.

The lookupField element defines one lookup search criterion field. DD: See LookupDefinition.java.

JSTL: lookupField is a Map which is accessed by a key which is the attributeName of a lookup field. This map contains entries with the following keys: "attributeName" (String) "required" (boolean String)

lookupField attribute definitions:

required = true means that the user must enter something into the search criterion lookup field forceLookup = this attribute is not used noLookup = true means that field should not include magnifying glass (i.e. quickfinder)


setResultFields

public void setResultFields(List<FieldDefinition> resultFields)
The resultFields element specifies the list of fields that are shown as a result of the lookup search.

JSTL: resultFields is a Map which is accesseed by a key of "resultFields". This map contains entries with the following keys: attributeName of first result field attributeName of second result field etc. The corresponding values are ExportMap's

The ExportMaps are accessed using a key of attributeName. Each ExportMap contains a single entry as follows: "attributeName" The corresponding value is the attributeName of the field.

See LookupMapBuilder.java.


getNumOfColumns

public int getNumOfColumns()
Returns:
the numOfColumns

setNumOfColumns

public void setNumOfColumns(int numOfColumns)
Parameters:
numOfColumns - the numOfColumns to set

getHelpDefinition

public HelpDefinition getHelpDefinition()
Returns:
the helpDefinition

setHelpDefinition

public void setHelpDefinition(HelpDefinition helpDefinition)
Parameters:
helpDefinition - the helpDefinition to set

getHelpUrl

public String getHelpUrl()
Returns:
the helpUrl

setHelpUrl

public void setHelpUrl(String helpUrl)
Parameters:
helpUrl - the helpUrl to set

isTranslateCodes

public boolean isTranslateCodes()

setTranslateCodes

public void setTranslateCodes(boolean translateCodes)

isDisableSearchButtons

public boolean isDisableSearchButtons()

setDisableSearchButtons

public void setDisableSearchButtons(boolean disableSearchButtons)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.