org.kuali.rice.krad.maintenance
Interface Maintainable

All Superinterfaces:
Serializable, ViewHelperService
All Known Subinterfaces:
Maintainable
All Known Implementing Classes:
AgendaEditorMaintainable, AuthorMaintainable, BookMaintainable, CampusMaintainableImpl, CampusTypeMaintainableImpl, ContextMaintainable, CountryMaintainableImpl, CountyMaintainableImpl, DocumentTypeMaintainable, FiscalOfficerInfoMaintainableImpl, GenericPermissionMaintainable, KualiGlobalMaintainableImpl, KualiMaintainableImpl, MaintainableImpl, NamespaceMaintainableImpl, ParameterMaintainableImpl, PeopleFlowMaintainableImpl, PostalCodeMaintainableImpl, ReviewResponsibilityMaintainable, RoutingRuleDelegationMaintainable, RoutingRuleMaintainable, StateMaintainableImpl, TermMaintainable, TermSpecificationMaintainable

public interface Maintainable
extends ViewHelperService, Serializable

Provides contract for implementing a maintenance object within the maintenance framework

Currently the Maintainable serves many purposes. First since all maintenance documents share the same document class MaintenanceDocumentBase certain document callbacks such as workflow post processing are invoked on the maintainable. Second the maintainable provides a hook for custom actions on the maintenance view. Finally since the maintainable extends ViewHelperService it is used to customize View configuration for MaintenanceView instances

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 void deleteDataObject()
          Invokes to delete the data object being maintained
 void doRouteStatusChange(DocumentHeader documentHeader)
          Invoked do perform custom processing when the route status for the containing maintenance document changes
 List<MaintenanceLock> generateMaintenanceLocks()
          Invoked to generating the list of maintenance locks used to block other edits of the same data object record
 String getCustomLockDescriptor(Person user)
          Generates a custom lock descriptor for pessimistic locking.
 Object getDataObject()
          Returns instance of the data object that is being maintained
 Class getDataObjectClass()
          Returns the class for the data object being maintained
 String getDocumentTitle(MaintenanceDocument document)
          Invoked when setting the title for the document instance in workflow (doc search results) to customize the title
 String getLockingDocumentId()
          Retrieves the locking document id for the maintainable which is used to create the maintenance lock string
 String getMaintenanceAction()
          Returns the type of maintenance action this maintainable has been configured with
 List<String> getWorkflowEngineDocumentIdsToLock()
          Return an array of document ids to lock prior to processing this document in the workflow engine
 boolean isExternalBusinessObject()
          Indicates whether the object being maintained is an instance of ExternalizableBusinessObject
 boolean isNotesEnabled()
          Indicates whether this maintainable supports notes on the maintenance object
 boolean isOldDataObjectInDocument()
          Indicates whether their is an old data object for the maintainable
 void prepareExternalBusinessObject(BusinessObject businessObject)
          Invoked to prepare a new BusinessObject instance that is external
 void prepareForSave()
          Hook for performing any custom processing before the maintenance object is saved
 void processAfterCopy(MaintenanceDocument document, Map<String,String[]> requestParameters)
          Hook for performing any custom processing after the maintenance object has been setup for a copy action
 void processAfterEdit(MaintenanceDocument document, Map<String,String[]> requestParameters)
          Hook for performing any custom processing after the maintenance object has been setup for a edit action
 void processAfterNew(MaintenanceDocument document, Map<String,String[]> requestParameters)
          Hook for performing any custom processing after the maintenance object has been setup for a new action
 void processAfterPost(MaintenanceDocument document, Map<String,String[]> requestParameters)
          Hook for performing any custom processing after each posting of the maintenance document (for various actions like add line, refresh)
 void processAfterRetrieve()
          Hook for performing any custom processing after the maintenance object is retrieved from persistence storage
 Object retrieveObjectForEditOrCopy(MaintenanceDocument document, Map<String,String> dataObjectKeys)
          Called during setupMaintenanceObject to retrieve the original dataObject that is being edited or copied.
 void saveDataObject()
          Invoked to persist changes to the data object being maintained
 void setDataObject(Object object)
          Sets an instance of a data object that should be maintained
 void setDataObjectClass(Class dataObjectClass)
          Sets the class for the data object that will be maintained
 void setDocumentNumber(String documentNumber)
          Sets the document number on this maintainable for referencing back to the containing MaintenanceDocument
 void setMaintenanceAction(String maintenanceAction)
          Sets the type of maintenance action to be performed (new, edit, or copy)
 void setupNewFromExisting(MaintenanceDocument document, Map<String,String[]> parameters)
          Performs the setting of some attributes that might be necessary if we're creating a new business object using on an existing business object.
 boolean useCustomLockDescriptors()
          Indicates whether or not this maintainable supports custom lock descriptors for pessimistic locking.
 
