org.kuali.rice.kns.maintenance
Class KualiMaintainableImpl

java.lang.Object
  extended by org.kuali.rice.kns.maintenance.KualiMaintainableImpl
All Implemented Interfaces:
Serializable, SelectiveReferenceRefresher, Maintainable
Direct Known Subclasses:
DocumentTypeMaintainable, GenericPermissionMaintainable, KualiGlobalMaintainableImpl, ParameterMaintainable, ReviewResponsibilityMaintainable, RoutingRuleDelegationMaintainable, RoutingRuleMaintainable

public class KualiMaintainableImpl
extends Object
implements Maintainable, Serializable

Base Maintainable class to hold things common to all maintainables.

See Also:
Serialized Form

Field Summary
protected  Class boClass
           
protected  PersistableBusinessObject businessObject
           
protected static BusinessObjectAuthorizationService businessObjectAuthorizationService
           
protected static BusinessObjectDictionaryService businessObjectDictionaryService
           
protected static BusinessObjectMetaDataService businessObjectMetaDataService
           
protected static BusinessObjectService businessObjectService
           
protected static DataDictionaryService dataDictionaryService
           
protected  String docTypeName
           
protected static DocumentHelperService documentHelperService
           
protected  String documentNumber
           
protected static EncryptionService encryptionService
           
protected  Map<String,Boolean> inactiveRecordDisplay
           
private static org.apache.log4j.Logger LOG
           
protected  String maintenanceAction
           
protected static MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService
           
protected static MaintenanceDocumentService maintenanceDocumentService
           
protected  Map<String,PersistableBusinessObject> newCollectionLines
           
protected static PersistenceStructureService persistenceStructureService
           
protected static PersonService personService
           
private static long serialVersionUID
           
 
Constructor Summary
KualiMaintainableImpl()
          Default empty constructor
KualiMaintainableImpl(PersistableBusinessObject businessObject)
          Constructor which initializes the business object to be maintained.
 
Method Summary
 void addMultipleValueLookupResults(MaintenanceDocument document, String collectionName, Collection<PersistableBusinessObject> rawValues, boolean needsBlank, PersistableBusinessObject bo)
           
 void addNewLineToCollection(String collectionName)
          Adds the new line for the given collection to the business object's collection.
 void clearBusinessObjectOfRestrictedValues(MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)
          Blanks out or sets the default of any value specified as restricted within the MaintenanceDocumentRestrictions instance.
protected  void clearCollectionRestrictedValues(String fieldNamePrefix, BusinessObject businessObject, MaintainableCollectionDefinition collectionDefinition, MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)
           
protected  void clearFieldRestrictedValues(String fieldNamePrefix, BusinessObject businessObject, MaintainableFieldDefinition fieldDefinition, MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)
           
protected  Map<String,String> decryptEncryptedData(Map<String,String> fieldValues, MaintenanceDocument maintenanceDocument, String methodToCall)
          Special hidden parameters are set on the maintenance jsp starting with a prefix that tells us which fields have been encrypted.
 void deleteBusinessObject()
           
 void doRouteStatusChange(DocumentHeader documentHeader)
          method to integrate with workflow, where we will actually handle the transitions of status for documents
protected  Collection<String> generateAllAffectedReferences(Class boClass, Map<String,String> fkToPkMappings, String nestedBOPrefix, String collectionPrefix)
           
 List<MaintenanceLock> generateMaintenanceLocks()
          Note: as currently implemented, every key field for a given BusinessObject subclass must have a visible getter.
 Collection<String> getAffectedReferencesFromLookup(BusinessObject baseBO, String attributeName, String collectionPrefix)
          Returns a list of references that must be refreshed after a lookup performed on an attribute is performed.
protected  Collection<String> getAllRefreshableReferences(Class boClass)
           
 Class getBoClass()
           
 PersistableBusinessObject getBusinessObject()
          Returns instance of the business object that is being maintained.
static BusinessObjectAuthorizationService getBusinessObjectAuthorizationService()
           
static BusinessObjectDictionaryService getBusinessObjectDictionaryService()
           
