Hi,
        For the past few weeks, I've been working on developing the meta
data storage facility that we discussed long ago on the xindice-dev list.
(See http://marc.theaimsgroup.com/?t=102873960400001&r=1&w=2 for
discussion.)
Essentially, this capability is a major advantage to Xindice when its being
used as something like a content management system.  All such systems
provide
some mechanisms similar to this.  Such functionality is not really available
within Xindice currently, and it takes a while to add on such features.  As
such, these features would definitely help Xindice attract CMS developers
who would like to use a native XML database.  Locally, we have been using
a modified version of Xindice with these features, and it is extremely
useful.

        Here are a series of new files and patches that will enable the
storage and retrieval of metadata within Xindice.  However, in the spirit of
not bogging all users down, an administrator must enable metadata storage
inside the server.xml by adding 'use-metadata="on"' to the root-collection
element.  So this functionality is completely configurable and can be added
to the core without any functionality change for users who don't need
metadata type functionality.
        Here's a short explanation of how it works.  When metadata is
enabled, the database will maintain a MetaSystemCollection.  This collection
is analagous to the SystemCollection in that no documents can be stored into
it directly by the user.  Each collection and document has a MetaData object
associated with it.  That object keeps track of several pieces of
information
that can be represented in xml as:
    <meta>
        <system [type="doc|col"]>
            <attr name="created" value="1038266252196" />
            <attr name="modified" value="1038266252196" />
        </system>
        <attrs>
            <attr name="name" value="value"/>
            <attr name="name" value="value"/>
        </attrs>
        <custom>
            <any>custom xml you want</any>
        </custom>
    </meta>
The system will keep track of the created and last modified times for you.
The attrs are an arbitrary set of key value pairs that a user can add to
or subtract from.  The custom section is used for any well-formed xml that
you might want.  (The create/modified values are stored as milliseconds
since
midnight Jan 1 1970, exactly as System.currentTimeMillisecs().)
        To access the metadata information, I've created a set of XMLRPC
'messages'.  They are GetCollectionMeta, GetDocumentMeta, SetCollectionMeta,
and SetDocumentMeta.  These allow complete access to the metadata
information.

        Attached to this message are the patches for the core server.  In
addition there are a few new files that are required.  Both the zip file
and the patch file should be run from the xml-xindice dir.  As this is a
pretty significant addition to the core of Xindice, please take a minute to
look it over and let me know what you think either of the design or this
initial implementation.  It is certainly not perfect, but it is a good first
step towards an implementation of metadata storage in the core of Xindice.

Thanks
Dave Viner

Attachment: metadata.patch
Description: Binary data

<<attachment: metadata.zip>>

Reply via email to