org.kuali.rice.kns.web.struts.form
Class KualiDocumentFormBase

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.kuali.rice.kns.web.struts.pojo.PojoFormBase
          extended by org.kuali.rice.kns.web.struts.form.KualiForm
              extended by org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
All Implemented Interfaces:
Serializable, PojoForm
Direct Known Subclasses:
KualiMaintenanceForm, KualiTransactionalDocumentFormBase

public abstract class KualiDocumentFormBase
extends KualiForm
implements Serializable

TODO we should not be referencing kew constants from this class and wedding ourselves to that workflow application This class is the base action form for all documents.

See Also:
Serialized Form

Field Summary
private  List<String> additionalScriptFiles
           
protected  Map adHocActionRequestCodes
           
private  String annotation
           
protected  org.apache.struts.upload.FormFile attachmentFile
           
private  List boNotes
           
private  String command
           
private  String docId
           
private  String docNum
           
private  String docTypeName
           
private  Document document
           
protected  Map documentActions
           
protected  Map editingMode
           
private  MessageMap errorMapFromPreviousRequest
          Stores the error map from previous requests, so that we can continue to display error messages displayed during a previous request
private  String formKey
           
private static org.apache.log4j.Logger LOG
           
private  AdHocRoutePerson newAdHocRoutePerson
           
private  AdHocRouteWorkgroup newAdHocRouteWorkgroup
           
private  Note newNote
           
private  boolean returnToActionList
           
private static long serialVersionUID
           
protected  boolean suppressAllButtons
           
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
extraButtons
 
Fields inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
requiredNonEditableProperties
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
KualiDocumentFormBase()
          no args constructor that just initializes things for us
 
Method Summary
 void addRequiredNonEditableProperties()
          This method adds the required property names, that are not directly editable by user on the html page, to a list, regardless of the context in which they appear.
protected  String buildHtmlLink(String url, String linkBody)
           
protected  void customInitMaxUploadSizes()
          Adds the attachment file size to the list of max file sizes.
 String getAdditionalScriptFile(int index)
           
 List<String> getAdditionalScriptFiles()
           
 Map getAdHocActionRequestCodes()
           
 AdHocRoutePerson getAdHocRoutePerson(int index)
          Special getter based on index to work with multi rows for ad hoc routing to persons struts page
 List<AdHocRoutePerson> getAdHocRoutePersons()
           
 AdHocRouteWorkgroup getAdHocRouteWorkgroup(int index)
          Special getter based on index to work with multi rows for ad hoc routing to workgroups struts page
 List<AdHocRouteWorkgroup> getAdHocRouteWorkgroups()
          get the ad hoc routing workgroup requests
 String getAnnotation()
           
 org.apache.struts.upload.FormFile getAttachmentFile()
           
 List getBoNotes()
          Gets the boNotes attribute.
 String getCommand()
           
protected  String getDefaultDocumentTypeName()
           
 String getDocId()
           
 String getDocNum()
           
 String getDocTypeName()
          getter for the docTypeName that was passed from workflow on the url
 Document getDocument()
           
 Map getDocumentActions()
           
private  Class<? extends Document> getDocumentClass()
          gets the document class from the datadictionary if getDefaultDocumentTypeName() is overriden to return a valid value otherwise behavior is nondeterministic.
protected  String getDocumentHandlerUrl(String documentId)
           
 Map getEditingMode()
           
 String getFormKey()
           
 Person getInitiator()
           
 String getInitiatorNetworkId()
          getter for convenience that will return the initiators network id
 MessageMap getMessageMapFromPreviousRequest()
           
 AdHocRoutePerson getNewAdHocRoutePerson()
           
 AdHocRouteWorkgroup getNewAdHocRouteWorkgroup()
           
 Note getNewNote()
           
protected  String getPersonInquiryUrlLink(Person user, String linkBody)
           
protected  List<HeaderField> getStandardHeaderFields(KualiWorkflowDocument workflowDocument)
          This method returns a list of HeaderField objects that are used by default on Kuali document display pages.
 KualiWorkflowDocument getWorkflowDocument()
           
 boolean hasDocumentId()
           
protected  void initializeHeaderNavigationTabs()
          initializes the header tabs from what is defined in the datadictionary if getDefaultDocumentTypeName() is overriden to return a valid value.