static BusinessObjectMetaDataService getBusinessObjectMetaDataService()
           
static BusinessObjectService getBusinessObjectService()
           
 List<Section> getCoreSections(MaintenanceDocument document, Maintainable oldMaintainable)
          Gets list of maintenance sections built from the data dictionary.
 String getCustomLockDescriptor(Person user)
          This default implementation just throws a PessimisticLockingException.
static DataDictionaryService getDataDictionaryService()
           
static DocumentHelperService getDocumentHelperService()
           
 String getDocumentTitle(MaintenanceDocument document)
          This is a hook to allow the document to override the generic document title.
protected  String getDocumentTypeName()
          Retrieves the document type name from the data dictionary based on business object class
 List<String> getDuplicateIdentifierFieldsFromDataDictionary(String docTypeName, String collectionName)
          This method is to retrieve a List of fields which are specified in the maintenance document data dictionary as the duplicateIdentificationFields.
static EncryptionService getEncryptionService()
           
 Map<String,Boolean> getInactiveRecordDisplay()
          Returns the Map used to control the state of inactive record collection display.
 String getLockingDocumentId()
          Searches for any relevant locking documents.
 String getMaintainableTitle()
          Retrieves title for maintenance document from data dictionary
 String getMaintenanceAction()
          Returns the maintenance action - new, edit, or copy
static MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()
           
static MaintenanceDocumentService getMaintenanceDocumentService()
           
 List<String> getMultiValueIdentifierList(Collection maintCollection, List<String> duplicateIdentifierFields)
           
 PersistableBusinessObject getNewCollectionLine(String collectionName)
          Gets the holder for the "add line" for a collection on the business object
static PersistenceStructureService getPersistenceStructureService()
           
static PersonService getPersonService()
           
 List getSections(MaintenanceDocument document, Maintainable oldMaintainable)
          Calls method to get all the core sections for the business object defined in the data dictionary.
 boolean getShowInactiveRecords(String collectionName)
          Indicates whether inactive records for the given collection should be display.
 List<Long> getWorkflowEngineDocumentIdsToLock()
          Return an array of document ids to lock prior to processing this document in the workflow engine.
 boolean hasBusinessObjectExisted(BusinessObject bo, List<String> existingIdentifierList, List<String> duplicateIdentifierFields)
           
 PersistableBusinessObject initNewCollectionLine(String collectionName)
           
 boolean isBoNotesEnabled()
          Retrieves the status of the boNotesEnabled
 boolean isExternalBusinessObject()
          By default a maintainable is not external
 boolean isOldBusinessObjectInDocument()
           
protected  boolean isRelationshipRefreshable(Class boClass, String relationshipName)
           
protected  void performCollectionForceUpperCase(String fieldNamePrefix, BusinessObject bo, MaintainableCollectionDefinition collectionDefinition, Map fieldValues)
           
protected  void performFieldForceUpperCase(BusinessObject bo, Map fieldValues)
           
protected  void performFieldForceUpperCase(String fieldNamePrefix, BusinessObject bo, MaintainableFieldDefinition fieldDefinition, Map fieldValues)
           
protected  void performForceUpperCase(Map fieldValues)
           
 Map populateBusinessObject(Map<String,String> fieldValues, MaintenanceDocument maintenanceDocument, String methodToCall)
          This method populates the business object based on key/value pairs.
 Map<String,String> populateNewCollectionLines(Map<String,String> fieldValues, MaintenanceDocument maintenanceDocument, String methodToCall)
          Populates the new collection lines based on key/value pairs.
