org.kuali.rice.krad.test.document
Class AccountRequestDocument2

java.lang.Object
  extended by org.kuali.rice.krad.bo.BusinessObjectBase
      extended by org.kuali.rice.krad.bo.PersistableBusinessObjectBase
          extended by org.kuali.rice.krad.document.DocumentBase
              extended by org.kuali.rice.krad.document.TransactionalDocumentBase
                  extended by org.kuali.rice.krad.test.document.AccountRequestDocument2
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, GloballyUnique, Versioned, ModelObjectBasic, BusinessObject, PersistableBusinessObject, Document, SessionDocument, TransactionalDocument

public class AccountRequestDocument2
extends TransactionalDocumentBase
implements SessionDocument

This is a test copy of AccountRequestDocument that has been modified to allow for custom lock descriptors.

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

Field Summary
static String ACCT_REQ_DOC_2_EDITABLE_FIELDS
          A test key to map to some value indicating what fields the user can edit on this doc.
static String EDIT_ALL_BUT_REASONS
          A test value indicating that the user has permission to edit everything except "reason1" and "reason2".
static String EDIT_REASONS_ONLY
          A test value indicating that the user only has permission to edit "reason1" and "reason2".
 
Fields inherited from class org.kuali.rice.krad.document.DocumentBase
documentHeader, documentNumber
 
Fields inherited from class org.kuali.rice.krad.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
AccountRequestDocument2()
           
 
Method Summary
 Account getAccount(int index)
           
 List<Account> getAccounts()
           
 String getAccountTypeCode()
           
 String getCustomLockDescriptor(Person user)
          Generates a custom lock descriptor with a format of "[documentNumber]-[The user session's 'acctReqDoc2EditableFields' parameter value]".
 String getReason1()
           
 String getReason2()
           
 String getRequester()
           
 String getRequestType()
           
 void setAccounts(List<Account> accounts)
           
 void setAccountTypeCode(String accountType)
           
 void setReason1(String reason1)
           
 void setReason2(String reason2)
           
 void setRequester(String requester)
           
 void setRequestType(String requestType)
           
 boolean useCustomLockDescriptors()
          Since this class was made to test custom lock descriptors, this method will always return true.
 
Methods inherited from class org.kuali.rice.krad.document.TransactionalDocumentBase
getAllowsCopy, isSessionDocument
 
Methods inherited from class org.kuali.rice.krad.document.DocumentBase
addCopyErrorDocumentNote, addNote, addPessimisticLock, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, createPropertySerializabilityEvaluator, doActionTaken, doRouteLevelChange, doRouteStatusChange, generateSaveEvents, getAdHocRoutePersons, getAdHocRouteWorkgroups, getAttachmentService, getBasePathToDocumentDuringSerialization, getDocumentHeader, getDocumentNumber, getDocumentPropertySerizabilityEvaluator, getDocumentTitle, getLockClearningMethodNames, getNonLockingActionTakenCodes, getNote, getNotes, getNoteService, getNoteTarget, getNoteType, getPessimisticLocks, getWorkflowEngineDocumentIdsToLock, getXmlForRouteReport, logErrors, populateDocumentForRouting, postProcessSave, prepareForSave, prepareForSave, processAfterRetrieve, refresh, refreshIfEmpty, refreshPessimisticLocks, refreshReferenceObject, removeNote, serializeDocumentToXml, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setDocumentNumber, setNewDocumentHeader, setNotes, setPessimisticLocks, toCopy, validateBusinessRules, wrapDocumentWithMetadataForXmlSerialization
 
