wftk core: datastore adaptor

[ back to the core ] [ discussion ]

A datastore adaptor interfaces the core engine with a system capable of storing named values somewhere other than regular datasheet values; if used, a datastore adaptor turns the datasheet value into a reference used to get and save named values from some other place. The canonical example is using a datastore adaptor to represent columns in the process table. The first use of a datastore adaptor is giving data-like access to the role assignments with the role: adaptor.

These are the functions exposed by a datastore adaptor:
0: init   Initialize adaptor instance
1: free   Clean up instance before shutting down
2: info   Return XML describing the adaptor
3: get XML * datasheet
const char * name
Get named value using datasheet as a reference. The datasheet may be modified with markers.
4: set XML * datasheet
const char * name
Set named value using datasheet as a reference. Same caveat.
5: store XML * data Takes the data XML itself and uses "id" and "value" attributes to write it. This was created for transparent write-through to e.g. DATASTORE_currecord.
6: isnull XML * datasheet
const char * name
Test named value for being null. Optional.
7: makenull XML * datasheet
const char * name
Make named value null. Optional.


As you can see, the datastore adaptor is meant to be a very versatile way to connect wftk to whatever data you've already got. You can imagine a DATASTORE_cvsfile, or DATASTORE_panagon, or just about anything. For longer values we're going to have to build some more API to make it all make sense, but that'll come in time.

This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. This presentation was prepared with LPML. Try literate programming. You'll like it.