protected  Map populateNewSubCollectionLines(MaintainableCollectionDefinition parentCollection, Map fieldValues)
           
 void prepareBusinessObject(BusinessObject businessObject)
          Gives chance to a maintainable object to prepare and return a maintainable object which might be external to the system
 void prepareBusinessObjectForAdditionFromMultipleValueLookup(String collectionName, BusinessObject bo)
           
 void prepareForSave()
          This method is a hook to do any necessary pre-save processing.
 void processAfterAddLine(String colName, Class colClass)
          Deprecated. 
 void processAfterCopy(MaintenanceDocument document, Map<String,String[]> parameters)
          Set the new collection records back to true so they can be deleted (copy should act like new)
 void processAfterEdit(MaintenanceDocument document, Map<String,String[]> parameters)
          This method is a hook to do any necessary post-edit processing, which is to say that it is called when a document is about to be edited; this is therefore a hook to write any code to modify the business object before it is displayed to the end user to edit.
 void processAfterNew(MaintenanceDocument document, Map<String,String[]> parameters)
          This method is a hook to do any necessary post-copy processing.
 void processAfterPost(MaintenanceDocument document, Map<String,String[]> parameters)
          This method is a hook to do any necessary post-post processing.
 void processAfterRetrieve()
          This method is a hook to do any necessary post-load processing.
 void processBeforeAddLine(String colName, Class colClass, BusinessObject addBO)
          KULRICE-4264 - a hook to change the state of the business object, which is the "new line" of a collection, before it is validated
 void refresh(String refreshCaller, Map fieldValues, MaintenanceDocument document)
          Called from a lookup return by the maintenance action.
protected  void refreshReferences(String referencesToRefresh)
           
 void saveBusinessObject()
          This method will cause the Maintainable implementation to save/store the relevant business object(s).
 void setBoClass(Class boClass)
           
 void setBusinessObject(PersistableBusinessObject businessObject)
          Sets an instance of a business object to be maintained.
 void setDocumentNumber(String documentNumber)
          Sets the documentNumber attribute value.
 void setGenerateBlankRequiredValues(String docTypeName)
          Set default values for blank required fields.
 void setGenerateDefaultValues(String docTypeName)
          Set default values.
 void setMaintenanceAction(String maintenanceAction)
          Sets the maintenance action - new, edit, or copy
protected  void setNewCollectionLineDefaultValues(String collectionName, PersistableBusinessObject addLine)
           
 void setShowInactiveRecords(String collectionName, boolean showInactive)
          Indicates to maintainble whether or not inactive records should be displayed for the given collection name.
 void setupNewFromExisting(MaintenanceDocument document, Map<String,String[]> parameters)
          This methods will do the setting of some attributes that might be necessary if we're creating a new business object using on an existing business object.
protected  boolean shouldFieldBeEncrypted(MaintenanceDocument maintenanceDocument, String fieldName, MaintenanceDocumentRestrictions auths, String methodToCall)
          Determines whether the field in a request should be encrypted.
 boolean useCustomLockDescriptors()
          This default implementation simply returns false to indicate that custom lock descriptors are not supported by KualiMaintainableImpl.
 
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

documentNumber

protected String documentNumber

businessObject

protected PersistableBusinessObject businessObject

boClass

protected Class boClass

maintenanceAction

protected String maintenanceAction

newCollectionLines

protected Map<String,PersistableBusinessObject> newCollectionLines

inactiveRecordDisplay

protected Map<String,Boolean> inactiveRecordDisplay

docTypeName

protected String docTypeName

persistenceStructureService

protected static PersistenceStructureService persistenceStructureService

maintenanceDocumentDictionaryService

protected static MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService

dataDictionaryService

protected static DataDictionaryService dataDictionaryService

businessObjectService

protected static BusinessObjectService businessObjectService

businessObjectDictionaryService

protected static BusinessObjectDictionaryService businessObjectDictionaryService

encryptionService

protected static EncryptionService encryptionService

personService

protected static PersonService personService

businessObjectMetaDataService

protected static BusinessObjectMetaDataService businessObjectMetaDataService

businessObjectAuthorizationService

protected static BusinessObjectAuthorizationService businessObjectAuthorizationService

maintenanceDocumentService

protected static MaintenanceDocumentService maintenanceDocumentService

documentHelperService

protected static DocumentHelperService documentHelperService
Constructor Detail

KualiMaintainableImpl

public KualiMaintainableImpl()
Default empty constructor


KualiMaintainableImpl

