Re: [greenstone-users] Displaying multiple metadata values individually?

From Stephen DeGabrielle
DateThu, 18 Aug 2005 16:15:01 +0930
Subject Re: [greenstone-users] Displaying multiple metadata values individually?
In-Reply-To (4303D431-9020907-gmx-net)
This is a great opportunity!
While we are looking at the macro language,
1. Is it possible to bring it and the format language together
so collection builders only have to learn one language?
1.1 enhance the conditionals available in format statements
2. Can the conditionals in {If}{<conditional expression>,,} be broadened to include more than
{lt gt eq ne}, eg ;  ge and le, the numeric versions { <,>,>=,<=,  }, the pattern match operators(*PLEASE*) ( so I could do a =~ /.*(tree|bush|shrub).*/ or some other RE) , logical operators too.
''Comparison operators are the same as the simple ones used in Perl (less than, greater than, equals, not equals)."
- p 50 developers guide (whoops I am looking at version 2.50 of the developers guide-  this may have changed)
2.1 can conditionals (or expressions) be nested? this would be great. (I think this works in format statements already?)
3. I should just give up and learn c++ huh?

On 8/18/05, 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
> javascript.
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?!

> Does this solve your problems? If not, it would be good to get a
> 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



Stephen De Gabrielle