Project Wonder 5.0

er.calendar
Class ERPublishCalendarPage

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.calendar.ERPublishCalendarPage
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable, java.lang.Cloneable

public class ERPublishCalendarPage
extends com.webobjects.appserver.WOComponent

ERPublishCalendarPage is a WebObjects component for dynamically generated iCalendar documents.

The response created by ERPublishCalendarPage is an iCalendar document (.ics) containing the events added to ERPublishCalendarPage by the application (see addEvent). An iCalendar-aware application, such as Apple's iCal, can subscribe to such a calendar, provided that the page has a fixed URL (either is the "Main" page, or a direct action serves the page).

Events added to a ERPublishCalendarPage is objects of any class that implements the ERCalendarEvent interface. Existing classes (for example EOCustomObject subclasses), that correspond to calendar events, can easily be modified to implement ERCalendarEvent and thus be added directly to ERPublishCalendarPage. If existing classes does not directly correspond to calendar events, create events from business data (or some algorithm) using either the included ERSimpleEvent class, a subclass of ERSimpleEvent, or any other class implementing the ERCalendarEvent interface.

Version:
1.0, 2002-09-30
See Also:
Serialized Form
Author:
Johan Carlberg

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException
 
Field Summary
protected  java.lang.String calendarName
           
protected  java.lang.String calendarTimeZone
           
protected  com.webobjects.foundation.NSTimestampFormatter dateFormatter
           
protected  com.webobjects.foundation.NSTimestampFormatter dateTimeFormatter
           
 ERCalendarEvent event
           
protected  com.webobjects.foundation.NSMutableArray events
           
protected  com.webobjects.foundation.NSTimestamp eventTimestamp
           
protected  int maxLineLength
           
static java.lang.String newline
           
protected  com.webobjects.foundation.NSTimestampFormatter timeZoneFormatter
           
protected  com.webobjects.foundation.NSTimestampFormatter utcDateTimeFormatter
           
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
ERPublishCalendarPage(com.webobjects.appserver.WOContext context)
          Standard constructor for WOComponent subclasses.
 
Method Summary
 void addEvent(ERCalendarEvent event)
          Adds an event to the calendar.
 void addEventsFromArray(com.webobjects.foundation.NSArray eventsArray)
          Adds an array of events to the calendar.
 void appendToResponse(com.webobjects.appserver.WOResponse aResponse, com.webobjects.appserver.WOContext aContext)
          Modifies content encoding to UTF8, and content type to text/calendar.
 java.lang.String calendarName()
           
 java.lang.String calendarTimeZone()
           
 com.webobjects.foundation.NSTimestampFormatter dateFormatter()
           
 com.webobjects.foundation.NSTimestampFormatter dateTimeFormatter()
           
 java.lang.String escapedCalendarName()
           
 java.lang.String escapedCalendarTimeZone()
           
 java.lang.String escapedEventStatus()
           
 java.lang.String escapedEventSummary()
           
 java.lang.String escapedEventUniqueId()
           
protected  java.lang.String escapedString(java.lang.String string)
           
 java.lang.String eventRepeatDayOfWeekString()
           
 java.lang.String eventRepeatDaysOfMonthString()
           
 java.lang.String eventRepeatFrequency()
           
 java.lang.Number eventRepeatMonth()
           
 com.webobjects.foundation.NSMutableArray events()
           
 com.webobjects.foundation.NSTimestamp eventTimestamp()
           
protected  java.lang.String foldLongLinesInString(java.lang.String content)
          Folds lines that are longer than the maximum allowed 75 characters.
 void removeEvent(ERCalendarEvent event)
          Removes a previously added event from the calendar.
 void removeEventsInArray(com.webobjects.foundation.NSArray eventsArray)
          Removes an array of previously added events from the calendar.
 void setCalendarName(java.lang.String value)
          Sets the name of the calendar.
 void setCalendarTimeZone(java.lang.String value)
          Sets the name of the time zone for the calendar.
 com.webobjects.foundation.NSTimestampFormatter timeZoneFormatter()
           
 com.webobjects.foundation.NSTimestampFormatter utcDateTimeFormatter()
           
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _awakeInContext, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

calendarName

protected java.lang.String calendarName

calendarTimeZone

protected java.lang.String calendarTimeZone

maxLineLength

protected final int maxLineLength
See Also:
Constant Field Values

newline

public static java.lang.String newline

events

protected com.webobjects.foundation.NSMutableArray events

event

public ERCalendarEvent event

eventTimestamp

protected com.webobjects.foundation.NSTimestamp eventTimestamp

dateTimeFormatter

protected com.webobjects.foundation.NSTimestampFormatter dateTimeFormatter

dateFormatter

protected com.webobjects.foundation.NSTimestampFormatter dateFormatter

utcDateTimeFormatter

protected com.webobjects.foundation.NSTimestampFormatter utcDateTimeFormatter

timeZoneFormatter

protected com.webobjects.foundation.NSTimestampFormatter timeZoneFormatter
Constructor Detail

ERPublishCalendarPage

public ERPublishCalendarPage(com.webobjects.appserver.WOContext context)
Standard constructor for WOComponent subclasses.

Parameters:
context - context of a transaction
See Also:
WOComponent.pageWithName(String), WOApplication.pageWithName(String, WOContext)
Method Detail

