ICal Format - One time import or RSS like functionality? - icalendar

I'd like to publish a list of events in the iCal format. If I have a public ICS file that I add/update events on, will clients like Google Reader and Outlook receive those updates automatically? I.e., does it behave like an RSS feed that gets periodically pinged for changes or is it a one time import?

One time import. See Wikipedia, it basically represents a mechanism for sending one or more appointments.
If the iCal is published and updated, and your client can be set to periodically refresh, you may get the effect of a subscription to an RSS, but really it is a series of imports.

It depends how the client is configured. For instance, in Korganizer I often do one-time imports (e.g. departure times when I book a flight). But I have other ICS files (e.g. organizational calendars) where I set it do pinging.

Related

How to setup an ICS file with recurring events that have lapses?

I've hit a roadblock in trying to figure out the best way to create an ICS file that will have recurring events (and single instance events). My main issue is with recurring events, because a lot of times the recurring events could have a break in between them. Given various articles I have read about ICS file size limitations, Google only accepting 1,111 events in total for a file, what are my options for formatting the event data to accurately represent the events while maximizing the events I can fit into the file?
So far I've come up with:
Option 1: A single VEVENT for each group of recurring events that have no lapse in recurrence.
Option 2: Separate VEVENTS for every single instance of recurring events.
Option 2 seems like the most accurate representation of events, however, that would use up data quickly.
Are these basically my two options?
If your lapse only involve a small number of instances skipped, then EXDATE may work for you. You could generate the next x years of EXDATES perhaps.
https://www.rfc-editor.org/rfc/rfc2445#section-4.8.5.1
Unfortunately for you EXRULE is deprecated and applications support for that may not be there.

How to deal with large ICS files?

My application (php/laravel, but irrelevant here) holds calendar entries for its users (comparable to a car logbook), and some users want to sync those events to their calendar app of choice. I started looking into the ics standard (RFC 5545 etc.) and created an endpoint that generates those files.
Problem: The files are getting huge. Some users have their entire driving history with hundreds and thousands of entries in the application, generating and transfering those MBs of ICS files will take ages (using php, anyways), let alone doing that everytime the calendar app tries to sync.
Question(s): What is the preferred way of dealing with huge ICS documents? HTTP headers and caching is one thing, but how do other people solve this problem? Just send events of the last year? Is there a (pagination?) spec that I haven't found yet?
This is historical data, so it is not going to change. You could offer batches by time period and cache the historical batches. Last years, or anything before the last 4 weeks, never gets updated for example. They do a one-off import of each historical batch into a separate 'driving history' calendar. No more subscribing? Or maybe they can only subscribe for the last month say?
One cannot import & subscribe into the same calendar, so it does mean they would have at least 2 calendars - 1 historical calendar used for imports, and 1 'current' that will update with yesterday's ride. Of course there is then manual effort for anyone who wants to always have the old data as when events fall off the 'current' calendar, at some point they'd have to go import the latest 'old' events.

Calendar events form entire Lotus Notes

I'm trying to fetch all events from entire system by using REST API to synchronize with own application. I was extracting events for every user using REST API for his own calendar file.
For example:
Fetch johndoe.nsf/api/calendar/events
Fetch jasonmartin.nsf/api/calendar/events
Fetch jeanmoore.nsf/api/calendar/events
etc.
It's working with low number of users. But I need to do it for around 2,5k users, which kills my system.
Is there any central database from I can extract this data?
I tried this with resource reservation databese, but only what I got was empty response.
No, there is no central database of calendar events. There couldn't be. Notes and Domino is a distributed environment. Information can be spread over dozens of servers.
But you could write Java or C application that runs on the Domino server and aggregates the information from all the users' calendars into one central database, and that application will probably run faster than your remote calls through the REST API. But you'll still have to make REST API calls into that central database, and the sum of the activity will be greater than what you are dealing with now.
Maybe my iCal freeware tool could help you
http://abdata.ch/publish-ibm-domino-calendar-entries-in-icalendar-format/

How to programmatically create a new version of a CQ5 page?

