org.jasig.portlet.courses.dao
Class MergingCoursesDaoImpl

java.lang.Object
  extended by org.jasig.portlet.courses.dao.MergingCoursesDaoImpl
All Implemented Interfaces:
ICoursesDao

public class MergingCoursesDaoImpl
extends Object
implements ICoursesDao

MergingCoursesDaoImpl merges together information from multiple data sources. This implementation will merge together matching terms and courses that contain identical IDs. In the case that two sources specify information for a single-value property (e.g. GPA), the last DAO in the list will be given priority. In the case of multi-valued list properties (instructors), the lists from each source will be merged together.

Version:
$Revision$
Author:
Jen Bourey, jennifer.bourey@gmail.com

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
MergingCoursesDaoImpl()
           
 
Method Summary
 CoursesByTerm getCoursesByTerm(javax.portlet.PortletRequest request, String termCode)
          Get courses for a term for the current user
 TermList getTermList(javax.portlet.PortletRequest request)
          Get a term list for the current user
protected  void mergeCourse(Course original, Course additional)
          Merge together information from the additional course into the provided original course.
protected  void mergeCourseSummaries(CoursesByTerm original, CoursesByTerm additional)
           
protected  void mergeTermSummaries(TermList original, TermList additional)
           
 void setCourseDaos(List<ICoursesDao> courseDaos)
          Set the list of course DAOs to be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

MergingCoursesDaoImpl

public MergingCoursesDaoImpl()
Method Detail

setCourseDaos

public void setCourseDaos(List<ICoursesDao> courseDaos)
Set the list of course DAOs to be called. This list will be called in order, and conflicting information will be resolved by prioritizing information from the last DAO.

Parameters:
courseDaos -

getTermList

public TermList getTermList(javax.portlet.PortletRequest request)
Description copied from interface: ICoursesDao
Get a term list for the current user

Specified by:
getTermList in interface ICoursesDao
Returns:

getCoursesByTerm

public CoursesByTerm getCoursesByTerm(javax.portlet.PortletRequest request,
                                      String termCode)
Description copied from interface: ICoursesDao
Get courses for a term for the current user

Specified by:
getCoursesByTerm in interface ICoursesDao
Returns:

mergeTermSummaries

protected void mergeTermSummaries(TermList original,
                                  TermList additional)

mergeCourseSummaries

protected void mergeCourseSummaries(CoursesByTerm original,
                                    CoursesByTerm additional)

mergeCourse

protected void mergeCourse(Course original,
                           Course additional)
Merge together information from the additional course into the provided original course.

Parameters:
original -
additional -


Copyright © 2012 Jasig. All Rights Reserved.