com.quadrique.jbuildingblocks.core.google.calendar
Class JbbGCalendar

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.google.calendar.JbbGCalendar

public class JbbGCalendar
extends Object


Method Summary
 com.google.gdata.data.calendar.CalendarEventEntry addEvent(JbbGCalendarUser user, String eventTitle, String eventContent, JbbDate startTime, JbbDate endTime)
          to add a single (non recurrent) event
 com.google.gdata.data.calendar.CalendarEventEntry addEventExtendedProperty(com.google.gdata.data.calendar.CalendarEventEntry entry, String name, String value)
          Adds an extended property to a calendar event.
 com.google.gdata.data.calendar.CalendarEventEntry addEventParticipant(com.google.gdata.data.calendar.CalendarEventEntry entry, String participantEmailAddress, boolean sendNotification)
           
 com.google.gdata.data.calendar.CalendarEventEntry addEventParticipants(com.google.gdata.data.calendar.CalendarEventEntry entry, List<String> participantEmailAddresses, boolean sendNotifications)
          Add participants to a calendar event.
 com.google.gdata.data.calendar.CalendarEventEntry addEventReminder(com.google.gdata.data.calendar.CalendarEventEntry entry, int numMinutes, com.google.gdata.data.extensions.Reminder.Method method)
          Adds a reminder to a calendar event.
 com.google.gdata.data.calendar.CalendarEventEntry addQuickAddEvent(JbbGCalendarUser user, String quickAddContent)
          Creates a quick add event.
 com.google.gdata.data.calendar.CalendarEventEntry addRecurringEvent(JbbGCalendarUser user, String eventTitle, String eventContent, String recurData)
          Creates a new recurring event.
 com.google.gdata.data.calendar.CalendarEventEntry addWebContentEvent(JbbGCalendarUser user, String title, String type, String url, String icon, String width, String height)
          Creates a web content event.
 List<JbbDateSpan> getAvailableDateSpans(JbbGCalendarUser user, JbbDate from, JbbDate to, int minNbOfMinutes)
           
 List<JbbDateSpan> getBusyDateSpans(JbbGCalendarUser user, JbbDate from, JbbDate to)
           
 com.google.gdata.data.calendar.CalendarEntry getCalendar(JbbGCalendarUser user)
           
 List<com.google.gdata.data.calendar.CalendarEntry> getCalendarsAll(JbbGCalendarUser user)
           
 List<com.google.gdata.data.calendar.CalendarEntry> getCalendarsOwned(JbbGCalendarUser user)
           
 com.google.gdata.data.calendar.CalendarEventEntry getEvent(JbbGCalendarUser user, URL entryUrl)
           
 List<String> getEventParticipants(com.google.gdata.data.calendar.CalendarEventEntry entry)
           
 List<com.google.gdata.data.calendar.CalendarEventEntry> getEvents(JbbGCalendarUser user, JbbGCalendarQuery query)
           
static URL getEventUrl(com.google.gdata.data.calendar.CalendarEventEntry entry)
           
 com.google.gdata.data.calendar.CalendarEventEntry modifyEventSchedule(com.google.gdata.data.calendar.CalendarEventEntry entry, JbbDate newStartTime, JbbDate newEndTime)
          Reschedule to the specified date.
 com.google.gdata.data.calendar.CalendarEventEntry modifyEventSchedule(JbbGCalendarUser user, URL entryUrl, JbbDate newStartTime, JbbDate newEndTime)
          Reschedule to the specified date.
 com.google.gdata.data.calendar.CalendarEventEntry modifyEventTitle(com.google.gdata.data.calendar.CalendarEventEntry entry, String newTitle)
          Updates the title of an existing calendar event.
 com.google.gdata.data.calendar.CalendarEventEntry modifyEventTitle(JbbGCalendarUser user, URL entryUrl, String newTitle)
          Updates the title of an existing calendar event.
static JbbGCalendar newInstance()
           
 void removeEvent(com.google.gdata.data.calendar.CalendarEventEntry entry)
           
 void removeEvent(JbbGCalendarUser user, com.google.gdata.data.calendar.CalendarEventEntry entry)
           
 void removeEvent(JbbGCalendarUser user, URL eventUrl)
           
 com.google.gdata.data.calendar.CalendarEventEntry removeEventParticipant(com.google.gdata.data.calendar.CalendarEventEntry entry, String participantEmailAddress, boolean sendNotification)
          Remove the given participant (if it is found) for the given event
 void removeEvents(JbbGCalendarUser user, JbbDate from, JbbDate to)
          Removes all the events that are starting in the given date range
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static JbbGCalendar newInstance()
Returns:
a new instance

