org.jasig.schedassist.portlet.webflow
Class FlowHelper

java.lang.Object
  extended by org.jasig.schedassist.portlet.webflow.FlowHelper

@Service(value="flowHelper")
public class FlowHelper
extends Object

Helper that wraps PortletSchedulingAssistantService functions for web flows.

Version:
$Id: FlowHelper.java $
Author:
Nicholas Blair, nblair@doit.wisc.edu

Field Summary
static String CURRENT_USER_ATTR
           
protected static String NO
           
protected static String YES
           
 
Constructor Summary
FlowHelper()
           
 
Method Summary
 EventCancellation cancelAppointment(CancelAppointmentFormBackingObject fbo, IScheduleOwner owner)
           
 CancelAppointmentFormBackingObject constructCancelAppointmentFormBackingObject(IScheduleOwner owner, Date startTime, Date endTime)
           
 CreateAppointmentFormBackingObject constructCreateAppointmentFormBackingObject(IScheduleOwner owner, Date startDateTime)
           
 Date convertDateTime(String dateTimePhrase)
           
 net.fortuna.ical4j.model.component.VEvent createAppointment(CreateAppointmentFormBackingObject fbo, IScheduleOwner owner)
           
 String getAdvisorUrl()
           
 String getAvailableWebBaseUrl()
           
 String getCurrentVisitorUsername()
           
 String getOwnerNoteboard(IScheduleOwner owner)
           
 List<String> getOwnerNoteboardSentences(IScheduleOwner owner)
           
 String getProfileSearchUrl()
           
 List<Relationship> getRelationshipsForCurrentVisitor()
           
 VisibleSchedule getVisibleSchedule(IScheduleOwner owner, int weekStart)
           
 VisibleSchedule getVisibleSchedule(IScheduleOwner owner, String weekStartParam)
          WebFlow can't apparently do type conversion on request parameters.
 VisibleScheduleRequestConstraints getVisibleScheduleRequestConstraints(IScheduleOwner owner, int weekStart)
           
 IScheduleOwner identifyTargetOwner(long ownerId)
           
 boolean isCurrentVisitorEligible()
           
 boolean isOwnerSamePersonAsCurrentVisitor(IScheduleOwner owner)
           
protected  int safeConvertWeekStartParam(String weekStartParam)
           
 void setAvailableWebBaseUrl(String availableWebBaseUrl)
           
 void setNormalWindowState(org.springframework.webflow.context.ExternalContext context)
           
 void setPortletAvailableService(PortletSchedulingAssistantService schedulingAssistantService)
           
 String testExceededMeetingLimit(IScheduleOwner owner)
           
 String validateChosenStartTime(VisibleWindow window, Date startTime)
          Verify the startTime argument is within the window; return NO if not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YES

protected static final String YES
See Also:
Constant Field Values

NO

protected static final String NO
See Also:
Constant Field Values

CURRENT_USER_ATTR

public static final String CURRENT_USER_ATTR
Constructor Detail

FlowHelper

public FlowHelper()
Method Detail

setPortletAvailableService

public void setPortletAvailableService(@Qualifier(value="portlet")
                                       PortletSchedulingAssistantService schedulingAssistantService)
Parameters:
schedulingAssistantService - the portletAvailableService to set

setAvailableWebBaseUrl

public void setAvailableWebBaseUrl(String availableWebBaseUrl)
Parameters:
availableWebBaseUrl - the availableWebBaseUrl to set

getAvailableWebBaseUrl

public String getAvailableWebBaseUrl()
Returns:
the availableWebBaseUrl

getAdvisorUrl

public String getAdvisorUrl()
Returns:
the advisorUrl

getProfileSearchUrl

public String getProfileSearchUrl()
Returns:
the profileSearchUrl

setNormalWindowState

public void setNormalWindowState(org.springframework.webflow.context.ExternalContext context)

convertDateTime

public Date convertDateTime(String dateTimePhrase)
                     throws ParseException
