org.kuali.rice.krad.lookup
Class LookupForm

java.lang.Object
  extended by org.kuali.rice.krad.web.form.UifFormBase
      extended by org.kuali.rice.krad.lookup.LookupForm
All Implemented Interfaces:
Serializable, ViewModel

public class LookupForm
extends UifFormBase

Form class containing backing data for LookupView.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.rice.krad.web.form.UifFormBase
actionParameters, addedCollectionItems, ajaxRequest, ajaxReturnType, attachmentFile, clientStateForSyncing, controllerMapping, dialogExplanation, dialogManager, dialogResponse, dirtyForm, extensionData, flowKey, focusId, formKey, formPostUrl, growlScript, historyFlow, historyManager, jumpToId, jumpToName, lightboxScript, methodToCall, newCollectionLines, pageId, queryParameters, readOnlyFieldsList, renderedInIframe, renderedInLightBox, requestedFormKey, requestRedirected, returnFormKey, returnLocation, selectedCollectionLines, selectedLookupResultsCache, sessionId, sessionTimeoutInterval, state, updateComponentId, view, viewId, viewName, viewPostMetadata, viewRequestParameters, viewsThatNeedDefaultValuesApplied, viewTypeName
 
Constructor Summary
LookupForm()
           
 
Method Summary
 String getDataObjectClassName()
          Class name for the data object the lookup should be performed against.
 Map<String,String> getFieldConversions()
          Map of conversions that should occur on the lookup return between properties on the lookup data object and properties on the calling view.
 Lookupable getLookupable()
          Returns an Lookupable instance associated with the lookup view.
 String getLookupCollectionId()
           
 String getLookupCollectionName()
          For the case of multi-value lookup, indicates the collection that should be populated with the return results.
 Map<String,String> getLookupCriteria()
          Map containing the criteria to be used for performing the search.
 Collection<?> getLookupResults()
          Holds the results of a search action.
 List<String> getMultiValueReturnFields()
          Holds the column names for the multi-value lookup selected values Note: as of KULRICE-12125 secure field names will not be stored in this parameter
 String getQuickfinderId()
          Id for the quickfinder that triggered the lookup action (if any).
 String getReferencesToRefresh()
          String containing references that should be refreshed when the lookup returns, passed back on the return URL.
 String getReturnTarget()
          Name of the window the lookup should return to.
 boolean isDisplayResults()
           
 boolean isMultipleValuesSelect()
          Indicates whether multiple values select should be enabled for the lookup.
 boolean isRedirectedLookup()
          Indicates whether the requested was redirected from the lookup framework due to an external object request.
 boolean isReturnByScript()
          Indicates whether the return value from the lookup should occur through script or a server side post (default is false, server side post).
 void postBind(javax.servlet.http.HttpServletRequest request)
          Picks out data object name from the request to retrieve a lookupable and for the initial get request populates the getFieldConversions() property.
 void setDataObjectClassName(String dataObjectClassName)
          Setter for getDataObjectClassName()
 void setDisplayResults(boolean displayResults)
           
 void setFieldConversions(Map<String,String> fieldConversions)
           
 void setLookupCollectionId(String lookupCollectionId)
           
 void setLookupCollectionName(String lookupCollectionName)
           
 void setLookupCriteria(Map<String,String> lookupCriteria)
           
 void setLookupResults(Collection<?> lookupResults)
           
 void setMultipleValuesSelect(boolean multipleValuesSelect)
           
 void setMultiValueReturnFields(List<String> multiValueReturnFields)
           
 void setQuickfinderId(String quickfinderId)
           
 void setRedirectedLookup(boolean redirectedLookup)
           
 void setReferencesToRefresh(String referencesToRefresh)
           
 void setReturnByScript(boolean returnByScript)
           
 void setReturnTarget(String returnTarget)
          org.kuali.rice.krad.lookup.LookupForm#getReturnTarget()
 
Methods inherited from class org.kuali.rice.krad.web.form.UifFormBase
addViewThatNeedsDefaultValuesApplied, generateFormKey, getActionEvent, getActionParamaterValue, getActionParameters, getActionParametersAsProperties, getAddedCollectionItems, getAjaxReturnType, getAttachmentFile, getClientStateForSyncing, getControllerMapping, getDialogExplanation, getDialogManager, getDialogResponse, getExtensionData, getFlowKey, getFocusId, getFormKey, getFormPostUrl, getGrowlScript, getHistoryFlow, getHistoryManager, getInitialRequestParameters, getJumpToId, getJumpToName, getLightboxScript, getMethodToCall, getNewCollectionLines, getPageId, getQueryParameters, getReadOnlyFieldsList, getRequestedFormKey, getRequestJsonTemplate, getRequestUrl, getReturnFormKey, getReturnLocation, getSelectedCollectionLines, getSelectedLookupResultsCache, getSessionId, getSessionTimeoutInterval, getState, getUpdateComponent, getUpdateComponentId, getView, getViewHelperService, getViewId, getViewName, getViewPostMetadata, getViewRequestParameters, getViewService, getViewsThatNeedDefaultValuesApplied, getViewTypeName, isAddedCollectionItem, isAjaxRequest, isCollectionPagingRequest, isDirtyForm, isJsonRequest, isRenderedInIframe, isRenderedInLightBox, isRequestRedirected, isUpdateComponentRequest, isUpdateDialogRequest, isUpdateNoneRequest, isUpdatePageRequest, preBind, setActionParameters, setAddedCollectionItems, setAjaxRequest, setAjaxReturnType, setAttachmentFile, setClientStateForSyncing, setCollectionPagingRequest, setDialogExplanation, setDialogManager, setDialogResponse, setDirtyForm, setDirtyForm, setExtensionData, setFlowKey, setFocusId, setFormKey, setFormPostUrl, setGrowlScript, setHistoryFlow, setHistoryManager, setInitialRequestParameters, setJumpToId, setJumpToName, setLightboxScript, setMethodToCall, setNewCollectionLines, setPageId, setQueryParameters, setReadOnlyFieldsList, setRenderedInIframe, setRenderedInLightBox, setRequestedFormKey, setRequestJsonTemplate, setRequestRedirected, setRequestUrl, setReturnFormKey, setReturnLocation, setSelectedCollectionLines, setSelectedLookupResultsCache, setState, setUpdateComponent, setUpdateComponentId, setView, setViewId, setViewName, setViewPostMetadata, setViewRequestParameters, setViewsThatNeedDefaultValuesApplied, setViewTypeName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LookupForm

public LookupForm()
Method Detail

postBind

public void postBind(javax.servlet.http.HttpServletRequest request)
Picks out data object name from the request to retrieve a lookupable and for the initial get request populates the getFieldConversions() property. Called after Spring binds the request to the form and before the controller method is invoked

Specified by:
postBind in interface ViewModel
Overrides:
postBind in class UifFormBase
Parameters:
request - - request object containing the query parameters
See Also:
ViewModel.postBind(javax.servlet.http.HttpServletRequest)

getLookupable

public Lookupable getLookupable()
Returns an Lookupable instance associated with the lookup view.

Returns:
Lookupable instance or null if one does not exist

getDataObjectClassName

public String getDataObjectClassName()
Class name for the data object the lookup should be performed against.

The object class name is used to pick up a dictionary entry which will feed the attribute field definitions and other configuration. In addition it is to configure the Lookupable which will carry out the search action

Returns:
lookup data object class

setDataObjectClassName

public void setDataObjectClassName(String dataObjectClassName)
Setter for getDataObjectClassName()

Parameters:
dataObjectClassName - property value

isMultipleValuesSelect

public boolean isMultipleValuesSelect()
Indicates whether multiple values select should be enabled for the lookup.

When set to true, the select field is enabled for the lookup results group that allows the user to select one or more rows for returning

Returns:
boolean true if multiple values should be enabled, false otherwise

setMultipleValuesSelect

public void setMultipleValuesSelect(boolean multipleValuesSelect)
See Also:
isMultipleValuesSelect()

isRedirectedLookup

public boolean isRedirectedLookup()
Indicates whether the requested was redirected from the lookup framework due to an external object request.

This prevents the framework from performing another redirect check

Returns:
boolean true if request was a redirect, false if not

setRedirectedLookup

public void setRedirectedLookup(boolean redirectedLookup)
See Also:
isRedirectedLookup()

isReturnByScript

public boolean isReturnByScript()
Indicates whether the return value from the lookup should occur through script or a server side post (default is false, server side post).

Returns:
boolean true if return should occur though script, false if return should be done through server side post

setReturnByScript

public void setReturnByScript(boolean returnByScript)
See Also:
isReturnByScript()

getReturnTarget

public String getReturnTarget()
Name of the window the lookup should return to.

The lookup can be invoked from several different contexts: new tab, lightbox within top window, lightbox within portal window. When the request is made, this parameter can be sent to specify the target for the return links.

Returns:
String return target window name

setReturnTarget

public void setReturnTarget(String returnTarget)
org.kuali.rice.krad.lookup.LookupForm#getReturnTarget()


getLookupCollectionName

public String getLookupCollectionName()
For the case of multi-value lookup, indicates the collection that should be populated with the return results.

Returns:
String collection name (must be full binding path)

setLookupCollectionName

public void setLookupCollectionName(String lookupCollectionName)
See Also:
getLookupCollectionName()

getLookupCollectionId

public String getLookupCollectionId()

setLookupCollectionId

public void setLookupCollectionId(String lookupCollectionId)

getReferencesToRefresh

public String getReferencesToRefresh()
String containing references that should be refreshed when the lookup returns, passed back on the return URL.

Returns:
String containing references that should be refreshed on return from lookup

setReferencesToRefresh

public void setReferencesToRefresh(String referencesToRefresh)
See Also:
getReferencesToRefresh()

getQuickfinderId

public String getQuickfinderId()
Id for the quickfinder that triggered the lookup action (if any).

When the lookup is triggered from a quickfinder, the return URLs will be present on the lookup results. In addition, the quickfinder id is passed back on the return URL so the caller can perform logic based on which quickfinder was invoked.

Returns:
String id for quickfinder that invoked the lookup

setQuickfinderId

public void setQuickfinderId(String quickfinderId)
See Also:
getQuickfinderId()

getFieldConversions

public Map<String,String> getFieldConversions()
Map of conversions that should occur on the lookup return between properties on the lookup data object and properties on the calling view.

When a lookup is invoked from a calling view, the purpose is to return one or more values that will populate fields on the calling view. To accomplish this, values for properties on the selected record are passed back on the URL as values for properties on the calling view. This map specifies which properties on the lookup data object should be pulled, and for each one what is the property on the caller to send the value back as.

For example, suppose the map contained the entries id:document.bookId and title:document.bookTitle. When the return URL is selected for a record, the value for the id property will be retrieved and added to the return URL query string as 'document.bookId={idValue}'. Likewise the value for the title property will be pulled and added to the return URL query string as 'document.bookTitle={titleValue}'. So the query string will contain something like 'document.bookId=3&document.bookTitle=Animals'

Returns:
Map of field conversions, each entry is a conversion between two properties. Key is property name on the lookup data object, entry value is the property name on the calling view/model

setFieldConversions

public void setFieldConversions(Map<String,String> fieldConversions)
See Also:
getFieldConversions()

getMultiValueReturnFields

public List<String> getMultiValueReturnFields()
Holds the column names for the multi-value lookup selected values Note: as of KULRICE-12125 secure field names will not be stored in this parameter

Returns:
a list of column names for the multi-value lookup

setMultiValueReturnFields

public void setMultiValueReturnFields(List<String> multiValueReturnFields)
See Also:
getMultiValueReturnFields()

getLookupCriteria

public Map<String,String> getLookupCriteria()
Map containing the criteria to be used for performing the search.

Fields that are defined in the LookupView.getCriteriaGroup() bind to this map. The key of the map is the property path specified for the field, and the value of the map is the search value (if any) entered by the user. This map is then passed into the Lookupable to carry out the search.

Returns:
Map of search criteria where key is the property the criteria will be applied to and the value is the search value entered by the user (if any)

setLookupCriteria

public void setLookupCriteria(Map<String,String> lookupCriteria)
See Also:
getLookupCriteria()

getLookupResults

public Collection<?> getLookupResults()
Holds the results of a search action.

After the search action is invoked, the results of the search will be held by this property. The LookupView.getResultsGroup() binds to this property for displaying the results.

Returns:
Collection of data objects that are the result of a search

setLookupResults

public void setLookupResults(Collection<?> lookupResults)
See Also:
getLookupResults()

isDisplayResults

public boolean isDisplayResults()

setDisplayResults

public void setDisplayResults(boolean displayResults)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.