org.jasig.portlet.calendar.adapter
Class CoursesCalendarAdapter

java.lang.Object
  extended by org.jasig.portlet.calendar.adapter.AbstractCalendarAdapter
      extended by org.jasig.portlet.calendar.adapter.CoursesCalendarAdapter
All Implemented Interfaces:
ICalendarAdapter

public class CoursesCalendarAdapter
extends AbstractCalendarAdapter
implements ICalendarAdapter

Implementation of ICalendarAdapter that creates a single calendar in a CalendarEventSet using data from a user's courses for the term. The implementation expects that a term has a start and end date specified.

Version:
$Id$
Author:
James Wennmacher, jameswennmacher@gmail.com

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
CoursesCalendarAdapter()
           
 
Method Summary
 CalendarEventSet getEvents(CalendarConfiguration calendarConfiguration, org.joda.time.Interval interval, javax.portlet.PortletRequest request)
          Get events for the defined calendar and time period.
 String getLink(CalendarConfiguration calendar, org.joda.time.Interval interval, javax.portlet.PortletRequest request)
          Get hyper link for the defined calendar.
protected  net.fortuna.ical4j.model.Calendar retrieveCourseCalendar(javax.portlet.PortletRequest request, org.joda.time.Interval interval, CalendarConfiguration calendarConfiguration, org.jasig.portlet.courses.model.xml.Term term)
          Return the full set of events (class schedule) for all the user's courses for the indicated term.
 void setCache(net.sf.ehcache.Cache cache)
           
 void setCacheKeyGenerator(ICacheKeyGenerator cacheKeyGenerator)
           
 void setCacheKeyPrefix(String cacheKeyPrefix)
           
 void setContentProcessor(IContentProcessor contentProcessor)
           
 void setCourseDao(org.jasig.portlet.courses.dao.ICoursesDao courseDao)
           
 
Methods inherited from class org.jasig.portlet.calendar.adapter.AbstractCalendarAdapter
getDescriptionKey, getParameters, getTitleKey, insertCalendarEventSetIntoCache, insertCalendarEventSetIntoCache, setDescriptionKey, setParameters, setTitleKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.portlet.calendar.adapter.ICalendarAdapter
getDescriptionKey, getParameters, getTitleKey
 

Field Detail

log

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

CoursesCalendarAdapter

public CoursesCalendarAdapter()
Method Detail

setCache

public void setCache(net.sf.ehcache.Cache cache)

setCourseDao

public void setCourseDao(org.jasig.portlet.courses.dao.ICoursesDao courseDao)

setCacheKeyGenerator

public void setCacheKeyGenerator(ICacheKeyGenerator cacheKeyGenerator)

setCacheKeyPrefix

public void setCacheKeyPrefix(String cacheKeyPrefix)

setContentProcessor

public void setContentProcessor(IContentProcessor contentProcessor)

getEvents

public CalendarEventSet getEvents(CalendarConfiguration calendarConfiguration,
                                  org.joda.time.Interval interval,
                                  javax.portlet.PortletRequest request)
                           throws CalendarException
Description copied from interface: ICalendarAdapter
Get events for the defined calendar and time period. The user's PortletRequest is made available to give the calendar adapter access to useful information such as the UserInfo map, session data, etc. These items can be used to identify the user, provide access to authentication resources, or other useful operations.

Specified by:
getEvents in interface ICalendarAdapter
Parameters:
calendarConfiguration - calendar configuration for which to retrieve events
interval - time period for which to retrieve events
request - user's portlet request
Returns:
Set of events for this calendar and time period
Throws:
CalendarException

getLink

public String getLink(CalendarConfiguration calendar,
                      org.joda.time.Interval interval,
                      javax.portlet.PortletRequest request)
               throws CalendarLinkException
Description copied from interface: ICalendarAdapter
Get hyper link for the defined calendar. In cases where the calendar resource has a web interface, this method allows provides access to the url.

Specified by:
getLink in interface ICalendarAdapter
Parameters:
calendar - calendar configuration for which to retrieve events
interval - time period for which to retrieve events
request - user's servlet request
Returns:
Set of events for this calendar and time period
Throws:
CalendarLinkException

retrieveCourseCalendar

protected final net.fortuna.ical4j.model.Calendar retrieveCourseCalendar(javax.portlet.PortletRequest request,
                                                                         org.joda.time.Interval interval,
                                                                         CalendarConfiguration calendarConfiguration,
                                                                         org.jasig.portlet.courses.model.xml.Term term)
Return the full set of events (class schedule) for all the user's courses for the indicated term.

Parameters:
request - portlet request
interval - requested interval
calendarConfiguration - calendar config
term - term to get class schedule for
Returns:
User's schedule of classes for the indicated term, represented as calendar events


Copyright © 2012 Jasig. All Rights Reserved.