Package org.kuali.rice.krad.service.impl
Class MaintenanceDocumentServiceImpl
java.lang.Object
org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl
- All Implemented Interfaces:
org.kuali.rice.krad.service.MaintenanceDocumentService
public class MaintenanceDocumentServiceImpl
extends Object
implements org.kuali.rice.krad.service.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 org.kuali.rice.krad.service.DataObjectAuthorizationServiceprotected org.kuali.rice.krad.data.DataObjectServiceprotected org.kuali.rice.krad.service.DocumentDictionaryServiceprotected org.kuali.rice.krad.service.DocumentServiceprotected org.kuali.rice.krad.service.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(org.kuali.rice.krad.maintenance.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 org.kuali.rice.krad.service.DataObjectAuthorizationServiceorg.kuali.rice.krad.service.DocumentDictionaryServiceprotected org.kuali.rice.krad.service.DocumentServicegetLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable maintainable, String documentNumber) getLockingDocumentId(org.kuali.rice.krad.maintenance.MaintenanceDocument document) protected StringgetLockingDocumentNumber(String lockingRepresentation, String documentNumber) protected voidpopulateMaintenanceObjectWithCopyKeyValues(Map<String, String> parameters, Object oldBusinessObject, org.kuali.rice.krad.maintenance.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(org.kuali.rice.krad.maintenance.MaintenanceDocument document, Map<String, String[]> requestParameters) For the edit or copy actions retrieves the record that is to be maintainedvoidsetDataObjectAuthorizationService(org.kuali.rice.krad.service.DataObjectAuthorizationService dataObjectAuthorizationService) voidsetDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) voidsetDocumentDictionaryService(org.kuali.rice.krad.service.DocumentDictionaryService documentDictionaryService) voidsetDocumentService(org.kuali.rice.krad.service.DocumentService documentService) voidsetLegacyDataAdapter(org.kuali.rice.krad.service.LegacyDataAdapter legacyDataAdapter) voidsetupMaintenanceObject(org.kuali.rice.krad.maintenance.MaintenanceDocument document, String maintenanceAction, Map<String, String[]> requestParameters) org.kuali.rice.krad.maintenance.MaintenanceDocumentsetupNewMaintenanceDocument(String objectClassName, String documentTypeName, String maintenanceAction) voidstoreLocks(List<org.kuali.rice.krad.maintenance.MaintenanceLock> maintenanceLocks)
-
Field Details
-
legacyDataAdapter
protected org.kuali.rice.krad.service.LegacyDataAdapter legacyDataAdapter -
dataObjectService
protected org.kuali.rice.krad.data.DataObjectService dataObjectService -
dataObjectAuthorizationService
protected org.kuali.rice.krad.service.DataObjectAuthorizationService dataObjectAuthorizationService -
documentService
protected org.kuali.rice.krad.service.DocumentService documentService -
documentDictionaryService
protected org.kuali.rice.krad.service.DocumentDictionaryService documentDictionaryService
-
-
Constructor Details
-
MaintenanceDocumentServiceImpl
public MaintenanceDocumentServiceImpl()
-
-
Method Details
-
setupNewMaintenanceDocument
public org.kuali.rice.krad.maintenance.MaintenanceDocument setupNewMaintenanceDocument(String objectClassName, String documentTypeName, String maintenanceAction) - Specified by:
setupNewMaintenanceDocumentin interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
setupMaintenanceObject
public void setupMaintenanceObject(org.kuali.rice.krad.maintenance.MaintenanceDocument document, String maintenanceAction, Map<String, String[]> requestParameters) - Specified by:
setupMaintenanceObjectin interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
checkMaintenanceActionAuthorization
protected void checkMaintenanceActionAuthorization(org.kuali.rice.krad.maintenance.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(org.kuali.rice.krad.maintenance.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:
- Mapinvalid input: '<'String, String> key value pairs
-
populateMaintenanceObjectWithCopyKeyValues
protected void populateMaintenanceObjectWithCopyKeyValues(Map<String, String> parameters, Object oldBusinessObject, org.kuali.rice.krad.maintenance.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 interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
getLockingDocumentId
public String getLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable maintainable, String documentNumber) - Specified by:
getLockingDocumentIdin interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
getLockingDocumentNumber
-
deleteLocks
- Specified by:
deleteLocksin interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
storeLocks
- Specified by:
storeLocksin interfaceorg.kuali.rice.krad.service.MaintenanceDocumentService- See Also:
-
getDataObjectAuthorizationService
protected org.kuali.rice.krad.service.DataObjectAuthorizationService getDataObjectAuthorizationService() -
setDataObjectAuthorizationService
public void setDataObjectAuthorizationService(org.kuali.rice.krad.service.DataObjectAuthorizationService dataObjectAuthorizationService) -
getDocumentService
protected org.kuali.rice.krad.service.DocumentService getDocumentService() -
setDocumentService
public void setDocumentService(org.kuali.rice.krad.service.DocumentService documentService) -
getDocumentDictionaryService
public org.kuali.rice.krad.service.DocumentDictionaryService getDocumentDictionaryService() -
setDocumentDictionaryService
public void setDocumentDictionaryService(org.kuali.rice.krad.service.DocumentDictionaryService documentDictionaryService) -
setDataObjectService
public void setDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) -
setLegacyDataAdapter
public void setLegacyDataAdapter(org.kuali.rice.krad.service.LegacyDataAdapter legacyDataAdapter)
-