[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] Palm event serial number.
On Thu, Sep 05, 2002 at 04:59:25PM -0600, kyle wrote:
> Is there anyway to get the serial number of the palm
> event (datebook) and then set this when adding a new event from a conduit.
> I want to be able to have identical numbers identifying each event in both
> the palm and the source, is this possible?
Do you mean, how to have the same record ID for each record,
both on the Palm and in ~/.palm/backup/DatebookDB.pdb ?
If so, then the generic conduit takes care of that. When it
uploads a record to the Palm, the Palm can assign it a record ID. The
generic conduit then updates its local copy of the record to have that
ID, and saves it to the backup file. (It has to do this, because the
record ID uniquely identifies each record in the database. If you
delete the record later on, the Palm will only give ColdSync the
record ID, and ColdSync will have to figure out from that which record
to delete from its backup file.)
One potential problem is if you're trying to sync with an
external data source, e.g., an SQL database or a KDE calendar file.
The obvious way to do this is with a Fetch/Dump conduit pair; that is,
your conduit will run twice: once before the generic sync, and once
after.
Of course, since the KDE calendar has no notion of Palm record
IDs, so when you add a new entry there, it won't have a Palm record
ID. When you add this entry to ~/.palm/backup/DatebookDB.pdb with a
Fetch conduit, the conduit will have to either make up its own unique
record ID, or set it to 0. If you set it to 0, then the Palm will
assign a new record ID. Then the Dump conduit will somehow have to
figure out that this record in ~/.palm/backup/DatebookDB.pdb
corresponds to that entry in the KDE calendar file (or perhaps you can
have it simply rewrite the KDE calendar file from scratch, so this
won't be an issue).
I used to think that you couldn't just make up record IDs, but
other people have reported that you can, and that they'll be
conserved. Of course, there's always the risk that you'll add one
record on the Palm, another on the desktop, and that they'll both have
the same record ID, so the Palm will need to assign a different record
ID. To mitigate this risk, you can use small integers (1, 2, 3,...)
when you make up records, since the Palm appears to always assign
record IDs in the millions. I've seen no official documentation to
suggest that this is always safe, though.
--
Andrew Arensburger This message *does* represent the
arensb@ooblick.com views of ooblick.com
Sooner or later, your cats will step on your keyboard while
you're editing sendmail.cf, and it'll still work.
--
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.