appendToResponse

public void appendToResponse(com.webobjects.appserver.WOResponse aResponse,
                             com.webobjects.appserver.WOContext aContext)
Modifies content encoding to UTF8, and content type to text/calendar.

Overrides:
appendToResponse in class com.webobjects.appserver.WOComponent
Parameters:
aResponse - the HTTP response that an application returns to a Web server to complete a cycle of the request-response loop
aContext - context of a transaction

addEvent

public void addEvent(ERCalendarEvent event)
Adds an event to the calendar.

Parameters:
event - the event to be included in the calendar
See Also:
ERCalendarEvent, addEventsFromArray(NSArray)

addEventsFromArray

public void addEventsFromArray(com.webobjects.foundation.NSArray eventsArray)
Adds an array of events to the calendar.

Parameters:
eventsArray - the events to be included in the calendar
See Also:
ERCalendarEvent, addEvent(ERCalendarEvent)

removeEvent

public void removeEvent(ERCalendarEvent event)
Removes a previously added event from the calendar.

Parameters:
event - the event to be removed from the calendar
See Also:
ERCalendarEvent, removeEventsInArray(NSArray)

removeEventsInArray

public void removeEventsInArray(com.webobjects.foundation.NSArray eventsArray)
Removes an array of previously added events from the calendar.

Parameters:
eventsArray - the events to be removed from the calendar
See Also:
ERCalendarEvent, removeEvent(ERCalendarEvent)

events

public com.webobjects.foundation.NSMutableArray events()

calendarName

public java.lang.String calendarName()
Returns:
name of the calendar
See Also:
setCalendarName(String)

escapedCalendarName

public java.lang.String escapedCalendarName()
Returns:
name of the calendar, backslash escaped for inclusion in iCalendar document.
See Also:
calendarName

setCalendarName

public void setCalendarName(java.lang.String value)
Sets the name of the calendar.

Parameters:
value - name of the calendar
See Also:
calendarName

calendarTimeZone

public java.lang.String calendarTimeZone()
Returns:
originating time zone for the calendar (name of the system default time zone, if not changed by setCalendarTimeZone
See Also:
setCalendarTimeZone(String)

escapedCalendarTimeZone

public java.lang.String escapedCalendarTimeZone()
Returns:
time zone name of the calendar, backslash escaped for inclusion in iCalendar document.
See Also:
calendarTimeZone

setCalendarTimeZone

public void setCalendarTimeZone(java.lang.String value)
Sets the name of the time zone for the calendar.

Parameters:
value - name of the time zone
See Also:
calendarTimeZone

escapedEventStatus

public java.lang.String escapedEventStatus()
Returns:
status of the current event, backslash escaped for inclusion in iCalendar document.
See Also:
ERCalendarEvent#status

escapedEventSummary

public java.lang.String escapedEventSummary()
Returns:
summary of the current event, backslash escaped for inclusion in iCalendar document.
See Also:
ERCalendarEvent#summary

escapedEventUniqueId

public java.lang.String escapedEventUniqueId()
Returns:
unique id of the current event, backslash escaped for inclusion in iCalendar document.
See Also:
ERCalendarEvent#uniqueId

eventTimestamp

public com.webobjects.foundation.NSTimestamp eventTimestamp()
Returns:
timestamp of the current event. This will always be the current time, as this is the time the event is converted to an iCalendar event.

eventRepeatFrequency

public java.lang.String eventRepeatFrequency()
Returns:
the recurring rule frequency, as one of "YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY" depending on the value returned by repeatFrequency.
See Also:
ERCalendarEvent#repeatFrequency

eventRepeatMonth

public java.lang.Number eventRepeatMonth()
Returns:
month number of a repeating event for use in the "BYMONTH" parameter.

eventRepeatDayOfWeekString

public java.lang.String eventRepeatDayOfWeekString()
Returns:
day of week of a repeating event for use in the "BYDAY" parameter.

eventRepeatDaysOfMonthString

public java.lang.String eventRepeatDaysOfMonthString()
Returns:
days of month of a repeating event for use in the "BYMONTHDAY" parameter.

dateTimeFormatter

public com.webobjects.foundation.NSTimestampFormatter dateTimeFormatter()
Returns:
formatter for date/time. Will format date/times as "20021003T191234", specified in the local time zone.

dateFormatter

public com.webobjects.foundation.NSTimestampFormatter dateFormatter()
Returns:
formatter for dates. Will format dates as "20021003", specified in the local time zone.

utcDateTimeFormatter

public com.webobjects.foundation.NSTimestampFormatter utcDateTimeFormatter()
Returns:
formatter for date/time stamps. Will format date/times as "20021003T171234Z", specified in UTC (GMT).

timeZoneFormatter

public com.webobjects.foundation.NSTimestampFormatter timeZoneFormatter()
Returns:
formatter for time zone. Will format date/times as only the name of the local time zone.

escapedString

protected java.lang.String escapedString(java.lang.String string)
Returns:
backslash escaped text string, with special characters replaced with its backslash escaped equivalent.

foldLongLinesInString

protected java.lang.String foldLongLinesInString(java.lang.String content)
Folds lines that are longer than the maximum allowed 75 characters.

Parameters:
content - unfolded iCalendar content
Returns:
folded content, with no line longer than 75 characters

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.