Reply
Thread Tools
Posts: 26 | Thanked: 97 times | Joined on Dec 2011
#1
Having a single calendar in the device is somewhat restrictive and a colorful calendar app is certainly nicer to look at... So here's a "short" guide on how to add multiple calendars to Jolla and sync them using Syncevolution (CalDAV). This might be a bit advanced for some, so read carefully and make sure you don't have anything important in the personal/default calendar.

1. Adding more calendars to the device
  • The calendars are located in an sqlite database file, which can be modified by hand using the sqlite3 tool. Root access is needed, since the database file is in a privileged folder.
Code:
[nemo@thefish ~]$ devel-su
Password:
[root@thefish nemo]# sqlite3 /home/nemo/.local/share/system/privileged/Calendar/mkcal/db
  • The calendars are in the Calendars table. Additional calendars can be simply inserted into this table. The schema of the table tells us what the values mean.
Code:
sqlite> select * from Calendars;
b49fb636-018e-4e1f-9d76-40793917bad0|Default||#0000FF|663|0|||-1|1393482006|||1384941655||
b1376da7-5555-1111-2222-227549c4e570|Birthdays||#e00080|215|0|Birthday-Nokia||0|1391191862|||1384941655||
5990166d-8d26-417c-aac1-1e92bce8ec14|Facebook|Jolla Sailor|#3B5998|215|0|Facebook|10|-1|1391224293|||1387661615||

sqlite> .schema Calendars
CREATE TABLE Calendars(CalendarId TEXT PRIMARY KEY, Name TEXT, Description TEXT, Color INTEGER, Flags INTEGER, syncDate INTEGER, pluginName TEXT, account TEXT, attachmentSize INTEGER, modifiedDate INTEGER, sharedWith TEXT, syncProfile TEXT, createdDate INTEGER, extra1 STRING, extra2 STRING);
CREATE INDEX IDX_CALENDAR on Calendars(CalendarId);
  • The first column in the table is a standard RFC4122 UUID, which can be random generated for example using python. Or you could perhaps create a similar hexadecimal string even by yourself.
Code:
[nemo@thefish ~]$ python
Python 2.7.5 (default, May 09 2013, 12:34:56) 
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import uuid
>>> uuid.uuid4()
UUID('f577b6fa-73af-4d3c-ad80-68aeebfed0ff')
>>> exit()
  • Now we can insert a new entry (calendar) into the Calendars table. You can add several calendars, if you want.

    The generated UUID goes into the first field, calendar name is in the second field and calendar description is in the third field. The calendar description is the only field that is shown in the Jolla Calendar app. I suggest that you keep the other fields as they are in the example, if you're not 100% sure of what they are for.
Code:
sqlite> insert into Calendars values('f577b6fa-73af-4d3c-ad80-68aeebfed0ff','Holidays','My Holidays','#000000',151,0,null,null,-1,1393542815,null,null,1393542815,null,null);
  • The Default calendar doesn't have a description by default, but you can add one for it. Remember to copy&paste the correct CalendarId from the select query.
Code:
sqlite> update Calendars set Description='My Appointments' where CalendarId='b49fb636-018e-4e1f-9d76-40793917bad0';
  • Check that the entries were successfully inserted and close the database.
Code:
sqlite> select * from Calendars;
b49fb636-018e-4e1f-9d76-40793917bad0|Default|My Appointments|#0000FF|663|0|||-1|1393482006|||1384941655||
b1376da7-5555-1111-2222-227549c4e570|Birthdays||#e00080|215|0|Birthday-Nokia||0|1391191862|||1384941655||
5990166d-8d26-417c-aac1-1e92bce8ec14|Facebook|Jolla Sailor|#3B5998|215|0|Facebook|10|-1|1391224293|||1387661615||
f577b6fa-73af-4d3c-ad80-68aeebfed0ff|Holidays|Holidays|#000000|151|0|||-1|1393542815|||1393542815||

sqlite> .exit
[root@thefish nemo]# exit
  • Open Jolla Calendar app and check that the added calendar shows up in the manage calendars view. The calendar can now be used just like the Default calendar.


2. Synchronizing the calendars by using Syncevolution
  • Create a webdav service entry in the Syncevolution app: http://linux.bigga.de/details/sync-c...syncevolution/

    The added calendars will show up as calendar store entries in the Syncevolution app. However the app doesn't yet provide a way to add multiple calendars into a single webdav service entry, which means that you would need to create one service entry per calendar. And it's kind of meaningless, if all calendars are synced from the same server. Anyway it is possible to do this from the terminal, and afterwards it's possible to edit the entries using the app.

    Check that the created calendars are seen by syncevolution.
Code:
syncevolution --print-databases
CalDAV:
    select database via absolute URL, set username/password to scan, set syncURL to base URL if server does not support auto-discovery (<path>)

CalDAVTodo:
    select database via absolute URL, set username/password to scan, set syncURL to base URL if server does not support auto-discovery (<path>)

CalDAVJournal:
    select database via absolute URL, set username/password to scan, set syncURL to base URL if server does not support auto-discovery (<path>)

CardDAV:
    select database via absolute URL, set username/password to scan, set syncURL to base URL if server does not support auto-discovery (<path>)

mkcal-events = mkcal = KCalExtended = MeeGo Calendar:
    Default (uid:b49fb636-018e-4e1f-9d76-40793917bad0) <default>
    Holidays (uid:f577b6fa-73af-4d3c-ad80-68aeebfed0ff)
    Birthdays (uid:b1376da7-5555-1111-2222-227549c4e570)
    Facebook (uid:5990166d-8d26-417c-aac1-1e92bce8ec14)

QtContacts = qt-contacts:
    org.nemomobile.contacts.sqlite (qtcontacts:org.nemomobile.contacts.sqlite:) <default>
    invalid (qtcontacts:invalid:)
    memory (qtcontacts:memory:)
  • Add a new caldav-calendar connection into an already existing syncevolution service entry. In the example we'll sync the Holidays (uid:f577b6fa-73af-4d3c-ad80-68aeebfed0ff) calendar with a caldav target (https://cal.example.com/your/caldav/address).

    The name of the service entry is the same as in the Syncevolution app ("example" in this case). So change it accordingly.
Code:
[nemo@thefish ~]$ syncevolution --configure backend=calendar database=uid:f577b6fa-73af-4d3c-ad80-68aeebfed0ff @example calendar_holidays
[nemo@thefish ~]$ syncevolution --configure backend=caldav sync=two-way database=https://cal.example.com/your/caldav/address target-config@example-target calendar_holidays
[nemo@thefish ~]$ syncevolution --configure sync=two-way database=uid:f577b6fa-73af-4d3c-ad80-68aeebfed0ff example calendar_holidays
  • Cross your fingers and run the first sync for the added calendar.
Code:
[nemo@thefish syncevolution]$ syncevolution --sync slow example calendar_holidays
Happy weekend tweaking for ya sailors
 

The Following 15 Users Say Thank You to Jare For This Useful Post:
Posts: 951 | Thanked: 2,344 times | Joined on Jan 2012 @ UK
#2
Great guide thanks
 
Reply

Tags
caldav, calendars, syncevolution

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:38.