Re: [greenstone-users] How to use /gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q and ifl argument in format DocumentText

From ruben pandolfi
DateFri, 04 Aug 2006 19:54:16 +0200
Subject Re: [greenstone-users] How to use /gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q and ifl argument in format DocumentText
In-Reply-To (44D26ACB-1030305-cs-waikato-ac-nz)
Thank you Michael,

Michael Dewsnip ha scritto:


>
> /gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q&q=[dc.ModsRecordInfoRecordIdentifi]
>
> instead of
>
> /gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q=[dc.ModsRecordInfoRecordIdentifi]
>
>> 2) I would like to add ifl argument to go directly to the first record
>> found , is this possible from format DocumentText?
>
> The "&ifl=1" is an argument to the query action, so it can go into an
> "/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q" link.

I almost resolved the query problem, but still can not get &ifl=1 to
work. It looks OK , since I do not have errors, but simply output the
search result and does not go to record directly.

This is what I have:


{If}{[dc.ModsExtensionHasTranslation^a], <tr><td
valign=top><b>_Ht_:</b></td><td valign=top>
<a
href=\"/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q&q=[dc.ModsExtensionHasTranslation^z]&fqf=DI&t=0&qt=0&ifl=1\">
[dc.ModsExtensionHasTranslation^a]</a></td></tr>}

dc.ModsExtensionHasTranslation^z contains ISBN unique identifier, and I
make a simple search in the ISBN index. It works and give me the only
possible result, but I would like to skip the search page and go
directly to the document. &ifl=1 should be the perfect argument to do
so, but is not ... you might have a try here:

http://www02.unibg.it/~morin/gsdl/cgi-bin/library?a=q&r=1&hs=1&e=q-000-00---0babel3--00-1-0--0prompt-10-DN--4------0-1l--1-en-50---20-preferences-890--00031-001-0-0utfZz-8-00&fqf=DN&t=0&q=ISBN+88-88-8888-8&ifl=1


that gives me the same output as:

http://www02.unibg.it/~morin/gsdl/cgi-bin/library?a=q&r=1&hs=1&e=q-000-00---0babel3--00-1-0--0prompt-10-DN--4------0-1l--1-en-50---20-preferences-890--00031-001-0-0utfZz-8-00&fqf=DN&t=0&q=ISBN+88-88-8888-8


2) I have some fields that have repeatable pairs of values, and I have
worked it out like this:


{If}{[sibling(2):dc.ModsExtensionHasTranslation^a], <tr><td
valign=top></td><td valign=top>
<a
href=\"/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q&q=[sibling(2):dc.ModsExtensionHasTranslation^z]&fqf=DI&t=0&qt=0&ifl=1\">[sibling(2):dc.ModsExtensionHasTranslation^a]</a></td></tr>}
{If}{[sibling(3):dc.ModsExtensionHasTranslation^a], <tr><td
valign=top></td><td valign=top>
<a
href=\"/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Jonathan+Pattison--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q&q=[sibling(3):dc.ModsExtensionHasTranslation^z]&fqf=DI&t=0&qt=0&ifl=1\">[sibling(3):dc.ModsExtensionHasTranslation^a]</a></td></tr>}


It is a solutions, but surely not the best, since I can not determine
how many times the field repeat, and the code is a bit bloated ...


I've seen the Axel Schild method here:

http://greenstone.sourceforge.net/wiki/index.php/Customizing_collections#How_can_I_hyperlink_individual_metadata_elements.3F

and I might need something similar. I have tried implementing it but
without success, since my javascript is quite poor.


I have copied the code in format DocumentText and I have just inserted
this in my extra.dm file:

-------------------------------
-------------------------------
package Style
-------------------------------

### Self-made Javascript functions
{
function ExtractAuthors() {
var res;
a = AuthorField.outerText.split(";");
resolver = a[0]+"&q=";
b = a[1].split("+%3b+");
c = a[2].split("_");
res = "";
for (i = 0; i < b.length ;i++)
{
res = res + "<a href=" + resolver + b[i]+ "&h=dd0&t=0>" +
c[i] + "</a><br/>";
}
AuthorField.outerHTML = res;
}
onload="ExtractSubjects();ExtractAuthors();"
}


-------------------------------

But it does not work.

I do not really understand what I'm doing, but I just took a javascript
manual and get back in two days :-) !

My idea is to write a generic function, put it in an external javascript
file and use it for everytime I have a repeatable metadata that need to
be linked.

Meanwhile, if you can give some help, I would appreciate,....


> Was it this collection:
> http://www.aladin.wrlc.org/gsdl/collect/treasure/treasure.shtml?
>

It was, thanks again!

Ruben