Parameters:
dateTimePhrase -
Returns:
Throws:
ParseException

getCurrentVisitorUsername

public String getCurrentVisitorUsername()
Returns:
the value of REMOTE_USER in the current PortletRequest.

isCurrentVisitorEligible

public boolean isCurrentVisitorEligible()
Returns:

getRelationshipsForCurrentVisitor

public List<Relationship> getRelationshipsForCurrentVisitor()
Returns:

isOwnerSamePersonAsCurrentVisitor

public boolean isOwnerSamePersonAsCurrentVisitor(IScheduleOwner owner)
Parameters:
owner -
Returns:

identifyTargetOwner

public IScheduleOwner identifyTargetOwner(long ownerId)
                                   throws ScheduleOwnerNotFoundException
Parameters:
ownerId -
Returns:
Throws:
ScheduleOwnerNotFoundException

getOwnerNoteboard

public String getOwnerNoteboard(IScheduleOwner owner)
Parameters:
owner -
Returns:

getOwnerNoteboardSentences

public List<String> getOwnerNoteboardSentences(IScheduleOwner owner)
Parameters:
owner -
Returns:
the owner's noteboard preference as a List of sentences

testExceededMeetingLimit

public String testExceededMeetingLimit(IScheduleOwner owner)
Parameters:
owner -
weekStart -
Returns:

getVisibleSchedule

public VisibleSchedule getVisibleSchedule(IScheduleOwner owner,
                                          String weekStartParam)
                                   throws ScheduleOwnerNotFoundException
WebFlow can't apparently do type conversion on request parameters.

Parameters:
owner -
weekStartParam -
Returns:
Throws:
ScheduleOwnerNotFoundException

getVisibleSchedule

public VisibleSchedule getVisibleSchedule(IScheduleOwner owner,
                                          int weekStart)
                                   throws ScheduleOwnerNotFoundException
Parameters:
ownerId -
weekStart -
Returns:
Throws:
ScheduleOwnerNotFoundException

getVisibleScheduleRequestConstraints

public VisibleScheduleRequestConstraints getVisibleScheduleRequestConstraints(IScheduleOwner owner,
                                                                              int weekStart)
Parameters:
owner -
weekStart -
Returns:

constructCreateAppointmentFormBackingObject

public CreateAppointmentFormBackingObject constructCreateAppointmentFormBackingObject(IScheduleOwner owner,
                                                                                      Date startDateTime)
                                                                               throws SchedulingException
Parameters:
owner -
startDateTime -
Returns:
Throws:
SchedulingException

createAppointment

public net.fortuna.ical4j.model.component.VEvent createAppointment(CreateAppointmentFormBackingObject fbo,
                                                                   IScheduleOwner owner)
                                                            throws SchedulingException
Parameters:
fbo -
owner -
Returns:
Throws:
SchedulingException

validateChosenStartTime

public String validateChosenStartTime(VisibleWindow window,
                                      Date startTime)
Verify the startTime argument is within the window; return NO if not.

Parameters:
window -
startTime -
Returns:
YES for valid, NO for invalid

constructCancelAppointmentFormBackingObject

public CancelAppointmentFormBackingObject constructCancelAppointmentFormBackingObject(IScheduleOwner owner,
                                                                                      Date startTime,
                                                                                      Date endTime)
                                                                               throws SchedulingException
Parameters:
owner -
startTime -
endTime -
Returns:
Throws:
SchedulingException

cancelAppointment

public EventCancellation cancelAppointment(CancelAppointmentFormBackingObject fbo,
                                           IScheduleOwner owner)
                                    throws SchedulingException
Parameters:
fbo -
owner -
Returns:
the event cancellation details
Throws:
SchedulingException

safeConvertWeekStartParam

protected int safeConvertWeekStartParam(String weekStartParam)
Parameters:
weekStartParam -
Returns:


Copyright © 2012 Jasig. All Rights Reserved.