|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.schedassist.impl.caldav.DefaultCaldavDialectImpl
public class DefaultCaldavDialectImpl
Class to encapsulate generation of the dialect between the scheduling assistant and the CalDAV server.
| Field Summary | |
|---|---|
protected static String |
DATE_FORMAT
Date format expected by CalDAV servers. |
protected static net.fortuna.ical4j.model.property.ProdId |
PROD_ID
ProdId attached to Calendars sent to the CalDAV server by the Scheduling Assistant. |
| Constructor Summary | |
|---|---|
DefaultCaldavDialectImpl()
|
|
| Method Summary | |
|---|---|
protected String |
formatDateTime(Date date)
Convert the date to a String using the format: |
org.apache.commons.httpclient.methods.RequestEntity |
generateGetCalendarRequestEntity(Date startDate,
Date endDate)
Generate an appropriate RequestEntity body for retrieving Calendar data between
the specified dates. |
protected String |
generateGetCalendarRequestXML(Date startDate,
Date endDate)
Generate the XML that makes up a valid CalDAV calendar-query request body that would be issued with a REPORT request for Calendar events between the 2 Date arguments. |
org.apache.commons.httpclient.methods.RequestEntity |
generatePutAppointmentRequestEntity(net.fortuna.ical4j.model.component.VEvent event)
Generate an appropriate RequestEntity body for storing the specified VEvent. |
String |
getAccountHomePrefix()
|
String |
getAccountHomeSuffix()
|
URI |
getCaldavHost()
Return a URI that resolves to the root address of the CalDAV server,
e.g. |
String |
getCalendarAccountHome(ICalendarAccount calendarAccount)
Returns a String that represents the "Path" the ICalendarAccount's
calendar home directory. |
URI |
resolveCalendarURI(CalendarWithURI calendar)
Return a URI that represents the full URI to the URI field within the CalendarWithURI. |
void |
setAccountHomePrefix(String accountHomePrefix)
|
void |
setAccountHomeSuffix(String accountHomeSuffix)
|
void |
setCaldavHost(URI caldavHost)
Annotated with Resource to allow injection by name. |
void |
setEventUtils(IEventUtils eventUtils)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String DATE_FORMAT
protected static final net.fortuna.ical4j.model.property.ProdId PROD_ID
ProdId attached to Calendars sent to the CalDAV server by the Scheduling Assistant.
| Constructor Detail |
|---|
public DefaultCaldavDialectImpl()
| Method Detail |
|---|
public String getAccountHomePrefix()
public void setAccountHomePrefix(String accountHomePrefix)
accountHomePrefix - the accountHomePrefix to setpublic String getAccountHomeSuffix()
public void setAccountHomeSuffix(String accountHomeSuffix)
accountHomeSuffix - the accountHomeSuffix to setpublic URI getCaldavHost()
CaldavDialectURI that resolves to the root address of the CalDAV server,
e.g. 'http://localhost:8080'
getCaldavHost in interface CaldavDialectURI for the CalDAV serverpublic void setCaldavHost(URI caldavHost)
Resource to allow injection by name.
caldavHost - the caldavHost to setpublic void setEventUtils(IEventUtils eventUtils)
eventUtils - the eventUtils to set
public org.apache.commons.httpclient.methods.RequestEntity generateGetCalendarRequestEntity(Date startDate,
Date endDate)
CaldavDialectRequestEntity body for retrieving Calendar data between
the specified dates.
generateGetCalendarRequestEntity in interface CaldavDialectRequestEntity used with the REPORT request to retrieve an account's Calendar data between the 2 Dates
protected String generateGetCalendarRequestXML(Date startDate,
Date endDate)
Date arguments.
startDate - endDate -
public org.apache.commons.httpclient.methods.RequestEntity generatePutAppointmentRequestEntity(net.fortuna.ical4j.model.component.VEvent event)
CaldavDialectRequestEntity body for storing the specified VEvent.
Per the CalDAV RFC:
PUT /home/lisa/calendars/events/qwue23489.ics HTTP/1.1
If-None-Match: *
Host: cal.example.com
Content-Type: text/calendar
Content-Length: xxxx
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:20010712T182145Z-123401@example.com
DTSTAMP:20060712T182145Z
DTSTART:20060714T170000Z
DTEND:20060715T040000Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
This method is focused on all of the content in the above example with the exception of
the very first line ('PUT /home/lisa...').
generatePutAppointmentRequestEntity in interface CaldavDialectRequestEntity used with the PUT request to store the specified VEventpublic String getCalendarAccountHome(ICalendarAccount calendarAccount)
CaldavDialectString that represents the "Path" the ICalendarAccount's
calendar home directory.
The calendar home directory is used as the base path for retrieving/storing calendar
data for that calendar account.
The return value MUST be terminated with a "/".
getCalendarAccountHome in interface CaldavDialectpublic URI resolveCalendarURI(CalendarWithURI calendar)
CaldavDialectURI that represents the full URI to the URI field within the CalendarWithURI.
It's common for CalDAV servers to respond with just a path (e.g. /caldav/some/user/file.ics) in the href
attribute for a calendar-query method response.
The intent of this method is to return a string that is composed of:
caldavhost + calendarWithUri.getUri()
Implementations may need to adjust from above, but the primary responsibility of this method is to return
a string that looks like:
http://hostname.somewhere.org:8080/caldav/some/user/file.ics
resolveCalendarURI in interface CaldavDialectprotected String formatDateTime(Date date)
yyyyMMdd'T'HHmmssZ
date -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||