|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.service.impl.MaintenanceDocumentServiceImpl
public class MaintenanceDocumentServiceImpl
Service implementation for the MaintenanceDocument structure. This is the default implementation, that is delivered with Kuali
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
LOG
|
Constructor Summary | |
---|---|
MaintenanceDocumentServiceImpl()
|
Method Summary | |
---|---|
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 |
protected void |
checkMaintenanceActionAuthorization(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. |
protected void |
clearPrimaryKeyFields(Object maintenanceObject,
Class<?> dataObjectClass)
Clears the value of the primary key fields on the maintenance object |
protected void |
clearUnauthorizedNewFields(MaintenanceDocument document)
Used as part of the Copy functionality, to clear any field values that the user making the copy does not have permissions to modify. |
void |
deleteLocks(String documentNumber)
Call the same-named method in the Dao, since the service has access to the Dao, but the caller doesn't. |
protected DataObjectAuthorizationService |
getDataObjectAuthorizationService()
|
protected DataObjectMetaDataService |
getDataObjectMetaDataService()
|
DocumentDictionaryService |
getDocumentDictionaryService()
|
protected DocumentService |
getDocumentService()
|
String |
getLockingDocumentId(Maintainable maintainable,
String documentNumber)
Attempts to find any other active documents that are pending on the same maintenance record. |
String |
getLockingDocumentId(MaintenanceDocument document)
Attempts to find any other active documents that are pending on the same maintenance record. |
MaintenanceDocumentDao |
getMaintenanceDocumentDao()
|
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 |
protected void |
processMaintenanceObjectForCopy(MaintenanceDocument document,
Object maintenanceObject,
Map<String,String[]> requestParameters)
For the copy action clears out primary key values for the old record and does authorization checks on the remaining fields. |
protected Object |
retrieveObjectForMaintenance(MaintenanceDocument document,
Map<String,String[]> requestParameters)
For the edit or copy actions retrieves the record that is to be maintained |
void |
setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService)
|
void |
setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService)
|
void |
setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
|
void |
setDocumentService(DocumentService documentService)
|
void |
setMaintenanceDocumentDao(MaintenanceDocumentDao maintenanceDocumentDao)
|
void |
setupMaintenanceObject(MaintenanceDocument document,
String maintenanceAction,
Map<String,String[]> requestParameters)
Called to setup the object being maintained |
MaintenanceDocument |
setupNewMaintenanceDocument(String objectClassName,
String documentTypeName,
String maintenanceAction)
Prepares the MaintenanceDocument on initial request |
void |
storeLocks(List<MaintenanceLock> maintenanceLocks)
Call the same-named method in the Dao, since the service has access to the Dao, but the caller doesn't. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public MaintenanceDocumentServiceImpl()
Method Detail |
---|
public MaintenanceDocument setupNewMaintenanceDocument(String objectClassName, String documentTypeName, String maintenanceAction)
MaintenanceDocumentService
MaintenanceDocument
on initial request
This includes retrieving the data object for edit or copy, clearing fields
setupNewMaintenanceDocument
in interface MaintenanceDocumentService
objectClassName
- - class name for the object being maintaineddocumentTypeName
- - workflow doc type for the maintenance document requestedmaintenanceAction
- - indicates whether this is a new, copy, or edit maintenance
action
MaintenanceDocumentService.setupNewMaintenanceDocument(java.lang.String,
java.lang.String, java.lang.String)
public void setupMaintenanceObject(MaintenanceDocument document, String maintenanceAction, Map<String,String[]> requestParameters)
MaintenanceDocumentService
For edit and copy actions, the old record is retrieved and prepared for
editing (in the case of a copy some fields are cleared). In addition some
authorization checks are performed and hooks for custom
Maintainble
implementations are invoked.
setupMaintenanceObject
in interface MaintenanceDocumentService
document
- - document instance for the maintenance objectmaintenanceAction
- - the requested maintenance action (new, new with existing,
copy, edit)requestParameters
- - Map of parameters from the requestsetupMaintenanceObject(org.kuali.rice.krad.document.MaintenanceDocument, java.lang.String, java.util.Map)
protected void checkMaintenanceActionAuthorization(MaintenanceDocument document, Object oldBusinessObject, String maintenanceAction, Map<String,String[]> requestParameters)
BusinessObjectAuthorizationService
to check whether the
action is allowed for the record data. In action is allowed invokes the
custom processing hook on the Maintainble
.
document
- - document instance for the maintenance objectoldBusinessObject
- - the old maintenance recordmaintenanceAction
- - type of maintenance action requestedrequestParameters
- - map of parameters from the requestprotected Object retrieveObjectForMaintenance(MaintenanceDocument document, Map<String,String[]> requestParameters)
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
.
document
- - document instance for the maintenance objectrequestParameters
- - Map of parameters from the request
protected void processMaintenanceObjectForCopy(MaintenanceDocument document, Object maintenanceObject, Map<String,String[]> requestParameters)
Maintainble
document
- - document instance for the maintenance objectmaintenanceObject
- - the object instance being maintainedrequestParameters
- - map of parameters from the requestprotected void clearPrimaryKeyFields(Object maintenanceObject, Class<?> dataObjectClass)
document
- - document to clear the pk fields ondataObjectClass
- - class to use for retrieving primary key metadataprotected void clearUnauthorizedNewFields(MaintenanceDocument document)
document
- - document to be adjustedprotected Map<String,String> buildKeyMapFromRequest(Map<String,String[]> requestParameters, Class<?> dataObjectClass)
BusinessObjectMetaDataService
(or alternatively from the
request parameters), then retrieves any matching key value pairs from the
request parameters
requestParameters
- - map of parameters from the requestdataObjectClass
- - class to use for checking security parameter restrictions
protected void populateMaintenanceObjectWithCopyKeyValues(Map<String,String> parameters, Object oldBusinessObject, Maintainable oldMaintainableObject)
parameters
- - map of parameters from the requestoldBusinessObject
- - the old maintenance objectoldMaintainableObject
- - the old maintainble object (used to get object class for
security checks)public String getLockingDocumentId(MaintenanceDocument document)
MaintenanceDocumentService
getLockingDocumentId
in interface MaintenanceDocumentService
document
- - document to test
MaintenanceDocumentService.getLockingDocumentId(org.kuali.rice.krad.document.MaintenanceDocument)
public String getLockingDocumentId(Maintainable maintainable, String documentNumber)
MaintenanceDocumentService
getLockingDocumentId
in interface MaintenanceDocumentService
maintainable
- - maintainable representing the document to testdocumentNumber
- - the documentNumber/docHeaderId of the document to test
MaintenanceDocumentService.getLockingDocumentId(org.kuali.rice.krad.maintenance.Maintainable,
java.lang.String)
public void deleteLocks(String documentNumber)
MaintenanceDocumentService
deleteLocks
in interface MaintenanceDocumentService
documentNumber
- - document number whose locks should be deletedMaintenanceDocumentService.deleteLocks(String)
public void storeLocks(List<MaintenanceLock> maintenanceLocks)
MaintenanceDocumentService
storeLocks
in interface MaintenanceDocumentService
maintenanceLocks
- - the list of maintenance locks to be storedorg.kuali.rice.krad.service.MaintenanceDocumentService#saveLocks(List)
public MaintenanceDocumentDao getMaintenanceDocumentDao()
public void setMaintenanceDocumentDao(MaintenanceDocumentDao maintenanceDocumentDao)
protected DataObjectAuthorizationService getDataObjectAuthorizationService()
public void setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService)
protected DocumentService getDocumentService()
public void setDocumentService(DocumentService documentService)
protected DataObjectMetaDataService getDataObjectMetaDataService()
public void setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService)
public DocumentDictionaryService getDocumentDictionaryService()
public void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |