Class UifFormBase

java.lang.Object
org.kuali.rice.krad.web.form.UifFormBase
All Implemented Interfaces:
Serializable, ViewModel
Direct Known Subclasses:
DocumentFormBase, DummyLoginForm, DynaForm, IncidentReportForm, InitiatedDocumentInfoForm, InquiryForm, LookupForm, SessionTimeoutForm

public class UifFormBase extends Object implements ViewModel
Base form class for views within the KRAD User Interface Framework.

Holds properties necessary to determine the View instance that will be used to render the user interface

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Field Details

  • Constructor Details

    • UifFormBase

      public UifFormBase()
  • Method Details

    • preBind

      public void preBind(javax.servlet.http.HttpServletRequest request)
      Called before Spring binds the request to the form to allow for pre-processing before setting values.
      Specified by:
      preBind in interface ViewModel
      Parameters:
      request - request object containing the query parameters
    • postBind

      public void postBind(javax.servlet.http.HttpServletRequest request)
      Called after Spring binds the request to the form and before the controller method is invoked
      Specified by:
      postBind in interface ViewModel
      Parameters:
      request - request object containing the query parameters
    • preRender

      public void preRender(javax.servlet.http.HttpServletRequest request)
      Called after the controller has finished executing, but before rendering occurs.
      Specified by:
      preRender in interface ViewModel
      Parameters:
      request - request object containing the query parameters
    • generateFormKey

      protected String generateFormKey()
      Creates the unique id used to store this "conversation" in the session. The default method generates a java UUID.
      Returns:
      UUID
    • getViewId

      public String getViewId()
      Description copied from interface: ViewModel
      Unique Id for the View instance. This is specified for a view in its definition by setting the 'id' property.
      Specified by:
      getViewId in interface ViewModel
      Returns:
      String view id
      See Also:
    • setViewId

      public void setViewId(String viewId)
      Description copied from interface: ViewModel
      Setter for the unique view id
      Specified by:
      setViewId in interface ViewModel
      Parameters:
      viewId -
      See Also:
    • getViewName

      public String getViewName()
      Description copied from interface: ViewModel
      Name for the View instance. This is specified for a view in its definition by setting the 'id' property. The name is not necessary unique and cannot be used by itself to retrieve a view. Typically it is used with other parameters to identify a view with a certain type (view type)
      Specified by:
      getViewName in interface ViewModel
      Returns:
      String view name
      See Also:
    • setViewName

      public void setViewName(String viewName)
      Description copied from interface: ViewModel
      Setter for the view name
      Specified by:
      setViewName in interface ViewModel
      Parameters:
      viewName -
      See Also:
    • getViewTypeName

      public UifConstants.ViewType getViewTypeName()
      Description copied from interface: ViewModel
      Name for the type of view being requested. This can be used to find View instances by request parameters (not necessary the unique id)
      Specified by:
      getViewTypeName in interface ViewModel
      Returns:
      String view type name
      See Also:
    • setViewTypeName

      public void setViewTypeName(UifConstants.ViewType viewTypeName)
      Description copied from interface: ViewModel
      Setter for the view type name
      Specified by:
      setViewTypeName in interface ViewModel
      Parameters:
      viewTypeName -
      See Also:
    • getPageId

      public String getPageId()
      Description copied from interface: ViewModel
      Id for the current page being displayed within the view
      Specified by:
      getPageId in interface ViewModel
      Returns:
      String page id
      See Also:
    • setPageId

      public void setPageId(String pageId)
      Description copied from interface: ViewModel
      Setter for the current page id
      Specified by:
      setPageId in interface ViewModel
      Parameters:
      pageId -
      See Also:
    • getFormPostUrl

      public String getFormPostUrl()
      Description copied from interface: ViewModel
      URL the form generated for the view should post to
      Specified by:
      getFormPostUrl in interface ViewModel
      Returns:
      String form post URL
      See Also:
    • setFormPostUrl

      public void setFormPostUrl(String formPostUrl)
      Description copied from interface: ViewModel
      Setter for the form post URL
      Specified by:
      setFormPostUrl in interface ViewModel
      Parameters:
      formPostUrl -
      See Also:
    • getControllerMapping

      public String getControllerMapping()
      Name of the controllerMapping for this form (includes slash)
      Returns:
      the controllerMapping string
    • getHistoryFlow

      public HistoryFlow getHistoryFlow()
      The current HistoryFlow for this form which stores a trail of urls/breadcrumbs primarily used for path-based breadcrumb display
      Returns:
      the HistoryFlow
    • setHistoryFlow

      public void setHistoryFlow(HistoryFlow historyFlow)
      Set the current HistoryFlow for this form
    • getHistoryManager

      public HistoryManager getHistoryManager()
      The current HistoryManager that was pulled from session which store all HistoryFlow objects in the current session to keep track of the path the user has taken across views (primarily used by path-based breadcrumbs)
      Returns:
      the HistoryManager
    • setHistoryManager

      public void setHistoryManager(HistoryManager historyManager)
      Set the current HistoryManager
    • getFlowKey

      public String getFlowKey()
      The flowKey representing the HistoryFlow this form may be in.

      This allows for a flow to continue by key or start (if set to "start"). If null or blank, no flow (or path based breadcrumbs) are being tracked.

      Returns:
      the flowKey
    • setFlowKey

      public void setFlowKey(String flowKey)
      Set the flowKey
    • getRequestUrl

      public String getRequestUrl()
      The original requestUrl for the View represented by this form (url received by the controller for initial request)
      Returns:
      the requestUrl
    • setRequestUrl

      public void setRequestUrl(String requestUrl)
      Set the requestUrl
    • getInitialRequestParameters

      public Map<String,String[]> getInitialRequestParameters()
      The requestParameters represent all the parameters in the query string that were initially passed to this View by the initial request
      Returns:
      the requestParameters
    • setInitialRequestParameters

      public void setInitialRequestParameters(Map<String,String[]> requestParameters)
      Set the requestParameters
    • getReturnLocation

      public String getReturnLocation()
    • setReturnLocation

      public void setReturnLocation(String returnLocation)
    • getReturnFormKey

      public String getReturnFormKey()
    • setReturnFormKey

      public void setReturnFormKey(String returnFormKey)
    • getSessionId

      public String getSessionId()
      Holds the id for the user's current session

      The user's session id is used to track when a timeout has occurred and enforce the policy configured with the ViewSessionPolicy. This property gets initialized in the postBind(javax.servlet.http.HttpServletRequest) method and then is written out as a hidden on the view. Therefore each post done on the view will send back the session id when the view was rendering, and the UifSessionTimeoutFilter can use that to determine if a timeout has occurred

      Returns:
      id for the user's current session
    • getSessionTimeoutInterval

      public int getSessionTimeoutInterval()
      Holds the configured session timeout interval

      Holds the session timeout interval so it can be referenced to give the user notifications (for example the session timeout warning reads this property). This is initialized from the session object in postBind(javax.servlet.http.HttpServletRequest)

      Returns:
      amount of time in milliseconds before the session will timeout
    • getMethodToCall

      public String getMethodToCall()
      Identifies the controller method that should be invoked to fulfill a request. The value will be matched up against the 'params' setting on the RequestMapping annotation for the controller method
      Returns:
      String method to call
    • setMethodToCall

      public void setMethodToCall(String methodToCall)
      Setter for the method to call
    • getViewRequestParameters

      public Map<String,String> getViewRequestParameters()
      Map of parameters that was used to configured the View. Maintained on the form to rebuild the view on posts and session timeout
      Specified by:
      getViewRequestParameters in interface ViewModel
      Returns:
      Mapinvalid input: '<'String, String> view parameters
    • setViewRequestParameters

      public void setViewRequestParameters(Map<String,String> viewRequestParameters)
      Setter for the view's request parameter map
      Specified by:
      setViewRequestParameters in interface ViewModel
      Parameters:
      viewRequestParameters - map of request parameters
    • getReadOnlyFieldsList

      public List<String> getReadOnlyFieldsList()
      List of fields that should be read only on the view

      If the view being rendered supports request setting of read-only fields, the readOnlyFields request parameter can be sent to mark fields as read only that might not have been otherwise

      Note the paths specified should be the simple property names (not the full binding path). Therefore if the property name appears multiple times in the view, all instances will be set as read only

      Specified by:
      getReadOnlyFieldsList in interface ViewModel
      Returns:
      List<String> read only property names
      See Also:
    • setReadOnlyFieldsList

      public void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
      Setter for the list of read only fields
      Specified by:
      setReadOnlyFieldsList in interface ViewModel
    • getNewCollectionLines

      public Map<String,Object> getNewCollectionLines()
      Description copied from interface: ViewModel
      Holds instances for collection add lines. The key of the Map gives the collection name the line instance applies to, the Map value is an instance of the collection object class that holds the new line data
      Specified by:
      getNewCollectionLines in interface ViewModel
      Returns:
      Mapinvalid input: '<'String, Object> new collection lines
      See Also:
    • setNewCollectionLines

      public void setNewCollectionLines(Map<String,Object> newCollectionLines)
      Setter for the new collection lines Map
      Specified by:
      setNewCollectionLines in interface ViewModel
      Parameters:
      newCollectionLines -
    • getTriggerActionId

      public String getTriggerActionId()
      When the request has been triggered by an action component, gives the id for the action.
      Specified by:
      getTriggerActionId in interface ViewModel
      Returns:
      String action id, or null if request was not triggered by an action component
    • setTriggerActionId

      public void setTriggerActionId(String triggerActionId)
      Specified by:
      setTriggerActionId in interface ViewModel
      See Also:
    • getActionParameters

      public Map<String,String> getActionParameters()
      Description copied from interface: ViewModel
      Map of parameters sent for the invoked action

      Many times besides just setting the method to call actions need to send additional parameters. For instance the method being called might do a redirect, in which case the action needs to send parameters for the redirect URL. An example of this is redirecting to a Lookup view. In some cases the parameters that need to be sent conflict with properties already on the form, and putting all the action parameters as form properties would grow massive (in addition to adds an additional step from the XML config). So this general map solves those issues.

      Specified by:
      getActionParameters in interface ViewModel
      Returns:
      Mapinvalid input: '<'String, String> action parameters
      See Also:
    • getActionParametersAsProperties

      public Properties getActionParametersAsProperties()
      Returns the action parameters map as a Properties instance
      Returns:
      Properties action parameters
    • setActionParameters

      public void setActionParameters(Map<String,String> actionParameters)
      Setter for the action parameters map
      Specified by:
      setActionParameters in interface ViewModel
      Parameters:
      actionParameters -
    • getActionParamaterValue

      public String getActionParamaterValue(String actionParameterName)
      Retrieves the value for the given action parameter, or empty string if not found
      Parameters:
      actionParameterName - - name of the action parameter to retrieve value for
      Returns:
      String parameter value or empty string
    • getActionEvent

      public String getActionEvent()
      Returns the action event that was sent in the action parameters (if any)

      The action event is a special action parameter that can be sent to indicate a type of action being taken. This can be looked at by the view or components to render differently

      TODO: make sure action parameters are getting reinitialized on each request
      Returns:
      String action event name or blank if action event was not sent
    • getClientStateForSyncing

      public Map<String,Object> getClientStateForSyncing()
      Description copied from interface: ViewModel
      Map that is populated from the component state maintained on the client

      Used when a request is made that refreshes part of the view. The current state for components (which have state that can be changed on the client), is populated into this map which is then used by the ViewHelperService to update the components so that the state is maintained when they render.

      Specified by:
      getClientStateForSyncing in interface ViewModel
      Returns:
      Mapinvalid input: '<'String, Object> map where key is name of property or component id, and value is the property value or another map of component key/value pairs
      See Also:
    • setClientStateForSyncing

      public void setClientStateForSyncing(Map<String,Object> clientStateForSyncing)
      Setter for the client state
    • getSelectedCollectionLines

      public Map<String,Set<String>> getSelectedCollectionLines()
      Description copied from interface: ViewModel
      Holds Set of String identifiers for lines that were selected in a collection from a single page. selectedCollectionLines are request level values and get reset with every page request

      When the select field is enabled for a CollectionGroup, the framework will be default bind the selected identifier strings to this property. The key of the map uniquely identifies the collection by the full binding path to the collection, and the value is a set of Strings for the checked lines.

      Specified by:
      getSelectedCollectionLines in interface ViewModel
      Returns:
      Map<String, Set<String>> map of collections and their selected lines
      See Also:
    • setSelectedCollectionLines

      public void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
      Setter for the map that holds selected collection lines
      Specified by:
      setSelectedCollectionLines in interface ViewModel
    • getSelectedLookupResultsCache

      public Set<String> getSelectedLookupResultsCache()
      Holds Set of String identifiers for lines that were selected in a lookup collection results across multiple pages. The value in the cache is preserved in the session across multiple requests. This allows for the server side paging of results to retain the user choices as they move through the pages.
      Returns:
      set of identifiers
    • setSelectedLookupResultsCache

      public void setSelectedLookupResultsCache(Set<String> selectedLookupResultsCache)
      Sets the lookup result selection cache values
    • getFormKey

      public String getFormKey()
      Key string that identifies the form instance in session storage

      When the view is posted, the previous form instance is retrieved and then populated from the request parameters. This key string is retrieve the session form from the session service

      Returns:
      String form session key
    • setFormKey

      public void setFormKey(String formKey)
      Setter for the form's session key
    • getRequestedFormKey

      public String getRequestedFormKey()
      This is the formKey sent on the original request. It may differ from the actual form key stored in formKey based on if the form still exists in session by this key or not.
      Returns:
      the original requested form key
    • setRequestedFormKey

      public void setRequestedFormKey(String requestedFormKey)
      Set the requestedFormKey
    • isRequestRedirected

      public boolean isRequestRedirected()
      Indicates whether a redirect has been requested for the view
      Returns:
      boolean true if redirect was requested, false if not
    • setRequestRedirected

      public void setRequestRedirected(boolean requestRedirected)
      Setter for the request redirect indicator
    • getAttachmentFile

      public org.springframework.web.multipart.MultipartFile getAttachmentFile()
      Holder for files that are attached through the view
      Returns:
      MultipartFile representing the attachment
    • setAttachmentFile

      public void setAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile)
      Setter for the form's attachment file
    • getUpdateComponentId

      public String getUpdateComponentId()
      Description copied from interface: ViewModel
      Id for the component that should be updated for a component refresh process
      Specified by:
      getUpdateComponentId in interface ViewModel
      Returns:
      String component id
      See Also:
    • setUpdateComponentId

      public void setUpdateComponentId(String updateComponentId)
      Description copied from interface: ViewModel
      Setter for the component id that should be refreshed
      Specified by:
      setUpdateComponentId in interface ViewModel
      Parameters:
      updateComponentId -
      See Also:
    • getUpdateComponent

      public Component getUpdateComponent()
      Description copied from interface: ViewModel
      Component instance that been built for a refresh/disclosure request.

      This is generally set by org.kuali.rice.krad.uif.lifecycle.ViewLifecycle#performComponentLifecycle(org.kuali.rice.krad.uif.view.View, java.lang.Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.kuali.rice.krad.uif.lifecycle.ViewPostMetadata, java.lang.String) after processing the lifecycle. The form property provides access to the rendering layer.

      Specified by:
      getUpdateComponent in interface ViewModel
      Returns:
      component instance for updating
      See Also:
    • setUpdateComponent

      public void setUpdateComponent(Component updateComponent)
      Specified by:
      setUpdateComponent in interface ViewModel
      See Also:
    • getView

      public View getView()
      Description copied from interface: ViewModel
      View instance associated with the model. Used to render the user interface
      Specified by:
      getView in interface ViewModel
      Returns:
      View
      See Also:
    • setView

      public void setView(View view)
      Description copied from interface: ViewModel
      Setter for the view instance
      Specified by:
      setView in interface ViewModel
      Parameters:
      view -
      See Also:
    • getViewHelperService

      public ViewHelperService getViewHelperService()
      Returns an instance of the view's configured view helper service.

      First checks if there is an initialized view containing a view helper instance. If not, and there is a view id on the form, a call is made to retrieve the view helper instance or class configuration.

      Returns the view helper service instance that was configured for the current view.
      Specified by:
      getViewHelperService in interface ViewModel
      Returns:
      instance of view helper service, null if view is null
    • getViewPostMetadata

      public ViewPostMetadata getViewPostMetadata()
      Gets the ViewPostMetadata that has been built up from processing of a view.

      The view post metadata is used to read information about the view that was rendered when a post occurs. For example, you might need to check whether a particular flag was enabled for the rendered view when processing the post logic

      Specified by:
      getViewPostMetadata in interface ViewModel
      Returns:
      ViewPostMetadata instance for the previously processed view
    • setViewPostMetadata

      public void setViewPostMetadata(ViewPostMetadata viewPostMetadata)
      Specified by:
      setViewPostMetadata in interface ViewModel
      See Also:
    • getViewService

      protected ViewService getViewService()
      Instance of the ViewService that can be used to retrieve View instances
      Returns:
      ViewService implementation
    • getJumpToId

      public String getJumpToId()
      The jumpToId for this form, the element with this id will be jumped to automatically when the form is loaded in the view. Using "TOP" or "BOTTOM" will jump to the top or the bottom of the resulting page. jumpToId always takes precedence over jumpToName, if set.
      Returns:
      the jumpToId
    • setJumpToId

      public void setJumpToId(String jumpToId)
      Parameters:
      jumpToId - the jumpToId to set
    • getJumpToName

      public String getJumpToName()
      The jumpToName for this form, the element with this name will be jumped to automatically when the form is loaded in the view. WARNING: jumpToId always takes precedence over jumpToName, if set.
      Returns:
      the jumpToName
    • setJumpToName

      public void setJumpToName(String jumpToName)
      Parameters:
      jumpToName - the jumpToName to set
    • getFocusId

      public String getFocusId()
      Field to place focus on when the page loads An empty focusId will result in focusing on the first visible input element by default.
      Returns:
      the focusId
    • setFocusId

      public void setFocusId(String focusId)
      Parameters:
      focusId - the focusId to set
    • isDirtyForm

      public boolean isDirtyForm()
      True when the form is considered dirty (data has changed from original value), false otherwise

      For most scenarios, this flag should NOT be set to true. If this is set, it must be managed explicitly by the application. This flag exists for marking a form dirty from a server call, so it must be changed to false when the form is no longer considered dirty. The krad save Action and navigate methodToCall resets this flag back to false, but any other setting of this flag must be managed by custom configuration/methods, if custom dirtyForm management is needed.

      Returns:
      true if the form is considered dirty, false otherwise
    • setDirtyForm

      public void setDirtyForm(boolean dirtyForm)
      Sets the dirtyForm flag

      For most scenarios, this flag should NOT be set to true. If this is set, it must be managed explicitly by the application. This flag exists for marking a form dirty from a server call, so it must be changed to false when the form is no longer considered dirty. The krad save Action and navigate methodToCall resets this flag back to false, but any other setting of this flag must be managed by custom configuration/methods, if custom dirtyForm management is needed.

    • setDirtyForm

      public void setDirtyForm(String dirtyForm)
      Set the dirtyForm flag using a String that will be converted to boolean
    • isRenderedInDialog

      public boolean isRenderedInDialog()
      Indicates whether the view is rendered within a lightbox

      Some discussion (for example how a close button behaves) need to change based on whether the view is rendered within a lightbox or the standard browser window. This boolean is true when it is within a lightbox

      Returns:
      boolean true if view is rendered within a lightbox, false if not
    • setRenderedInDialog

      public void setRenderedInDialog(boolean renderedInDialog)
      Setter for the rendered within lightbox indicator
    • isRenderedInIframe

      public boolean isRenderedInIframe()
      Indicates whether the view is rendered within an iframe (this setting must be passed to the View on the url)
      Returns:
      boolean true if view is rendered within a iframe, false if not
    • setRenderedInIframe

      public void setRenderedInIframe(boolean renderedInIframe)
      See Also:
    • isApplyDefaultValues

      public boolean isApplyDefaultValues()
      Description copied from interface: ViewModel
      Indicates whether default values should be applied.

      Default field values of a view need to be applied after the view life cycle completes. Otherwise, they risk getting over written.

      Specified by:
      isApplyDefaultValues in interface ViewModel
      Returns:
      boolean true if the request was an ajax call, false if not
      See Also:
    • setApplyDefaultValues

      public void setApplyDefaultValues(boolean applyDefaultValues)
      Description copied from interface: ViewModel
      Set whether default values should be applied to the view
      Specified by:
      setApplyDefaultValues in interface ViewModel
      See Also:
    • isEvaluateFlagsAndModes

      public boolean isEvaluateFlagsAndModes()
      Description copied from interface: ViewModel
      Determines whether edit modes and action flags should be evaluated.

      Initially this will be true causing edit modes and action flags to be evaluated on the initial request to a view. If these need to be reevaluated at some point (for a particular view instance), this flag can be set to true and causing the authorization to be reevaluated during the lifecycle.

      Specified by:
      isEvaluateFlagsAndModes in interface ViewModel
      Returns:
      boolean true if flags and modes should be evaluate during the view lifecycle, false if not
      See Also:
    • setEvaluateFlagsAndModes

      public void setEvaluateFlagsAndModes(boolean evaluateFlagsAndModes)
      Specified by:
      setEvaluateFlagsAndModes in interface ViewModel
      See Also:
    • isCanEditView

      public Boolean isCanEditView()
      Description copied from interface: ViewModel
      Copy of the edit view flag to be used by subsequent requests (so they don't need to be evaluated on each request).

      If null, edit check will be performed

      Specified by:
      isCanEditView in interface ViewModel
      See Also:
    • setCanEditView

      public void setCanEditView(Boolean canEditView)
      Specified by:
      setCanEditView in interface ViewModel
      See Also:
    • getActionFlags

      public Map<String,Boolean> getActionFlags()
      Description copied from interface: ViewModel
      Copy of the action flags on the view to be used by subsequent requests (so they don't need to be evaluated on each request).
      Specified by:
      getActionFlags in interface ViewModel
      See Also:
    • setActionFlags

      public void setActionFlags(Map<String,Boolean> actionFlags)
      Specified by:
      setActionFlags in interface ViewModel
      See Also:
    • getEditModes

      public Map<String,Boolean> getEditModes()
      Description copied from interface: ViewModel
      Copy of the edit modes on the view to be used by subsequent requests (so they don't need to be evaluated on each request).
      Specified by:
      getEditModes in interface ViewModel
      See Also:
    • setEditModes

      public void setEditModes(Map<String,Boolean> editModes)
      Specified by:
      setEditModes in interface ViewModel
      See Also:
    • getGrowlScript

      public String getGrowlScript()
      Description copied from interface: ViewModel
      Script that will run on render (view or component) for generating growl messages
      Specified by:
      getGrowlScript in interface ViewModel
      Returns:
      String JS growl script
      See Also:
    • setGrowlScript

      public void setGrowlScript(String growlScript)
      Description copied from interface: ViewModel
      Setter for the script that generates growls on render
      Specified by:
      setGrowlScript in interface ViewModel
      Parameters:
      growlScript -
      See Also:
    • getState

      public String getState()
      Description copied from interface: ViewModel
      Gets the state. This is the default location for state on KRAD forms.
      Specified by:
      getState in interface ViewModel
      Returns:
      the state
      See Also:
    • setState

      public void setState(String state)
      Description copied from interface: ViewModel
      Set the state
      Specified by:
      setState in interface ViewModel
      Parameters:
      state -
      See Also:
    • isAjaxRequest

      public boolean isAjaxRequest()
      Description copied from interface: ViewModel
      Indicates whether the request was made by an ajax call

      Depending on whether the request was made via ajax (versus standard browser submit) the response will be handled different. For example with an ajax request we can send back partial page updates, which cannot be done with standard submits

      If this indicator is true, ViewModel.getAjaxReturnType() will be used to determine how to handling the ajax return

      Specified by:
      isAjaxRequest in interface ViewModel
      Returns:
      boolean true if the request was an ajax call, false if not
      See Also:
    • setAjaxRequest

      public void setAjaxRequest(boolean ajaxRequest)
      Description copied from interface: ViewModel
      Set the ajaxRequest
      Specified by:
      setAjaxRequest in interface ViewModel
      Parameters:
      ajaxRequest -
      See Also:
    • getAjaxReturnType

      public String getAjaxReturnType()
      Description copied from interface: ViewModel
      Gets the return type for the ajax call

      The ajax return type indicates how the response content will be handled in the client. Typical examples include updating a component, the page, or doing a redirect.

      Specified by:
      getAjaxReturnType in interface ViewModel
      Returns:
      String return type
      See Also:
    • setAjaxReturnType

      public void setAjaxReturnType(String ajaxReturnType)
      Description copied from interface: ViewModel
      Setter for the type of ajax return
      Specified by:
      setAjaxReturnType in interface ViewModel
      Parameters:
      ajaxReturnType -
      See Also:
    • isUpdateComponentRequest

      public boolean isUpdateComponentRequest()
      Description copied from interface: ViewModel
      Indicates whether the request is to update a component (only applicable for ajax requests)
      Specified by:
      isUpdateComponentRequest in interface ViewModel
      Returns:
      boolean true if the request is for update component, false if not
      See Also:
    • isUpdateDialogRequest

      public boolean isUpdateDialogRequest()
      Description copied from interface: ViewModel
      Indicates whether the request is to update a dialog (only applicable for ajax requests)
      Specified by:
      isUpdateDialogRequest in interface ViewModel
      Returns:
      boolean true if the request is for update dialog, false if not
      See Also:
    • isUpdatePageRequest

      public boolean isUpdatePageRequest()
      Description copied from interface: ViewModel
      Indicates whether the request is to update a page (only applicable for ajax requests)
      Specified by:
      isUpdatePageRequest in interface ViewModel
      Returns:
      boolean true if the request is for update page, false if not
      See Also:
    • isUpdateNoneRequest

      public boolean isUpdateNoneRequest()
      Description copied from interface: ViewModel
      Indicates whether the request is for a non-update of the view (only applicable for ajax requests)

      Examples of requests that do not update the view are ajax queries or requests that download a file

      Specified by:
      isUpdateNoneRequest in interface ViewModel
      Returns:
      boolean true if the request is for non-update, false if not
      See Also:
    • isJsonRequest

      public boolean isJsonRequest()
      Description copied from interface: ViewModel
      Indicates whether the request should return a JSON string

      When this indicator is true, the rendering process will invoke the template given by ViewModel.getRequestJsonTemplate() which should return a JSON string

      For JSON requests the view is not built, however a component can be retrieved and exported in the request by setting ViewModel.getUpdateComponentId()

      Specified by:
      isJsonRequest in interface ViewModel
      Returns:
      boolean true if request is for JSON, false if not
      See Also:
    • getRequestJsonTemplate

      public String getRequestJsonTemplate()
      Description copied from interface: ViewModel
      Template the will be invoked to return a JSON string

      Certain templates can be rendered to build JSON for a JSON request. The template set here (by a controller) will be rendered

      Specified by:
      getRequestJsonTemplate in interface ViewModel
      Returns:
      path to template
      See Also:
    • setRequestJsonTemplate

      public void setRequestJsonTemplate(String requestJsonTemplate)
      Description copied from interface: ViewModel
      Setter for the template to render for the request
      Specified by:
      setRequestJsonTemplate in interface ViewModel
      Parameters:
      requestJsonTemplate -
      See Also:
    • isCollectionPagingRequest

      public boolean isCollectionPagingRequest()
      Indicates whether the request is for paging a collection (or sorting).
      Specified by:
      isCollectionPagingRequest in interface ViewModel
      Returns:
      boolean true if a paging request is present, false if not
    • setCollectionPagingRequest

      public void setCollectionPagingRequest(boolean collectionPagingRequest)
      Specified by:
      setCollectionPagingRequest in interface ViewModel
      See Also:
    • getShowDialogId

      public String getShowDialogId()
      For cases where the request was triggered from within a dialog, we want to show that dialog, identified by this id, again.
    • setShowDialogId

      public void setShowDialogId(String dialogId)
      See Also:
    • getReturnDialogId

      public String getReturnDialogId()
      Used by the dialog framework to set the dialog id for a return dialog call (when the server has triggered a dialog).

      Note this is a request only property. On a return call the value for this gets pulled and used to create an entry in getDialogResponses()

      Returns:
      String id for the dialog being returned from
    • setReturnDialogId

      public void setReturnDialogId(String returnDialogId)
      See Also:
    • getReturnDialogResponse

      public String getReturnDialogResponse()
      Used by the dialog framework to set the dialog response for a return dialog call (when the server has triggered a dialog).

      Note this is a request only property. On a return call the value for this gets pulled and used to create an entry in getDialogResponses()

      Returns:
      String response for the dialog being returned from
    • setReturnDialogResponse

      public void setReturnDialogResponse(String returnDialogResponse)
      See Also:
    • getDialogExplanations

      public Map<String,String> getDialogExplanations()
      Contains values for dialog explanation fields present on the page.

      Since multiple dialogs can be present on the same page using the generic explanation field, the values are maintained in this map using the dialog id as the key. Values are cleared on each request.

      Specified by:
      getDialogExplanations in interface ViewModel
      Returns:
      map of dialog explanations, where key is the dialog id and map value is the explanation
    • setDialogExplanations

      public void setDialogExplanations(Map<String,String> dialogExplanations)
      Specified by:
      setDialogExplanations in interface ViewModel
      See Also:
    • getDialogResponses

      public Map<String,DialogResponse> getDialogResponses()
      Map containing dialog responses for a request 'conversation'.

      When a controller methods requests a dialog, the response is collected on the return call and placed into this map. The key to the map is the id for the dialog. Since a single controller method can spawn multiple dialogs in a single conversation (these are actually multiple requests/responses, but part of the same action request), the responses are collected in this map. Whenever a request is encountered that is not a return, the map is cleared. This means the responses will be cleared in case the action is triggered action.

      Specified by:
      getDialogResponses in interface ViewModel
      Returns:
      map of dialog responses, where map key is the dialog id and the map value is the dialog response object
    • getDialogResponse

      public DialogResponse getDialogResponse(String dialogId)
      Helper method to get a dialog response for the given dialog id.
      Specified by:
      getDialogResponse in interface ViewModel
      Parameters:
      dialogId - id of the dialog to get response for
      Returns:
      dialog response object, or null if response does not exist
      See Also:
    • setDialogResponses

      public void setDialogResponses(Map<String,DialogResponse> dialogResponses)
      Specified by:
      setDialogResponses in interface ViewModel
      See Also:
    • getExtensionData

      public Map<String,Object> getExtensionData()
      Description copied from interface: ViewModel
      A generic map for framework pieces (such as component modifiers) that need to dynamically store data to the form
      Specified by:
      getExtensionData in interface ViewModel
      Returns:
      Mapinvalid input: '<'String, Object>
      See Also:
    • setExtensionData

      public void setExtensionData(Map<String,Object> extensionData)
      Setter for the generic extension data map
      Specified by:
      setExtensionData in interface ViewModel
      Parameters:
      extensionData -
    • getRequest

      public javax.servlet.http.HttpServletRequest getRequest()
      Http servlet request instance for the current request being processed.
      Returns:
      HttpServletRequest instance
    • setRequest

      public void setRequest(javax.servlet.http.HttpServletRequest request)
      See Also:
    • getAddedCollectionItems

      public List getAddedCollectionItems()
      The List that contains all newly added items for the collections on the model

      This list contains the new items for all the collections on the model.

      Returns:
      List of the newly added item lists
    • setAddedCollectionItems

      public void setAddedCollectionItems(List addedCollectionItems)
      Setter for the newly added item list
    • isAddedCollectionItem

      public boolean isAddedCollectionItem(Object item)
      Indicates whether an collection item has been newly added

      Tests collection items against the list of newly added items on the model. This list gets cleared when the view is submitted and the items are persisted.

      Parameters:
      item - - the item to test against list of newly added items
      Returns:
      boolean true if the item has been newly added
    • getDialogDataObject

      public Object getDialogDataObject()
      The data object to bind to for a dialog

      The data object serves as a placeholder for temporary properties that might be used within a dialog. The purpose of placeholder is to provide a separation between the dialog object and the underlying object for use in cases like object manipulation.

    • setDialogDataObject

      public void setDialogDataObject(Object dataObject)
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCsrfToken

      public String getCsrfToken()
    • setCsrfToken

      public void setCsrfToken(String csrfToken)