Multiple calendars in one ics file - icalendar

I have a website that has resource data that can be exported as calendars ( .ics files). It is an internal website and so the users will likely be loading them into Outlook 2013 so that they can cross reference the resource data with their own calendars.
I have run into the challenge that users can easily export multiple sets of data in one go resulting in multiple calendars being available to be download (the common worst case being 12 calendars, but there are going to be a few users who will push it well beyond that). I can easily zip the ics files up and provide the zip as a single download, but my goal is to keep it at simple to use as possible for the user to import into Outlook. From the research I have done and my own tests I have not found any way for .ics to have multiple calendars in one file. As such here is my chain of questions:
Does icalendar have a way of storing multiple calendars in a single file?
If not is there a different calendar file format that Outlook 2013 can import and parse that does support multiple calendars?
If there is no better calendar file type for this, is there a general best practice for providing multiple calendar files for download and import?

I'm not sure exactly what you mean when you say "calendar", but, to expand on #jgm's answer, the specification allows more than one VCALENDAR component to exist inside of the same file.
BEGIN:VCALENDAR
...
END:VCALENDAR
BEGIN:VCALENDAR
...
END:VCALENDAR

According to the specification you can have multiple calendars in a single iCalendar entry:
The Calendaring and Scheduling Core Object is a collection of
calendaring and scheduling information. Typically, this information
will consist of an iCalendar stream with a single iCalendar object.
However, multiple iCalendar objects can be sequentially grouped
together in an iCalendar stream.
However, you would have to test each client individually to see if it was supported as this is not a common situation.

No. The iCalendar format has no notion of calendar "containers". The closest would be to use the CATEGORY property to distinguish between different types of events.
If you really only care about Outlook, the alternative would be to create PST files, which can contain arbitrary hierarchies. But generating those is much more involved in terms of development.

Related

Do ICS files contain any info about online meetings?

In my application I need to understand if the ICS file represents an online meeting (Teams, Meet, Zoom...) or not.
I read the RFC5545 standard docs, but I couldn't find any specific standard attribute. I also analyzed the content of some online events created inside Google Calendar or Microsoft Teams and found out that Google puts a custom string
X-GOOGLE-CONFERENCE:your-meeting-link
while Microsoft specifies this info in the LOCATION attribute like "Teams meeting".
Is there anything standard across multiple providers? Is there any discussion about this to be done in the future?

How do I export a gSuite user's email when I'm a delegate for their account

I'm trying to find a way to export the emails of a current employee without them knowing. I'm currently a delegate on the account and am using GAM. Any ideas?
If you are superadmin then you should look into either Google Vault which is the immutable record of emails see doc or you should use Got Your Back here written by Jay0lee who wrote GAM. GYB exports to MBOX though so if you want to share the emails with someone who for whatever reason can't read MBOX then you will need an MBOX to PST converter of which there are many online. I have used the one from Systools effectively link. Or you can export by GYB and then import into a different gmail account which is quite useful for some types of investigation.
If you are merely a delegate then there is no easy way.

Which event data format should use?

I have an application that (among other features) has an event calendar. Some users need to export and import event data to their own calendars. I've found the iCalendar format, but I don't know if that's the most suitable format for me.
The format should be an extended format (as much as possible to reach the maximum number of users), particularly it must be a format that allows import/export of iPhone and Android calendars (the built in calendars).
The event data itself is very basic (name, description, start and length).
Is there any format that fits these requirements? Is there any way to make an iPhone/Android phone to import/export events in the iCalendar format?
Yes iCalendar is the standard that you are looking for (for more information you can go to http://calconnect.org/ )
regarding exports:
iCalendar is a standard that is based on apple calendar sor iPhone is compatible with icalendar and since this is the de-facto standard for calendaring so is Android compatible.

How to create a news like iPhone app that updates weekly

I have created a few small apps for the iPhone so I have some experience. An organization that I'm in asked me if I could program a weekly newsletter app for them. I though it would be a good challenge so I agreed. My question is: how do I get the app to update weekly without the users having to re-download or manually update? Do I connect to a database or a website? Can anyone send me the link to a good tutorial? I wasn't able to find one.
Thank you!
Your question is very general but I could give you some suggestions.
First, you need to connect to a service that provides you news info. This is needed. The service could send you an xml that you can parse and display, for example in a UITableView. XML is not the only solution. You could use also JSON.
For parsing XML I suggest you to read GDataXML, while for JSON JSONKit framework. But there are also other valid framework out there.
Then, to save data it depends on what kind of data you deal with. Here you could find different ways to save your news. Save an XML that contains your news, serialize data and save them in the local filesystem or use Core-Data.
To update your news without user actions, you have to save the last time when the app has downloaded news (for example in NSUserDefaults) and each time time the application is "activated" check for that date and update news if necessary.
Out there there are plenty of tutorials on how to (in parenthesis I inserted classes or framework that you could have a look):
consuming web service on iPhone (ASIHttpRequest - no more supported, NSURLConnection class, AFNetworking)
dealing with XML file/data and theirs parsing (GDataXML, touchXML, etc.)
dealing with JSON messages (JSONKit, etc.)
managing documents (NSFileManager class)
using Core-Data
using Property-List and/or NSUserDefaults
First three cover the first step (download). Other three cover the second one (save). Obviously you have not to use all of them. For example a configuration could be:
NSURLConnection for service, GDataXML for parsing XML data and Property-List for save data.
Hope it helps.
A simpler approach would be to make it a pure web app and update the website weekly.
Your content providers are going to have to do those updates anyway.
Check: Adding Newsstand Support to Your App or Tutorial: How To Make Your App Work With The Newsstand

What to do with CSV after export on the iPhone?

One of the requested features for my apps is to have an export feature. Most of the time the data is table-like in nature. As an example, users might enter every day what types of food they ate that day, and how many portions of each food type. As the data is table-like, I figure the most useful for export would be into CSV format. Then it can be read in spreadsheet software.
I'm confident I can get the data into a CSV like format without too much trouble, and found this post would should help me: How to convert data to CSV or HTML format on iOS?
What I'm wondering about is what I can do with the file once it has been created? Can I attach it to an email? How else can I make it available to the user so that it has some use?
Alternatively, am I going about this the wrong way and would there be a better way to offer an export function?
I would suggest using MFMailComposeViewController and attaching your CSV file to it. This has the benefit of allowing the user to forward to the file to multiple recipients, customize the email body etc. You can also insert HTML into the email body, so if the data isn't too large you could simply present a table of the information within the email itself.
To send an attachment follow the instructions here.
Usually when an iPhone app needs exporting functionality you have the following options:
Attaching it to an email (as you mentioned)
Sending it to a server (with HTTP or any other TCP/IP based protocol)
Exposing it with a small WebServer you code inside your app (like the Video Camera APPs for 3G and older iPhones do)
Unfortunately, you can't use iTunes for sync your exported file. At least you can't with the current version of the SDK.
Instead of CSV, I would use XML. It can also be read with Excel (or any other spreadsheet), plus you won't have to deal with COMMA (or any other separator for that matter) escaping.