Methods inherited from interface org.kuali.rice.krad.uif.service.ViewHelperService
applyDefaultValuesForCollectionLine, buildInquiryLink, cleanViewAfterRender, performApplyModel, performComponentInitialization, performComponentLifecycle, performFinalize, performInitialization, populateViewFromRequestParameters, processCollectionAddLine, processCollectionDeleteLine, processMultipleValueLookupResults
 

Method Detail

setDocumentNumber

void setDocumentNumber(String documentNumber)
Sets the document number on this maintainable for referencing back to the containing MaintenanceDocument

Parameters:
documentNumber - - document number for the containing maintenance document

getDocumentTitle

String getDocumentTitle(MaintenanceDocument document)
Invoked when setting the title for the document instance in workflow (doc search results) to customize the title

Parameters:
document - - maintenance document instance to build title for
Returns:
String document title

getDataObject

Object getDataObject()
Returns instance of the data object that is being maintained

Returns:
Object data object instance

setDataObject

void setDataObject(Object object)
Sets an instance of a data object that should be maintained

Parameters:
object - - data object instance

getDataObjectClass

Class getDataObjectClass()
Returns the class for the data object being maintained

Returns:
Class data object class

setDataObjectClass

void setDataObjectClass(Class dataObjectClass)
Sets the class for the data object that will be maintained

Parameters:
dataObjectClass - - class for maintenance data object

getMaintenanceAction

String getMaintenanceAction()
Returns the type of maintenance action this maintainable has been configured with

Returns:
String maintenance action string

setMaintenanceAction

void setMaintenanceAction(String maintenanceAction)
Sets the type of maintenance action to be performed (new, edit, or copy)

Parameters:
maintenanceAction - - string identifying the action type

generateMaintenanceLocks

List<MaintenanceLock> generateMaintenanceLocks()
Invoked to generating the list of maintenance locks used to block other edits of the same data object record

Returns:
the locking representation(s) of this document, which are reproducible given the same keys and the same maintainable object

saveDataObject

void saveDataObject()
Invoked to persist changes to the data object being maintained

Called after the maintenance document has become final indicating the changes should be applied


deleteDataObject

void deleteDataObject()
Invokes to delete the data object being maintained

Called after the maintenance document has become final indicating the changes should be applied


doRouteStatusChange

void doRouteStatusChange(DocumentHeader documentHeader)
Invoked do perform custom processing when the route status for the containing maintenance document changes

Usually used for determining when the document has become final so further actions can take place in addition to the usual persistence of the object changes

Parameters:
documentHeader - - document header instance for containing maintenance document which can be used to check the new status

getLockingDocumentId

String getLockingDocumentId()
Retrieves the locking document id for the maintainable which is used to create the maintenance lock string

Returns:
String locking id

getWorkflowEngineDocumentIdsToLock

List<String> getWorkflowEngineDocumentIdsToLock()
Return an array of document ids to lock prior to processing this document in the workflow engine

Returns:
List list of document ids

useCustomLockDescriptors

