public class AwardTemplateSyncServiceImpl extends Object implements AwardTemplateSyncService
SYNC_PROPERTY| Constructor and Description |
|---|
AwardTemplateSyncServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkSourceField(Object awardTemplateObject,
Object awardObject,
Field field,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate) |
protected boolean |
checkSourceList(Object awardTemplateObject,
Object awardObject,
Field field,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate) |
protected boolean |
checkTargetField(Object awardTemplateObject,
Object awardObject,
Field field,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This checks to see if a target field is null or otherwise empty.
|
protected boolean |
checkTargetList(Object awardTemplateObject,
Object awardObject,
Field field,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
Check the target list, returns true if there is an element in the collection that is in scope.
|
protected AwardComment |
clearListElement(AwardComment comment,
Class syncClass,
Award award,
AwardTemplate awardTemplate) |
protected void |
copyField(Object awardTemplateObject,
Object awardObject,
Field field,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This copies value from Award Template object to Award object
|
protected Stack<AwardTemplateSyncScope[]> |
createScopeStack()
This method returns an empty scope stack.
|
protected void |
extractListFromParentAndSync(Object awardTemplateObject,
Object awardObject,
Field field,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This method is for extracting the appropriate list from award by using property name and sync the list
|
protected AwardTemplate |
fetchAwardTemplate(Award award)
This method is to fetch the award template by using template code from Award object.
|
protected void |
findAllFields(Class klass,
List<Field> allFields)
This method uses recursion to find all declared fields for a class hierierachy
|
protected Method |
findIsInScopeMethodForClass(Class clazz) |
protected AwardTemplateComment |
findSourceListElementFromTarget(AwardComment comment,
Map<Object,Object> sourceToTargetMap,
Award award,
AwardTemplate awardTemplate) |
org.kuali.rice.krad.service.BusinessObjectService |
getBusinessObjectService()
Gets the businessObjectService attribute.
|
protected Method |
getClearExistingElementMethod(Class targetClass) |
protected Method |
getCreateNewListElementMethod(Class syncSourceClass)
This method finds the appropriate getOrCreateNewListElementObject for a class.
|
protected AwardTemplateSyncScope[] |
getEffectiveScope(Stack<AwardTemplateSyncScope[]> scopeStack)
This method calculates the scope that should be used for an element given a scope stack.
|
protected Method |
getFindSourceListElementFromTargetMethod(Class targetClass) |
org.kuali.rice.krad.service.KualiRuleService |
getKualiRuleService()
Gets the kualiRuleService attribute.
|
protected AwardComment |
getOrCreateNewListElementObject(AwardTemplateComment sourceComment,
Class syncClass,
Award award,
AwardTemplate awardTemplate,
boolean createNew) |
protected AwardReportTermRecipient |
getOrCreateNewListElementObject(AwardTemplateReportTermRecipient recipient,
Class syncClass,
Award award,
AwardTemplate awardTemplate,
boolean createNew) |
protected AwardSponsorTerm |
getOrCreateNewListElementObject(AwardTemplateTerm sponsorTerm,
Class syncClass,
Award award,
AwardTemplate awardTemplate,
boolean createNew) |
protected Object |
getOrCreateNewListElementObject(Object sourceObject,
Class syncClass,
Award award,
AwardTemplate awardTemplate,
boolean createNew) |
protected AwardTemplateSyncScope[] |
getScopeArray(AwardTemplateSyncScope scope)
Get an array of AwardTemplateSyncScopes that should be used.
|
protected void |
invokeMethodToSync(Award awardObject,
List awardTemplateObjectList,
String syncMethodName,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This method is to invoke individual method if there is a method mentioned in the AwardSyncableList annotation
|
static String |
scopesArrayToDelimitedList(AwardTemplateSyncScope[] scopes)
Utility method to generate a comma delimited list of scopes contained in the array passed in.
|
void |
setBusinessObjectService(org.kuali.rice.krad.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.
|
void |
setKualiRuleService(org.kuali.rice.krad.service.KualiRuleService kualiRuleService)
Sets the kualiRuleService attribute value.
|
protected void |
sync(Object awardTemplateObject,
Object awardObject,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This method is used to sync member properties of an award template object to an award object
|
void |
syncAwardComments(Award awardObject,
List<AwardTemplateComment> awardTemplateComments,
Stack<AwardTemplateSyncScope[]> scopeStack)
This is an overloaded method for syncing only AwardComments.
|
void |
syncAwardSponsorTerms(Award awardObject,
List<AwardTemplateTerm> awardTemplateTerms,
Stack<AwardTemplateSyncScope[]> scopeStack)
This is an overloaded method for syncing only AwardSponsorTerms.
|
boolean |
syncAwardToTemplate(AwardDocument awardDocument,
AwardTemplateSyncScope[] scopes)
This method is to sync a particular syncable list from award template
|
protected void |
syncListObjects(Object awardObject,
List<Object> listObject,
Field field,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This is the default method use to sync objects.
|
protected boolean |
syncSourceCheck(Object awardTemplateObject,
Object awardObject,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This method
|
protected boolean |
syncTargetCheck(Object awardTemplateObject,
Object awardObject,
AwardTemplateSyncScope[] scopes,
Stack<AwardTemplateSyncScope[]> scopeStack,
Award award,
AwardTemplate awardTemplate)
This method
|
boolean |
syncWillAlterData(AwardDocument awardDocument,
AwardTemplateSyncScope scope)
Method checks if a scope sync will alter existing data within the award when called with a specific scope.
|
boolean |
templateContainsScopedData(AwardDocument awardDocument,
AwardTemplateSyncScope scope)
Method returns true if the award's award template contains data that would
be synchronized in the provided scope.
|
public boolean syncAwardToTemplate(AwardDocument awardDocument, AwardTemplateSyncScope[] scopes)
AwardTemplateSyncServicesyncAwardToTemplate in interface AwardTemplateSyncServiceAwardTemplateSyncService.syncAwardToTemplate(org.kuali.kra.award.document.AwardDocument, org.kuali.kra.award.AwardTemplateSyncScope[])public boolean syncWillAlterData(AwardDocument awardDocument, AwardTemplateSyncScope scope)
AwardTemplateSyncServicesyncWillAlterData in interface AwardTemplateSyncServiceawardDocument - The award document to check.scope - The scope to check.AwardTemplateSyncService.syncWillAlterData(org.kuali.kra.award.document.AwardDocument, org.kuali.kra.award.AwardTemplateSyncScope)public boolean templateContainsScopedData(AwardDocument awardDocument, AwardTemplateSyncScope scope)
AwardTemplateSyncServicetemplateContainsScopedData in interface AwardTemplateSyncServiceawardDocument - The award document to check.scope - The scope to check.AwardTemplateSyncService.templateContainsScopedData(org.kuali.kra.award.document.AwardDocument, org.kuali.kra.award.AwardTemplateSyncScope)protected AwardTemplateSyncScope[] getScopeArray(AwardTemplateSyncScope scope)
scope - The scopeprotected Stack<AwardTemplateSyncScope[]> createScopeStack()
protected boolean syncTargetCheck(Object awardTemplateObject, Object awardObject, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - Exceptionprotected boolean checkTargetField(Object awardTemplateObject, Object awardObject, Field field, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - field - Exceptionprotected boolean syncSourceCheck(Object awardTemplateObject, Object awardObject, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - Exceptionprotected boolean checkSourceField(Object awardTemplateObject, Object awardObject, Field field, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate)
protected boolean checkSourceList(Object awardTemplateObject, Object awardObject, Field field, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
Exceptionprotected void extractListFromParentAndSync(Object awardTemplateObject, Object awardObject, Field field, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - propertyName - awardSyncableList - Exceptionprotected AwardTemplateSyncScope[] getEffectiveScope(Stack<AwardTemplateSyncScope[]> scopeStack) throws IllegalStateException
scopeStack - The scope stack you want to get the effective scope for.IllegalStateException - if there is no array in the stack that contains a scope other than CONTAINING_CLASS_INHERIT.protected void invokeMethodToSync(Award awardObject, List awardTemplateObjectList, String syncMethodName, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardObject - awardTemplateObjectList - syncMethodName - Exceptionprotected void sync(Object awardTemplateObject, Object awardObject, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - Exceptionprotected void findAllFields(Class klass, List<Field> allFields)
klass - allFields - protected void copyField(Object awardTemplateObject, Object awardObject, Field field, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - field - Exceptionprotected boolean checkTargetList(Object awardTemplateObject, Object awardObject, Field field, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardTemplateObject - awardObject - propertyName - awardSyncableList - Exceptionprotected void syncListObjects(Object awardObject, List<Object> listObject, Field field, AwardTemplateSyncScope[] scopes, Stack<AwardTemplateSyncScope[]> scopeStack, Award award, AwardTemplate awardTemplate) throws Exception
awardObject - listObject - objectInList - field - Exceptionprotected Method getCreateNewListElementMethod(Class syncSourceClass)
syncSourceClass - - The class you wish to find the method for. If a specific method for this class does not exist, the generic method is returned.protected Method getFindSourceListElementFromTargetMethod(Class targetClass)
protected Object getOrCreateNewListElementObject(Object sourceObject, Class syncClass, Award award, AwardTemplate awardTemplate, boolean createNew)
protected AwardComment getOrCreateNewListElementObject(AwardTemplateComment sourceComment, Class syncClass, Award award, AwardTemplate awardTemplate, boolean createNew)
protected AwardComment clearListElement(AwardComment comment, Class syncClass, Award award, AwardTemplate awardTemplate)
protected AwardTemplateComment findSourceListElementFromTarget(AwardComment comment, Map<Object,Object> sourceToTargetMap, Award award, AwardTemplate awardTemplate)
protected AwardSponsorTerm getOrCreateNewListElementObject(AwardTemplateTerm sponsorTerm, Class syncClass, Award award, AwardTemplate awardTemplate, boolean createNew)
protected AwardReportTermRecipient getOrCreateNewListElementObject(AwardTemplateReportTermRecipient recipient, Class syncClass, Award award, AwardTemplate awardTemplate, boolean createNew)
protected AwardTemplate fetchAwardTemplate(Award award)
Award - objectpublic org.kuali.rice.krad.service.BusinessObjectService getBusinessObjectService()
public void setBusinessObjectService(org.kuali.rice.krad.service.BusinessObjectService businessObjectService)
businessObjectService - The businessObjectService to set.public void syncAwardComments(Award awardObject, List<AwardTemplateComment> awardTemplateComments, Stack<AwardTemplateSyncScope[]> scopeStack)
awardObject - templateComments - objectInList - propertyName - public void syncAwardSponsorTerms(Award awardObject, List<AwardTemplateTerm> awardTemplateTerms, Stack<AwardTemplateSyncScope[]> scopeStack)
awardObject - templateTerms - objectInList - propertyName - public org.kuali.rice.krad.service.KualiRuleService getKualiRuleService()
public void setKualiRuleService(org.kuali.rice.krad.service.KualiRuleService kualiRuleService)
kualiRuleService - The kualiRuleService to set.public static final String scopesArrayToDelimitedList(AwardTemplateSyncScope[] scopes)
scopes - Copyright © 2013 The Kuali Foundation. All Rights Reserved.