org.kuali.student.lum.course.service.assembler
Class FormatAssembler

java.lang.Object
  extended by org.kuali.student.lum.course.service.assembler.FormatAssembler
All Implemented Interfaces:
BOAssembler<FormatInfo,CluInfo>

public class FormatAssembler
extends Object
implements BOAssembler<FormatInfo,CluInfo>

Assembler for FormatInfo. Assembles/Disassemble FormatInfo from CluInfo and other structures.

Author:
Kuali Student Team

Field Summary
private  BOAssembler<ActivityInfo,CluInfo> activityAssembler
           
(package private) static Logger LOG
           
private  LuService luService
           
 
Constructor Summary
FormatAssembler()
           
 
Method Summary
 FormatInfo assemble(CluInfo clu, FormatInfo formatInfo, boolean shallowBuild)
          This method assembles the business DTO from its base DTO.
 BaseDTOAssemblyNode<FormatInfo,CluInfo> disassemble(FormatInfo format, BaseDTOAssemblyNode.NodeOperation operation)
          This method returns a collection of base DTOs and the operations that need to be performed on them in a given order
private  List<BaseDTOAssemblyNode<?,?>> disassembleActivities(String nodeId, FormatInfo format, BaseDTOAssemblyNode.NodeOperation operation)
          This method will return assembly nodes representing activities and activity->format relations for a format based on the operation CREATE: all activities and format-> activity relations will be created UPDATE: activities will be taken from the luService and compared with the incomming format's activities.
 BOAssembler<ActivityInfo,CluInfo> getActivityAssembler()
           
 LuService getLuService()
           
 void setActivityAssembler(BOAssembler<ActivityInfo,CluInfo> activityAssembler)
           
 void setLuService(LuService luService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

static final Logger LOG

activityAssembler

private BOAssembler<ActivityInfo,CluInfo> activityAssembler

luService

private LuService luService
Constructor Detail

FormatAssembler

public FormatAssembler()
Method Detail

assemble

public FormatInfo assemble(CluInfo clu,
                           FormatInfo formatInfo,
                           boolean shallowBuild)
                    throws AssemblyException
Description copied from interface: BOAssembler
This method assembles the business DTO from its base DTO.

Specified by:
assemble in interface BOAssembler<FormatInfo,CluInfo>
Parameters:
clu - Base DTO that corresponds to the business DTO
formatInfo - Reference to Business DTO
shallowBuild - boolean flag to indicate if the assembly should be shallow or deep
Returns:
Assembled business DTO
Throws:
AssemblyException

disassemble

public BaseDTOAssemblyNode<FormatInfo,CluInfo> disassemble(FormatInfo format,
                                                           BaseDTOAssemblyNode.NodeOperation operation)
                                                    throws AssemblyException
Description copied from interface: BOAssembler
This method returns a collection of base DTOs and the operations that need to be performed on them in a given order

Specified by:
disassemble in interface BOAssembler<FormatInfo,CluInfo>
Parameters:
format - Business DTO to be disassembled
Returns:
A sorted map of BaseDTOAssemblyNodes to be processed in the given order. The key (Integer) is the sequence in which the nodes have to be processed
Throws:
AssemblyException

disassembleActivities

private List<BaseDTOAssemblyNode<?,?>> disassembleActivities(String nodeId,
                                                             FormatInfo format,
                                                             BaseDTOAssemblyNode.NodeOperation operation)
                                                      throws AssemblyException,
                                                             DoesNotExistException,
                                                             InvalidParameterException,
                                                             MissingParameterException,
                                                             OperationFailedException
This method will return assembly nodes representing activities and activity->format relations for a format based on the operation CREATE: all activities and format-> activity relations will be created UPDATE: activities will be taken from the luService and compared with the incomming format's activities. Any new activites will be created with a corresponding CluCluRelation Any existing activities will be Updated All leftover activities and their CluCluRelations will be deleted DELETE: all activities and their CluCluRelations will be deleted If the Operation

Parameters:
format -
result -
operation -
Returns:
List of Assembly nodes
Throws:
AssemblyException
OperationFailedException
MissingParameterException
InvalidParameterException
DoesNotExistException

getActivityAssembler

public BOAssembler<ActivityInfo,CluInfo> getActivityAssembler()

setActivityAssembler

public void setActivityAssembler(BOAssembler<ActivityInfo,CluInfo> activityAssembler)

getLuService

public LuService getLuService()

setLuService

public void setLuService(LuService luService)


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