protected  void instantiateDocument()
          will instatiate a new document setting it on the form if getDefaultDocumentTypeName() is overriden to return a valid value.
 boolean isDocumentEnRoute()
           
 boolean isFormDocumentInitialized()
           
 boolean isHasWorkflowDocument()
          Null-safe check to see if the workflow document object exists before attempting to retrieve it.
 boolean isReturnToActionList()
           
 boolean isSuppressAllButtons()
          Gets the suppressAllButtons attribute.
 boolean isUserDocumentInitiator()
          TODO rk implemented to account for caps coming from kuali user service from workflow
 void populate(javax.servlet.http.HttpServletRequest request)
          Setup workflow doc in the document.
 void populateHeaderFields(KualiWorkflowDocument workflowDocument)
          This method is used to populate the list of header field objects (see KualiForm.getDocInfo()) displayed on the Kuali document form display pages.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
           
 void setAdditionalScriptFile(int index, String scriptFile)
           
 void setAdditionalScriptFiles(List<String> additionalScriptFiles)
           
 void setAdHocActionRequestCodes(Map adHocActionRequestCodes)
           
 void setAdHocRoutePersons(List<AdHocRoutePerson> adHocRouteRecipients)
          set the ad hoc routing persons list
 void setAdHocRouteWorkgroups(List<AdHocRouteWorkgroup> adHocRouteWorkgroups)
          set the ad hoc routing workgroup requests
 void setAnnotation(String annotation)
           
 void setAttachmentFile(org.apache.struts.upload.FormFile attachmentFile)
           
 void setBoNotes(List boNotes)
          Sets the boNotes attribute value.
 void setCommand(String command)
          setter for the command that was passed from workflow on the url
 void setDerivedValuesOnForm(javax.servlet.http.HttpServletRequest request)
           
 void setDocId(String docId)
          setter for the docId that was passed from workflow on the url
 void setDocNum(String docNum)
           
 void setDocTypeName(String docTypeName)
          setter for the docTypeName that was passed from workflow on the url
 void setDocument(Document document)
           
 void setDocumentActions(Map documentActions)
           
 void setEditingMode(Map editingMode)
          Set editingMode for this document
 void setFormKey(String formKey)
           
 void setMessageMapFromPreviousRequest(MessageMap errorMapFromPreviousRequest)
           
 void setNewAdHocRoutePerson(AdHocRoutePerson newAdHocRoutePerson)
          set the new ad hoc route person object
 void setNewAdHocRouteWorkgroup(AdHocRouteWorkgroup newAdHocRouteWorkgroup)
          set the new ad hoc route workgroup object
 void setNewNote(Note newNote)
           
 void setReturnToActionList(boolean returnToActionList)
          Sets flag indicating whether upon completion of approve, blanketApprove, cancel, or disapprove, the user should be returned to the actionList instead of to the portal
 void setSuppressAllButtons(boolean suppressAllButtons)
          Sets the suppressAllButtons attribute value.
 boolean shouldMethodToCallParameterBeUsed(String methodToCallParameterName, String methodToCallParameterValue, javax.servlet.http.HttpServletRequest request)
          This overridden method ...
 boolean shouldPropertyBePopulatedInForm(String requestParameterName, javax.servlet.http.HttpServletRequest request)
          This overridden method ...
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
clearEditablePropertyInformation, getActionFormUtilMap, getAnchor, getBackLocation, getCurrentTabIndex, getDisplayedErrors, getDisplayedInfo, getDisplayedWarnings, getDocInfo, getExtraButton, getExtraButtons, getFieldNameToFocusOnAfterSubmit, getHeaderNavigationTabs, getMethodToCall, getNavigationCss, getNextArbitrarilyHighIndex, getNumColumns, getRefreshCaller, getTabState, getTabStates, incrementTabIndex, isFieldLevelHelpEnabled, populateBackLocation, populateFieldLevelHelpEnabled, reset, retrieveFormValueForLookupInquiryParameters, setActionFormUtilMap, setAnchor, setBackLocation, setCurrentTabIndex, setDocInfo, setExtraButton, setExtraButtons, setFieldLevelHelpEnabled, setFieldNameToFocusOnAfterSubmit, setHeaderNavigationTabs, setMethodToCall, setNavigationCss, setNumColumns, setRefreshCaller, setTabStates
 
