org.kuali.student.common.ui.server.gwt
Class AbstractDataService

java.lang.Object
  extended by org.kuali.student.common.ui.server.gwt.AbstractDataService
All Implemented Interfaces:
DataService
Direct Known Subclasses:
CoreProgramDataService, CourseDataService, CredentialProgramDataService, LoCategoryDataService, MajorDisciplineDataService, MajorDisciplineProposalDataService

@Transactional(readOnly=true,
               noRollbackFor=DoesNotExistException.class,
               rollbackFor=java.lang.Throwable.class)
public abstract class AbstractDataService
extends Object
implements DataService


Constructor Summary
AbstractDataService()
           
 
Method Summary
protected  DataSaveResult _saveData(Data data, Map<String,Object> filterProperties, ContextInfo contextInfo)
           
protected  void addAdditionalAttributes(Map<String,String> attributes, ProposalInfo proposalInfo, DocumentDetail docDetail)
           
protected  boolean checkDocumentLevelPermissions()
           
protected abstract  Object get(String id, ContextInfo contextInfo)
          Implement this method to make to make service call to get DTO object.
 Data getData(String id, ContextInfo contextInfo)
           
 Map<String,Object> getDefaultFilterProperties(ContextInfo contextInfo)
           
protected abstract  String getDefaultMetaDataState()
           
protected abstract  String getDefaultWorkflowDocumentType()
           
protected abstract  Class<?> getDtoClass()
          Implement this method to return the type of the dto object.
 Metadata getMetadata(String id, Map<String,String> attributes, ContextInfo contextInfo)
           
 PermissionService getPermissionService()
           
 ProposalService getProposalService()
           
 TransformationManager getTransformationManager()
           
 WorkflowDocumentService getWorkflowDocumentService()
           
 Boolean isAuthorized(PermissionType type, Map<String,String> attributes, ContextInfo contextInfo)
           
protected abstract  Object save(Object dto, Map<String,Object> properties, ContextInfo contextInfo)
          Implement this method to make a service call to get DTO object.
 DataSaveResult saveData(Data data, ContextInfo contextInfo)
           
 void setPermissionService(PermissionService permissionService)
           
 void setProposalService(ProposalService proposalService)
           
 void setTransformationManager(TransformationManager transformationManager)
           
 void setWorkflowDocumentService(WorkflowDocumentService workflowDocumentService)
           
protected abstract  List<ValidationResultInfo> validate(Object dto, ContextInfo contextInfo)
          Implement this method to make a service call to get DTO object.
 List<ValidationResultInfo> validateData(Data data, ContextInfo contextInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataService

public AbstractDataService()
Method Detail

getData

public Data getData(String id,
                    ContextInfo contextInfo)
             throws OperationFailedException
Specified by:
getData in interface DataService
Throws:
OperationFailedException

getMetadata

public Metadata getMetadata(String id,
                            Map<String,String> attributes,
                            ContextInfo contextInfo)
Specified by:
getMetadata in interface DataService

saveData

@Transactional(readOnly=false,
               noRollbackFor=DoesNotExistException.class,
               rollbackFor=java.lang.Throwable.class)
public DataSaveResult saveData(Data data,
                                                                                                                                 ContextInfo contextInfo)
                        throws OperationFailedException,
                               DataValidationErrorException,
                               VersionMismatchException
Specified by:
saveData in interface DataService
Throws:
OperationFailedException
DataValidationErrorException
VersionMismatchException

validateData

public List<ValidationResultInfo> validateData(Data data,
                                               ContextInfo contextInfo)
                                        throws OperationFailedException
Specified by:
validateData in interface DataService
Throws:
OperationFailedException

isAuthorized

public Boolean isAuthorized(PermissionType type,
                            Map<String,String> attributes,
                            ContextInfo contextInfo)
Specified by:
isAuthorized in interface DataService

addAdditionalAttributes

protected void addAdditionalAttributes(Map<String,String> attributes,
                                       ProposalInfo proposalInfo,
                                       DocumentDetail docDetail)

getDefaultFilterProperties

public Map<String,Object> getDefaultFilterProperties(ContextInfo contextInfo)

_saveData

protected DataSaveResult _saveData(Data data,
                                   Map<String,Object> filterProperties,
                                   ContextInfo contextInfo)
                            throws OperationFailedException
Throws:
OperationFailedException

checkDocumentLevelPermissions

protected boolean checkDocumentLevelPermissions()

getTransformationManager

public TransformationManager getTransformationManager()

setTransformationManager

public void setTransformationManager(TransformationManager transformationManager)

getPermissionService

public PermissionService getPermissionService()

setPermissionService

public void setPermissionService(PermissionService permissionService)

getProposalService

public ProposalService getProposalService()

setProposalService

public void setProposalService(ProposalService proposalService)

getWorkflowDocumentService

public WorkflowDocumentService getWorkflowDocumentService()

setWorkflowDocumentService

public void setWorkflowDocumentService(WorkflowDocumentService workflowDocumentService)

getDefaultWorkflowDocumentType

protected abstract String getDefaultWorkflowDocumentType()

getDefaultMetaDataState

protected abstract String getDefaultMetaDataState()

get

protected abstract Object get(String id,
                              ContextInfo contextInfo)
                       throws Exception
Implement this method to make to make service call to get DTO object. The method is called by the get(Data) method before it invokes transformationManager to convert DTO to a Data map

Parameters:
id - DTO id
contextInfo -
Returns:
the dto retrieved by calling the appropriate service method
Throws:
Exception

save

protected abstract Object save(Object dto,
                               Map<String,Object> properties,
                               ContextInfo contextInfo)
                        throws Exception
Implement this method to make a service call to get DTO object. The method is called by the save(Data) method after it invokes transformationManager to convert Data map to DTO

Parameters:
dto -
properties -
Returns:
the persisted dto object
Throws:
Exception

validate

protected abstract List<ValidationResultInfo> validate(Object dto,
                                                       ContextInfo contextInfo)
                                                throws Exception
Implement this method to make a service call to get DTO object. The method is called in the save(data) method before calling the save(dto,properties) method to validate the data

Parameters:
dto -
Returns:
Throws:
Exception

getDtoClass

protected abstract Class<?> getDtoClass()
Implement this method to return the type of the dto object.

Returns:
The object type returned and expected by the get & save dto methods


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