Re: [greenstone-devel] Retrieving a page from greenstone

From John R. McPherson
DateMon, 4 Aug 2003 20:29:35 +1200
Subject Re: [greenstone-devel] Retrieving a page from greenstone
In-Reply-To (71E37EF6B7DCC1499CEA0316A256832801057002-loki-globexplorer-com)
On Sun, Aug 03, 2003 at 11:42:04PM -0700, Gregory S. Williamson wrote:

> Since I have a few dozen directories (in my test case) and this is
> on a Windows machine, I am at a bit of a loss as to how to find the
> hash code for a given document ... I could accumulate all of the
> relevant lines from the .xml files (<Metadata
> name="Identifier">HASH010ddaf18d9e03d233379b41</Metadata>, etc.) and
> put them into a dbm or other easily searched format. Or code a tool
> that searches .xml files in directories (and sub-directories, and
> perhaps sub-sub-directories ?) for the proper .xml file and then
> extract the hash.

> I was wondering, I suppose, if there is a function call that,
> given a file name would calculate the hash. I've been poking through
> various perl modules without luck so far ... (slightly slow going,
> lots of neat aspects to the code).

We use our own hash function, so that we can get consistency in
hashes across all platforms etc. (Actually, it seems possible that
it works differently on little-endian vs big-endian machines, I'm not
sure). Anyway, the program is in the gsdlhomebin(operating system)
directory, so on windows, look for %GSDLHOME%binwindowshashfile.exe.

Another thing you could do if you want predictable Identifiers is to
modify the plugin and define your own set_OID() function, otherwise
the default set_OID() function in BasPlug is used if the import plugin
doesn't use its own. (This assumes you know some perl).

One last thing that might be helpful is the OIDtype option that you
can put in the collect.cfg file. If you put
OIDtype incremental
in the collect.cfg (instead of the default hash method), then the
identifiers get called D0, D1, D2, etc in order that they are
processed at import time. (The "D" means document, and is so that the
Identifier isn't purely numeric).

Hope this helps
John McPherson