getCalendar

public com.google.gdata.data.calendar.CalendarEntry getCalendar(JbbGCalendarUser user)
                                                         throws IOException,
                                                                com.google.gdata.util.ServiceException
Parameters:
user - the user object
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server

getCalendarsOwned

public List<com.google.gdata.data.calendar.CalendarEntry> getCalendarsOwned(JbbGCalendarUser user)
                                                                     throws IOException,
                                                                            com.google.gdata.util.ServiceException
Parameters:
user - the user object
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server

getCalendarsAll

public List<com.google.gdata.data.calendar.CalendarEntry> getCalendarsAll(JbbGCalendarUser user)
                                                                   throws IOException,
                                                                          com.google.gdata.util.ServiceException
Parameters:
user - the user object
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server

getEvents

public List<com.google.gdata.data.calendar.CalendarEventEntry> getEvents(JbbGCalendarUser user,
                                                                         JbbGCalendarQuery query)
                                                                  throws Exception
Parameters:
user - the user object
the - query object
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.
Exception

getBusyDateSpans

public List<JbbDateSpan> getBusyDateSpans(JbbGCalendarUser user,
                                          JbbDate from,
                                          JbbDate to)
                                   throws Exception
Parameters:
user - user object.
from - Start time (inclusive) of events to print.
to - End time (exclusive) of events to print.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.
Exception

getAvailableDateSpans

public List<JbbDateSpan> getAvailableDateSpans(JbbGCalendarUser user,
                                               JbbDate from,
                                               JbbDate to,
                                               int minNbOfMinutes)
                                        throws Exception
Parameters:
user -
from -
to -
minNbOfMinutes - do not return any date/time span that is less than minNbOfMinutes
Returns:
returns all the available date/time spans with the given minimum duration in the calendar
Throws:
Exception

addEvent

public com.google.gdata.data.calendar.CalendarEventEntry addEvent(JbbGCalendarUser user,
                                                                  String eventTitle,
                                                                  String eventContent,
                                                                  JbbDate startTime,
                                                                  JbbDate endTime)
                                                           throws Exception
to add a single (non recurrent) event

Parameters:
user -
eventTitle -
eventContent -
startTime -
endTime -
Returns:
Throws:
Exception

getEventUrl

public static URL getEventUrl(com.google.gdata.data.calendar.CalendarEventEntry entry)
Parameters:
entry -

removeEvent

public void removeEvent(JbbGCalendarUser user,
                        URL eventUrl)
                 throws Exception
Parameters:
user -
entry -
Throws:
Exception

removeEvent

public void removeEvent(JbbGCalendarUser user,
                        com.google.gdata.data.calendar.CalendarEventEntry entry)
                 throws Exception
Parameters:
user -
entry -
Throws:
Exception

removeEvent

public void removeEvent(com.google.gdata.data.calendar.CalendarEventEntry entry)
                 throws Exception
Parameters:
user -
entry -
Throws:
Exception

getEvent

public com.google.gdata.data.calendar.CalendarEventEntry getEvent(JbbGCalendarUser user,
                                                                  URL entryUrl)
                                                           throws Exception
Parameters:
user -
entry -
Throws:
Exception

removeEvents

public void removeEvents(JbbGCalendarUser user,
                         JbbDate from,
                         JbbDate to)
                  throws Exception
Removes all the events that are starting in the given date range

Parameters:
user -
from -
to -
Throws:
Exception

addQuickAddEvent

public com.google.gdata.data.calendar.CalendarEventEntry addQuickAddEvent(JbbGCalendarUser user,
                                                                          String quickAddContent)
                                                                   throws Exception
Creates a quick add event.

Parameters:
user - user object.
quickAddContent - The quick add text, including the event title, date and time.
Returns:
The newly-created CalendarEventEntry.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.
Exception

addWebContentEvent

public com.google.gdata.data.calendar.CalendarEventEntry addWebContentEvent(JbbGCalendarUser user,
                                                                            String title,
                                                                            String type,
                                                                            String url,
                                                                            String icon,
                                                                            String width,
                                                                            String height)
                                                                     throws com.google.gdata.util.ServiceException,
                                                                            IOException
Creates a web content event.

Parameters:
user - user object.
title - The title of the web content event.
type - The MIME type of the web content event, e.g. "image/gif"
url - The URL of the content to display in the web content window.
icon - The icon to display in the main Calendar user interface.
width - The width of the web content window.
height - The height of the web content window.
Returns:
The newly-created CalendarEventEntry.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

addRecurringEvent