public KualiMaintainableImpl(PersistableBusinessObject businessObject)
Constructor which initializes the business object to be maintained.

Parameters:
businessObject -
Method Detail

setupNewFromExisting

public void setupNewFromExisting(MaintenanceDocument document,
                                 Map<String,String[]> parameters)
Description copied from interface: Maintainable
This methods will do the setting of some attributes that might be necessary if we're creating a new business object using on an existing business object. For example, create a division Vendor based on an existing parent Vendor. (Please see VendorMaintainableImpl.java)

Specified by:
setupNewFromExisting in interface Maintainable

processAfterPost

public void processAfterPost(MaintenanceDocument document,
                             Map<String,String[]> parameters)
Description copied from interface: Maintainable
This method is a hook to do any necessary post-post processing.

Specified by:
processAfterPost in interface Maintainable

getDocumentTitle

public String getDocumentTitle(MaintenanceDocument document)
This is a hook to allow the document to override the generic document title.

Specified by:
getDocumentTitle in interface Maintainable
Returns:
String document title

generateMaintenanceLocks

public List<MaintenanceLock> generateMaintenanceLocks()
Note: as currently implemented, every key field for a given BusinessObject subclass must have a visible getter.

Specified by:
generateMaintenanceLocks in interface Maintainable
Returns:
String containing the business object class and key value pairs of the current instance that can be used as a unique locking representation.

populateBusinessObject

public Map populateBusinessObject(Map<String,String> fieldValues,
                                  MaintenanceDocument maintenanceDocument,
                                  String methodToCall)
Description copied from interface: Maintainable
This method populates the business object based on key/value pairs.

Specified by:
populateBusinessObject in interface Maintainable
Returns:
See Also:
Maintainable.populateBusinessObject(java.util.Map, org.kuali.rice.kns.document.MaintenanceDocument, String)

decryptEncryptedData

protected Map<String,String> decryptEncryptedData(Map<String,String> fieldValues,
                                                  MaintenanceDocument maintenanceDocument,
                                                  String methodToCall)
Special hidden parameters are set on the maintenance jsp starting with a prefix that tells us which fields have been encrypted. This field finds the those parameters in the map, whose value gives us the property name that has an encrypted value. We then need to decrypt the value in the Map before the business object is populated.

Parameters:
fieldValues - - possibly with encrypted values
Returns:
Map fieldValues - with no encrypted values

shouldFieldBeEncrypted

protected boolean shouldFieldBeEncrypted(MaintenanceDocument maintenanceDocument,
                                         String fieldName,
                                         MaintenanceDocumentRestrictions auths,
                                         String methodToCall)
Determines whether the field in a request should be encrypted. This base implementation does not work for properties of collection elements. This base implementation will only return true if the maintenance document is being refreshed after a lookup (i.e. methodToCall is "refresh") and the data dictionary-based attribute security definition has any restriction defined, whether the user would be authorized to view the field. This assumes that only fields returned from a lookup should be encrypted in a request. If the user otherwise has no permissions to view/edit the field, then a request parameter will not be sent back to the server for population.

Parameters:
maintenanceDocument -
fieldName -
auths -
methodToCall -
Returns:

getSections

public List getSections(MaintenanceDocument document,
                        Maintainable oldMaintainable)
Calls method to get all the core sections for the business object defined in the data dictionary. Then determines if the bo has custom attributes, if so builds a custom attribute section and adds to the section list.

Specified by:
getSections in interface Maintainable
oldMaintainable - - If this is the new maintainable, the old is passed in for reference. If it is the old maintainable, then null will be passed in
Returns:
List of org.kuali.ui.Section objects

getCoreSections

public List<Section> getCoreSections(MaintenanceDocument document,
                                     Maintainable oldMaintainable)
Gets list of maintenance sections built from the data dictionary. If the section contains maintenance fields, construct Row/Field UI objects and place under Section UI. If section contains a maintenance collection, call method to build a Section UI which contains rows of Container Fields.

Returns:
List of org.kuali.ui.Section objects

saveBusinessObject