Methods inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
addMaxUploadSize, cacheUnconvertedValue, copyPopulateEditablePropertiesToActionEditableProperties, formatterClassForKeypath, formatValue, getActionEditablePropertiesGuid, getEditableProperties, getFormatter, getFormatterTypes, getIsNewForm, getMaxUploadSizes, getMethodToCallsToBypassSessionRetrievalForGETRequests, getParameter, getParameterValues, getPopulateEditableProperties, getPopulateEditablePropertiesGuid, getPropertyType, getRequiredNonEditableProperties, getStrutsActionMappingScope, getUnconvertedValues, getUnknownKeys, initMaxUploadSizes, isPropertyEditable, isPropertyNonEditableButRequired, populateForProperty, postprocessRequestParameters, processValidationFail, registerEditableProperty, registerIsNewForm, registerRequiredNonEditableProperty, registerStrutsActionMappingScope, setActionEditablePropertiesGuid, setFormatterType, setFormatterTypes, setPopulateEditablePropertiesGuid, setUnconvertedValues
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

LOG

private static final org.apache.log4j.Logger LOG

document

private Document document

annotation

private String annotation

command

private String command

docId

private String docId

docTypeName

private String docTypeName

additionalScriptFiles

private List<String> additionalScriptFiles

newAdHocRoutePerson

private AdHocRoutePerson newAdHocRoutePerson

newAdHocRouteWorkgroup

private AdHocRouteWorkgroup newAdHocRouteWorkgroup

newNote

private Note newNote

boNotes

private List boNotes

attachmentFile

protected org.apache.struts.upload.FormFile attachmentFile

editingMode

protected Map editingMode

documentActions

protected Map documentActions

suppressAllButtons

protected boolean suppressAllButtons

adHocActionRequestCodes

protected Map adHocActionRequestCodes

returnToActionList

private boolean returnToActionList

formKey

private String formKey

docNum

private String docNum

errorMapFromPreviousRequest

private MessageMap errorMapFromPreviousRequest
Stores the error map from previous requests, so that we can continue to display error messages displayed during a previous request

Constructor Detail

KualiDocumentFormBase

public KualiDocumentFormBase()
no args constructor that just initializes things for us

Method Detail

addRequiredNonEditableProperties

public void addRequiredNonEditableProperties()
Description copied from interface: PojoForm
This method adds the required property names, that are not directly editable by user on the html page, to a list, regardless of the context in which they appear. Request parameter names corresponding to these properties will be populated into the form.

Specified by:
addRequiredNonEditableProperties in interface PojoForm
Overrides:
addRequiredNonEditableProperties in class KualiForm
See Also:
KualiForm.addRequiredNonEditableProperties()

getDocNum

public String getDocNum()
Returns:
the docNum

setDocNum

public void setDocNum(String docNum)
Parameters:
docNum - the docNum to set

populate

public void populate(javax.servlet.http.HttpServletRequest request)
Setup workflow doc in the document.

Specified by:
populate in interface PojoForm
Overrides:
populate in class KualiForm

getPersonInquiryUrlLink

protected String getPersonInquiryUrlLink(Person user,
                                         String linkBody)

getDocumentHandlerUrl

protected String getDocumentHandlerUrl(String documentId)

buildHtmlLink

protected String buildHtmlLink(String url,
                               String linkBody)

populateHeaderFields

public void populateHeaderFields(KualiWorkflowDocument workflowDocument)
This method is used to populate the list of header field objects (see KualiForm.getDocInfo()) displayed on the Kuali document form display pages.

Parameters:
workflowDocument - - the workflow document of the document being displayed (null is allowed)

getStandardHeaderFields

protected List<HeaderField> getStandardHeaderFields(KualiWorkflowDocument workflowDocument)
This method returns a list of HeaderField objects that are used by default on Kuali document display pages. To use this list and override an individual HeaderField object the id constants from KNSConstants.DocumentFormHeaderFieldIds can be used to identify items from the list.

Parameters:
workflowDocument - - the workflow document of the document being displayed (null is allowed)
Returns:
a list of the standard fields displayed by default for all Kuali documents

validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      javax.servlet.http.HttpServletRequest request)
Overrides:
validate in class org.apache.struts.action.ActionForm
See Also:
ActionForm.validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)

isFormDocumentInitialized

public final boolean isFormDocumentInitialized()
Returns:
true if this document was properly initialized with a DocumentHeader and related KualiWorkflowDocument

getEditingMode

public Map getEditingMode()
Returns:
Map of editingModes for this document, as set during the most recent call to populate(javax.servlet.http.HttpServletRequest)

