[GeoNetwork-devel] How to add an element in search results? [SEC=UNCLASSIFIED]

Kuochih,
I'm not an expert on this topic but from memory the search results works by
first of all creating an XML document with embedded metadata records. The XML
document passed into the results stylesheet can be viewed by inserting an
exclamation mark '!' at the end of the service name e.g.

http://localhost:8080/geonetwork/srv/en/main.search.embedded!?any=&sortBy=rel
evance&hitsPerPage=10&output=full&remote=off

Caution, I've found the search results to be a little tricky. The XML output
above represents the input to the XSL process but is not the full document
being rendered. The fields you are interested in, e.g. $metadata/title, are
inserted into the original XML document by templates operating in 'brief'
mode. Look for the following fragment in search-results.xhtml.xsl:

<xsl:variable name="md">
  <xsl:apply-templates mode="brief" select="."/>
</xsl:variable>

This is where the document the variable $metadata is derived from is created.
Note, this is performed in memory, not from a file. As far as I can tell each
metadata format has its own stylesheet to normalize common fields. I normally
work with ISO19139. If you look at template "briefster" in
metadata-iso19139.xsl you will see the field being copied to form <title>.
Each format does things a little differently but you should be able to work
this out. Use template "dublin-coreBrief" in metadata-dublin-core.xsl for
comparison.

Hope this helps,
Steve

-----Original Message-----
From: Kuochih [mailto:r92544026@anonymised.com]
Sent: Thursday, 9 October 2008 3:41
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] How to add an element in search results?

Search results will display title, abstract, and keysords with
search-results-xhtml.xsl. I want to add more information like Organisation
name in the results page, but I am not sure what file defines the $metadata.
May someone give me an advice?

Thanks.
--
View this message in context:
http://www.nabble.com/How-to-add-an-element-in-search-results--tp19892279p198
92279.html
Sent from the geonetwork-devel mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork