From: <fxp...@us...> - 2008-04-08 11:00:00
|
Revision: 1258 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=1258&view=rev Author: fxprunayre Date: 2008-04-08 04:00:03 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Added pdf.search service Modified Paths: -------------- trunk/web/geonetwork/xsl/search-results-xhtml.xsl Added Paths: ----------- trunk/web/geonetwork/xsl/metadata-fop.xsl trunk/web/geonetwork/xsl/portal-present-fop.xsl Added: trunk/web/geonetwork/xsl/metadata-fop.xsl =================================================================== --- trunk/web/geonetwork/xsl/metadata-fop.xsl (rev 0) +++ trunk/web/geonetwork/xsl/metadata-fop.xsl 2008-04-08 11:00:03 UTC (rev 1258) @@ -0,0 +1,314 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xalan="http://xml.apache.org/xalan" + exclude-result-prefixes="xalan" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:fo="http://www.w3.org/1999/XSL/Format"> + + + <!-- + gui to show a simple element + --> + <xsl:template name="simpleElementFop"> + <xsl:param name="title" /> + <xsl:param name="text" /> + <xsl:param name="helpLink" /> + <xsl:param name="addLink" /> + <xsl:param name="removeLink" /> + <xsl:param name="upLink" /> + <xsl:param name="downLink" /> + <xsl:param name="schematronLink" /> + <xsl:param name="schema" /> + <xsl:param name="edit" select="false()" /> + <!-- used as do*ElementAction url anchor to go back to the same position after editing operations --> + <xsl:param name="anchor"> + <xsl:choose> + + <!-- current node is an element --> + <xsl:when test="geonet:element/@ref"> + _ + <xsl:value-of select="geonet:element/@ref" /> + </xsl:when> + + <!-- current node is an attribute or a new child: create anchor to parent --> + <xsl:when test="../geonet:element/@ref"> + _ + <xsl:value-of select="../geonet:element/@ref" /> + </xsl:when> + + </xsl:choose> + </xsl:param> + + + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:inline font-weight="bold"> + <xsl:value-of select="$title" /> + </fo:inline> + </fo:block> + </fo:table-cell> + <fo:table-cell number-columns-spanned="2"> + <fo:block> + <xsl:value-of select="$text" /> + </fo:block> + </fo:table-cell> + </fo:table-row> + </xsl:template> + + + <!-- + gui to show a complex element + --> + <xsl:template name="complexElementFop"> + <xsl:param name="title" /> + <xsl:param name="text" /> + <xsl:param name="content" /> + <xsl:param name="helpLink" /> + <xsl:param name="addLink" /> + <xsl:param name="removeLink" /> + <xsl:param name="upLink" /> + <xsl:param name="downLink" /> + <xsl:param name="schematronLink" /> + <xsl:param name="schema" /> + <xsl:param name="edit" select="false()" /> + + <!-- used as do*ElementAction url anchor to go back to the same position after editing operations --> + <xsl:param name="anchor"> + <xsl:choose> + + <!-- current node is an element --> + <xsl:when test="geonet:element/@ref"> + _ + <xsl:value-of select="geonet:element/@ref" /> + </xsl:when> + + <!-- current node is a new child: create anchor to parent --> + <xsl:when test="../geonet:element/@ref"> + _ + <xsl:value-of select="../geonet:element/@ref" /> + </xsl:when> + + </xsl:choose> + </xsl:param> + + <fo:table-row> + <fo:table-cell> + <fo:block> + <fo:table width="100%" table-layout="fixed"> + <fo:table-column column-width="3cm" /> + <fo:table-column column-width="12cm" /> + <fo:table-column column-width="1cm" /> + <fo:table-body> + <fo:table-row> + <fo:table-cell + number-columns-spanned="3"> + <fo:block + border-top="2pt solid black"> + <fo:inline font-weight="bold"> + <xsl:text>::</xsl:text> + <xsl:value-of + select="$title" /> + </fo:inline> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell> + <fo:block></fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <xsl:variable name="n" + select="xalan:nodeset($content)" /> + <xsl:if test="$n/node()"> + <fo:table + table-layout="fixed" width="100%" + border-collapse="separate"> + <fo:table-body> + <xsl:copy-of + select="$content" /> + </fo:table-body> + </fo:table> + </xsl:if> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </fo:block> + </fo:table-cell> + </fo:table-row> + + </xsl:template> + + + + <!-- + metadata result to fop + --> + <xsl:template name="fo"> + <xsl:param name="res" /> + <xsl:param name="server" /> + <xsl:param name="gui" /> + <xsl:param name="remote" /> + + <xsl:for-each select="$res/*"> + <xsl:variable name="md"> + <xsl:apply-templates mode="brief" select="."/> + </xsl:variable> + <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> + + <xsl:if test="$metadata/geonet:info/id != ''"> + <fo:table-row> + <fo:table-cell> + + <xsl:variable name="source" select="string($metadata/geonet:info/source)"/> + + <fo:block font-weight="bold" font-size="14pt" + border-top="2pt solid black"> + <fo:external-graphic content-width="35pt"> + <xsl:attribute name="src"> + url('<xsl:value-of + select="concat('http://', $server/host,':', $server/port, $gui/url, '/images/logos/', $source , '.gif')" />')" + </xsl:attribute> + </fo:external-graphic> + <xsl:value-of select="$metadata/title" /> + </fo:block> + <fo:block text-align="left"> + <xsl:value-of select="$gui/strings/abstract" /> + : + <xsl:value-of select="$metadata/abstract" /> + </fo:block> + <!-- keywords --> + <xsl:if test="$metadata/keyword"> + <fo:block text-align="left" + font-style="italic"> + <xsl:value-of select="$gui/strings/keywords" /> + : + <xsl:for-each select="$metadata/keyword"> + <xsl:if test="position() > 1"> + , + </xsl:if> + <xsl:value-of select="." /> + </xsl:for-each> + </fo:block> + </xsl:if> + + <fo:block text-align="left"> + |<fo:basic-link text-decoration="underline" + color="blue"> + <xsl:attribute + name="external-destination"> + url('<xsl:value-of + select="concat('http://', $server/host,':', $server/port, $gui/locService,'/metadata.show?id=', $metadata/geonet:info/id, '&currTab=simple')" />') + </xsl:attribute> + <xsl:value-of select="$gui/strings/show" /> + </fo:basic-link>| + + <xsl:if test="$metadata/geonet:info/download='true'"> + <xsl:for-each + select="$metadata/link[@type='download']"> + <fo:basic-link + text-decoration="underline" color="blue"> + <xsl:attribute + name="external-destination"> + url('<xsl:value-of + select="." />') + </xsl:attribute> + <xsl:value-of + select="$gui/strings/download" /> + </fo:basic-link>| + </xsl:for-each> + </xsl:if> + + <xsl:if test="$metadata/geonet:info/dynamic='true'"> + <xsl:for-each + select="$metadata/link[@type='application/vnd.ogc.wms_xml']"> + <fo:basic-link + text-decoration="underline" color="blue"> + <xsl:attribute + name="external-destination"> + url('<xsl:value-of + select="@href" />') + </xsl:attribute> + <xsl:value-of + select="$gui/strings/interactiveMap" /> + </fo:basic-link>| + </xsl:for-each> + </xsl:if> + + + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <xsl:if test="$metadata/image"> + <xsl:choose> + <xsl:when + test="contains($metadata/image ,'://')"> + <fo:external-graphic> + <xsl:attribute name="src"><xsl:text>url('</xsl:text><xsl:value-of + select="$metadata/image" /><xsl:text>')"</xsl:text></xsl:attribute> + </fo:external-graphic> + </xsl:when> + <xsl:otherwise> + <fo:external-graphic> + <xsl:attribute name="src"><xsl:text>url('</xsl:text><xsl:value-of + select="concat('http://', $server/host,':', $server/port, $metadata/image)" /><xsl:text>')"</xsl:text></xsl:attribute> + </fo:external-graphic> + </xsl:otherwise> + </xsl:choose> + + </xsl:if> + </fo:block> + </fo:table-cell> + </fo:table-row> + </xsl:if> + </xsl:for-each> + </xsl:template> + + + <!-- + main pdf banner + --> + <xsl:template name="banner"> + <fo:table table-layout="fixed" width="100%"> + <fo:table-column + column-width="proportional-column-width(1)" /> + <fo:table-body> + <fo:table-row> + <fo:table-cell display-align="left" background-color="#064377"> + <fo:block text-align="left"> + <!-- FIXME --> + <fo:external-graphic> + <xsl:attribute name="src"> + url('<xsl:value-of + select="concat('http://', //server/host,':', //server/port, /root/gui/url,'/images/header-left.jpg')" />')" + </xsl:attribute> + </fo:external-graphic> + </fo:block> + </fo:table-cell><fo:table-cell display-align="right" background-color="#064377"> + <fo:block text-align="right"> + <fo:external-graphic> + <xsl:attribute name="src"> + url('<xsl:value-of + select="concat('http://', //server/host,':', //server/port, /root/gui/url,'/images/header-right.gif')" />')" + </xsl:attribute> + + </fo:external-graphic> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + </xsl:template> + + + + + + +</xsl:stylesheet> Property changes on: trunk/web/geonetwork/xsl/metadata-fop.xsl ___________________________________________________________________ Name: svn:mime-type + text/plain Added: trunk/web/geonetwork/xsl/portal-present-fop.xsl =================================================================== --- trunk/web/geonetwork/xsl/portal-present-fop.xsl (rev 0) +++ trunk/web/geonetwork/xsl/portal-present-fop.xsl 2008-04-08 11:00:03 UTC (rev 1258) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0" xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:xalan="http://xml.apache.org/xalan" + xmlns:date="http://exslt.org/dates-and-times" + exclude-result-prefixes="xsl xalan geonet"> + + <xsl:include href="metadata-fop.xsl" /> + <xsl:include href="metadata.xsl" /> + <xsl:include href="utils.xsl" /> + + <xsl:template match="/root"> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="simpleA4" + page-height="29.7cm" page-width="21cm" margin-top="1cm" + margin-bottom="1cm" margin-left="1cm" margin-right="1cm"> + <fo:region-body margin-top="1cm" /> + <fo:region-before extent="1cm" /> + </fo:simple-page-master> + + + <fo:page-sequence-master master-name="PSM_Name"> + <fo:single-page-master-reference + master-reference="simpleA4" /> + </fo:page-sequence-master> + </fo:layout-master-set> + + <fo:page-sequence master-reference="simpleA4" + initial-page-number="1"> + + <xsl:variable name="df">yyyy-MM-dd'T'HH:mm:ss</xsl:variable> + + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end"> + GeoNetwork opensource - <xsl:value-of select="date:format-date(date:date-time(),$df)"/> - + <fo:page-number /> + / + <fo:page-number-citation ref-id="terminator" /> + </fo:block> + </fo:static-content> + + <fo:flow flow-name="xsl-region-body"> + + <!-- Banner level --> + <xsl:call-template name="banner" /> + + + <fo:block font-size="10pt"> + + <fo:table width="100%" table-layout="fixed"> + <fo:table-column column-width="13cm" /> + <fo:table-column column-width="5cm" /> + <fo:table-body> + <fo:table-row height="10mm"> + <fo:table-cell + display-align="center"> + <fo:block text-align="center"> + <xsl:value-of + select="/root/gui/strings/resultsMatching" /> + <xsl:value-of + select="/root/response/summary/@count" /> + </fo:block> + </fo:table-cell> + </fo:table-row> + + <xsl:variable name="remote" + select="/root/response/summary/@type='remote'" /> + + + <xsl:call-template name="fo"> + <xsl:with-param name="res" + select="//mdresults" /> + <xsl:with-param name="gui" + select="/root/gui" /> + <xsl:with-param name="server" + select="//server" /> + <xsl:with-param name="remote" + select="$remote" /> + + </xsl:call-template> + </fo:table-body> + </fo:table> + </fo:block> + + <fo:block id="terminator" /> + </fo:flow> + </fo:page-sequence> + </fo:root> + </xsl:template> + + <!-- ============================================================== --> + + <xsl:template match="geonet:info/title" mode="strip" /> + + <xsl:template match="@*|node()" mode="strip"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="strip" /> + </xsl:copy> + </xsl:template> + +</xsl:stylesheet> Property changes on: trunk/web/geonetwork/xsl/portal-present-fop.xsl ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: trunk/web/geonetwork/xsl/search-results-xhtml.xsl =================================================================== --- trunk/web/geonetwork/xsl/search-results-xhtml.xsl 2008-04-08 10:58:31 UTC (rev 1257) +++ trunk/web/geonetwork/xsl/search-results-xhtml.xsl 2008-04-08 11:00:03 UTC (rev 1258) @@ -87,7 +87,14 @@ </xsl:for-each> </select> </xsl:if> - </div> + </div> + + <xsl:if test="/root/response/summary/@count > 0"> + <!-- print pdf - - - - - - - - - - - - - - - - - - - - --> + <div style="float:right;"> + <a href="#" onclick="runPdfSearch();"><img align="absmiddle" src="{/root/gui/url}/images/pdf.gif" alt="{/root/gui/strings/savepdf}" title="{/root/gui/strings/savepdf}"/></a> + </div> + </xsl:if> </td> </tr> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |