Table of Contents

This page is in the 'old' namespace, and was imported from our previous wiki. We recommend checking for more up-to-date information using the search box.

Inserting metadata into a live collection using metadata-server.pl

This functionality is only available in versions of Greenstone newer than 2.83.

The metadata-server.pl script inserts the new value into the metadata.xml in the import directory and the collection.gdb file in the index directory Important: it only updates the live metadata display; the search index and classifiers will not be updated until the collection is rebuilt. Collection administrator will have to rebuild the collection to see the changes. In our example, we set up a cron job to rebuild the collection every-night.

Before starting

 _rebuildpendingmessage_ (This will appear on top of the newly added metadata value to remind user this piece of information is not searchable)
 _newline_ (New line characters in the inserted metadata value will be replaced by this macro)

Calling the script

metadata-server.pl has the following arguments:

It returns following message on success

 insert-metadata successful: Key[D0]
 [In metadata.xml] giv.submittedText = new metadata value
 [In database] giv.submittedText = _rebuildpendingmessage_new metadata value
 The new text has not been indexed, rebuilding collection is required

You need to customize your collection interface to have an AJAX call to this script when user submit new values. This AJAX call will have to evaluate the return value of the script to determine if that was successful. The possible error messages:

Locking

This script shares the same lock as the GLI: