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 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:
      setupNewMaintenanceDocument in interface org.kuali.rice.krad.service.MaintenanceDocumentService
      See Also:
      • MaintenanceDocumentService.setupNewMaintenanceDocument(java.lang.String, java.lang.String, java.lang.String)
    • setupMaintenanceObject

      public void setupMaintenanceObject(org.kuali.rice.krad.maintenance.MaintenanceDocument document, String maintenanceAction, Map<String,String[]> requestParameters)
      Specified by:
      setupMaintenanceObject in interface org.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 the BusinessObjectAuthorizationService to check whether the action is allowed for the record data. In action is allowed invokes the custom processing hook on the Maintainble.
      Parameters:
      document - - document instance for the maintenance object
      oldBusinessObject - - the old maintenance record
      maintenanceAction - - type of maintenance action requested
      requestParameters - - 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 maintained

      Based 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 object
      requestParameters - - Map of parameters from the request
      Returns:
      Object the retrieved old object
    • clearPrimaryKeyFields

      protected void clearPrimaryKeyFields(Object maintenanceObject, Class<?> dataObjectClass)
      Clears the value of the primary key fields on the maintenance object
      Parameters:
      maintenanceObject - - document to clear the pk fields on
      dataObjectClass - - class to use for retrieving primary key metadata
    • clearValuesForPropertyNames

      protected void clearValuesForPropertyNames(Object maintenanceObject, Class<?> dataObjectClass)
      Clears the value of the particular fields on the maintenance object
      Parameters:
      maintenanceObject - - document to clear the fields on
      dataObjectClass - - 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 the BusinessObjectMetaDataService (or alternatively from the request parameters), then retrieves any matching key value pairs from the request parameters
      Parameters:
      requestParameters - - map of parameters from the request
      dataObjectClass - - 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 request
      oldBusinessObject - - the old maintenance object
      oldMaintainableObject - - the old maintainble object (used to get object class for security checks)
    • getLockingDocumentId

      public String getLockingDocumentId(org.kuali.rice.krad.maintenance.MaintenanceDocument document)
      Specified by:
      getLockingDocumentId in interface org.kuali.rice.krad.service.MaintenanceDocumentService
      See Also:
      • MaintenanceDocumentService.getLockingDocumentId(org.kuali.rice.krad.maintenance.MaintenanceDocument)
    • getLockingDocumentId

      public String getLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable maintainable, String documentNumber)
      Specified by:
      getLockingDocumentId in interface org.kuali.rice.krad.service.MaintenanceDocumentService
      See Also:
      • MaintenanceDocumentService.getLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable, java.lang.String)
    • getLockingDocumentNumber

      protected String getLockingDocumentNumber(String lockingRepresentation, String documentNumber)
    • deleteLocks

      public void deleteLocks(String documentNumber)
      Specified by:
      deleteLocks in interface org.kuali.rice.krad.service.MaintenanceDocumentService
      See Also:
      • MaintenanceDocumentService.deleteLocks(String)
    • storeLocks

      public void storeLocks(List<org.kuali.rice.krad.maintenance.MaintenanceLock> maintenanceLocks)
      Specified by:
      storeLocks in interface org.kuali.rice.krad.service.MaintenanceDocumentService
      See Also:
      • MaintenanceDocumentService.storeLocks(java.util.List)
    • 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)