Re: [greenstone-users] Length of a classifier list

From Richard Managh
DateMon, 05 Dec 2005 13:54:41 +1300
Subject Re: [greenstone-users] Length of a classifier list
In-Reply-To (Pine-WNT-4-61-0512020832040-1124-LIBSTFSYS11-LIBRARY-UIUC-EDU)
Hi Jonathan,

You could use the GenericList classifier to get 10 items per browse
grouping, for example:

classify GenericList -metadata Title -sort_leaf_nodes_using Title
-partition_type_within_level constant_size -partition_size_within_level 10

Replacing "Title" with the name of your "cooking terms" metadata.

I'm not sure if you have definitions for your glossary terms, whether
you intend the definitions to be displayed in the classifier or for the
classifier to link to the definitions.

What is the benefit of having a classifier for cooking terms? Would it
be simpler to have a static page, or perhaps a number of static pages
and simply link to them?

You could create a new macro file called for example, with say

package glossary

at the top, adding it to your collection as the documentation suggests,
with its


The requested page could not be found. Please use your browsers 'back' button or the above home button to return to the Greenstone Digital Library. macro containing the html for your glossary terms and
their definitions.

You could link to cooking terms in this page by adding anchor tags for
each of your terms and adding something like <a
href="/gsdlmod?a=p&p=glossary#browned">browned</a> in your recipes.

This wouldnt require you to create an index of <terms> -> <their
location in the classifier>. If however you do want to go this way, you
might find parsing the gdbm database for your collection easier than
parsing the classifier html pages by browsing the collection directly.
Find the *.ldb file in your collection's index/text directory, and use
the db2txt utility provided with greenstone to convert it to text form.
You can do something like

db2txt recipes.ldb > recipe_database.txt

Hope this helps,

DL Consulting
Greenstone Digital Library and Digitisation Specialists

Hello again,

I feel a little foolish asking this question, but I'm afraid of spending
a lot of time looking at the wrong places. Is there a way to have some
predictability as to the number of items shown on a page within a
browse. I know there is min and max grouping, but what I would like is
to be able to say that there will be always 10 items per browse. I'm
pretty sure I've seen this somewhere. I guess I'd prefer not having to
control it but rather be able to predict how the classifier will be set up.

Why I'm asking:

My end goal would be to have links contained within a generated html
document for important terms. So a paragraph in a recipe has "and wait
the meat is browned". I'd like to link that to the page in the "cooking
terms" classifier where "brown" appears. There seems no nice way to do
this in Greenstone so here is my worse case scenario:

I have XML documents so it seems not to difficult to have something like
<cooking_term index="brown">browned</cooking_term>. Then when I convert
it to the HTML I have Greenstone process, I can replace that with a link
by looking up the attribute "index" in an index (not Greenstone-based)
that contains the terms and where they will appear (ie CL3.2.3). Then I
just have to make the link <a

The trick is how to generate that index. Worse case scenario I go ahead
and generate the Greenstone library. Then I can spider over it and
determine what pages the terms occur on in the classifier.

Basic algorithm would be to do a depth search, starting at CL1, seeing
if there are items, if so try CL1.1 and keep going until there is no
items, then go back up one level in the hierarchy and check the next

The other approach is to define my own hierarchy but I would like to
avoid that if possible since some of the terms I'd be adding probably
wouldn't be very well controlled.

Jonathan T. Gorman

greenstone-users mailing list