Methods inherited from class org.kuali.rice.krad.bo.PersistableBusinessObjectBase
afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, buildListOfDeletionAwareLists, getExtension, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isNewCollectionRecord, linkEditableUserFields, postLoad, postPersist, postRemove, postUpdate, prePersist, preRemove, preUpdate, refreshNonUpdateableReferences, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from class org.kuali.rice.krad.bo.BusinessObjectBase
prepareForWorkflow, toString, toStringBuilder, toStringMapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.document.Document
addNote, addPessimisticLock, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, doActionTaken, doRouteLevelChange, doRouteStatusChange, generateSaveEvents, getAdHocRoutePersons, getAdHocRouteWorkgroups, getBasePathToDocumentDuringSerialization, getDocumentHeader, getDocumentNumber, getDocumentPropertySerizabilityEvaluator, getDocumentTitle, getLockClearningMethodNames, getNote, getNotes, getNoteTarget, getNoteType, getPessimisticLocks, getWorkflowEngineDocumentIdsToLock, getXmlForRouteReport, populateDocumentForRouting, postProcessSave, prepareForSave, prepareForSave, processAfterRetrieve, refreshPessimisticLocks, removeNote, serializeDocumentToXml, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setDocumentNumber, setNotes, validateBusinessRules, wrapDocumentWithMetadataForXmlSerialization
 
Methods inherited from interface org.kuali.rice.krad.bo.PersistableBusinessObject
buildListOfDeletionAwareLists, getExtension, isNewCollectionRecord, linkEditableUserFields, refreshNonUpdateableReferences, refreshReferenceObject, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from interface org.kuali.rice.krad.bo.BusinessObject
refresh
 
Methods inherited from interface org.kuali.rice.core.api.mo.ModelObjectBasic
toString
 
Methods inherited from interface org.kuali.rice.core.api.mo.common.Versioned
getVersionNumber
 
Methods inherited from interface org.kuali.rice.core.api.mo.common.GloballyUnique
getObjectId
 

Field Detail

ACCT_REQ_DOC_2_EDITABLE_FIELDS

public static final String ACCT_REQ_DOC_2_EDITABLE_FIELDS
A test key to map to some value indicating what fields the user can edit on this doc. Note that such behavior is not enforced; it is simply here for testing the PessimisticLockService's custom lock descriptor functionality.

See Also:
Constant Field Values

EDIT_ALL_BUT_REASONS

public static final String EDIT_ALL_BUT_REASONS
A test value indicating that the user has permission to edit everything except "reason1" and "reason2". This is here only for testing the generation of custom lock descriptors for PessimisticLockServiceTest; AccountRequestDocument2 does not actually enforce any such behavior.

See Also:
Constant Field Values

EDIT_REASONS_ONLY

public static final String EDIT_REASONS_ONLY
A test value indicating that the user only has permission to edit "reason1" and "reason2". This is here only for testing the generation of custom lock descriptors for PessimisticLockServiceTest; AccountRequestDocument2 does not actually enforce any such behavior.

See Also:
Constant Field Values
Constructor Detail

AccountRequestDocument2

public AccountRequestDocument2()
Method Detail

getReason2

public String getReason2()

setReason2

public void setReason2(String reason2)

getReason1

public String getReason1()

setReason1

public void setReason1(String reason1)

getRequester

public String getRequester()

setRequester

public void setRequester(String requester)

getAccounts

public List<Account> getAccounts()

setAccounts

public void setAccounts(List<Account> accounts)

getAccount

public Account getAccount(int index)

getRequestType

public String getRequestType()

setRequestType

public void setRequestType(String requestType)

setAccountTypeCode

public void setAccountTypeCode(String accountType)

getAccountTypeCode

public String getAccountTypeCode()

useCustomLockDescriptors

public boolean useCustomLockDescriptors()
Since this class was made to test custom lock descriptors, this method will always return true.

Specified by:
useCustomLockDescriptors in interface Document
Overrides:
useCustomLockDescriptors in class DocumentBase
See Also:
DocumentBase.useCustomLockDescriptors()

getCustomLockDescriptor

public String getCustomLockDescriptor(Person user)
Generates a custom lock descriptor with a format of "[documentNumber]-[The user session's 'acctReqDoc2EditableFields' parameter value]". Will throw a PessimisticLockingException if this parameter is not defined or if its value is neither "editAllButReasons" nor "editReasonsOnly".

Specified by:
getCustomLockDescriptor in interface Document
Overrides:
getCustomLockDescriptor in class DocumentBase
See Also:
DocumentBase.getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person)


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