View source for PIM Storage
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to PIM Storage.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to PIM Storage.
PIM storage describes a means of storing data in an extensible and cross-referencable way. In the SHR distribution you find a solution for syncing PIM with other devices (see SHR User Manual further details).
(TBD)
Possible solutions:
This Import/Export can be realized by syncing an ics Calendar File (e.g. std.ics from Kontact-KDE, ...) by parsing this ICS-file (iCal) and import the ics-file to the PIM-Storage on the OpenMoko device. Make sure you have sqlite3 client installed
opkg install sqlite3
The PIM database file on the OpenMoko device is located at
/home/root/Applications/Qtopia/qtopia_db.sqlite
You can handle the file with sqlite (see Import Vcf Contacts):
sqlite3 ~/Applications/Qtopia/qtopia_db.sqlite
For parsing the ics-File (iCal) on the OpenMoko device you need to install Perl
opkg install perl
Remark: The following desciption shows a possbible additional concept for PIM storage for import/export by application of OpenSource perl libraries that can be used to realized the concept.
Lets name the perl scripts ics2qtcal.pl and qtcal2ics.pl.
For parsing the ICS-file there are several CPAN perl libraries available
After parsing the ics-file a file import.sql with SQL-Commands should be generated for importing the calendar dates via sqlite3 to the qtopia PIM storage ics2qtcal.pl. In a first step of realisation of ics2qtcal.pl the old qtopia-db can be backuped and a full import of. Create a directory remotecal in ~/Applications/Qtopia
mkdir ~/Applications/Qtopia/remotecal
All temporary data during the import/export process can be stored in that directory. The ics-File is on the Linux-Computer with IP 192.168.0.200 and an accout user. Lets assume that the ics-file is stored by the PIM Kontact in the directory /home/user/.kde/share/apps/korganizer/ on an Linux machine with SSH daemon running, that is not blocked by the firewall (check setting for SSH-daemon in firewall on Desktop computer). KDE-Kontact stores the calendar data in std.ics. This file should be used to update PIM storage. To automate this task a shell script might be useful. Lets call the following script for syncing the ics-file to OpenMoko device sync4ics2openmoko.sh.
#!/usr/bin/sh cd ~/Applications/Qtopia rsync -avz -e ssh user@192.168.0.200:/home/user/.kde/share/apps/korganizer/std.ics std.ics mv qtopia_db.sqlite qtopia_db.sqlite.backup perl /path_to_the_script/ics2qtcal.pl std.ics qtopia_db.sqlite
When all scripts mentioned above are in place, generate an icon in /usr/share/application, that calls sync4ics2openmoko.sh and syncs you desktop computer PIM data with the Openmoko device. After using the OpenMoko-PIM you should create to copy the kontact-KDE ics-file parse it and copy it to the qtopia database. The following lines show the content of desktop Icon file sync2openmoko.desktop
[Desktop Entry] Name=iCal2OpenMoko Comment=Syncing ics calendar to Openmoko Exec=sh /path_to_the_script/sync4ics2openmoko.sh Terminal=1 Type=Application Icon=phone.png Categories=Application;PIM StartupNotify=True
In the Exec you specifiy the command to be executed when you click on the icon. The can also be called from the terminal by calling:
sh /path_to_the_script/sync4ics2openmoko.sh
When you call the script you have to enter the password of the aacount user on the desktop computer. 192.168.0.200 is the IP of the desktop computer. It can be replaced by any IP you have your home directory with the ICS file on. Because you need to enter a password so far, it might be inconvient for an automated update. To automate this process see http://troy.jdmz.net/rsync/index.html for using rsync and ssh without authentication. sync4ics2openmoko.sh calls the perl script ics2qtcal.pl. The perl script ics2qtcal.pl generates the SQL commands, store the commands in the file import.sql and calls the sqlite3 and import the calendar data in the sqlite-database via executing the SQL-Commands in import.sql.
To avoid to have the same events 2 times in the PIM storage the existing OpenMoko database should be exported first via qtcal2ics.pl to the file qtopia.ics removing events from the SQL imput that already exist in the SQL database. Records that have changed should be updated via SQL commands.
.... mv qtopia_db.sqlite qtopia_db.sqlite.backup perl /path_to_the_script/qtcal2ics.pl qtopia_db.sqlite qtopia.ics perl /path_to_the_script/ics2qtcal.pl std.ics qtopia_db.sqlite qtopia.ics
Remark: The perl scripts mentioned above are not programmed yet (Jan 19th 2009), they show a solution for syncing. The development of the perl scripts ics2qtcal.pl and qtcal2ics.pl mentioned above can be helpful in converting ical formats to and from the OpenMoko device anyway. If anyone has created a protype of the scripts mentioned above, icons for syncing etc. the links can be provided here.