Making Bedework Events Available
Calendar suites
Each calendar suite in your Bedework implementation can produce a custom web site, and you will need at least one calendar suite to display public events or to produce data feeds. For more information, see the topics already covered in this chapter (section 4.5).
Downloads
Events and whole calendars can be downloaded in iCalendar format from Bedework's web interfaces. The downloads are suitable for any desktop calendar client such as MS Outlook and Apple's iCal. They can be imported into other calendar systems as well.
To download an event, look for the download icon on the event details page or in a list view. To download a calendar, visit the "All Topical Areas" section of a public calendar suite and select the icon to download the calendar. Calendars can be downloaded from today into the future, for past dates, or for a date range.
Subscriptions
Subscriptions to Bedework's public events can be pulled for use in Bedework's user client, where there is built in integration for subscribing to public calendars, and from any ical capable calendar client. RSS and javascript feeds are also available (see "Data feeds" below).
Data feeds - ical, raw xml, rss, json, js, etc.
Bedework 3.6 ships with a specialized application for serving data feeds: the "feeder" web app found at http://localhost:8080/feeder. The feeder app comes with a number of skins, the default being clean XML.
...
Several caching systems have been recently developed for use with Bedework. Please visit the Bedework webite, wiki, and mailing lists for information about caching if you anticipate using the feed API directly against your system.
Action: listEvents
"listEvents.do" generates a listing of discrete events optionally filtered by categories or creator in a range of time. This listing is useful for RSS, javascript, and ical feeds and for producing the traditional event list such as a printed Academic Calendar or agenda.
...
The action's simplest form looks like:
http://localhost:8080/cal/listEvents.do
and returns the discrete events for the next seven days.
Parameters:
Time parameters:
• days=n (number of days to display forward from "today"; default is seven days.)
...
A number of Bedework skins provide a means for arbitrary filtering, and are easily extended. For example, the list-json.xsl skin found in the feeder app allows for the a key/value pair to be sent with a filter name as an application variable. By extending this file you could, for example, send the parameter: "setappvar=filter(location:Jefferson Hall)" and then use this to filter events in the stylesheet.
Examples:
(note: these exclude the calPath parameter. In most cases, you should append the calPath to the query string shown. e.g. "&calPath=/public/cals/MainCal").
...
*http://localhost:8080/cal/main/listEvents.do?start=2009-06-07&format=text/calendar*
returns events in icalendar format for seven days starting June 7, 2009
Output:
Events are represented as follows:
...
http://www.bedework.org/trac/bedework/wiki/BedeworkManual/v3.6/DesignGuide/jsonFeeds
Cached Feed and URL/Widget Builder
The Cached Feed and URL Builder are packaged in the Tomcat server found in the Bedework quickstart and provide a way for users to produce cached data feeds and widgets for public events.
URL/Widget Builder
From the user's perspective it all starts here. The user fills out a web form where she dictates which events she wants (lectures and seminars hosted by the School of Architecture, for example), over what timeframe (the next 21 days, the current month, etc.) and in what form (rss feed, iframe widget, etc.). For those looking for a feed, the form generates a URL that when clicked initiates a download (icalendar) or perhaps an invocation of their feed aggregators (rss). For those looking for a widget, the form writes some paste-able code into a text box.
CachedFeeder
CachedFeeder is written in Ruby and uses Ruby's page cache. Results that Bedework generates are mapped to a unique URL; each URL corresponds to a physical location in the cache's filestore. The filestore is hierarchical and follows the path components in the URL. As you'd expect, when a URL is requested, CachedFeeder first looks for the corresponding cache file. If the file exists, then it returns it. If it doesn't exist, the caching app calls Bedework's feeder application and caches the resulting file in the cache's file system store.
CachedFeeder uses jruby, an implementation of Ruby that generates JVM code, to compile the program into a war file for deployment. The cache appears by default in <tomcat>/webapps/webcache/v1.0. Currently, cache pages aren't expired by the system. See http://www.bedework.org/trac/bedework/wiki/CachedFeeder/ExpiringEvents for some advice on expiring pages.
Feeder Application
The feeder application is a simplified version of the webclient application. It doesn't need nearly as much functionality, since the app only needs to worry about public event feeds.
Further documentation for the Cached Feed and URL Builder is maintained in the Bedework Wiki at http://www.bedework.org/trac/bedework/wiki/CachedFeeder
Adding custom properties (X-Properties) to events
X-Properties are a means of extending ical to define custom fields. They are useful for site-specific data and for extending Bedework for site specific functionality, but be aware that while other calendar clients will preserve them, they will not display them. For example, if a user downloads an event into outlook, your locally defined x-properties will not be seen.
...
Local properties can be named appropriately, e.g. X-MYUNIVERSITY-PROPNAME.
Bedework X-Properties
The following table lists two of the x-properties used by Bedework. For more information about Bedework's x-properties, see the Bedework wiki.
X-Property Name | Property Value | Parameters | Description |
X-BEDEWORK-SUBMITTEDBY | Identity of event submitter | none | Assembles the userId of the event submitter, the group name, and the group userId |
X-BEDEWORK-IMAGE | URL of image resource | X-BEDEWORK-PARAM-WIDTH | URL of image to be included with event description in web views |
Adding Custom X-Properties
Add custom X-Property handling to the setBedeworkXProperties() function of bedeworkEventForm.js. This function takes the event form object as a parameter; you can convert a custom form field to an x-property using the update() method of the x-property javascript object (declared in bedeworkXProperties.js in admin, submission, and user clients):
...
Note: in this example, the image parameters are hard coded. The value of formObj["xBwImageHolder"] will be a url reference to an image.
X-Property Output
X-Properties are output within the event XML like so:
...