public com.google.gdata.data.calendar.CalendarEventEntry addRecurringEvent(JbbGCalendarUser user,
                                                                           String eventTitle,
                                                                           String eventContent,
                                                                           String recurData)
                                                                    throws com.google.gdata.util.ServiceException,
                                                                           IOException
Creates a new recurring event.

Parameters:
user - user object.
eventTitle - Title of the event to create.
eventContent - Text content of the event to create.
Returns:
The newly-created CalendarEventEntry.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

modifyEventTitle

public com.google.gdata.data.calendar.CalendarEventEntry modifyEventTitle(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                          String newTitle)
                                                                   throws com.google.gdata.util.ServiceException,
                                                                          IOException
Updates the title of an existing calendar event.

Parameters:
entry - The event to update.
newTitle - The new title for this event.
Returns:
The updated CalendarEventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

modifyEventTitle

public com.google.gdata.data.calendar.CalendarEventEntry modifyEventTitle(JbbGCalendarUser user,
                                                                          URL entryUrl,
                                                                          String newTitle)
                                                                   throws Exception
Updates the title of an existing calendar event.

Parameters:
entryUrl - The URL of the event to update.
newTitle - The new title for this event.
Returns:
The updated CalendarEventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.
Exception

modifyEventSchedule

public com.google.gdata.data.calendar.CalendarEventEntry modifyEventSchedule(JbbGCalendarUser user,
                                                                             URL entryUrl,
                                                                             JbbDate newStartTime,
                                                                             JbbDate newEndTime)
                                                                      throws Exception
Reschedule to the specified date.

Parameters:
entryUrl - The URL of the event to update.
newStartTime -
newEndTime -
Returns:
The updated CalendarEventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.
Exception

modifyEventSchedule

public com.google.gdata.data.calendar.CalendarEventEntry modifyEventSchedule(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                             JbbDate newStartTime,
                                                                             JbbDate newEndTime)
                                                                      throws com.google.gdata.util.ServiceException,
                                                                             IOException
Reschedule to the specified date.

Parameters:
entry - The event to update.
newStartTime -
newEndTime -
Returns:
The updated CalendarEventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

addEventReminder

public com.google.gdata.data.calendar.CalendarEventEntry addEventReminder(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                          int numMinutes,
                                                                          com.google.gdata.data.extensions.Reminder.Method method)
                                                                   throws com.google.gdata.util.ServiceException,
                                                                          IOException
Adds a reminder to a calendar event.

Parameters:
entry - The event to update.
numMinutes - Reminder time, in minutes.
method - e.g.Reminder.Method.SMS or Reminder.Method.ALL
Returns:
The updated EventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

addEventParticipant

public com.google.gdata.data.calendar.CalendarEventEntry addEventParticipant(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                             String participantEmailAddress,
                                                                             boolean sendNotification)
                                                                      throws com.google.gdata.util.ServiceException,
                                                                             IOException
Parameters:
entry -
participantEmailAddress -
sendNotification -
Returns:
Throws:
com.google.gdata.util.ServiceException
IOException

addEventParticipants

public com.google.gdata.data.calendar.CalendarEventEntry addEventParticipants(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                              List<String> participantEmailAddresses,
                                                                              boolean sendNotifications)
                                                                       throws com.google.gdata.util.ServiceException,
                                                                              IOException
Add participants to a calendar event.

Parameters:
entry -
participantEmailAddresses -
sendNotifications - if true, an email will be sent to the added participants
Returns:
Throws:
com.google.gdata.util.ServiceException
IOException

removeEventParticipant

public com.google.gdata.data.calendar.CalendarEventEntry removeEventParticipant(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                                String participantEmailAddress,
                                                                                boolean sendNotification)
                                                                         throws com.google.gdata.util.ServiceException,
                                                                                IOException
Remove the given participant (if it is found) for the given event

Parameters:
entry -
participantEmailAddress -
sendNotification -
Returns:
Throws:
com.google.gdata.util.ServiceException
IOException

addEventExtendedProperty

public com.google.gdata.data.calendar.CalendarEventEntry addEventExtendedProperty(com.google.gdata.data.calendar.CalendarEventEntry entry,
                                                                                  String name,
                                                                                  String value)
                                                                           throws com.google.gdata.util.ServiceException,
                                                                                  IOException
Adds an extended property to a calendar event.

Parameters:
entry - The event to update.
Returns:
The updated EventEntry object.
Throws:
com.google.gdata.util.ServiceException - If the service is unable to handle the request.
IOException - Error communicating with the server.

getEventParticipants

public List<String> getEventParticipants(com.google.gdata.data.calendar.CalendarEventEntry entry)
                                  throws Exception
Parameters:
entry - The event
Throws:
Exception


Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.