setEditingMode

public void setEditingMode(Map editingMode)
Set editingMode for this document


getDocumentActions

public Map getDocumentActions()
Returns:
the documentActions

setDocumentActions

public void setDocumentActions(Map documentActions)
Parameters:
documentActions - the documentActions to set

setAdHocActionRequestCodes

public void setAdHocActionRequestCodes(Map adHocActionRequestCodes)
Parameters:
adHocActionRequestCodes - the adHocActionRequestCodes to set

getAdHocActionRequestCodes

public Map getAdHocActionRequestCodes()
Returns:
a map of the possible action request codes that takes into account the users context on the document

getAdHocRoutePersons

public List<AdHocRoutePerson> getAdHocRoutePersons()
Returns:
the list of ad hoc routing persons

getAttachmentFile

public org.apache.struts.upload.FormFile getAttachmentFile()
Returns:
attachmentFile

setAttachmentFile

public void setAttachmentFile(org.apache.struts.upload.FormFile attachmentFile)
Parameters:
attachmentFile - The attachmentFile to set.

setAdHocRoutePersons

public void setAdHocRoutePersons(List<AdHocRoutePerson> adHocRouteRecipients)
set the ad hoc routing persons list

Parameters:
adHocRouteRecipients -

getAdHocRouteWorkgroups

public List<AdHocRouteWorkgroup> getAdHocRouteWorkgroups()
get the ad hoc routing workgroup requests

Returns:

setAdHocRouteWorkgroups

public void setAdHocRouteWorkgroups(List<AdHocRouteWorkgroup> adHocRouteWorkgroups)
set the ad hoc routing workgroup requests

Parameters:
adHocRouteWorkgroups -

getAdHocRoutePerson

public AdHocRoutePerson getAdHocRoutePerson(int index)
Special getter based on index to work with multi rows for ad hoc routing to persons struts page

Parameters:
index -
Returns:

getAdHocRouteWorkgroup

public AdHocRouteWorkgroup getAdHocRouteWorkgroup(int index)
Special getter based on index to work with multi rows for ad hoc routing to workgroups struts page

Parameters:
index -
Returns:

getNewAdHocRoutePerson

public AdHocRoutePerson getNewAdHocRoutePerson()
Returns:
the new ad hoc route person object

setNewAdHocRoutePerson

public void setNewAdHocRoutePerson(AdHocRoutePerson newAdHocRoutePerson)
set the new ad hoc route person object

Parameters:
newAdHocRoutePerson -

getNewAdHocRouteWorkgroup

public AdHocRouteWorkgroup getNewAdHocRouteWorkgroup()
Returns:
the new ad hoc route workgroup object

setNewAdHocRouteWorkgroup

public void setNewAdHocRouteWorkgroup(AdHocRouteWorkgroup newAdHocRouteWorkgroup)
set the new ad hoc route workgroup object

Parameters:
newAdHocRouteWorkgroup -

getDocument

public Document getDocument()
Returns:
Returns the Document

setDocument

public void setDocument(Document document)
Parameters:
document -

getWorkflowDocument

public KualiWorkflowDocument getWorkflowDocument()
Returns:
WorkflowDocument for this form's document

isHasWorkflowDocument

public boolean isHasWorkflowDocument()
Null-safe check to see if the workflow document object exists before attempting to retrieve it. (Which, if called, will throw an exception.)


isUserDocumentInitiator

public boolean isUserDocumentInitiator()
TODO rk implemented to account for caps coming from kuali user service from workflow


getInitiator

public Person getInitiator()

isDocumentEnRoute

public boolean isDocumentEnRoute()
Returns:
true if the workflowDocument associated with this form is currently enroute

setAnnotation

public void setAnnotation(String annotation)
Parameters:
annotation - The annotation to set.

getAnnotation

public String getAnnotation()
Returns:
Returns the annotation.

getCommand

public String getCommand()
Returns:
returns the command that was passed from workflow

setCommand

public void setCommand(String command)
setter for the command that was passed from workflow on the url

Parameters:
command -

getDocId

public String getDocId()
Returns:
returns the docId that was passed from workflow on the url

setDocId

public void setDocId(String docId)
setter for the docId that was passed from workflow on the url

Parameters:
docId -

getDocTypeName

public String getDocTypeName()
getter for the docTypeName that was passed from workflow on the url

Returns:

setDocTypeName

