org.jasig.schedassist.web
Class VisibleScheduleTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.springframework.web.servlet.tags.RequestContextAwareTag
          extended by org.jasig.schedassist.web.VisibleScheduleTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class VisibleScheduleTag
extends org.springframework.web.servlet.tags.RequestContextAwareTag

JSP tag for rendering a VisibleSchedule.

Version:
$Id: VisibleScheduleTag.java 2527 2010-09-10 19:25:38Z npblair $
Author:
Nicholas Blair, nblair@doit.wisc.edu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
logger, REQUEST_CONTEXT_PAGE_ATTRIBUTE
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
VisibleScheduleTag()
           
 
Method Summary
 int doEndTag()
           
protected  boolean doesWeekHaveBlocks(Map<Date,List<AvailableBlock>> dailySchedules)
          Inspects the List of AvailableBlock for each map key between the start and end arguments.
 int doStartTagInternal()
           
 org.springframework.context.MessageSource getMessageSource()
           
protected  String getSilkIconPrefix(javax.servlet.ServletContext servletContext)
           
protected  void renderAttendingBlock(javax.servlet.ServletContext servletContext, javax.servlet.jsp.JspWriter writer, AvailableBlock event)
          Render a single AvailableBlock with AvailableStatus.ATTENDING.
protected  void renderBusyBlock(javax.servlet.ServletContext servletContext, javax.servlet.jsp.JspWriter writer, AvailableBlock event)
          Render a single AvailableBlock with AvailableStatus.BUSY.
protected  void renderFreeBlock(javax.servlet.ServletContext servletContext, javax.servlet.jsp.JspWriter writer, AvailableBlock event)
          Render a single AvailableBlock with AvailableStatus.FREE.
protected  void renderWeek(javax.servlet.ServletContext servletContext, javax.servlet.jsp.JspWriter writer, int weekNumber, SortedMap<Date,List<AvailableBlock>> dailySchedules, SortedMap<AvailableBlock,AvailableStatus> scheduleBlockMap)
          Render a single week.
 void setPreviewMode(boolean previewMode)
           
 void setVisibleSchedule(VisibleSchedule visibleSchedule)
           
 
Methods inherited from class org.springframework.web.servlet.tags.RequestContextAwareTag
doCatch, doFinally, doStartTag, getRequestContext
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisibleScheduleTag

public VisibleScheduleTag()
Method Detail

setVisibleSchedule

public void setVisibleSchedule(VisibleSchedule visibleSchedule)
Parameters:
visibleSchedule - the visibleSchedule to set

setPreviewMode

public void setPreviewMode(boolean previewMode)
Parameters:
previewMode - the previewMode to set

getMessageSource

public org.springframework.context.MessageSource getMessageSource()
Returns:
the MessageSource

getSilkIconPrefix

protected String getSilkIconPrefix(javax.servlet.ServletContext servletContext)
Returns:
the path to the silk icons directory (dependency on ServletContext of the request)

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doStartTagInternal

public int doStartTagInternal()
Specified by:
doStartTagInternal in class org.springframework.web.servlet.tags.RequestContextAwareTag

doesWeekHaveBlocks

protected boolean doesWeekHaveBlocks(Map<Date,List<AvailableBlock>> dailySchedules)
Inspects the List of AvailableBlock for each map key between the start and end arguments. If any List for those keys is not empty, return true.

Parameters:
dailySchedules -
start -
end -
Returns:
true if any blocks exist between start and end; false if none.

renderWeek

protected void renderWeek(javax.servlet.ServletContext servletContext,
                          javax.servlet.jsp.JspWriter writer,
                          int weekNumber,
                          SortedMap<Date,List<AvailableBlock>> dailySchedules,
                          SortedMap<AvailableBlock,AvailableStatus> scheduleBlockMap)
                   throws IOException
Render a single week.

Parameters:
servletContext -
writer -
weekNumber -
dailySchedules -
scheduleBlockMap -
Throws:
IOException

renderBusyBlock

protected void renderBusyBlock(javax.servlet.ServletContext servletContext,
                               javax.servlet.jsp.JspWriter writer,
                               AvailableBlock event)
                        throws IOException
Render a single AvailableBlock with AvailableStatus.BUSY.

Parameters:
servletContext -
writer -
event -
Throws:
IOException

renderFreeBlock

protected void renderFreeBlock(javax.servlet.ServletContext servletContext,
                               javax.servlet.jsp.JspWriter writer,
                               AvailableBlock event)
                        throws IOException
Render a single AvailableBlock with AvailableStatus.FREE.

Parameters:
servletContext -
writer -
event -
Throws:
IOException

renderAttendingBlock

protected void renderAttendingBlock(javax.servlet.ServletContext servletContext,
                                    javax.servlet.jsp.JspWriter writer,
                                    AvailableBlock event)
                             throws IOException
Render a single AvailableBlock with AvailableStatus.ATTENDING.

Parameters:
writer -
event -
Throws:
IOException


Copyright © 2011 Jasig. All Rights Reserved.