public void saveBusinessObject()
Description copied from interface: Maintainable
This method will cause the Maintainable implementation to save/store the relevant business object(s). This typically is called only after the maint document has gone through state to final.

Specified by:
saveBusinessObject in interface Maintainable
See Also:
Maintainable.saveBusinessObject()

getMaintainableTitle

public String getMaintainableTitle()
Retrieves title for maintenance document from data dictionary

Specified by:
getMaintainableTitle in interface Maintainable

isBoNotesEnabled

public boolean isBoNotesEnabled()
Retrieves the status of the boNotesEnabled

Specified by:
isBoNotesEnabled in interface Maintainable

refresh

public void refresh(String refreshCaller,
                    Map fieldValues,
                    MaintenanceDocument document)
Description copied from interface: Maintainable
Called from a lookup return by the maintenance action.

Specified by:
refresh in interface Maintainable
See Also:
Impls will be needed if custom action is needed on refresh.

refreshReferences

protected void refreshReferences(String referencesToRefresh)

addMultipleValueLookupResults

public void addMultipleValueLookupResults(MaintenanceDocument document,
                                          String collectionName,
                                          Collection<PersistableBusinessObject> rawValues,
                                          boolean needsBlank,
                                          PersistableBusinessObject bo)
Specified by:
addMultipleValueLookupResults in interface Maintainable

getDuplicateIdentifierFieldsFromDataDictionary

public List<String> getDuplicateIdentifierFieldsFromDataDictionary(String docTypeName,
                                                                   String collectionName)
This method is to retrieve a List of fields which are specified in the maintenance document data dictionary as the duplicateIdentificationFields. This List is used to determine whether the new entry being added to the collection is a duplicate entry and if so, we should not add the new entry to the existing collection

Specified by:
getDuplicateIdentifierFieldsFromDataDictionary in interface Maintainable
Parameters:
docTypeName -
collectionName -

getMultiValueIdentifierList

public List<String> getMultiValueIdentifierList(Collection maintCollection,
                                                List<String> duplicateIdentifierFields)
Specified by:
getMultiValueIdentifierList in interface Maintainable

hasBusinessObjectExisted

public boolean hasBusinessObjectExisted(BusinessObject bo,
                                        List<String> existingIdentifierList,
                                        List<String> duplicateIdentifierFields)
Specified by:
hasBusinessObjectExisted in interface Maintainable

prepareBusinessObjectForAdditionFromMultipleValueLookup

public void prepareBusinessObjectForAdditionFromMultipleValueLookup(String collectionName,
                                                                    BusinessObject bo)

prepareForSave

public void prepareForSave()
Description copied from interface: Maintainable
This method is a hook to do any necessary pre-save processing.

Specified by:
prepareForSave in interface Maintainable
See Also:
Maintainable.prepareForSave()

processAfterRetrieve

public void processAfterRetrieve()
Description copied from interface: Maintainable
This method is a hook to do any necessary post-load processing.

Specified by:
processAfterRetrieve in interface Maintainable
See Also:
Maintainable.processAfterRetrieve()

processAfterCopy

public void processAfterCopy(MaintenanceDocument document,
                             Map<String,String[]> parameters)
Set the new collection records back to true so they can be deleted (copy should act like new)

Specified by:
processAfterCopy in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.KualiMaintainableImpl#processAfterCopy()

processAfterEdit

public void processAfterEdit(MaintenanceDocument document,
                             Map<String,String[]> parameters)
Description copied from interface: Maintainable
This method is a hook to do any necessary post-edit processing, which is to say that it is called when a document is about to be edited; this is therefore a hook to write any code to modify the business object before it is displayed to the end user to edit.

Specified by:
processAfterEdit in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.Maintainable#processAfterEdit()

processAfterNew

public void processAfterNew(MaintenanceDocument document,
                            Map<String,String[]> parameters)
Description copied from interface: Maintainable
This method is a hook to do any necessary post-copy processing.

Specified by:
processAfterNew in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.Maintainable#processAfterNew()

getDocumentTypeName

