|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mycompany.controller.AbstractController
com.mycompany.controller.EventController
public class EventController
This class implements controller behavior for a number of screens in the application. It supports the member dashboard, shows, and reviews screens. This class is responsible for handling any calendar event related data and functionality for the application.
Constructor Summary | |
---|---|
EventController()
|
Method Summary | |
---|---|
void |
dateSelected(org.primefaces.event.SelectEvent evt)
This method is called when the user clicks on a date in the calendar. |
void |
eventMoved(org.primefaces.event.ScheduleEntryMoveEvent evt)
This method is called when the user moves a calendar Event from
one date/time to another date/time. |
void |
eventResized(org.primefaces.event.ScheduleEntryResizeEvent evt)
This method is called when the user resizes an event. |
void |
eventSelected(org.primefaces.event.SelectEvent evt)
This method is called when the user clicks on an existing event in the schedule. |
java.util.List<Event> |
getAllEvents()
This method returns all Event objects in the database. |
java.util.List<EventAttendance> |
getAllEventsAttendance()
This method returns a list of EventAttendance objects
encapsulating information about a user's attendance for a particular
event. |
Event |
getEvent()
This method returns the currently selected Event . |
EventType[] |
getEventTypes()
This method returns an array of EventType enum objects. |
org.primefaces.model.ScheduleModel |
getUserScheduleModel()
This method provides a LazyScheduleModel for the PrimeFaces
schedule component. |
void |
init(javax.faces.event.ComponentSystemEvent evt)
This method is called by JSF when the view is first loaded. |
void |
newEvent(javax.faces.event.ActionEvent evt)
This method is called when the user clicks on the "New Event" button in the mobile web application. |
void |
refreshAttendance(javax.faces.event.ActionEvent event)
This method is called from the reviews screen to refresh the EventAttendance data. |
void |
saveEvent(javax.faces.event.ActionEvent evt)
This method is called when the user clicks the "Save" button in the new event dialog. |
void |
setEvent(Event event)
Sets the Event . |
void |
setEventService(EventService eventService)
|
void |
updateAttendance(EventAttendance attendance)
This method updates the current user's EventAttendance object for a particular event. |
Methods inherited from class com.mycompany.controller.AbstractController |
---|
setUserSession |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventController()
Method Detail |
---|
public void dateSelected(org.primefaces.event.SelectEvent evt)
Event
object.
evt
- The SelectEvent
object.public void eventMoved(org.primefaces.event.ScheduleEntryMoveEvent evt)
Event
from
one date/time to another date/time. It updates the object and saves the
changes to the database.
evt
- The ScheduleEntryMoveEvent
object.public void eventResized(org.primefaces.event.ScheduleEntryResizeEvent evt)
Event
object and updates the
database.
evt
- The ScheduleEntryResizeEvent
object.public void eventSelected(org.primefaces.event.SelectEvent evt)
evt
- The SelectEvent
object.public java.util.List<Event> getAllEvents()
Event
objects in the database.
public java.util.List<EventAttendance> getAllEventsAttendance()
EventAttendance
objects
encapsulating information about a user's attendance for a particular
event.
public Event getEvent()
Event
.
public EventType[] getEventTypes()
EventType
enum objects.
public org.primefaces.model.ScheduleModel getUserScheduleModel()
LazyScheduleModel
for the PrimeFaces
schedule component. It loads all events for the current user that have a
start date between two dates. The overridden
LazyScheduleModel.loadEvents(Date, Date)
method is called by
PrimeFaces when data is needed for a particular date range.
ScheduleModel
object.public void init(javax.faces.event.ComponentSystemEvent evt)
Event
objects from the database so they can be displayed in
the UI, and prepares the EventAttendance
model for the current
user.
evt
- The JSF ComponentSystemEvent
object.public void newEvent(javax.faces.event.ActionEvent evt)
Event
object
and assigns it to the event
instance variable.
evt
- The JSF ActionEvent
object.public void refreshAttendance(javax.faces.event.ActionEvent event)
EventAttendance
data. When the user reloads the dashboard, the
getAllEventsAttendance()
method will see that this instance
variable is null, and reload the data to update the graph.
event
- The JSF ActionEvent
object.public void saveEvent(javax.faces.event.ActionEvent evt)
Event
object to the database.
evt
- The JSF ActionEvent
object.public void setEvent(Event event)
Event
.
event
- The Event object.public void setEventService(EventService eventService)
public void updateAttendance(EventAttendance attendance)
This method updates the current user's EventAttendance object for a
particular event. It uses the JPA EntityManager.merge(Object)
method to save the object's changes to the database, and then replaces
this object in the allEventsAttendance
list to ensure the latest
object is loaded in the UI.
Note: this method is called directly from the UI since it takes advantage of the Expression Language (EL) 2.2 feature that allows method argument passing from JSF.
attendance
- The EventAttendance
object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |