Re: [greenstone-users] Displaying multiple metadata valuesindividually?

From schild
DateThu, 18 Aug 2005 08:49:47 +0200
Subject Re: [greenstone-users] Displaying multiple metadata valuesindividually?
In-Reply-To (4303D431-9020907-gmx-net)
Hi katherine,

jens wille wrote:
hi katherine!

Katherine Don wrote:
What is the basic problem that you are having with the format
statements that means you can't do it just using [sibling:]?? Is
it that need to print out the value twice for each item? You
could probably generate a series of links using sibling:, but you
wouldn't be able to display the text that the link pertained to.
Is that the main problem? Are there any others?
my understanding of this topic is that one might want to combine
several multi-valued metadata "pairwise". e.g.:

assume metadata 'foo': a, b, c (this could be href's)
                'bar': x, y, z (this would then be the link texts)

=> aim: <a href="a">x</a><br><a href="b">y</a><br><a href="c">z</a>

I have added sibling(first):, sibling(last), sibling(1),
sibling(2) etc to the latest release, so if you knew how many
items there would be, then you could do it just using format
statements. If you don't know in advance, I guess you could do a
series of if statements, if sibling(0), print sibling(0) if
sibling(1), print sibling(1) etc a bit ugly but doesn't involve
these new sibling (and parent, and child) functionalities are great!
and you could now even achieve the above mentioned by saying:

<a href="[sibling(1):foo]">[sibling(1):bar]</a><br>
<a href="[sibling(2):foo]">[sibling(2):bar]</a><br>
<a href="[sibling(3):foo]">[sibling(3):bar]</a>

...but: in practice, you just can't put several hundreds of these
statements (maybe with if-clauses) into your collect.cfg. and what
if one of your documents has more instances of that metadata than
you precalculated?!
I think Jens comment is right. If for instance want to create links for each author of a document, such when clicking on the hyperlinks a search for documents of that particular author is executed and the search results are displayed, you never know up front how many authors there are for a document (from 1 to many). It gets even worse when you think of reference linking of documents. So you would have to cope for that by adding a long list of if cases to the .cfg file. In this case really a loop construction would be advantages. (see jens comment below...)

Does this solve your problems? If not, it would be good to get 
clear picture of what the main problem is, and we'll add it to
our todo list :-)
i'm not sure if i was able to draw a sufficiently clear picture, but
what i'd think would be nice is some kind of a for-loop (actually
somehow more than just nice ;-):

{For}{[foo],[bar], <a href="_1_">_2_</a><br>}
        |     |
       _1_   _2_ ...

it takes a list of metadata names and a format statement as
arguments. the _x_ parameters are then sequentially set to the
according metadata value.
(the single-metadata-case would be equivalent to our well-known
"[sibling(All:'xxx'):...]xxx". maybe one could even add another
argument for the delimiter: "{For}{..., <a .../a>, <br>}". thus it
would really be equivalent to the [sibling...] construct, and more
appropriate, too)

now, this picture might be a bit visionary, but your request was
quite an invitation ;-)


greenstone-users mailing list
I guess this would do the basic job for most users of greenstone.
Anyhow in my particular case my collection I cannot go without javascript anyhow, as I what to have the user interface a bit more user friendly (instead of just hyperlinks for each term individually I want checkboxes, etc. behind terms such that the user can "combine" his search query), such that the user can refine a search query more intuitively (graphical user interface). For this I need to use javascript anyway...




Dipl.-Ing. Axel Schild
Automatisierungstechnik und Prozessinformatik
Ruhr-Universitaet Bochum IC-3/140
D-44780 Bochum, Germany

Tel: +49 234 32 25203
Fax: +49 234 32 14101