Is it possible to programmatically create a new version of a CQ5 page that has a start time some time in the future?
As an example, let's say we have a page that displays tax rates. We have a component that allows the author to upload a new rates table (in the form of a css file) and it creates the rates page content. We would like to allow the author to upload rates that will be effective the first of next month.
I know the jcr supports multiple versions of nodes, but its unclear how (or whether) this relates to cq5 page versioning. And, further, whether a new version can be activated in the future.
Given the requirements as you've described them, I would probably accomplish the task in a slightly different way...
Instead of storing my rates table information directly within the page's jcr:content node (or a sub node their of) I'd probably abstract it out to somewhere else in the repository. You could then, if you so desired, create some sort of an admin interface to allow content authors to upload their csv file of new rates, and ingest that into the repository as needed. Alternatively, assuming that data comes from some sort of a database, you could probably just write a job to automatically injest it on some sort of a scheduled basis by using a JDBC connection from CQ. Once the data is in the repository, you could then write the display component to read the data from the repository, instead of it being directly inside the page.
This approach has the advantage of making that data re-useable within CQ to be shown on multiple pages, multiple sites, even many different display formats if need be. In addition, you can design your jcr structure to support whatever requirement you have around updates to the data, including daily, monthly, weekly, yearly etc., obviously this will depend on the specific requirements.
The one downside to this is that since there is a separation b/w the data and the page(s) where it is displayed, you may need to find a way to ensure the cache is properly cleared whenever the data does change.
Update (based on your comment):
The problem I foresee with versioning the page, and granted I've not tried this so maybe it will work, is that there can only ever be one active version at a time. Therefore, once the next months data is uploaded, you need to maintain the old data (active) and the new data (not yet active) at the same time. What happens if you require a separate content change during that window...from a business process perspective that just seems messy to me.
Back to cache clear issues, If you know the affected pages, especially if they are all in one subtree, you could write a custom workflow process that uses the replicator service to clear the cache for the affected pages, then set up a launcher to run the wf on node change for the data.
The other option, and this one is less defined in my head, so some experimentation required, would be to use CQs built in activate later and de-activate later functionality.
Maybe create a specific template for the rates data, with the implicit requirement that only one page using that template is ever active at one time. Your display components could use a query to find the currently active rates data.
I have not personally tried this, but...
I assume that you can use the PageManager service's createRevision method, and then if that returns without throwing an exception, you may call page.getContentResource.adaptTo(Node.class), and from there take the node that is returned and edit the JCR properties for your tax rates component.
See PageManager
You could write a workflow that includes a publish step that is triggered by the arrival of a calendar date. The version of the page with the new tax rates remains in the workflow pipeline in draft form and is only published/activated when the date arrives. (So you'd need some sort of process that wakes up once a day to check the calendar.)
Each time a page is modified cq creates a version of the page.
This modified page's modification time is set in jcr:lastModified property of the page.
Manipulation of this property can be done to save future date and activate page on that date though its not preferred way.
You can store the future date as a property in the page.
Later as suggested by #David you can create a workflow or a scheduled job which activates pages with a future date.

Prevent google calendar from creating duplicate entries when a remote icalendar file changes

There's a lot of events happening all the time on my university campus, and, together with a few other students, we thought it would be nice to provide the event schedule as a calendar. So organisers register their event on the intranet, and it gets added to an icalendar file which people on the campus can subscribe to.
This works great when people load the calendar url on their iPhones, but it doesn't when loading in Google Calendar. We have noticed two problems:
When you subscribe to the calendar and then log out and back in, events are no longer visible. Sometimes, clicking refresh fixes it. The vents do not disappear from android devices associated with your account.
When an event is removed from the icalendar file (eg. if it's cancelled), it still remains on the android devices that sync with any google account that subscribed to the calendar. New events sync fine, though, so it's not that the sync didn't happen.
Do you know how I can solve these two problems? I've noticed the STATUS:CANCELLED property in VEVENTs, but it doesn't seem to work when the calendar method is PUBLISH.
Thanks!
PS: If you can suggest a way to test changes faster that waiting for Google to pull the changes from the server, it would be great; right now, I have to wait about 6 hours between each test...
my understanding is that removing it from the file is not the way to cancel an event. One must ensure that there is a UNIQUE identifier to match any changes.
Also must follow the spec for cancelling/changing an event.
See How to cancel an calendar event using ics files?
If all of that is correct, then the various applications that 'subscribe' to a calendar should in theory update the event status when they read the updated file. Unfortunately the speed and frequency of that is up to that application. (NB: note also difference between subscribe and "import")
Yes I have noticed that google is slow to update sometimes. Only thing I can think of is use another application where you have control perhaps over the subscription update frequency to test if the way that you are cancelling an event is working. Once you see the cancellations happening there, then resume testing on google (I have noticed Google is more pedantic than some apps, so you may still have to work to get it 100% working on google.)
Hope that helps!
I've tried the suggestions but Google Calendar only ever adds another event. The iCalendar validators say that the files I generate are valid, and iCal on the Mac removes an event if it has cancel information. But neither Google Calendar or Outlook do. Rather frustrating.