public void setDocTypeName(String docTypeName)
setter for the docTypeName that was passed from workflow on the url

Parameters:
docTypeName -

getInitiatorNetworkId

public String getInitiatorNetworkId()
getter for convenience that will return the initiators network id

Returns:

isSuppressAllButtons

public final boolean isSuppressAllButtons()
Gets the suppressAllButtons attribute.

Returns:
Returns the suppressAllButtons.

setSuppressAllButtons

public final void setSuppressAllButtons(boolean suppressAllButtons)
Sets the suppressAllButtons attribute value.

Parameters:
suppressAllButtons - The suppressAllButtons to set.

hasDocumentId

public boolean hasDocumentId()
Returns:
true if this form's getDocument() method returns a Document, and if that Document's getDocumentHeaderId method returns a non-null

setReturnToActionList

public void setReturnToActionList(boolean returnToActionList)
Sets flag indicating whether upon completion of approve, blanketApprove, cancel, or disapprove, the user should be returned to the actionList instead of to the portal

Parameters:
returnToActionList -

isReturnToActionList

public boolean isReturnToActionList()

getAdditionalScriptFiles

public List<String> getAdditionalScriptFiles()

setAdditionalScriptFiles

public void setAdditionalScriptFiles(List<String> additionalScriptFiles)

setAdditionalScriptFile

public void setAdditionalScriptFile(int index,
                                    String scriptFile)

getAdditionalScriptFile

public String getAdditionalScriptFile(int index)

getNewNote

public Note getNewNote()

setNewNote

public void setNewNote(Note newNote)

getBoNotes

public List getBoNotes()
Gets the boNotes attribute.

Returns:
Returns the boNotes.

setBoNotes

public void setBoNotes(List boNotes)
Sets the boNotes attribute value.

Parameters:
boNotes - The boNotes to set.

getFormKey

public String getFormKey()

setFormKey

public void setFormKey(String formKey)

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Overrides:
reset in class KualiForm
See Also:
ActionForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)

customInitMaxUploadSizes

protected void customInitMaxUploadSizes()
Adds the attachment file size to the list of max file sizes.

Overrides:
customInitMaxUploadSizes in class PojoFormBase
See Also:
PojoFormBase.customInitMaxUploadSizes()

shouldPropertyBePopulatedInForm

public boolean shouldPropertyBePopulatedInForm(String requestParameterName,
                                               javax.servlet.http.HttpServletRequest request)
This overridden method ... IMPORTANT: any overrides of this method must ensure that nothing in the HTTP request will be used to determine whether document is in session

Specified by:
shouldPropertyBePopulatedInForm in interface PojoForm
Overrides:
shouldPropertyBePopulatedInForm in class KualiForm
Parameters:
requestParameterName - the name of the request parameter
request - the HTTP request
Returns:
whether the parameter should be
See Also:
PojoFormBase.shouldPropertyBePopulatedInForm(java.lang.String, javax.servlet.http.HttpServletRequest)

shouldMethodToCallParameterBeUsed

public boolean shouldMethodToCallParameterBeUsed(String methodToCallParameterName,
                                                 String methodToCallParameterValue,
                                                 javax.servlet.http.HttpServletRequest request)
This overridden method ...

Overrides:
shouldMethodToCallParameterBeUsed in class KualiForm
See Also:
KualiForm.shouldMethodToCallParameterBeUsed(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)

getMessageMapFromPreviousRequest

public MessageMap getMessageMapFromPreviousRequest()

setMessageMapFromPreviousRequest

public void setMessageMapFromPreviousRequest(MessageMap errorMapFromPreviousRequest)

setDerivedValuesOnForm

public void setDerivedValuesOnForm(javax.servlet.http.HttpServletRequest request)
Overrides:
setDerivedValuesOnForm in class KualiForm

getDefaultDocumentTypeName

protected String getDefaultDocumentTypeName()

instantiateDocument

protected void instantiateDocument()
will instatiate a new document setting it on the form if getDefaultDocumentTypeName() is overriden to return a valid value.


getDocumentClass

private Class<? extends Document> getDocumentClass()
gets the document class from the datadictionary if getDefaultDocumentTypeName() is overriden to return a valid value otherwise behavior is nondeterministic.


initializeHeaderNavigationTabs

protected void initializeHeaderNavigationTabs()
initializes the header tabs from what is defined in the datadictionary if getDefaultDocumentTypeName() is overriden to return a valid value.



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