Active Topics

 



Notices


Reply
Thread Tools
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#1
Is there any way of accessing the calendar from the command line? E.g. I would like to write add a calendar quick add widget that does the follows:

1. Pops up a small entry widget in which I would type something like:

Lunch with Ron next Wednesday at 12:00

2. A freetext format parses would convert this into an ical file.
3. The widget should somehow import the ical file into the calendar db.

The question is how to do step number 3?
 

The Following User Says Thank You to dov For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#2
Originally Posted by dov View Post
Is there any way of accessing the calendar from the command line? E.g. I would like to write add a calendar quick add widget that does the follows:

1. Pops up a small entry widget in which I would type something like:

Lunch with Ron next Wednesday at 12:00

2. A freetext format parses would convert this into an ical file.
3. The widget should somehow import the ical file into the calendar db.

The question is how to do step number 3?
The only way I know is using the calendar-backend API.
http://maemo.org/api_refs/5.0/5.0-fi...4d8d5b8d043570
But if you do so, you can just skip step 2 and 3 and use
the API for adding a new task.

Feel free to ask me if you have any questions. I used the calendar
API in my calendar-home-widget and my scout application.

Nicolai
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
Posts: 466 | Thanked: 661 times | Joined on Jan 2009
#3
This is a little off-topic, Nicolai, but how hard would it be to create a command line app that exports a calendar to ical? I know there is an option in the UI for this, but I would like to automatically push some of my calendars to my personal "cloud" using scheduled tasks. I don't know C++ nor QT (I'm a java guy) but I'd like to learn. Would this API be something easy enough to use to do what I have described. Any high level steps to get started? There is a ton of documentation floating out there on how to develop on Maemo and getting started seems difficult.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
@jackburton

Yes, this should be easy.
Setting up the scratchbox development
envrionment is much more difficult than writing this app.

I don't know the qtmobility api for the calendar. But installing
QtCreator and making a simple commandline application should be
easy. The calendar-backend uses C++ as well, so it is easier to use
this from Qt code than for a gtk+ application for example.


nicolai
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 466 | Thanked: 661 times | Joined on Jan 2009
#5
@Nicolai

Thanks for the input. So I should be able to do this with QtCreator then? I'll check that out first.

Also, kudos for the Calendar Home Widget.
 
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#6
@nicolai

The link you pointed me at imports ICS data. Do you have a link to this format, or did you suggest that I use non-file methods of the API? Is it the same fromat as the VCARD file format mentioned in: http://en.wikipedia.org/wiki/ICalendar ?

Regarding your programs scout and calendar-home-widget, are the sources available for reference?

Originally Posted by nicolai View Post
The only way I know is using the calendar-backend API.
http://maemo.org/api_refs/5.0/5.0-fi...4d8d5b8d043570
But if you do so, you can just skip step 2 and 3 and use
the API for adding a new task.

Feel free to ask me if you have any questions. I used the calendar
API in my calendar-home-widget and my scout application.

Nicolai
Thanks a lot!
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#7
Originally Posted by dov View Post
@nicolai

The link you pointed me at imports ICS data. Do you have a link to this format, or did you suggest that I use non-file methods of the API? Is it the same fromat as the VCARD file format mentioned in: http://en.wikipedia.org/wiki/ICalendar ?
I would suggest to use non-file methods and use the api to
create and insert new entries.
Originally Posted by dov View Post
Regarding your programs scout and calendar-home-widget, are the sources available for reference?
Thanks a lot!
Yes -> maemo.org/packages

regards
Nicolai
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#8
 

The Following User Says Thank You to Khertan For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#9
And the bruteforce methode


sqlite3 ~/.calendardb
Insert into Components (CalendarId, ComponentType, Flags, DateStart, DateEnd, Summary, Status, AllDay, Until, CreatedTime, ModifiedTime, Tzid, TzOffset) VALUES (1, 2, -1, 1294095600, -1, 'Test Insert Todo Non valide', 0, -1,0,1294087227,1294144124,'Europe/Paris',3600);
^D
But be careful with text encoding
 

The Following User Says Thank You to Khertan For This Useful Post:
Posts: 81 | Thanked: 45 times | Joined on Dec 2009
#10
@ Khertan

Now we're talking.

Does the calendar application poll its database or is it necessary to bump it somehow to make it reread the file when it changes after inserting changes through sqlite3?

Btw, I assume that you meant ~/.calendar/calendardb .
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:36.