[EMAIL PROTECTED] wrote:

> I'd like to start on our next documentation project. Preferably something
> that'll be easier than SiteGroups. :)  What's the status on blobserving,
> if you have a document started, send it over to me and I'll start
> working on it.

Blobserving is ready to be documented. No guarantees about it being
simple.
That's what I thought about Sitegroups at first, and look where that got
us :/


The documentation such as it is:

** Blobserving (managing & serving non-text objects with Midgard)

Set up a directory for the blobs. This directory must be browseable by
the apache user (nobody in my case) but owned by root. Nobody does
not require write permissions to the directory.

In that directory, do
# mkdir `perl midgard-1.4b3-blobs-mkdir.pl`
# chown -R nobody *

Add the following directive to you httpd.conf:
        MidgardBlobDir /path/to/the/dir

When you get an object with mgd_<object>_get, you will find a number
of methods available on that object:

$object->createattachment(string name, string title, string mimetype)
        This will create a blob record and return its ID

$object->listattachments([string order])
        returns a cursor on the list of attachments for the object. The cursor
        will have the following fields: id, name, title, mimetype,score,author,
        created. The order in which these will be listed can be specified by
the
        optional parameter, which may be any of the field names.

$object->openattachment(string name)
        opens the object for writing. Doing this will clobber existing content.
        The return value is a file pointer you can use with the usual PHP file
        function. Don't forget to fclose when ready

$object->serveattachment(string name)
        sends out the Content-Type header, any other headers you've specified
        with Header, and sends out the content. You will usually want to
        exit(); after this.

$object->deleteattachment(string name)
        deletes the attachment

$object->updateattachment(string name, string newname, string title,
        string mimetype [, int score [, int author ] ])
        Updates the blob fields.

All methods except create have function counterparts that take the blob
id as it's first parameter instead of the name.

Blobs are owned by whoever owns the object they attach to. The ownership
rules may not be complete and in those cases default to no write access;
if you happen to
meet such an instance I'd appreciate it if you let me know.

Page blobs are special in that they will be served automatically.

Emile

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to