boolean useCustomLockDescriptors()
Indicates whether or not this maintainable supports custom lock descriptors for pessimistic locking.

Returns:
boolean true if the maintainable can generate custom lock descriptors, false otherwise
See Also:
#getCustomLockDescriptor(Map, org.kuali.rice.kim.api.identity.Person)

getCustomLockDescriptor

String getCustomLockDescriptor(Person user)
Generates a custom lock descriptor for pessimistic locking. This method should not be called unless useCustomLockDescriptors() returns true

Parameters:
user - - the user trying to establish the lock
Returns:
String representing the lock descriptor
See Also:
useCustomLockDescriptors(), PessimisticLockService, PessimisticLockServiceImpl

isNotesEnabled

boolean isNotesEnabled()
Indicates whether this maintainable supports notes on the maintenance object

Note this is only applicable if the data object is an instance of BusinessObject

Returns:
boolean true if notes are supported, false if they are not supported

isExternalBusinessObject

boolean isExternalBusinessObject()
Indicates whether the object being maintained is an instance of ExternalizableBusinessObject

For the case when we want to maintain a business object that doesn't necessarily map to a single table in the database or may doesn't map to a database at all

Returns:
boolean true if the data object is an external business object, false if not

prepareExternalBusinessObject

void prepareExternalBusinessObject(BusinessObject businessObject)
Invoked to prepare a new BusinessObject instance that is external

Parameters:
businessObject - - new business object instance to prepare

isOldDataObjectInDocument

boolean isOldDataObjectInDocument()
Indicates whether their is an old data object for the maintainable

Returns:
boolean true if old data object exists, false if not

prepareForSave

void prepareForSave()
Hook for performing any custom processing before the maintenance object is saved


processAfterRetrieve

void processAfterRetrieve()
Hook for performing any custom processing after the maintenance object is retrieved from persistence storage


retrieveObjectForEditOrCopy

Object retrieveObjectForEditOrCopy(MaintenanceDocument document,
                                   Map<String,String> dataObjectKeys)
Called during setupMaintenanceObject to retrieve the original dataObject that is being edited or copied. Override this method for non BusinessObject external persistence, Maintainable objects that extend BO should override isExternalBusinessObject and prepareBusinessObject instead. Do not override this method and isExternalBusinessObject.

Parameters:
document - document instance for the maintenance object
dataObjectKeys - Map of keys for the requested object
Returns:
the object identified by the dataObjectKeys

setupNewFromExisting

void setupNewFromExisting(MaintenanceDocument document,
                          Map<String,String[]> parameters)
Performs 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)

Parameters:
document - - maintenance document instance this maintainable belong to
requestParameters - - map of request parameters sent for the request

processAfterCopy

void processAfterCopy(MaintenanceDocument document,
                      Map<String,String[]> requestParameters)
Hook for performing any custom processing after the maintenance object has been setup for a copy action

Parameters:
document - - maintenance document instance this maintainable belong to
requestParameters - - map of request parameters sent for the copy request

processAfterEdit

void processAfterEdit(MaintenanceDocument document,
                      Map<String,String[]> requestParameters)
Hook for performing any custom processing after the maintenance object has been setup for a edit action

Parameters:
document - - maintenance document instance this maintainable belong to
requestParameters - - map of request parameters sent for the copy request

processAfterNew

void processAfterNew(MaintenanceDocument document,
                     Map<String,String[]> requestParameters)
Hook for performing any custom processing after the maintenance object has been setup for a new action

Parameters:
document - - maintenance document instance this maintainable belong to
requestParameters - - map of request parameters sent for the copy request

processAfterPost

void processAfterPost(MaintenanceDocument document,
                      Map<String,String[]> requestParameters)
Hook for performing any custom processing after each posting of the maintenance document (for various actions like add line, refresh)

Parameters:
document - - maintenance document instance this maintainable belong to
requestParameters - - map of request parameters from the post


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.