org.jasig.portlet.calendar.mvc
Class ViewSelectorDefaultImpl

java.lang.Object
  extended by org.jasig.portlet.calendar.mvc.ViewSelectorDefaultImpl
All Implemented Interfaces:
IViewSelector

public class ViewSelectorDefaultImpl
extends Object
implements IViewSelector

ViewSelectorDefaultImpl provides a default implementation of IViewSelector that returns JSP view names based on a combination of the browser user agent string and the portlet window state. Requests which indicate that the user is interacting with the portlet via a mobile device, or that the portlet is currently not in maximized mode will result in a "narrow" view of the calendar. Non-mobile devices using the portlet in the maximized window state will be shown the "wide" view of the portlet.

Version:
$Revision: 24031 $
Author:
Jen Bourey

Constructor Summary
ViewSelectorDefaultImpl()
           
 
Method Summary
 String getCalendarViewName(javax.portlet.PortletRequest request)
          Return the JSP view name of the main calendar view for this request.
 String getEditViewName(javax.portlet.PortletRequest request)
           
 String getEventListViewName(javax.portlet.PortletRequest request)
          Return the JSP view name of the AJAX event list for this request.
protected  boolean isMobile(javax.portlet.PortletRequest request)
           
 void setMobileDeviceRegexes(List<String> patterns)
          Set a list of regex patterns for user agents which should be considered to be mobile devices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewSelectorDefaultImpl

public ViewSelectorDefaultImpl()
Method Detail

setMobileDeviceRegexes

public void setMobileDeviceRegexes(List<String> patterns)
Set a list of regex patterns for user agents which should be considered to be mobile devices.

Parameters:
patterns -

getCalendarViewName

public String getCalendarViewName(javax.portlet.PortletRequest request)
Description copied from interface: IViewSelector
Return the JSP view name of the main calendar view for this request.

Specified by:
getCalendarViewName in interface IViewSelector
Returns:

getEditViewName

public String getEditViewName(javax.portlet.PortletRequest request)
Specified by:
getEditViewName in interface IViewSelector

getEventListViewName

public String getEventListViewName(javax.portlet.PortletRequest request)
Description copied from interface: IViewSelector
Return the JSP view name of the AJAX event list for this request.

Specified by:
getEventListViewName in interface IViewSelector
Returns:

isMobile

protected boolean isMobile(javax.portlet.PortletRequest request)


Copyright © 2012 Jasig. All Rights Reserved.