On Mo, 2010-03-15 at 10:11 +0000, paul wrote:
> Well I wrote my database plugin in copying the example of SDK_demodb,
> because for whatever reason I couldn't get the SDK_textdb example to
> work.  So now I have a plugin written in C for a client.  Now the the
> libsynthesis engine calls this plugin for example with an
> InsertItem(), I get data in the aa:bb<CRLF> format.  However I have no
> why of interpreting that data and I need it in vcard format without
> rewriting code to convert it based on the configuration xml file.

This is exactly what SyncEvolution does. Here's an outline how it works,
for details see the SyncEvolution source code:
      * in the plugin's Module_Capabilities, set CA_ItemAsKey to
        ":yes" (SynthesisDBPlugin.cpp)
      * instead of the normal Item() callbacks implement the ItemAsKey()
        variants (SynthesisDBPlugin.cpp)
      * in the <initscript> of the data store, create a variable
        ("itemdata" in SyncSource.cpp) and map it so that it can be
        accessed from the AsKey() code ("<map name='data'
        references='itemdata' type='string'/>")
      * in the <before/afterwritescript>, call the
        MAKE/PARSETEXTWITHPROFILE() macros to convert to/from the field
        list (SyncSource.cpp)
      * in your AsKey() implementations, read/write the "data" field
        (SyncSourceSerialize::readItemAsKey,
        SyncSourceSerialize::insertItemAsKey)

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to