Package org.kuali.rice.krad.service.impl
Class MaintenanceDocumentServiceImpl
java.lang.Object
org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl
- All Implemented Interfaces:
MaintenanceDocumentService
Service implementation for the MaintenanceDocument structure. This is the
default implementation, that is delivered with Kuali
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataObjectAuthorizationServiceprotected org.kuali.rice.krad.data.DataObjectServiceprotected DocumentDictionaryServiceprotected DocumentServiceprotected LegacyDataAdapter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildKeyMapFromRequest(Map<String, String[]> requestParameters, Class<?> dataObjectClass) Based on the maintenance object class retrieves the key field names from theBusinessObjectMetaDataService(or alternatively from the request parameters), then retrieves any matching key value pairs from the request parametersprotected voidcheckMaintenanceActionAuthorization(MaintenanceDocument document, Object oldBusinessObject, String maintenanceAction, Map<String, String[]> requestParameters) For the edit and delete maintenance actions checks with theBusinessObjectAuthorizationServiceto check whether the action is allowed for the record data.protected voidclearPrimaryKeyFields(Object maintenanceObject, Class<?> dataObjectClass) Clears the value of the primary key fields on the maintenance objectprotected voidclearValuesForPropertyNames(Object maintenanceObject, Class<?> dataObjectClass) Clears the value of the particular fields on the maintenance objectvoiddeleteLocks(String documentNumber) protected DataObjectAuthorizationServiceprotected DocumentServicegetLockingDocumentId(Maintainable maintainable, String documentNumber) getLockingDocumentId(MaintenanceDocument document) protected StringgetLockingDocumentNumber(String lockingRepresentation, String documentNumber) protected voidpopulateMaintenanceObjectWithCopyKeyValues(Map<String, String> parameters, Object oldBusinessObject, Maintainable oldMaintainableObject) Looks for a special request parameters giving the names of the keys that should be retrieved from the request parameters and copied to the maintenance objectprotected ObjectretrieveObjectForMaintenance(MaintenanceDocument document, Map<String, String[]> requestParameters) For the edit or copy actions retrieves the record that is to be maintainedvoidsetDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService) voidsetDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) voidsetDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) voidsetDocumentService(DocumentService documentService) voidsetLegacyDataAdapter(LegacyDataAdapter legacyDataAdapter) voidsetupMaintenanceObject(MaintenanceDocument document, String maintenanceAction, Map<String, String[]> requestParameters) setupNewMaintenanceDocument(String objectClassName, String documentTypeName, String maintenanceAction) voidstoreLocks(List<MaintenanceLock> maintenanceLocks)
-
Field Details
-
legacyDataAdapter
-
dataObjectService
protected org.kuali.rice.krad.data.DataObjectService dataObjectService -
dataObjectAuthorizationService
-
documentService
-
documentDictionaryService
-
-
Constructor Details
-
MaintenanceDocumentServiceImpl
public MaintenanceDocumentServiceImpl()
-
-
Method Details
-
setupNewMaintenanceDocument
public MaintenanceDocument setupNewMaintenanceDocument(String objectClassName, String documentTypeName, String maintenanceAction) -
setupMaintenanceObject
public void setupMaintenanceObject(MaintenanceDocument document, String maintenanceAction, Map<String, String[]> requestParameters) -
checkMaintenanceActionAuthorization
protected void checkMaintenanceActionAuthorization(MaintenanceDocument document, Object oldBusinessObject, String maintenanceAction, Map<String, String[]> requestParameters) For the edit and delete maintenance actions checks with theBusinessObjectAuthorizationServiceto check whether the action is allowed for the record data. In action is allowed invokes the custom processing hook on theMaintainble.- Parameters:
document- - document instance for the maintenance objectoldBusinessObject- - the old maintenance recordmaintenanceAction- - type of maintenance action requestedrequestParameters- - map of parameters from the request
-
retrieveObjectForMaintenance
protected Object retrieveObjectForMaintenance(MaintenanceDocument document, Map<String, String[]> requestParameters) For the edit or copy actions retrieves the record that is to be maintainedBased on the persistence metadata for the maintenance object class retrieves the primary key values from the given request parameters map (if the class is persistable). With those key values attempts to find the record using the
LookupService.- Parameters:
document- - document instance for the maintenance objectrequestParameters- - Map of parameters from the request- Returns:
- Object the retrieved old object
-
clearPrimaryKeyFields
Clears the value of the primary key fields on the maintenance object- Parameters:
maintenanceObject- - document to clear the pk fields ondataObjectClass- - class to use for retrieving primary key metadata
-
clearValuesForPropertyNames
Clears the value of the particular fields on the maintenance object- Parameters:
maintenanceObject- - document to clear the fields ondataObjectClass- - class to use for retrieving list of fields to clear
-
buildKeyMapFromRequest
protected Map<String,String> buildKeyMapFromRequest(Map<String, String[]> requestParameters, Class<?> dataObjectClass) Based on the maintenance object class retrieves the key field names from theBusinessObjectMetaDataService(or alternatively from the request parameters), then retrieves any matching key value pairs from the request parameters- Parameters:
requestParameters- - map of parameters from the requestdataObjectClass- - class to use for checking security parameter restrictions- Returns:
- Map<String, String> key value pairs
-
populateMaintenanceObjectWithCopyKeyValues
protected void populateMaintenanceObjectWithCopyKeyValues(Map<String, String> parameters, Object oldBusinessObject, Maintainable oldMaintainableObject) Looks for a special request parameters giving the names of the keys that should be retrieved from the request parameters and copied to the maintenance object- Parameters:
parameters- - map of parameters from the requestoldBusinessObject- - the old maintenance objectoldMaintainableObject- - the old maintainble object (used to get object class for security checks)
-
getLockingDocumentId
- Specified by:
getLockingDocumentIdin interfaceMaintenanceDocumentService- See Also:
-
getLockingDocumentId
-
getLockingDocumentNumber
-
deleteLocks
- Specified by:
deleteLocksin interfaceMaintenanceDocumentService- See Also:
-
storeLocks
- Specified by:
storeLocksin interfaceMaintenanceDocumentService- See Also:
-
getDataObjectAuthorizationService
-
setDataObjectAuthorizationService
public void setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService) -
getDocumentService
-
setDocumentService
-
getDocumentDictionaryService
-
setDocumentDictionaryService
-
setDataObjectService
public void setDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) -
setLegacyDataAdapter
-