protected String getDocumentTypeName()
Retrieves the document type name from the data dictionary based on business object class


getBusinessObject

public PersistableBusinessObject getBusinessObject()
Description copied from interface: Maintainable
Returns instance of the business object that is being maintained.

Specified by:
getBusinessObject in interface Maintainable
Returns:
Returns the instance of the business object being maintained.

setBusinessObject

public void setBusinessObject(PersistableBusinessObject businessObject)
Description copied from interface: Maintainable
Sets an instance of a business object to be maintained.

Specified by:
setBusinessObject in interface Maintainable
Parameters:
businessObject - Sets the instance of a business object that will be maintained.

getBoClass

public Class getBoClass()
Specified by:
getBoClass in interface Maintainable
Returns:
Returns the boClass.

setBoClass

public void setBoClass(Class boClass)
Specified by:
setBoClass in interface Maintainable
Parameters:
boClass - The boClass to set.

getMaintenanceAction

public String getMaintenanceAction()
Description copied from interface: Maintainable
Returns the maintenance action - new, edit, or copy

Specified by:
getMaintenanceAction in interface Maintainable
Returns:
Returns the maintenanceAction.

setMaintenanceAction

public void setMaintenanceAction(String maintenanceAction)
Description copied from interface: Maintainable
Sets the maintenance action - new, edit, or copy

Specified by:
setMaintenanceAction in interface Maintainable
Parameters:
maintenanceAction - The maintenanceAction to set.

setGenerateDefaultValues

public void setGenerateDefaultValues(String docTypeName)
Description copied from interface: Maintainable
Set default values.

Specified by:
setGenerateDefaultValues in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.Maintainable#setGenerateDefaultValues()

setGenerateBlankRequiredValues

public void setGenerateBlankRequiredValues(String docTypeName)
Description copied from interface: Maintainable
Set default values for blank required fields.

Specified by:
setGenerateBlankRequiredValues in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.Maintainable#setGenerateBlankRequiredValues()

setDocumentNumber

public final void setDocumentNumber(String documentNumber)
Sets the documentNumber attribute value.

Specified by:
setDocumentNumber in interface Maintainable
Parameters:
documentNumber - The documentNumber to set.

processAfterAddLine

@Deprecated
public void processAfterAddLine(String colName,
                                           Class colClass)
Deprecated. 


processBeforeAddLine

public void processBeforeAddLine(String colName,
                                 Class colClass,
                                 BusinessObject addBO)
Description copied from interface: Maintainable
KULRICE-4264 - a hook to change the state of the business object, which is the "new line" of a collection, before it is validated

Specified by:
processBeforeAddLine in interface Maintainable
See Also:
Maintainable.processBeforeAddLine(java.lang.String, java.lang.Class, org.kuali.rice.kns.bo.BusinessObject)

getShowInactiveRecords

public boolean getShowInactiveRecords(String collectionName)
Description copied from interface: Maintainable
Indicates whether inactive records for the given collection should be display.

Specified by:
getShowInactiveRecords in interface Maintainable
Parameters:
collectionName - - name of the collection (or sub-collection) to check inactive record display setting
Returns:
true if inactive records should be displayed, false otherwise
See Also:
Maintainable.getShowInactiveRecords(java.lang.String)

setShowInactiveRecords

public void setShowInactiveRecords(String collectionName,
                                   boolean showInactive)
Description copied from interface: Maintainable
Indicates to maintainble whether or not inactive records should be displayed for the given collection name.

Specified by:
setShowInactiveRecords in interface Maintainable
Parameters:
collectionName - - name of the collection (or sub-collection) to set inactive record display setting
showInactive - - true to display inactive, false to not display inactive records
See Also:
Maintainable.setShowInactiveRecords(java.lang.String, boolean)

getInactiveRecordDisplay

public Map<String,Boolean> getInactiveRecordDisplay()
Description copied from interface: Maintainable
Returns the Map used to control the state of inactive record collection display. Exposed for setting from the maintenance jsp.

Specified by:
getInactiveRecordDisplay in interface Maintainable
Returns:
the inactiveRecordDisplay

addNewLineToCollection

public void addNewLineToCollection(String collectionName)
Description copied from interface: Maintainable
Adds the new line for the given collection to the business object's collection.

Specified by:
addNewLineToCollection in interface Maintainable

getNewCollectionLine

public PersistableBusinessObject getNewCollectionLine(String collectionName)
Description copied from interface: Maintainable
Gets the holder for the "add line" for a collection on the business object

Specified by:
getNewCollectionLine in interface Maintainable
Returns:

initNewCollectionLine

public PersistableBusinessObject initNewCollectionLine(String collectionName)

populateNewCollectionLines

public Map<String,String> populateNewCollectionLines(Map<String,String> fieldValues,
                                                     MaintenanceDocument maintenanceDocument,
                                                     String methodToCall)
Description copied from interface: Maintainable
Populates the new collection lines based on key/value pairs.

Specified by:
populateNewCollectionLines in interface Maintainable
Returns:
See Also:
org.kuali.rice.kns.maintenance.Maintainable#populateNewCollectionLines(java.util.Map)

populateNewSubCollectionLines

protected Map populateNewSubCollectionLines(MaintainableCollectionDefinition parentCollection,
                                            Map fieldValues)

getAffectedReferencesFromLookup

public Collection<String> getAffectedReferencesFromLookup(BusinessObject baseBO,
                                                          String attributeName,
                                                          String collectionPrefix)
Description copied from interface: SelectiveReferenceRefresher
Returns a list of references that must be refreshed after a lookup performed on an attribute is performed. A lookup on an attribute may cause many attribute values to be updated upon return from lookup. Generally, the returned attributes are the PK of the BO being looked up. For example, a lookup on an account number attribute will cause the chart of accounts code and account code to be returned. These returned attributes may cause other references on the page to be returned. For example, an account number lookup may cause the chart code to change, and if there is also an ObjectCode reference in the BO, then any change in the chart code will cause the referenced ObjectCode BO to be changed.

Specified by:
getAffectedReferencesFromLookup in interface SelectiveReferenceRefresher
attributeName - the name of the attribute with a quickfinder of the maintained BO.
Returns:
a list of reference names that could be affected by lookup return values

isRelationshipRefreshable

protected boolean isRelationshipRefreshable(Class boClass,
                                            String relationshipName)

generateAllAffectedReferences

protected Collection<String> generateAllAffectedReferences(Class boClass,
                                                           Map<String,String> fkToPkMappings,
                                                           String nestedBOPrefix,
                                                           String collectionPrefix)

getAllRefreshableReferences

protected Collection<String> getAllRefreshableReferences(Class boClass)

setNewCollectionLineDefaultValues

protected void setNewCollectionLineDefaultValues(String collectionName,
                                                 PersistableBusinessObject addLine)

doRouteStatusChange

public void doRouteStatusChange(DocumentHeader documentHeader)
Description copied from interface: Maintainable
method to integrate with workflow, where we will actually handle the transitions of status for documents

Specified by:
doRouteStatusChange in interface Maintainable

getWorkflowEngineDocumentIdsToLock

public List<Long> getWorkflowEngineDocumentIdsToLock()
Description copied from interface: Maintainable
Return an array of document ids to lock prior to processing this document in the workflow engine.

Specified by:
getWorkflowEngineDocumentIdsToLock in interface Maintainable

getPersistenceStructureService

public static PersistenceStructureService getPersistenceStructureService()

getMaintenanceDocumentDictionaryService

public static MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()

getDataDictionaryService

public static DataDictionaryService getDataDictionaryService()

getBusinessObjectService

public static BusinessObjectService getBusinessObjectService()

getBusinessObjectDictionaryService

public static BusinessObjectDictionaryService getBusinessObjectDictionaryService()

getEncryptionService

public static EncryptionService getEncryptionService()

getPersonService

public static PersonService getPersonService()

getBusinessObjectMetaDataService

public static BusinessObjectMetaDataService getBusinessObjectMetaDataService()

getBusinessObjectAuthorizationService

public static BusinessObjectAuthorizationService getBusinessObjectAuthorizationService()

getMaintenanceDocumentService

public static MaintenanceDocumentService getMaintenanceDocumentService()

getDocumentHelperService

public static DocumentHelperService getDocumentHelperService()

clearBusinessObjectOfRestrictedValues

public void clearBusinessObjectOfRestrictedValues(MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)
Description copied from interface: Maintainable
Blanks out or sets the default of any value specified as restricted within the MaintenanceDocumentRestrictions instance. This method should only be called if this maintainable represents the new maintainable of the maintenance document.

Specified by:
clearBusinessObjectOfRestrictedValues in interface Maintainable
See Also:
Maintainable.clearBusinessObjectOfRestrictedValues(org.kuali.rice.kns.document.authorization.MaintenanceDocumentRestrictions)

clearCollectionRestrictedValues

protected void clearCollectionRestrictedValues(String fieldNamePrefix,
                                               BusinessObject businessObject,
                                               MaintainableCollectionDefinition collectionDefinition,
                                               MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)

clearFieldRestrictedValues

protected void clearFieldRestrictedValues(String fieldNamePrefix,
                                          BusinessObject businessObject,
                                          MaintainableFieldDefinition fieldDefinition,
                                          MaintenanceDocumentRestrictions maintenanceDocumentRestrictions)

performForceUpperCase

protected void performForceUpperCase(Map fieldValues)

performFieldForceUpperCase

protected void performFieldForceUpperCase(String fieldNamePrefix,
                                          BusinessObject bo,
                                          MaintainableFieldDefinition fieldDefinition,
                                          Map fieldValues)

performCollectionForceUpperCase

protected void performCollectionForceUpperCase(String fieldNamePrefix,
                                               BusinessObject bo,
                                               MaintainableCollectionDefinition collectionDefinition,
                                               Map fieldValues)

performFieldForceUpperCase

protected void performFieldForceUpperCase(BusinessObject bo,
                                          Map fieldValues)

isExternalBusinessObject

public boolean isExternalBusinessObject()
By default a maintainable is not external

Specified by:
isExternalBusinessObject in interface Maintainable
Returns:
See Also:
Maintainable.isExternalBusinessObject()

prepareBusinessObject

public void prepareBusinessObject(BusinessObject businessObject)
Description copied from interface: Maintainable
Gives chance to a maintainable object to prepare and return a maintainable object which might be external to the system

Specified by:
prepareBusinessObject in interface Maintainable
See Also:
org.kuali.rice.kns.maintenance.Maintainable#getExternalBusinessObject()

getLockingDocumentId

public String getLockingDocumentId()
Description copied from interface: Maintainable
Searches for any relevant locking documents.

Specified by:
getLockingDocumentId in interface Maintainable
Returns:
See Also:
Maintainable.getLockingDocumentId()

useCustomLockDescriptors

public boolean useCustomLockDescriptors()
This default implementation simply returns false to indicate that custom lock descriptors are not supported by KualiMaintainableImpl. If custom lock descriptors are needed, the appropriate subclasses should override this method.

Specified by:
useCustomLockDescriptors in interface Maintainable
Returns:
True if the maintainable can generate custom lock descriptors, false otherwise.
See Also:
Maintainable.useCustomLockDescriptors()

getCustomLockDescriptor

public String getCustomLockDescriptor(Person user)
This default implementation just throws a PessimisticLockingException. Subclasses of KualiMaintainableImpl that need support for custom lock descriptors should override this method.

Specified by:
getCustomLockDescriptor in interface Maintainable
Parameters:
user - The user trying to establish the lock.
Returns:
A String representing the lock descriptor.
See Also:
Maintainable.getCustomLockDescriptor(org.kuali.rice.kim.bo.Person)

deleteBusinessObject

public void deleteBusinessObject()
Specified by:
deleteBusinessObject in interface Maintainable

isOldBusinessObjectInDocument

public boolean isOldBusinessObjectInDocument()
Specified by:
isOldBusinessObjectInDocument in interface Maintainable


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