From: <aca...@us...> - 2007-03-09 17:59:38
|
Revision: 226 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=226&view=rev Author: acarboni Date: 2007-03-09 09:59:36 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Added 'harvestingNodes' to xml.info service to better manage harvesting nodes Modified Paths: -------------- trunk/src/org/fao/geonet/constants/Geonet.java trunk/src/org/fao/geonet/services/main/Info.java trunk/web/xsl/xml/info.xsl Modified: trunk/src/org/fao/geonet/constants/Geonet.java =================================================================== --- trunk/src/org/fao/geonet/constants/Geonet.java 2007-03-09 16:29:40 UTC (rev 225) +++ trunk/src/org/fao/geonet/constants/Geonet.java 2007-03-09 17:59:36 UTC (rev 226) @@ -70,7 +70,6 @@ public static final String OPERATIONS = "operations"; public static final String OPER = "oper"; public static final String SUMMARY = "summary"; - public static final String SITE_ID = "siteId"; public static final String SITE_URL = "siteURL"; } Modified: trunk/src/org/fao/geonet/services/main/Info.java =================================================================== --- trunk/src/org/fao/geonet/services/main/Info.java 2007-03-09 16:29:40 UTC (rev 225) +++ trunk/src/org/fao/geonet/services/main/Info.java 2007-03-09 17:59:36 UTC (rev 226) @@ -95,6 +95,9 @@ else if (type.equals("knownNodes")) result.addContent(getKnownNodes(dbms)); + else if (type.equals("harvestingNodes")) + result.addContent(getHarvestingNodes(dbms)); + else throw new BadParameterEx("type", type); } @@ -119,12 +122,6 @@ while (i.hasNext()) { Element record = (Element) i.next(); - String siteId = record.getChildText("siteid"); - - String query = "SELECT COUNT(*) as result FROM Metadata WHERE source='"+ siteId +"'"; - Element count = (Element) dbms.select(query).getChildren().get(0); - - record.addContent(new Element("metadata").setText(count.getText())); record.getChild("siteid").setName("siteId"); } @@ -133,6 +130,18 @@ //-------------------------------------------------------------------------- + private Element getHarvestingNodes(Dbms dbms) throws SQLException + { + String query = "SELECT name, source, count(*) as num "+ + "FROM Metadata, KnownNodes "+ + "WHERE source=siteId "+ + "GROUP BY source"; + + return dbms.select(query).setName("harvestingNodes"); + } + + //-------------------------------------------------------------------------- + private Element getEnv(ServiceContext context) { return new Element("env") Modified: trunk/web/xsl/xml/info.xsl =================================================================== --- trunk/web/xsl/xml/info.xsl 2007-03-09 16:29:40 UTC (rev 225) +++ trunk/web/xsl/xml/info.xsl 2007-03-09 17:59:36 UTC (rev 226) @@ -100,6 +100,20 @@ <!-- ============================================================================================= --> + <xsl:template match="harvestingNodes"> + <xsl:copy> + <xsl:for-each select="record"> + <node> + <name><xsl:value-of select="name"/></name> + <siteId><xsl:value-of select="source"/></siteId> + <metadata><xsl:value-of select="num"/></metadata> + </node> + </xsl:for-each> + </xsl:copy> + </xsl:template> + + <!-- ============================================================================================= --> + <xsl:template match="env"/> <!-- ============================================================================================= --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tic...@us...> - 2007-03-12 22:09:02
|
Revision: 241 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=241&view=rev Author: ticheler Date: 2007-03-12 15:09:02 -0700 (Mon, 12 Mar 2007) Log Message: ----------- Know issues file moved. This file can be moved into the WIKI of the TRAC once set up on osgeo.org Added Paths: ----------- trunk/docs/developers/ trunk/docs/developers/known issues.txt Removed Paths: ------------- trunk/known issues.txt Added: trunk/docs/developers/known issues.txt =================================================================== --- trunk/docs/developers/known issues.txt (rev 0) +++ trunk/docs/developers/known issues.txt 2007-03-12 22:09:02 UTC (rev 241) @@ -0,0 +1,48 @@ +List of bugs, issues to be resolved & todo list + +Bugs: +- XML Metadata insert form requires a template "title" even for regular metadata. + Without a title the import fails. + Proposed resolution: title field is not displayed when Metadata is selected in the + drop down. In Insert.java the title parameter will be validated depending on the + isTemplate parameter. +- XML Metadata insert using ISO19139 only works when the gmd: prefix is used for + ISO19115 elements. The current import conversion from 19115 to 19139 does not + create output that includes these prefixes. The related XSLTs need updating. + +Issues: +- A big issue is the backward compatibility of the harvesting. v2.1 does not harvest + nodes of v2.0. This can not be. Even if less optimal harvesting, this should remain + possible when upgrading. + +- The process of creating a database should: + - provide the default option to add metadata templates to the database so people can get started. + - provide the option to add sample data + +- Sample metadata does not have: + - thumbnails + - online resources (requires InterMap integration too) + - code list issues with ISO19139 metadata + +- The Back button's behavior in the administration services should be verified as at + least a number of them should bring the user back to the administration page and + not back into the editing forms for instance. User and Group management are among + these. + +- The Check for ISO19139 fails. + +- General error handling seems to be missing. Raw Java errors are displayed in case + of a session time out for instance + +To do: +- in metadata.show.xsl & search-results.xsl the href does not point to baseURL yet of + the resource yet. + +- Revisit the help.xml, links.xml and about.xml to verify and update (a.o. links & + some of the translations)) + +- Further improve help through the use of DHTML tooltips and AJAX request to server + +- Integrated version with InterMap opensource + +- Set logging options to OFF before creating final release \ No newline at end of file Deleted: trunk/known issues.txt =================================================================== --- trunk/known issues.txt 2007-03-12 17:40:24 UTC (rev 240) +++ trunk/known issues.txt 2007-03-12 22:09:02 UTC (rev 241) @@ -1,44 +0,0 @@ -List of bugs, issues to be resolved & todo list - -Bugs: -- XML Metadata insert form requires a template "title" even for regular metadata. - Without a title the import fails. - Proposed resolution: title field is not displayed when Metadata is selected in the - drop down. In Insert.java the title parameter will be validated depending on the - isTemplate parameter. -- XML Metadata insert using ISO19139 only works when the gmd: prefix is used for - ISO19115 elements. The current import conversion from 19115 to 19139 does not - create output that includes these prefixes. The related XSLTs need updating. - -Issues: -- A big issue is the backward compatibility of the harvesting. v2.1 does not harvest - nodes of v2.0. This can not be. Even if less optimal harvesting, this should remain - possible when upgrading. - -- Sample metadata does not have: - - thumbnails - - online resources (requires InterMap integration too) - - code list issues with ISO19139 metadata - -- The Back button's behavior in the administration services should be verified as at - least a number of them should bring the user back to the administration page and - not back into the editing forms for instance. User and Group management are among - these. - -- The Check for ISO19139 fails. - -- General error handling seems to be missing. Raw Java errors are displayed in case - of a session time out for instance - -To do: -- in metadata.show.xsl & search-results.xsl the href does not point to baseURL yet of - the resource yet. - -- Revisit the help.xml, links.xml and about.xml to verify and update (a.o. links & - some of the translations)) - -- Further improve help through the use of DHTML tooltips and AJAX request to server - -- Integrated version with InterMap opensource - -- Set logging options to OFF before creating final release \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-13 17:36:24
|
Revision: 257 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=257&view=rev Author: acarboni Date: 2007-03-13 10:36:10 -0700 (Tue, 13 Mar 2007) Log Message: ----------- Removed variables substitution is string files Modified Paths: -------------- trunk/installer/installer-config.xml trunk/web/loc/cn/xml/strings.xml trunk/web/loc/en/xml/strings.xml trunk/web/loc/es/xml/strings.xml trunk/web/loc/fr/xml/strings.xml trunk/web/xsl/file-download.xsl trunk/web/xsl/main-page.xsl Modified: trunk/installer/installer-config.xml =================================================================== --- trunk/installer/installer-config.xml 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/installer/installer-config.xml 2007-03-13 17:36:10 UTC (rev 257) @@ -85,9 +85,6 @@ <executable targetfile="$INSTALL_PATH/bin/stop-geonetwork.sh" /> <parsable targetfile="$INSTALL_PATH/docs/post-install.txt" type="plain"/> - <parsable targetfile="$INSTALL_PATH/web/loc/en/xml/strings.xml" type="xml"/> - <parsable targetfile="$INSTALL_PATH/web/loc/fr/xml/strings.xml" type="xml"/> - <parsable targetfile="$INSTALL_PATH/web/loc/es/xml/strings.xml" type="xml"/> <parsable targetfile="$INSTALL_PATH/web/xml/repositories.xml" type="xml"/> <parsable targetfile="$INSTALL_PATH/web/xml/schema-mappings.xml" type="xml"/> Modified: trunk/web/loc/cn/xml/strings.xml =================================================================== --- trunk/web/loc/cn/xml/strings.xml 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/loc/cn/xml/strings.xml 2007-03-13 17:36:10 UTC (rev 257) @@ -95,7 +95,6 @@ <meta name="DC.date" content="01-11-2005"/> <meta name="DC.type" scheme="DCMIType" content="InteractiveResource"/> <meta name="DC.format" content="text/html; charset=UTF-8"/> - <meta name="DC.identifier" content="http://$WEBSERVER_HOST/geonetwork"/> <meta name="DC.language" content="Chinese English French Spanish"/> <meta name="DC.coverage" content="Global"/> </header_meta> Modified: trunk/web/loc/en/xml/strings.xml =================================================================== --- trunk/web/loc/en/xml/strings.xml 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/loc/en/xml/strings.xml 2007-03-13 17:36:10 UTC (rev 257) @@ -119,11 +119,9 @@ <meta name="DC.creator" content="GeoNetwork Team"/> <meta name="DC.subject" lang="English French" content="GeoNetwork opensource metadata ISO19115 ISO19139 ISO GIS remote sensing data shapefiles spatial data satellite images map maps interactive opengis mapping 19115 19139 geographic z39.50 catalog clearinghouse coverages grid raster data opensource open source network"/> <meta name="DC.description" lang="English French" content="GeoNetwork opensource provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> -<!-- <meta name="DC.publisher" content="$ORGANIZATION"/> --> <meta name="DC.date" content="01-11-2005"/> <meta name="DC.type" scheme="DCMIType" content="InteractiveResource"/> <meta name="DC.format" content="text/html; charset=UTF-8"/> -<!-- <meta name="DC.identifier" content="http://$WEBSERVER_HOST/$SERVLET"/> --> <meta name="DC.language" content="English French"/> <meta name="DC.coverage" content="Global"/> </header_meta> @@ -164,7 +162,9 @@ <li>To enhance understanding of the benefits of geographic information</li> </ul> </mainpage1> - <mainpage2> GeoNetwork opensource allows to easily share geographically referenced thematic information between different organizations. For more information please contact: <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a> or send us <a href="/$SERVLET/srv/en/feedback">feedback</a> + <mainpage2> + GeoNetwork opensource allows to easily share geographically referenced thematic + information between different organizations. For more information please contact </mainpage2> <mainhelp1> How to search... </mainhelp1> <mainhelp2> Hide help... </mainhelp2> @@ -220,9 +220,6 @@ <newPassword>New Password</newPassword> <newUser>Add a new User to the Database</newUser> <none>none</none> - <nofilefound1>Sorry, the download file was not found. Please send us a </nofilefound1> - <nofilefound2>feedback message</nofilefound2> - <nofilefound3> or an email ($ADMIN_MAIL) with the title and the following Metadata id: </nofilefound3> <noHelp>Sorry, no help available</noHelp> <noInfo>Sorry, no info available</noInfo> <noLogin>You are not logged in</noLogin> @@ -301,8 +298,7 @@ <copyright2> <p>All rights reserved.<br/> Your generic copyright statement </p> </copyright2> - <moreinfo>For more information you can contact us via email at <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a>, or send us <a href="/$SERVLET/srv/en/feedback">feedback</a> - </moreinfo> + <moreinfo>For more information you can contact us via email at </moreinfo> <message>The username or the password is wrong.<br/>Press the 'back' button and try again.</message> <protocolChoice value="WWW:LINK-1.0-http--link">Web address (URL)</protocolChoice> <protocolChoice value="WWW:DOWNLOAD-1.0-http--download">File for download</protocolChoice> Modified: trunk/web/loc/es/xml/strings.xml =================================================================== --- trunk/web/loc/es/xml/strings.xml 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/loc/es/xml/strings.xml 2007-03-13 17:36:10 UTC (rev 257) @@ -76,15 +76,13 @@ <meta name="keywords" content="GeoNetwork opensource metadatos ISO19115 ISO19139 ISO GIS teledetección datos shapefiles datos espaciales imágenes de satélite mapa mapas interactivos opengis mapping 19115 19139 geographic z39.50 catalogo clearinghouse coberturas mallas raster data opensource open source network"/> <meta name="description" content="GeoNetwork opensource proporciona a través de internet acceso a mapas interactivos, imágenes de satélite y bases de datos espaciales relacionadas. El propósito es mejorar el acceso a y la integración de datos espaciales e información. GeoNetwork opensource permite compartir fácilmente datos espaciales entre los usuarios"/> <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"/> - <meta name="DC.title" lang="Spanish" content="$ORGANIZATION Portal GeoNetwork para datos espaciales e información"/> + <meta name="DC.title" lang="Spanish" content="Portal GeoNetwork para datos espaciales e información"/> <meta name="DC.creator" content="Equipo GeoNetwork"/> <meta name="DC.subject" lang="Spanish" content="GeoNetwork metadata ISO19115 ISO19139 ISO GIS remote sensing data shapefiles spatial data satellite images map maps interactive opengis mapping 19115 19139 geographic z39.50 catalog clearinghouse coverages grid raster data opensource open source network"/> - <meta name="DC.description" lang="Spanish" content="$ORGANIZATION GeoNetwork provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> - <meta name="DC.publisher" content="$ORGANIZATION"/> + <meta name="DC.description" lang="Spanish" content="GeoNetwork provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> <meta name="DC.date" content="01-11-2005"/> <meta name="DC.type" scheme="DCMIType" content="InteractiveResource"/> <meta name="DC.format" content="text/html; charset=UTF-8"/> - <meta name="DC.identifier" content="http://$WEBSERVER_HOST/$SERVLET"/> <meta name="DC.language" content="English French Spanish"/> <meta name="DC.coverage" content="Global"/> </header_meta> @@ -132,7 +130,9 @@ <li>Enfatizar los beneficios que proporcionan la comprensión de la Información Geográfica</li> </ul> </mainpage1> - <mainpage2> El proyecto GeoNetwork opensource promueve que se comparta la información temática y georeferenciada disponible entre las organizaciones. Si desea más información, puede enviar un mensaje: <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a> o bien enviar sus <a href="/$SERVLET/srv/es/feedback">sugerencias</a> a través de un formulario en la Web. <p/> + <mainpage2> + El proyecto GeoNetwork opensource promueve que se comparta la información temática y georeferenciada + disponible entre las organizaciones. Si desea más información, puede enviar un mensaje </mainpage2> <mainhelp1> Como buscar... </mainhelp1> <mainhelp2> Ocultar la ayuda... </mainhelp2> @@ -184,9 +184,6 @@ <newMdDes>Añade un nuevo metadato</newMdDes> <newMetadata>Nuevo Metadato</newMetadata> <newUser>Añade un nuevo usuario a la Base de datos</newUser> - <nofilefound1>Disculpe las molestias, no se ha podido encontrar el fichero solicitado para su descarga. Envienos un </nofilefound1> - <nofilefound2>mensaje de comentarios</nofilefound2> - <nofilefound3> o un correo electrónico ($ADMIN_MAIL) con el título del metadatos y el id: </nofilefound3> <noHelp>Disculpe las molestias, no hay ayuda disponible</noHelp> <noInfo>Disculpe las molestias, no hay información disponible</noInfo> <online>Mapa Interactivo</online> @@ -252,7 +249,7 @@ <copyright2> <p>Reservados todos los derechos.<br/> Escriba su propio copyright. </p> </copyright2> - <moreinfo>Para mayor información usted puede contactar por correo electrónico en <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a>, o enviarnos un <a href="/$SERVLET/srv/es/feedback">comentario</a> + <moreinfo>Para mayor información usted puede contactar por correo electrónico en </a> </moreinfo> <message>El nombre de usuario o la contaseña son incorrectos.<br/>Presione el botón 'atrás' e intentelo de nuevo.</message> <protocolChoice value="WWW:LINK-1.0-http--link">Dirección Web (URL)</protocolChoice> Modified: trunk/web/loc/fr/xml/strings.xml =================================================================== --- trunk/web/loc/fr/xml/strings.xml 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/loc/fr/xml/strings.xml 2007-03-13 17:36:10 UTC (rev 257) @@ -101,15 +101,13 @@ <meta name="keywords" content="GeoNetwork opensource metadata ISO19115 ISO19139 ISO GIS remote sensing data shapefiles spatial data satellite images map maps interactive opengis mapping 19115 19139 geographic z39.50 catalog clearinghouse coverages grid raster data opensource open source network"/> <meta name="description" content="GeoNetwork opensource provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"/> - <meta name="DC.title" lang="French" content="$ORGANIZATION GeoNetwork portal to spatial data and information"/> + <meta name="DC.title" lang="French" content="GeoNetwork portal to spatial data and information"/> <meta name="DC.creator" content="GeoNetwork Team"/> <meta name="DC.subject" lang="French" content="GeoNetwork opensource metadata ISO19115 ISO19139 ISO GIS remote sensing data shapefiles spatial data satellite images map maps interactive opengis mapping 19115 19139 geographic z39.50 catalog clearinghouse coverages grid raster data opensource open source network"/> - <meta name="DC.description" lang="French" content="$ORGANIZATION GeoNetwork provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> - <meta name="DC.publisher" content="$ORGANIZATION"/> + <meta name="DC.description" lang="French" content="GeoNetwork provides Internet access to interactive maps, satellite imagery and related spatial databases. It's purpose is to improve access to and integrated use of spatial data and information. GeoNetwork opensource allows to easily share spatial data among different users"/> <meta name="DC.date" content="01-11-2005"/> <meta name="DC.type" scheme="DCMIType" content="InteractiveResource"/> <meta name="DC.format" content="text/html; charset=UTF-8"/> - <meta name="DC.identifier" content="http://$WEBSERVER_HOST/$SERVLET"/> <meta name="DC.language" content="English French Spanish"/> <meta name="DC.coverage" content="Global"/> </header_meta> @@ -157,7 +155,7 @@ </mainpage1> <mainpage2> GeoNetwork opensource permet de partager des informations géographiques thématiques entre organisations. - Pour plus d'information, contacter : <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a> ou envoyer nous <a href="/$SERVLET/srv/fr/feedback"> vos commentaires </a> + Pour plus d'information, contacter </mainpage2> <mainhelp1> Comment chercher ... @@ -233,9 +231,6 @@ <newPassword>Nouveau mot de passe</newPassword> <newUser>Ajouter un utilisateur</newUser> <none>Aucun</none> - <nofilefound1>Désolé, le fichier à télécharger n'a pas été trouvé. Envoyez nous </nofilefound1> - <nofilefound2>un message</nofilefound2> - <nofilefound3> ou un email ($ADMIN_MAIL) avec l'identifiant suivant : </nofilefound3> <noHelp>Désolé, pas d'aide disponible</noHelp> <noInfo>Désolé, pas d'information disponible</noInfo> <noLogin>Vous n'étes pas connecté.</noLogin> @@ -313,7 +308,7 @@ <p>Tout droit réservé.<br/> </p> </copyright2> - <moreinfo>Pour plus d'information, contacter : <a href="mailto:$ADMIN_MAIL">$ADMIN_MAIL</a>, ou envoyer nous <a href="/$SERVLET/srv/fr/feedback"> vos commentaires </a></moreinfo> + <moreinfo>Pour plus d'information, contacter : </moreinfo> <message>Le nom ou mot de passe est incorrect.<br/>Appuyer sur le bouton 'retour'.</message> <protocolChoice value="WWW:LINK-1.0-http--link">Adresse Internet (URL)</protocolChoice> <protocolChoice value="WWW:DOWNLOAD-1.0-http--download">Fichier à télécharger</protocolChoice> Modified: trunk/web/xsl/file-download.xsl =================================================================== --- trunk/web/xsl/file-download.xsl 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/xsl/file-download.xsl 2007-03-13 17:36:10 UTC (rev 257) @@ -13,6 +13,7 @@ <h2><xsl:value-of select="/root/gui/strings/messageDownload"/></h2> <p/> <xsl:copy-of select="/root/gui/strings/moreinfo"/> + <a href="mailto:{/root/gui/env/feedback/email}"><xsl:value-of select="/root/gui/env/feedback/email"/></a> </xsl:with-param> <xsl:with-param name="buttons"> <button class="content" onclick="load('{/root/gui/locService}/metadata.show?id={/root/request/id}')"><xsl:value-of select="/root/gui/strings/back"/></button> Modified: trunk/web/xsl/main-page.xsl =================================================================== --- trunk/web/xsl/main-page.xsl 2007-03-13 16:58:52 UTC (rev 256) +++ trunk/web/xsl/main-page.xsl 2007-03-13 17:36:10 UTC (rev 257) @@ -163,6 +163,7 @@ <td valign="top"> <xsl:copy-of select="/root/gui/strings/mainpage1"/> <xsl:copy-of select="/root/gui/strings/mainpage2"/> + <a href="mailto:{/root/gui/env/feedback/email}"><xsl:value-of select="/root/gui/env/feedback/email"/></a> </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-13 18:00:59
|
Revision: 260 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=260&view=rev Author: acarboni Date: 2007-03-13 11:01:00 -0700 (Tue, 13 Mar 2007) Log Message: ----------- Fixed a small bug Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java trunk/web/loc/en/xml/harvesting.xml Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-03-13 18:00:19 UTC (rev 259) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-03-13 18:01:00 UTC (rev 260) @@ -107,7 +107,7 @@ protected void doDestroy(Dbms dbms) throws SQLException { - String query = "DELETE FROM Metadata WHERE siteId = ?"; + String query = "DELETE FROM Metadata WHERE source = ?"; for (Search s : params.getSearches()) dbms.execute(query, s.siteId); Modified: trunk/web/loc/en/xml/harvesting.xml =================================================================== --- trunk/web/loc/en/xml/harvesting.xml 2007-03-13 18:00:19 UTC (rev 259) +++ trunk/web/loc/en/xml/harvesting.xml 2007-03-13 18:01:00 UTC (rev 260) @@ -112,7 +112,7 @@ <cannotStart>Cannot start the selected entry/ies</cannotStart> <cannotStop>Cannot stop the selected entry/ies</cannotStop> <cannotRun>Cannot run the selected entry/ies</cannotRun> - <confirmRemove>Remove the selected entries ? The node and all harvested metadata will be removed.</confirmRemove> + <confirmRemove>Remove the selected entries ? The nodes and all harvested metadata will be removed.</confirmRemove> <everyZero>The harvesting period cannot be 0:0:0</everyZero> <pleaseRetrieve>Please retrieve some sites first</pleaseRetrieve> <cannotRetrieve>Unable to retrieve information</cannotRetrieve> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tic...@us...> - 2007-03-16 15:23:04
|
Revision: 283 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=283&view=rev Author: ticheler Date: 2007-03-16 08:23:03 -0700 (Fri, 16 Mar 2007) Log Message: ----------- Installation improvements Modified Paths: -------------- trunk/docs/post-install.txt trunk/docs/readme.html trunk/installer/windows-shortcuts.xml Modified: trunk/docs/post-install.txt =================================================================== --- trunk/docs/post-install.txt 2007-03-16 14:46:57 UTC (rev 282) +++ trunk/docs/post-install.txt 2007-03-16 15:23:03 UTC (rev 283) @@ -17,6 +17,19 @@ - start-geonetwork.sh - stop-geonetwork.sh + +--------------------------------------------------------------------------- +--- First time use +--------------------------------------------------------------------------- + +After installation make sure you start the web server to start the +Geonetwork opensource application. You can than open the GeoNetwork +application in your browser after that. +By default this should be at http://localhost:8080/geonetwork + +IMPORTANT!! After opening the GeoNetwork homepage, log on as Administrator. +You should use the username "admin" and password "admin". +In the Administration section you can now modify your password. --------------------------------------------------------------------------- --- Running GeoNetwork opensource on Tomcat Modified: trunk/docs/readme.html =================================================================== --- trunk/docs/readme.html 2007-03-16 14:46:57 UTC (rev 282) +++ trunk/docs/readme.html 2007-03-16 15:23:03 UTC (rev 283) @@ -11,6 +11,19 @@ <body> <div align="right"><span class="style1">GeoNetwork opensource V2.1.0 beta 1 Date: 15-02-2007</span></div> <h1>GeoNetwork release notes</h1> + + <h2>First time use</h2> + <p> + After installation make sure you start the web server to start the Geonetwork opensource application. You can than open the GeoNetwork application in your browser after that. + </p> + <p> + By default this should be at <a href="http://localhost:8080/geonetwork">http://localhost:8080/geonetwork</a> + </p> + <p> + <stong>IMPORTANT!!</stong> After opening the GeoNetwork homepage, log on as Administrator. + You should use the username <code>admin</code> and password <code>admin</code>. + In the Administration section you can now modify your password. + </p> <h2>Requirements</h2> Modified: trunk/installer/windows-shortcuts.xml =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-16 18:01:27
|
Revision: 297 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=297&view=rev Author: acarboni Date: 2007-03-16 11:01:26 -0700 (Fri, 16 Mar 2007) Log Message: ----------- Updated Modified Paths: -------------- trunk/docs/changes.txt trunk/docs/developers/known issues.txt Property Changed: ---------------- trunk/web/xml/ Modified: trunk/docs/changes.txt =================================================================== --- trunk/docs/changes.txt 2007-03-16 17:44:27 UTC (rev 296) +++ trunk/docs/changes.txt 2007-03-16 18:01:26 UTC (rev 297) @@ -42,6 +42,11 @@ - Fixed bug with templates that were not shown +- Fixed bug when changing the user's password. It seems that the 'update()' function + has a different sematic if called inside the 'onClick' attribute + +- Fixed wrong behaviour of 'back' button in categories/groups/users + ================================================================================ === === GeoNetwork 2.1.0 alpha2 : List of changes Modified: trunk/docs/developers/known issues.txt =================================================================== --- trunk/docs/developers/known issues.txt 2007-03-16 17:44:27 UTC (rev 296) +++ trunk/docs/developers/known issues.txt 2007-03-16 18:01:26 UTC (rev 297) @@ -9,7 +9,8 @@ Proposed resolution: title field is not displayed when Metadata is selected in the drop down. In Insert.java the title parameter will be validated depending on the isTemplate parameter. -- XML Metadata insert using ISO19139 only works when the gmd: prefix is used for + +- XML Metadata insert using ISO19139 only works when the gmd: prefix is used for ISO19115 elements. The current import conversion from 19115 to 19139 does not create output that includes these prefixes. The related XSLTs need updating. @@ -30,11 +31,6 @@ - online resources (requires InterMap integration too) - code list issues with ISO19139 metadata -- The Back button's behavior in the administration services should be verified as at - least a number of them should bring the user back to the administration page and - not back into the editing forms for instance. User and Group management are among - these. - - The Check for ISO19139 fails. ================================================================== @@ -69,3 +65,8 @@ - General error handling seems to be missing. Raw Java errors are displayed in case of a session time out for instance +- The Back button's behavior in the administration services should be verified as at + least a number of them should bring the user back to the administration page and + not back into the editing forms for instance. User and Group management are among + these. + Property changes on: trunk/web/xml ___________________________________________________________________ Name: svn:ignore + schema-mappings.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-19 15:41:07
|
Revision: 304 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=304&view=rev Author: acarboni Date: 2007-03-19 06:30:52 -0700 (Mon, 19 Mar 2007) Log Message: ----------- Latest fixes before beta1 Modified Paths: -------------- trunk/docs/changes.txt trunk/docs/developers/known issues.txt trunk/docs/readme.html trunk/installer/build.xml trunk/installer/installer-config.xml trunk/installer/unix-shortcuts.xml trunk/web/WEB-INF/server.prop Modified: trunk/docs/changes.txt =================================================================== --- trunk/docs/changes.txt 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/docs/changes.txt 2007-03-19 13:30:52 UTC (rev 304) @@ -42,11 +42,13 @@ - Fixed bug with templates that were not shown -- Fixed bug when changing the user's password. It seems that the 'update()' function - has a different sematic if called inside the 'onClick' attribute +- Fixed bug when changing the user's password. It seems that the 'update()' + function has a different sematic if called inside the 'onClick' attribute - Fixed wrong behaviour of 'back' button in categories/groups/users +- Fixed some bugs with Z39.50. Now, it should work. + ================================================================================ === === GeoNetwork 2.1.0 alpha2 : List of changes Modified: trunk/docs/developers/known issues.txt =================================================================== --- trunk/docs/developers/known issues.txt 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/docs/developers/known issues.txt 2007-03-19 13:30:52 UTC (rev 304) @@ -16,9 +16,6 @@ - Some metadata element strings are not found in the editor -- Bug with Z39.50: when clicking a metadata on the search results page, - the link is wrong because it points always to the last metadata in results. - ================================================================== Issues: ================================================================== @@ -47,26 +44,4 @@ - Integrated version with InterMap opensource -- Set logging options to OFF before creating final release - ================================================================== -DONE -================================================================== - -- Remove debug printing in the editor - -- The process of creating a database should: - - provide the default option to add metadata templates to the database so people can get started. - - provide the option to add sample data - -- Sample metadata does not have: - - thumbnails - -- General error handling seems to be missing. Raw Java errors are displayed in case - of a session time out for instance - -- The Back button's behavior in the administration services should be verified as at - least a number of them should bring the user back to the administration page and - not back into the editing forms for instance. User and Group management are among - these. - Modified: trunk/docs/readme.html =================================================================== --- trunk/docs/readme.html 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/docs/readme.html 2007-03-19 13:30:52 UTC (rev 304) @@ -9,7 +9,7 @@ </style></head> <body> - <div align="right"><span class="style1">GeoNetwork opensource V2.1.0 beta 1 Date: 15-02-2007</span></div> + <div align="right"><span class="style1">GeoNetwork opensource V2.1.0 beta1 Date: 16-03-2007</span></div> <h1>GeoNetwork release notes</h1> <h2>First time use</h2> @@ -21,8 +21,8 @@ </p> <p> <strong>IMPORTANT!!</strong> After opening the GeoNetwork homepage, log on as Administrator. - You should use the username <code>admin</code> and password <code>admin</code>. - In the Administration section you can now modify your password. + You should use the username <code><b>admin</b></code> and password <code><b>admin</b></code>. + In the Administration section you can then modify your account. </p> <h2>Loading sample data</h2> Modified: trunk/installer/build.xml =================================================================== --- trunk/installer/build.xml 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/installer/build.xml 2007-03-19 13:30:52 UTC (rev 304) @@ -18,17 +18,14 @@ <ant dir=".." target="all" /> <delete file="../geonetwork-${release}-install.jar" /> + <delete dir =".build" /> <mkdir dir =".build" /> <!-- file copying --> <copy todir=".build"> - <fileset dir=".."> - <exclude name="**/WEB-INF/lucene/*"/> - <exclude name="**/db/data/*"/> - <exclude name="**/log/*"/> - </fileset> + <fileset dir=".."/> </copy> <izpack input="${basedir}/installer-config.xml" Modified: trunk/installer/installer-config.xml =================================================================== --- trunk/installer/installer-config.xml 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/installer/installer-config.xml 2007-03-19 13:30:52 UTC (rev 304) @@ -6,7 +6,7 @@ <info> <appname>geonetwork</appname> - <appversion>2.1.0 beta-1</appversion> + <appversion>2.1.0 beta1</appversion> <authors> <author name="FAO GeoNetwork Team" email="Geo...@fa..."/> <author name="VAM WFP" email="va...@wf..."/> @@ -76,18 +76,26 @@ <fileset dir=".build/bin" targetdir="$INSTALL_PATH/bin"/> <fileset dir=".build/gast" targetdir="$INSTALL_PATH/gast"/> - <fileset dir=".build/jetty" targetdir="$INSTALL_PATH/jetty"/> + + <fileset dir=".build/jetty" targetdir="$INSTALL_PATH/jetty"> + <exclude name="log/*"/> + <exclude name="log/archive/*"/> + </fileset> + <fileset dir=".build/web" targetdir="$INSTALL_PATH/web"> - <exclude name="**/WEB-INF/db/account.prop"/> + <exclude name="WEB-INF/db/account.prop"/> + <exclude name="WEB-INF/db/data/*"/> + <exclude name="WEB-INF/db/log/*"/> + <exclude name="WEB-INF/data/0*"/> + <exclude name="WEB-INF/lucene/*"/> </fileset> <executable targetfile="$INSTALL_PATH/bin/start-geonetwork.sh" /> <executable targetfile="$INSTALL_PATH/bin/stop-geonetwork.sh" /> <executable targetfile="$INSTALL_PATH/bin/start-gast.sh" /> - <parsable targetfile="$INSTALL_PATH/docs/post-install.txt" type="plain"/> - <parsable targetfile="$INSTALL_PATH/web/xml/repositories.xml" type="xml"/> - <parsable targetfile="$INSTALL_PATH/web/xml/schema-mappings.xml" type="xml"/> + <parsable targetfile="$INSTALL_PATH/docs/post-install.txt" type="plain"/> + <parsable targetfile="$INSTALL_PATH/web/xml/repositories.xml" type="xml"/> <executable targetfile="$INSTALL_PATH/gast/gast.jar" type ="jar" @@ -124,7 +132,9 @@ <description>The installer data files. Installing this package you will be able to create the installer.</description> - <fileset dir=".build/installer" targetdir="$INSTALL_PATH/installer"/> + <fileset dir=".build/installer" targetdir="$INSTALL_PATH/installer"> + <exclude name="**/.build"/> + </fileset> </pack> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> Modified: trunk/installer/unix-shortcuts.xml =================================================================== --- trunk/installer/unix-shortcuts.xml 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/installer/unix-shortcuts.xml 2007-03-19 13:30:52 UTC (rev 304) @@ -4,60 +4,133 @@ <!-- =================================================================================== --> - <skipIfNotSupported/> - <programGroup defaultName="GeoNetwork" location="applications"/> + <skipIfNotSupported/> + <programGroup defaultName="GeoNetwork opensource" location="applications"/> <!-- =================================================================================== --> + <!-- GN open homepage --> + + <shortcut + name="Open GeoNetwork opensource" + description="This opens the GeoNetwork homepage in a web browser" + target="$INSTALL_PATH/bin/win/start-stdln.html" + commandLine="" + workingDirectory="$INSTALL_PATH" + iconFile="$INSTALL_PATH/bin/ico/gn.ico" + iconIndex="0" + initialState="normal" + programGroup="yes" + startup="no"> + <createForPack name="Core"/> + </shortcut> + + <!-- =================================================================================== --> + <!-- GN start --> <shortcut - name="Start GeoNetwork" - programGroup="yes" - desktop="yes" - target=""$INSTALL_PATH/bin/start-geonetwork.sh"" - workingDirectory=""$INSTALL_PATH/bin"" - type="Application" - encoding="UTF-8"> - - <createForPack name="Integrated Jetty server"/> + name="Start server" + description="This starts the GeoNetwork server" + programGroup="yes" + desktop="no" + startup="no" + target="$INSTALL_PATH/bin/start-geonetwork.sh" + initialState="noShow" + workingDirectory="$INSTALL_PATH/bin" + type="Application" + iconFile="$INSTALL_PATH/bin/ico/gnstart.ico" + iconIndex="0" + encoding="UTF-8"> + <createForPack name="Core"/> </shortcut> <!-- =================================================================================== --> + <!-- GN stop --> <shortcut - name="Stop GeoNetwork" - programGroup="yes" - desktop="yes" - target=""$INSTALL_PATH/bin/stop-geonetwork.sh"" - workingDirectory=""$INSTALL_PATH/bin"" - type="Application" - encoding="UTF-8"> - - <createForPack name="Integrated Jetty server"/> + name="Stop server" + description="This stops the GeoNetwork server" + programGroup="yes" + desktop="no" + target="$INSTALL_PATH/bin/stop-geonetwork.sh" + initialState="noShow" + workingDirectory="$INSTALL_PATH/bin" + type="Application" + iconFile="$INSTALL_PATH/bin/ico/gnstop.ico" + iconIndex="0" + encoding="UTF-8"> + <createForPack name="Core"/> </shortcut> <!-- =================================================================================== --> + <!-- GAST --> + + <shortcut + name="Start GAST" + description="This starts GeoNetwork's Administrator Survival Tool" + programGroup="yes" + desktop="no" + commandLine="-jar "$INSTALL_PATH/gast/gast.jar"" + initialState="noShow" + workingDirectory="$INSTALL_PATH/bin" + type="Application" + iconFile="$INSTALL_PATH/bin/ico/gast.ico" + iconIndex="0" + encoding="UTF-8"> + <createForPack name="Core"/> + </shortcut> + <!-- =================================================================================== --> + <!-- Documentation --> + <shortcut - name="List of Changes" - programGroup="yes" - target="konqueror" - initialState="noShow" - iconFile="help" - iconIndex="0" - commandLine=""$INSTALL_PATH/docs/changes.txt"" - type="Application" - encoding="UTF-8"> + name="Documentation" + description="GeoNetwork opensource documentation" + target="$INSTALL_PATH/docs/manuals/" + commandLine="" + workingDirectory="$INSTALL_PATH" + iconFile="$INSTALL_PATH/bin/ico/docs.ico" + iconIndex="0" + initialState="normal" + programGroup="yes" + startup="no"> </shortcut> - <!-- =================================================================================== --> -<!-- - <shortcut - name="Documentation" - iconFile="acroread" - </shortcut> ---> - <!-- =================================================================================== --> - + <!-- =================================================================================== --> + <!-- GN readme --> + + <shortcut + name="Release notes " + description="GeoNetwork desktop release notes " + target="$INSTALL_PATH\docs\readme.html" + commandLine="" + workingDirectory="$INSTALL_PATH" + iconFile="$INSTALL_PATH/bin/ico/text.ico" + iconIndex="0" + initialState="normal" + programGroup="yes" + startup="no"> + <createForPack name="Core"/> + </shortcut> + + <!-- =================================================================================== --> + <!-- License --> + + <shortcut + name="GPL License" + description="GeoNetwork opensource GNU-GPL license " + target="$INSTALL_PATH\docs\license.html" + commandLine="" + workingDirectory="$INSTALL_PATH" + iconFile="$INSTALL_PATH/bin/ico/text.ico" + iconIndex="0" + initialState="normal" + programGroup="yes" + startup="no"> + </shortcut> + + <!-- =================================================================================== --> + <!-- Uninstall --> + <shortcut name="Uninstaller" programGroup="yes" Modified: trunk/web/WEB-INF/server.prop =================================================================== --- trunk/web/WEB-INF/server.prop 2007-03-19 13:30:36 UTC (rev 303) +++ trunk/web/WEB-INF/server.prop 2007-03-19 13:30:52 UTC (rev 304) @@ -1,8 +1,8 @@ # geonetwork version ### this is used to build the jar filename -release = 2.1.0-beta-1 +release = 2.1.0-beta1 ### these are used by both gast and geonetwork at runtime version = 2.1.0 -subVersion = beta-1 +subVersion = beta1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-20 13:35:42
|
Revision: 327 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=327&view=rev Author: acarboni Date: 2007-03-20 06:27:02 -0700 (Tue, 20 Mar 2007) Log Message: ----------- Fixed NullPointerException with Tomcat Modified Paths: -------------- trunk/bin/jetty.xml trunk/docs/changes.txt trunk/src/org/fao/gast/lib/EmbeddedSCLib.java trunk/web/WEB-INF/web.xml trunk/web/index.html Modified: trunk/bin/jetty.xml =================================================================== --- trunk/bin/jetty.xml 2007-03-19 15:24:39 UTC (rev 326) +++ trunk/bin/jetty.xml 2007-03-20 13:27:02 UTC (rev 327) @@ -1,48 +1,46 @@ -<?xml version="1.0"?> - -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "jetty-configure_1_3.dtd"> - -<Configure class="org.mortbay.jetty.Server"> - - <Call name="addListener"> - <Arg> - <New class="org.mortbay.http.SocketListener"> - <Set name="port">8080</Set> - <Set name="MinThreads">10</Set> - <Set name="MaxThreads">200</Set> - <Set name="MaxIdleTimeMs">30000</Set> - <Set name="lowResources">50</Set> - <Set name="LowResourcePersistTimeMs">2000</Set> - </New> - </Arg> - </Call> - - <!-- ============================================================ --> - - <Set name="WebApplicationConfigurationClassNames"> - <Array type="java.lang.String"> - <Item>org.mortbay.jetty.servlet.XMLConfiguration</Item> - <Item>org.mortbay.jetty.servlet.JettyWebConfiguration</Item> - </Array> - </Set> - - <!-- ============================================================ --> - - <Call name="addWebApplication"> - <Arg>/geonetwork</Arg> - <Arg>../web</Arg> - </Call> - - <!-- =============================================================== --> - - <Set name="RequestLog"> - <New class="org.mortbay.http.NCSARequestLog"> - <Arg>../jetty/log/yyyy_mm_dd.request.log</Arg> - <Set name="retainDays">90</Set> - <Set name="append">false</Set> - <Set name="extended">false</Set> - <Set name="LogTimeZone">GMT</Set> - </New> - </Set> - -</Configure> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "jetty-configure_1_3.dtd"> +<Configure class="org.mortbay.jetty.Server"> + + <Call name="addListener"> + <Arg> + <New class="org.mortbay.http.SocketListener"> + <Set name="port">8080</Set> + <Set name="MinThreads">10</Set> + <Set name="MaxThreads">200</Set> + <Set name="MaxIdleTimeMs">30000</Set> + <Set name="lowResources">50</Set> + <Set name="LowResourcePersistTimeMs">2000</Set> + </New> + </Arg> + </Call> + + <!-- ============================================================ --> + + <Set name="WebApplicationConfigurationClassNames"> + <Array type="java.lang.String"> + <Item>org.mortbay.jetty.servlet.XMLConfiguration</Item> + <Item>org.mortbay.jetty.servlet.JettyWebConfiguration</Item> + </Array> + </Set> + + <!-- ============================================================ --> + + <Call name="addWebApplication"> + <Arg>/geonetwork</Arg> + <Arg>../web</Arg> + </Call> + + <!-- =============================================================== --> + + <Set name="RequestLog"> + <New class="org.mortbay.http.NCSARequestLog"> + <Arg>../jetty/log/yyyy_mm_dd.request.log</Arg> + <Set name="retainDays">90</Set> + <Set name="append">false</Set> + <Set name="extended">false</Set> + <Set name="LogTimeZone">GMT</Set> + </New> + </Set> + +</Configure> Modified: trunk/docs/changes.txt =================================================================== --- trunk/docs/changes.txt 2007-03-19 15:24:39 UTC (rev 326) +++ trunk/docs/changes.txt 2007-03-20 13:27:02 UTC (rev 327) @@ -1,5 +1,21 @@ ================================================================================ === +=== GeoNetwork 2.1.0 beta2 : List of changes +=== +================================================================================ + +-------------------------------------------------------------------------------- +--- Changes +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +--- Bugs fixed +-------------------------------------------------------------------------------- + +- Fixed NullPointerException with Tomcat + +================================================================================ +=== === GeoNetwork 2.1.0 beta1 : List of changes === ================================================================================ Modified: trunk/src/org/fao/gast/lib/EmbeddedSCLib.java =================================================================== --- trunk/src/org/fao/gast/lib/EmbeddedSCLib.java 2007-03-19 15:24:39 UTC (rev 326) +++ trunk/src/org/fao/gast/lib/EmbeddedSCLib.java 2007-03-20 13:27:02 UTC (rev 327) @@ -47,7 +47,8 @@ { this.appPath = appPath; - jetty = Lib.xml.load(appPath +"/bin/jetty.xml"); + jetty = Lib.xml.load(appPath + JETTY_FILE); + webXml = Lib.xml.load(appPath + WEBXML_FILE); //--- retrieve 'host', 'port' and 'servlet' parameters from jetty @@ -122,14 +123,28 @@ { if (servletElem != null) servletElem.setText("/"+name); + + for (Object e : webXml.getRootElement().getChildren()) + { + Element elem = (Element) e; + + if (elem.getName().equals("display-name")) + { + elem.setText(name); + return; + } + } } //--------------------------------------------------------------------------- public void save() throws FileNotFoundException, IOException { - Lib.xml.save(appPath +"/bin/jetty.xml", jetty); + Lib.xml.save(appPath + JETTY_FILE, jetty); + Lib.xml.save(appPath + WEBXML_FILE, webXml); + //--- create proper index.html file to point to correct servlet + Map<String, String> vars = new HashMap<String, String>(); vars.put("$SERVLET", getServlet()); @@ -149,7 +164,11 @@ private Element hostElem; private Element portElem; private Element servletElem; + private Document webXml; + private static final String JETTY_FILE = "/bin/jetty.xml"; + private static final String WEBXML_FILE = "/web/WEB-INF/web.xml"; + private static final String INDEX_SRC_FILE = "/gast/data/index.html"; private static final String INDEX_DES_FILE = "/web/index.html"; } Modified: trunk/web/WEB-INF/web.xml =================================================================== --- trunk/web/WEB-INF/web.xml 2007-03-19 15:24:39 UTC (rev 326) +++ trunk/web/WEB-INF/web.xml 2007-03-20 13:27:02 UTC (rev 327) @@ -1,28 +1,30 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> - -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" - version="2.4"> - - <servlet> - <servlet-name>gn-servlet</servlet-name> - <servlet-class>jeeves.server.sources.http.JeevesServlet</servlet-class> - - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>gn-servlet</servlet-name> - <url-pattern>/srv/*</url-pattern> - </servlet-mapping> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - - <session-config> - <!-- 3 hours --> - <session-timeout>180</session-timeout> - </session-config> -</web-app> +<?xml version="1.0" encoding="UTF-8"?> + +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <display-name>geonetwork</display-name> + + <servlet> + <servlet-name>gn-servlet</servlet-name> + <servlet-class>jeeves.server.sources.http.JeevesServlet</servlet-class> + + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>gn-servlet</servlet-name> + <url-pattern>/srv/*</url-pattern> + </servlet-mapping> + + <welcome-file-list> + <welcome-file>index.html</welcome-file> + </welcome-file-list> + + <session-config> + <!-- 3 hours --> + <session-timeout>180</session-timeout> + </session-config> +</web-app> Modified: trunk/web/index.html =================================================================== --- trunk/web/index.html 2007-03-19 15:24:39 UTC (rev 326) +++ trunk/web/index.html 2007-03-20 13:27:02 UTC (rev 327) @@ -1,7 +1,7 @@ <HTML> <HEAD> - <META http-equiv="refresh" content="0; URL=/geonetwork/srv/en/main.home"> - <META http-equiv="Pragma" content="no-cache"> + <META http-equiv="refresh" content="0; URL=/geonetwork/srv/en/main.home"> + <META http-equiv="Pragma" content="no-cache"> <META http-equiv="Cache-Control" content="no-cache,no-store"> <script language="Javascript1.5" type="text/javascript"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-21 15:55:24
|
Revision: 329 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=329&view=rev Author: acarboni Date: 2007-03-21 08:55:24 -0700 (Wed, 21 Mar 2007) Log Message: ----------- Fixed generation of links. Harvested metadata cannot be edited Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/DataManager.java trunk/web/xml/schemas/iso19115/update-fixed-info.xsl trunk/web/xml/schemas/iso19139/update-fixed-info.xsl Modified: trunk/src/org/fao/geonet/kernel/DataManager.java =================================================================== --- trunk/src/org/fao/geonet/kernel/DataManager.java 2007-03-21 15:51:41 UTC (rev 328) +++ trunk/src/org/fao/geonet/kernel/DataManager.java 2007-03-21 15:55:24 UTC (rev 329) @@ -259,7 +259,7 @@ public void validate(String schema, Element md) throws Exception { - Xml.validate(md, null, editLib.getSchemaDir(schema) + Geonet.File.SCHEMA); + Xml.validate(editLib.getSchemaDir(schema) + Geonet.File.SCHEMA, md); } //-------------------------------------------------------------------------- @@ -369,7 +369,7 @@ //--- generate a new metadata id int serial = sf.getSerial(dbms, "Metadata"); - Element xml = updateFixedInfo(schema, Integer.toString(serial), Xml.loadString(data, false), uuid, source); + Element xml = updateFixedInfo(schema, Integer.toString(serial), Xml.loadString(data, false), uuid); //--- store metadata @@ -452,8 +452,7 @@ int serial = sf.getSerial(dbms, "Metadata"); if (isTemplate.equals("n")) - xml = updateFixedInfo(schema, Integer.toString(serial), xml, uuid, source); - //System.out.println("AFTER:\n"+Xml.getString(xml)); + xml = updateFixedInfo(schema, Integer.toString(serial), xml, uuid); //--- store metadata @@ -859,7 +858,7 @@ md = updateFixedInfo(schema, id, md, dbms); if (validate) - Xml.validate(md, null, editLib.getSchemaDir(schema) + Geonet.File.SCHEMA); + validate(schema, md); XmlSerializer.update(dbms, id, md); @@ -1166,37 +1165,33 @@ private Element updateFixedInfo(String schema, String id, Element md, Dbms dbms) throws Exception { -// System.out.println("#### id = " + id); // DEBUG + String query = "SELECT uuid, source, isTemplate FROM Metadata WHERE id = " + id; - Element rec = dbms.select("SELECT uuid, source, isTemplate FROM Metadata WHERE id = " + id).getChild("record"); + Element rec = dbms.select(query).getChild("record"); String isTemplate = rec.getChildText("istemplate"); -// System.out.println("#### - isTemplate = " + isTemplate); // DEBUG - // don't process templates if (isTemplate.equals("n")) { - String uuid = rec.getChildText("uuid"); - String source = rec.getChildText("source"); - return updateFixedInfo(schema, id, md,uuid, source); + String uuid = rec.getChildText("uuid"); + + return updateFixedInfo(schema, id, md, uuid); } else return md; } //-------------------------------------------------------------------------- - public Element updateFixedInfo(String schema, String id, Element md, String uuid, String source) throws Exception + public Element updateFixedInfo(String schema, String id, Element md, String uuid) throws Exception { //--- setup environment Element env = new Element("env"); - env.addContent(new Element("id") .setText(id)); - env.addContent(new Element("uuid") .setText(uuid)); - env.addContent(new Element("currDate").setText(new ISODate().toString())); - env.addContent(new Element("siteURL") .setText(getSiteURL())); - env.addContent(new Element("siteID") .setText(getSiteID())); - env.addContent(new Element("source") .setText(source)); + env.addContent(new Element("id") .setText(id)); + env.addContent(new Element("uuid") .setText(uuid)); + env.addContent(new Element("changeDate").setText(new ISODate().toString())); + env.addContent(new Element("siteURL") .setText(getSiteURL())); //--- setup root element @@ -1206,8 +1201,8 @@ //--- do an XSL transformation -//System.out.println("BEFORE:\n"+Xml.getString(root)); String styleSheet = editLib.getSchemaDir(schema) + Geonet.File.UPDATE_FIXED_INFO; + return Xml.transform(root, styleSheet); } @@ -1215,7 +1210,7 @@ private Element buildInfoElem(ServiceContext srvContext, String id, String version) throws Exception { - Dbms dbms = (Dbms) srvContext.getResourceManager().open(Geonet.Res.MAIN_DB); + Dbms dbms = (Dbms) srvContext.getResourceManager().open(Geonet.Res.MAIN_DB); String query ="SELECT schemaId, createDate, changeDate, source, isTemplate, title, "+ "uuid, isHarvested FROM Metadata WHERE id = " + id; Modified: trunk/web/xml/schemas/iso19115/update-fixed-info.xsl =================================================================== --- trunk/web/xml/schemas/iso19115/update-fixed-info.xsl 2007-03-21 15:51:41 UTC (rev 328) +++ trunk/web/xml/schemas/iso19115/update-fixed-info.xsl 2007-03-21 15:55:24 UTC (rev 329) @@ -36,7 +36,7 @@ <!-- ================================================================= --> <xsl:template match="mdDateSt"> - <xsl:copy><xsl:value-of select="/root/env/currDate"/></xsl:copy> + <xsl:copy><xsl:value-of select="/root/env/changeDate"/></xsl:copy> </xsl:template> <!-- ================================================================= --> @@ -63,15 +63,9 @@ online resources: download --> <xsl:template match="linkage[parent::onLineSrc and starts-with(following-sibling::protocol,'WWW:DOWNLOAD-') and contains(following-sibling::protocol,'http--download') and following-sibling::orName]"> - <xsl:choose> - <xsl:when test="string(/root/env/siteID)=string(/root/env/source)"> - <linkage><xsl:value-of select="concat(/root/env/siteURL,'/resources.get?id=',/root/env/id,'&fname=',following-sibling::orName,'&access=private')"/></linkage> - </xsl:when> - <xsl:otherwise> - <xsl:copy-of select="."/> - </xsl:otherwise> - </xsl:choose> - + <linkage> + <xsl:value-of select="concat(/root/env/siteURL,'/resources.get?id=',/root/env/id,'&fname=',following-sibling::orName,'&access=private')"/> + </linkage> </xsl:template> </xsl:stylesheet> Modified: trunk/web/xml/schemas/iso19139/update-fixed-info.xsl =================================================================== --- trunk/web/xml/schemas/iso19139/update-fixed-info.xsl 2007-03-21 15:51:41 UTC (rev 328) +++ trunk/web/xml/schemas/iso19139/update-fixed-info.xsl 2007-03-21 15:55:24 UTC (rev 329) @@ -35,7 +35,7 @@ <xsl:template match="gmd:dateStamp"> <xsl:copy> - <gco:DateTime><xsl:value-of select="/root/env/currDate"/></gco:DateTime> + <gco:DateTime><xsl:value-of select="/root/env/changeDate"/></gco:DateTime> </xsl:copy> </xsl:template> @@ -81,21 +81,11 @@ <!-- ================================================================= --> <xsl:template match="gmd:linkage[starts-with(following-sibling::gmd:protocol/gco:CharacterString,'WWW:DOWNLOAD-') and contains(following-sibling::gmd:protocol/gco:CharacterString,'http--download') and following-sibling::gmd:name]"> - - <xsl:choose> - <xsl:when test="string(/root/env/siteID)=string(/root/env/source)"> - <gmd:linkage> - <gmd:URL> - <xsl:value-of select="concat(/root/env/siteURL,'/resources.get?id=',/root/env/id,'&fname=',following-sibling::gmd:name/gco:CharacterString,'&access=private')"/> - </gmd:URL> - </gmd:linkage> - </xsl:when> - - <xsl:otherwise> - <xsl:copy-of select="."/> - </xsl:otherwise> - </xsl:choose> - + <gmd:linkage> + <gmd:URL> + <xsl:value-of select="concat(/root/env/siteURL,'/resources.get?id=',/root/env/id,'&fname=',following-sibling::gmd:name/gco:CharacterString,'&access=private')"/> + </gmd:URL> + </gmd:linkage> </xsl:template> <!-- ================================================================= --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-03-27 20:12:45
|
Revision: 347 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=347&view=rev Author: acarboni Date: 2007-03-27 13:12:45 -0700 (Tue, 27 Mar 2007) Log Message: ----------- Added iso19115 to iso19139 conversion Modified Paths: -------------- trunk/gast/data/gui.xml trunk/src/org/fao/gast/gui/panels/database/setup/Worker.java trunk/src/org/fao/gast/gui/panels/manag/conversion/MainPanel.java trunk/src/org/fao/gast/gui/panels/manag/conversion/Worker.java trunk/src/org/fao/gast/lib/MetadataLib.java Added Paths: ----------- trunk/web/conversion/ trunk/web/conversion/iso19115-to-iso19139/ trunk/web/conversion/iso19115-to-iso19139/app-schema.xsl trunk/web/conversion/iso19115-to-iso19139/citation.xsl trunk/web/conversion/iso19115-to-iso19139/content.xsl trunk/web/conversion/iso19115-to-iso19139/data-quality.xsl trunk/web/conversion/iso19115-to-iso19139/distribution.xsl trunk/web/conversion/iso19115-to-iso19139/extension.xsl trunk/web/conversion/iso19115-to-iso19139/extent.xsl trunk/web/conversion/iso19115-to-iso19139/identification.xsl trunk/web/conversion/iso19115-to-iso19139/main.xsl trunk/web/conversion/iso19115-to-iso19139/ref-system.xsl trunk/web/conversion/iso19115-to-iso19139/resp-party.xsl trunk/web/conversion/iso19115-to-iso19139/spat-rep-types.xsl trunk/web/conversion/iso19115-to-iso19139/unmapped.xsl Removed Paths: ------------- trunk/src/org/fao/gast/gui/panels/manag/conversion/GNSource.java Modified: trunk/gast/data/gui.xml =================================================================== --- trunk/gast/data/gui.xml 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/gast/data/gui.xml 2007-03-27 20:12:45 UTC (rev 347) @@ -116,33 +116,6 @@ <image>22x22/gear.png</image> <label>Management</label> - <!-- Metadata Sync - - - - - - - - - - - - - - - - - - - - - - --> - - <form> - <id>mdsync</id> - <image>16x16/run.png</image> - <label>Metadata Sync</label> - <title>Metadata synchronization</title> - <class>manag.mdsync.MainPanel</class> - <description> - Each metadata contains links to the GeoNetwork's server in - order to allow resource retrieval. If you change the server's - address and port from the web interface, these links will break. - This panel simply scans all metadata and fixes these links. - </description> - - <button> - <image>16x16/run.png</image> - <label>Synchronize</label> - <action>sync</action> - </button> - - <precon type="stopped"> - All local metadata must be scanned and changed so there must not - be records under editing. - </precon> - </form> - <!-- Import - - - - - - - - - - - - - - - - - - - - - - --> <form> @@ -194,6 +167,63 @@ Uses MEF facilities so GeoNetwork must be running. </precon> </form> + + <!-- Metadata Sync - - - - - - - - - - - - - - - - - - - - - - --> + + <form> + <id>mdsync</id> + <image>16x16/run.png</image> + <label>Metadata Sync</label> + <title>Metadata synchronization</title> + <class>manag.mdsync.MainPanel</class> + <description> + Each metadata contains links to the GeoNetwork's server in + order to allow resource retrieval. If you change the server's + address and port from the web interface, these links will break. + This panel simply scans all metadata and fixes these links. + </description> + + <button> + <image>16x16/run.png</image> + <label>Synchronize</label> + <action>sync</action> + </button> + + <precon type="stopped"> + All local metadata must be scanned and changed so there must not + be records under editing. + </precon> + </form> + + <!-- 115 to 139 - - - - - - - - - - - - - - - - - - - - - - --> + + <form> + <id>115to139</id> + <image>16x16/run.png</image> + <label>115 to 139</label> + <title>ISO 19115 to 19139 conversion</title> + <class>manag.conversion.MainPanel</class> + <description> + Prior to version 2.1, GeoNetwork managed only the old ISO 19115 + metadata format (the one with short names). Starting from + version 2.1 you can use the new ISO 19139 format, which is + the XML encoding of the ISO 19115:2003 spec. + This panel lets you convert your old metadata in ISO 19115 + format to the new one. + </description> + + <button> + <image>16x16/run.png</image> + <label>Convert</label> + <action>convert</action> + </button> + + <precon type="stopped"> + GeoNetwork could even be running but maybe it is better + if it is stopped. + </precon> + </form> + </container> <!-- ========================================================== --> @@ -275,8 +305,12 @@ <title>Migrate an old GeoNetwork</title> <class>migration.oldinst.MainPanel</class> <description> - This panel allows you to migrate data and metadata from - an old GeoNetwork installation. + This panel allows you to migrate metadata from an old GeoNetwork + installation. This procedure migrates the database content. After + this stage, you will probably need to setup some parameters into + the config.xml file (like dataDir). Other parameters (like proxy + settings) must be changed using the web interface. Harvested + metadata are not migrated. </description> <button> @@ -286,6 +320,7 @@ </button> <precon type="stopped"> + GeoNetwork must be stopped when the database is being migrated. </precon> </form> </container> Modified: trunk/src/org/fao/gast/gui/panels/database/setup/Worker.java =================================================================== --- trunk/src/org/fao/gast/gui/panels/database/setup/Worker.java 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/src/org/fao/gast/gui/panels/database/setup/Worker.java 2007-03-27 20:12:45 UTC (rev 347) @@ -54,8 +54,8 @@ { try { - Resource resource = Lib.config.createResource(); - Lib.database.setup(resource, callBack); + Resource res = Lib.config.createResource(); + Lib.database.setup(res, callBack); } catch(Exception e) { Deleted: trunk/src/org/fao/gast/gui/panels/manag/conversion/GNSource.java =================================================================== --- trunk/src/org/fao/gast/gui/panels/manag/conversion/GNSource.java 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/src/org/fao/gast/gui/panels/manag/conversion/GNSource.java 2007-03-27 20:12:45 UTC (rev 347) @@ -1,187 +0,0 @@ -//============================================================================== -//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the -//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) -//=== and United Nations Environment Programme (UNEP) -//=== -//=== This program is free software; you can redistribute it and/or modify -//=== it under the terms of the GNU General Public License as published by -//=== the Free Software Foundation; either version 2 of the License, or (at -//=== your option) any later version. -//=== -//=== This program is distributed in the hope that it will be useful, but -//=== WITHOUT ANY WARRANTY; without even the implied warranty of -//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -//=== General Public License for more details. -//=== -//=== You should have received a copy of the GNU General Public License -//=== along with this program; if not, write to the Free Software -//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -//=== -//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, -//=== Rome - Italy. email: geo...@os... -//============================================================================== - -package org.fao.gast.gui.panels.manag.conversion; - - -import java.io.IOException; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.UUID; -import jeeves.resources.dbms.Dbms; -import jeeves.utils.Xml; -import org.fao.gast.lib.ConfigLib; -import org.fao.gast.lib.ProfileLib; -import org.fao.geonet.kernel.XmlSerializer; -import org.jdom.Element; -import org.jdom.JDOMException; - -//============================================================================== - -public class GNSource -{ - //--------------------------------------------------------------------------- - //--- - //--- Constructor - //--- - //--------------------------------------------------------------------------- - - public GNSource(String oldAppPath) throws JDOMException, IOException - { - appPath = oldAppPath; - - config = new ConfigLib (oldAppPath); - profiles = new ProfileLib(oldAppPath); - } - - //--------------------------------------------------------------------------- - //--- - //--- API Methods - //--- - //--------------------------------------------------------------------------- - - public Set<String> getAllIsoMetadataId(Dbms dbms) throws Exception - { - String query = "SELECT id FROM Metadata WHERE schemaId='iso19115'"; - -// try -// { - List list = dbms.select(query).getChildren(); - - Set<String> ids = new HashSet<String>(); - - for(int i=0; i<list.size(); i++) - { - Element rec = (Element) list.get(i); - ids.add(rec.getChildText("id")); - } - - return ids; -// } -// catch (SQLException e) -// { -// throw geoNetExc(e, "Cannot select query : "+ query); -// } - } - - //--------------------------------------------------------------------------- - - public Element getMetadata(Dbms dbms, String id) throws Exception - { -// try -// { - return XmlSerializer.select(dbms, "Metadata", id); -// } -// catch (Exception e) -// { -// throw geoNetExc(e, "Cannot retrieve metadata with id : "+ id); -// } - } - - //--------------------------------------------------------------------------- - - public Element getUnmappedFields(Element md) throws Exception - { -// try -// { - return Xml.transform(md, appPath +"/gast/xsl/unmapped.xsl"); -// } -// catch (Exception e) -// { -// throw geoNetExc(e, "Cannot get unmapped fields"); -// } - } - - //--------------------------------------------------------------------------- - - public void upgradeMetadata(Dbms dbms, String id, Element md) throws Exception - { - //--- step 1 : convert metadata from ISO19115 to ISO19139 - - try - { - md = Xml.transform(md, appPath +"/gast/xsl/19115-to-19139.xsl"); - } - catch (Exception e) - { -// throw geoNetExc(e, "Cannot transform metadata to ISO19139"); - } - - //--- step 2 : save new metadata - - try - { - String query = "UPDATE Metadata SET schemaId='iso19139', data=? WHERE id=?"; - - dbms.execute(query, Xml.getString(md), new Integer(id)); - } - catch (Exception e) - { -// throw geoNetExc(e, "Cannot upgrade metadata with id : "+ id); - } - } - - //--------------------------------------------------------------------------- - - public void addMetadata(Dbms dbms, List list) throws Exception - { - String schema = "iso19115"; - String source = ""; //appHand.getValue("siteId"); - - for(int i=0; i<list.size(); i++) - { - Element rec = (Element) list.get(i); - - String id = rec.getChildText("id"); - String data = rec.getChildText("data"); - String date = rec.getChildText("lastchangedate"); - String uuid = UUID.randomUUID().toString(); - - try - { -// Element md = updateFixedInfo(schema, id, Xml.loadString(data, false), uuid, date); -// -// XmlSerializer.insert(dbms, schema, md, Integer.parseInt(id), source, uuid, date, date, null); - } - catch (Exception e) - { -// throw geoNetExc(e, "Cannot migrate metadata with id : "+ id); - } - } - } - - //-------------------------------------------------------------------------- - //--- - //--- Variables - //--- - //-------------------------------------------------------------------------- - - private String appPath; - public ConfigLib config; - public ProfileLib profiles; -} - -//============================================================================== - - Modified: trunk/src/org/fao/gast/gui/panels/manag/conversion/MainPanel.java =================================================================== --- trunk/src/org/fao/gast/gui/panels/manag/conversion/MainPanel.java 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/src/org/fao/gast/gui/panels/manag/conversion/MainPanel.java 2007-03-27 20:12:45 UTC (rev 347) @@ -23,17 +23,9 @@ package org.fao.gast.gui.panels.manag.conversion; - import java.awt.Frame; import java.awt.event.ActionEvent; -import java.io.File; -import javax.swing.JButton; import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; -import org.dlib.gui.FlexLayout; import org.dlib.gui.GuiUtil; import org.dlib.gui.ProgressDialog; import org.fao.gast.gui.panels.FormPanel; @@ -48,11 +40,7 @@ //--- //--------------------------------------------------------------------------- - public MainPanel() - { - jfcBrowser.setDialogTitle("Choose input folder"); - jfcBrowser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - } + public MainPanel() {} //--------------------------------------------------------------------------- //--- @@ -64,34 +52,18 @@ { String cmd = e.getActionCommand(); - if (cmd.equals("browse")) - browse(); - - else if (cmd.equals("migrate")) - migrate(); + if (cmd.equals("convert")) + convert(); } //--------------------------------------------------------------------------- - private void browse() + private void convert() { - jfcBrowser.setSelectedFile(new File(txtOldDir.getText())); - - int res = jfcBrowser.showDialog(this, "Choose"); - - if (res == JFileChooser.APPROVE_OPTION) - txtOldDir.setText(jfcBrowser.getSelectedFile().getAbsolutePath()); - } - - //--------------------------------------------------------------------------- - - private void migrate() - { Frame owner = GuiUtil.getFrame(this); - ProgressDialog dialog = new ProgressDialog(owner, "Migrating data"); + ProgressDialog dialog = new ProgressDialog(owner, "Converting data"); Worker worker = new Worker(dialog); - worker.setOldDir(txtOldDir.getText()); dialog.run(worker); } @@ -101,33 +73,14 @@ //--- //--------------------------------------------------------------------------- - protected JComponent buildInnerPanel() - { - JPanel p = new JPanel(); + protected JComponent buildInnerPanel() { return null; } - FlexLayout fl = new FlexLayout(3,1); - fl.setColProp(1, FlexLayout.EXPAND); - p.setLayout(fl); - - p.add("0,0", new JLabel("Old GeoNetwork")); - p.add("1,0,x", txtOldDir); - p.add("2,0", btnBrowse); - - btnBrowse.addActionListener(this); - btnBrowse.setActionCommand("browse"); - - return p; - } - //--------------------------------------------------------------------------- //--- //--- Variables //--- //--------------------------------------------------------------------------- - private JTextField txtOldDir = new JTextField(20); - private JButton btnBrowse = new JButton("Browse"); - private JFileChooser jfcBrowser = new JFileChooser(); } //============================================================================== Modified: trunk/src/org/fao/gast/gui/panels/manag/conversion/Worker.java =================================================================== --- trunk/src/org/fao/gast/gui/panels/manag/conversion/Worker.java 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/src/org/fao/gast/gui/panels/manag/conversion/Worker.java 2007-03-27 20:12:45 UTC (rev 347) @@ -23,9 +23,9 @@ package org.fao.gast.gui.panels.manag.conversion; - import java.io.FileOutputStream; import java.io.PrintWriter; +import java.sql.SQLException; import java.util.List; import jeeves.resources.dbms.Dbms; import jeeves.utils.Xml; @@ -33,6 +33,7 @@ import org.fao.gast.lib.Lib; import org.fao.gast.lib.Resource; import org.jdom.Element; +import org.jdom.Namespace; //============================================================================== @@ -51,113 +52,103 @@ //--------------------------------------------------------------------------- //--- - //--- API methods + //--- Conversion process //--- //--------------------------------------------------------------------------- - public void setOldDir(String dir) - { - appPath = dir; - } - - //--------------------------------------------------------------------------- - //--- - //--- Migration process - //--- - //--------------------------------------------------------------------------- - public void run() { - if (!openSource()) - return; + Resource res = null; - Resource oldRes = null; - Resource newRes = null; - try { - oldRes = source.config.createResource(); - newRes = Lib.config.createResource(); - - executeJob((Dbms) oldRes.open(), (Dbms) newRes.open()); + res = Lib.config.createResource(); + executeJob((Dbms) res.open()); } - catch(Throwable t) + catch(Exception e) { - Lib.gui.showError(dlg, t); + Lib.gui.showError(dlg, e); } finally { - if (oldRes != null) - oldRes.close(); + if (res != null) + res.close(); - if (newRes != null) - newRes.close(); - + Lib.gui.showInfo(dlg, "Conversion terminated.\n"+ + "Please, see gast/log/unmapped.log for more info"); dlg.stop(); } } //--------------------------------------------------------------------------- - private boolean openSource() + private void executeJob(Dbms dbms) throws Exception { - try - { - source = new GNSource(appPath); + String log = Lib.server.getAppPath() +"/gast/log/unmapped.log"; + PrintWriter out = new PrintWriter(new FileOutputStream(log)); - return true; - } - catch (Exception e) + dlg.reset(1); + dlg.advance("Retrieving metadata ids"); + + List ids = getAllIsoMetadata(dbms); + dbms.commit(); + + dlg.reset(ids.size()); + + for(Object o : ids) { - Lib.gui.showError(dlg, "It seems that the specified folder does not \n"+ - "contain an old GeoNetwork installation"); + Element el = (Element) o; + String id = el.getChildText("id"); - return false; + dlg.advance("Converting metadata with id : "+ id); + + Element md = Lib.metadata.getMetadata(dbms, id); + Element res = Lib.metadata.convert(md, "iso19115", "iso19139"); + + Element metadata = (Element) res.getChild("metadata").getChildren().get(0); + Element unmapped = res.getChild("unmapped"); + + updateMetadata(dbms, id, metadata); + dbms.commit(); + saveUnmapped(out, id, unmapped); } + +// logger.logInfo("Cleaning lucene indexes"); +// removeLuceneFiles(); + + out.close(); } //--------------------------------------------------------------------------- - private void executeJob(Dbms oldDbms, Dbms newDbms) throws Exception + private List getAllIsoMetadata(Dbms dbms) throws SQLException { - String log = Lib.server.getAppPath() +"/gast/log/unmapped.log"; - PrintWriter out = new PrintWriter(new FileOutputStream(log)); + String query = "SELECT id FROM Metadata WHERE schemaId = ?"; - //--- open GeoNetwork 2 + return dbms.select(query, "iso19115").getChildren(); + } - dlg.reset(2); + //--------------------------------------------------------------------------- -// Set<String> ids = destin.getAllIsoMetadataId(); + private void updateMetadata(Dbms dbms, String id, Element md) throws Exception + { + Namespace ns = Namespace.getNamespace("gmd", md.getNamespace().getURI()); + fixNamespace(md, ns); -// destin.commit(); + String query = "UPDATE Metadata SET schemaId='iso19139', data=?, root=? WHERE id=?"; -// dlg.reset(ids.size()); + dbms.execute(query, Xml.getString(md), md.getName(), new Integer(id)); + } -// for(String id : ids) -// { -// if (testOnly) dlg.advance("Analyzing metadata with id : "+ id); -// else dlg.advance("Migrating metadata with id : "+ id); -// -// Element metadata = destin.getMetadata(id); -// Element unmapped = destin.getUnmappedFields(metadata); + //--------------------------------------------------------------------------- -// destin.commit(); -// saveUnmapped(out, id, unmapped); -// -// if (!testOnly) -// { -// destin.upgradeMetadata(id, metadata); -// destin.commit(); -// } -// } -// -// if (!testOnly) -// { -// logger.logInfo("Cleaning lucene indexes"); -// destin.removeLuceneFiles(); -// } + private void fixNamespace(Element md, Namespace ns) + { + if (md.getNamespaceURI().equals(ns.getURI())) + md.setNamespace(ns); - out.close(); + for (Object o : md.getChildren()) + fixNamespace((Element) o, ns); } //--------------------------------------------------------------------------- @@ -184,9 +175,6 @@ //--- //--------------------------------------------------------------------------- - private String appPath; - private GNSource source; - private ProgressDialog dlg; } Modified: trunk/src/org/fao/gast/lib/MetadataLib.java =================================================================== --- trunk/src/org/fao/gast/lib/MetadataLib.java 2007-03-27 20:11:02 UTC (rev 346) +++ trunk/src/org/fao/gast/lib/MetadataLib.java 2007-03-27 20:12:45 UTC (rev 347) @@ -58,6 +58,44 @@ //--- //--------------------------------------------------------------------------- + public Element getMetadata(Dbms dbms, String id) throws Exception + { + return XmlSerializer.select(dbms, "Metadata", id); + } + + //--------------------------------------------------------------------------- + + public boolean canConvert(String fromSchema, String toSchema) + { + String format = fromSchema +"-to-"+ toSchema; + String path = appPath +"/web/conversion/"+format+"/main.xsl"; + + return new File(path).exists(); + } + + //--------------------------------------------------------------------------- + + public Element convert(Element md, String fromSchema, String toSchema) throws Exception + { + if (!canConvert(fromSchema, toSchema)) + throw new Exception("Cannot convert to schema :"+ toSchema); + + String format = fromSchema +"-to-"+ toSchema; + String path = appPath +"/web/conversion/"+format; + + Element result = Xml.transform(md, path +"/main.xsl"); + Element unmapped = Xml.transform(md, path +"/unmapped.xsl"); + + Element metadata = new Element("metadata") + .addContent(result); + + return new Element("result") + .addContent(metadata) + .addContent(unmapped); + } + + //--------------------------------------------------------------------------- + /** Transactional */ public void sync(Dbms dbms) throws Exception @@ -135,7 +173,6 @@ public void clearIndexes() throws Exception { File dir = new File(appPath +"/web/"+ Lib.config.getLuceneDir()); - System.out.println("dir:"+dir.getAbsolutePath()); Lib.io.cleanDir(dir); } Added: trunk/web/conversion/iso19115-to-iso19139/app-schema.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/app-schema.xsl (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/app-schema.xsl 2007-03-27 20:12:45 UTC (rev 347) @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="AppSchInfo"> + + <name> + <CI_Citation> + <xsl:apply-templates select="asName" mode="Citation"/> + </CI_Citation> + </name> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <schemaLanguage> + <gco:CharacterString><xsl:value-of select="asSchLang"/></gco:CharacterString> + </schemaLanguage> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <constraintLanguage> + <gco:CharacterString><xsl:value-of select="asCstLang"/></gco:CharacterString> + </constraintLanguage> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="asAscii"> + <schemaAscii> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </schemaAscii> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="asGraFile"> + <graphicsFile> + <gco:Binary><xsl:value-of select="."/></gco:Binary> + </graphicsFile> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="asSwDevFile"> + <softwareDevelopmentFile> + <gco:Binary><xsl:value-of select="."/></gco:Binary> + </softwareDevelopmentFile> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="asSwDevFiFt"> + <softwareDevelopmentFileFormat> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </softwareDevelopmentFileFormat> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + +</xsl:stylesheet> Added: trunk/web/conversion/iso19115-to-iso19139/citation.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/citation.xsl (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/citation.xsl 2007-03-27 20:12:45 UTC (rev 347) @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="Citation"> + + <title> + <gco:CharacterString><xsl:value-of select="resTitle"/></gco:CharacterString> + </title> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="resAltTitle"> + <alternateTitle> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </alternateTitle> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="resRefDate"> + <date> + <CI_Date> + <xsl:apply-templates select="." mode="RefDate"/> + </CI_Date> + </date> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="resEd"> + <edition> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </edition> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="resEdDate"> + <editionDate> + <gco:DateTime><xsl:value-of select="."/></gco:DateTime> + </editionDate> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="citId"> + <identifier> + <MD_Identifier> + <code> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </code> + </MD_Identifier> + </identifier> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="citRespParty"> + <citedResponsibleParty> + <CI_ResponsibleParty> + <xsl:apply-templates select="." mode="RespParty"/> + </CI_ResponsibleParty> + </citedResponsibleParty> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="presForm"> + <presentationForm> + <CI_PresentationFormCode codeList="./resources/codeList.xml#CI_PresentationFormCode" codeListValue="{PresFormCd/@value}" /> + </presentationForm> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="datasetSeries"> + <series> + <CI_Series> + <xsl:apply-templates select="." mode="DatasetSeries"/> + </CI_Series> + </series> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="otherCitDet"> + <otherCitationDetails> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </otherCitationDetails> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="collTitle"> + <collectiveTitle> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </collectiveTitle> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="isbn"> + <ISBN> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </ISBN> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="issn"> + <ISSN> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </ISSN> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="RefDate"> + + <date> + <gco:DateTime><xsl:value-of select="refDate"/></gco:DateTime> + </date> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <dateType> + <CI_DateTypeCode codeList="./resources/codeList.xml#CI_DateTypeCode" codeListValue="{refDateType/DateTypCd/@value}" /> + </dateType> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DatasetSeries"> + + <xsl:for-each select="seriesName"> + <name> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </name> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="issId"> + <issueIdentification> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </issueIdentification> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="artPage"> + <page> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </page> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + +</xsl:stylesheet> Added: trunk/web/conversion/iso19115-to-iso19139/content.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/content.xsl (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/content.xsl 2007-03-27 20:12:45 UTC (rev 347) @@ -0,0 +1,379 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:gml="http://www.opengis.net/gml" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="ContInfoTypes"> + + <xsl:for-each select="CovDesc"> + <MD_CoverageDescription> + <xsl:apply-templates select="." mode="CovDesc"/> + </MD_CoverageDescription> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="FetCatDesc"> + <MD_FeatureCatalogueDescription> + <xsl:apply-templates select="." mode="FetCatDesc"/> + </MD_FeatureCatalogueDescription> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="ImgDesc"> + <MD_ImageDescription> + <xsl:apply-templates select="." mode="ImgDesc"/> + </MD_ImageDescription> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + <!-- === CovDesc === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="CovDesc"> + + <attributeDescription> + <gco:RecordType><xsl:value-of select="attDesc"/></gco:RecordType> + </attributeDescription> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <contentType> + <MD_CoverageContentTypeCode codeList="./resources/codeList.xml#MD_CoverageContentTypeCode" codeListValue="{contentTyp/ContentTypCd/@value}" /> + </contentType> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="covDim"> + <dimension> + <xsl:apply-templates select="." mode="RangeDimTypes"/> + </dimension> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="RangeDimTypes"> + + <xsl:for-each select="RangeDim"> + <MD_RangeDimension> + <xsl:apply-templates select="." mode="RangeDim"/> + </MD_RangeDimension> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="Band"> + <MD_Band> + <xsl:apply-templates select="." mode="Band"/> + </MD_Band> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="RangeDim"> + + <xsl:for-each select="seqID"> + <sequenceIdentifier> + <gco:MemberName> + <xsl:apply-templates select="." mode="MemberName"/> + </gco:MemberName> + </sequenceIdentifier> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="dimDescrp"> + <descriptor> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </descriptor> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="MemberName"> + + <gco:aName> + <gco:CharacterString><xsl:value-of select="aName"/></gco:CharacterString> + </gco:aName> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <gco:attributeType> + <gco:TypeName> + <gco:aName> + <gco:CharacterString><xsl:value-of select="attributeType/aName"/></gco:CharacterString> + </gco:aName> + </gco:TypeName> + </gco:attributeType> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="Band"> + + <xsl:apply-templates select="." mode="RangeDim"/> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="maxVal"> + <maxValue> + <gco:Real><xsl:value-of select="."/></gco:Real> + </maxValue> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="minVal"> + <minValue> + <gco:Real><xsl:value-of select="."/></gco:Real> + </minValue> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="valUnit"> + <units> + <gml:UnitDefinition> + <xsl:apply-templates select="." mode="UomLength"/> + </gml:UnitDefinition> + </units> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="pkResp"> + <peakResponse> + <gco:Real><xsl:value-of select="."/></gco:Real> + </peakResponse> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="bitsPerVal"> + <bitsPerValue> + <gco:Integer><xsl:value-of select="."/></gco:Integer> + </bitsPerValue> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="toneGrad"> + <toneGradation> + <gco:Integer><xsl:value-of select="."/></gco:Integer> + </toneGradation> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="sclFac"> + <scaleFactor> + <gco:Real><xsl:value-of select="."/></gco:Real> + </scaleFactor> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="offset"> + <offset> + <gco:Real><xsl:value-of select="."/></gco:Real> + </offset> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="UomLength"> + + <gml:name> + <xsl:value-of select="uomName"/> + </gml:name> + + </xsl:template> + + <!-- ============================================================================= --> + <!-- === FetCatDesc === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="FetCatDesc"> + + <xsl:for-each select="compCode"> + <complianceCode> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </complianceCode> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="catLang"> + <language> + <gco:CharacterString><xsl:value-of select="languageCode/@value"/></gco:CharacterString> + </language> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <includedWithDataset> + <gco:Boolean><xsl:value-of select="incWithDS"/></gco:Boolean> + </includedWithDataset> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="catFetTypes"> + <featureTypes> + <xsl:apply-templates select="." mode="GenericNameTypes"/> + </featureTypes> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="catCitation"> + <featureCatalogueCitation> + <CI_Citation> + <xsl:apply-templates select="idCitation" mode="Citation"/> + </CI_Citation> + </featureCatalogueCitation> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="GenericNameTypes"> + + <xsl:for-each select="LocalName"> + <gco:LocalName><xsl:value-of select="scope"/></gco:LocalName> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="ScopedName"> + <gco:ScopedName><xsl:value-of select="scope"/></gco:ScopedName> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + <!-- === ImgDesc === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="ImgDesc"> + + <xsl:apply-templates select="." mode="CovDesc"/> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="illElevAng"> + <illuminationElevationAngle> + <gco:Real><xsl:value-of select="."/></gco:Real> + </illuminationElevationAngle> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="illAziAng"> + <illuminationAzimuthAngle> + <gco:Real><xsl:value-of select="."/></gco:Real> + </illuminationAzimuthAngle> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="imagCond"> + <imagingCondition> + <MD_ImagingConditionCode codeList="./resources/codeList.xml#MD_ImagingConditionCode" codeListValue="{ImgCondCd/@value}" /> + </imagingCondition> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="imagQuCode"> + <imageQualityCode> + <xsl:apply-templates select="." mode="MdIdentTypes"/> + </imageQualityCode> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="cloudCovPer"> + <cloudCoverPercentage> + <gco:Real><xsl:value-of select="."/></gco:Real> + </cloudCoverPercentage> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="prcTypCde"> + <processingLevelCode> + <xsl:apply-templates select="." mode="MdIdentTypes"/> + </processingLevelCode> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="cmpGenQuan"> + <compressionGenerationQuantity> + <gco:Integer><xsl:value-of select="."/></gco:Integer> + </compressionGenerationQuantity> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="trianInd"> + <triangulationIndicator> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </triangulationIndicator> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="radCalDatAv"> + <radiometricCalibrationDataAvailability> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </radiometricCalibrationDataAvailability> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="camCalInAv"> + <cameraCalibrationInformationAvailability> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </cameraCalibrationInformationAvailability> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="filmDistInAv"> + <filmDistortionInformationAvailability> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </filmDistortionInformationAvailability> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="lensDistInAv"> + <lensDistortionInformationAvailability> + <gco:Boolean><xsl:value-of select="."/></gco:Boolean> + </lensDistortionInformationAvailability> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + +</xsl:stylesheet> Added: trunk/web/conversion/iso19115-to-iso19139/data-quality.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/data-quality.xsl (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/data-quality.xsl 2007-03-27 20:12:45 UTC (rev 347) @@ -0,0 +1,553 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DataQuality"> + + <scope> + <DQ_Scope> + <xsl:apply-templates select="dqScope" mode="DQScope"/> + </DQ_Scope> + </scope> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="dqReport"> + <report> + <xsl:apply-templates select="." mode="DQElementTypes"/> + </report> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="dataLineage"> + <lineage> + <LI_Lineage> + <xsl:apply-templates select="." mode="Lineage"/> + </LI_Lineage> + </lineage> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + <!-- === Data quality scope === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DQScope"> + + <level> + <MD_ScopeCode codeList="./resources/codeList.xml#MD_ScopeCode" codeListValue="{scpLvl/ScopeCd/@value}" /> + </level> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="scpExt"> + <extent> + <EX_Extent> + <xsl:apply-templates select="." mode="Extent"/> + </EX_Extent> + </extent> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="scpLvlDesc"> + <levelDescription> + <MD_ScopeDescription> + <xsl:apply-templates select="." mode="ScpDesc"/> + </MD_ScopeDescription> + </levelDescription> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="ScpDesc"> + + <xsl:for-each select="attribIntSet"> + <attributeInstances><xsl:value-of select="."/></attributeInstances> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="attribSet"> + <attributes><xsl:value-of select="."/></attributes> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="datasetSet"> + <dataset><xsl:value-of select="."/></dataset> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="featIntSet"> + <featureInstances><xsl:value-of select="."/></featureInstances> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="featSet"> + <features><xsl:value-of select="."/></features> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="other"> + <other><xsl:value-of select="."/></other> + </xsl:for-each> + </xsl:template> + + <!-- ============================================================================= --> + <!-- === DQElementTypes === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DQElementTypes"> + + <xsl:for-each select="DQAbsExtPosAcc"> + <DQ_AbsoluteExternalPositionalAccuracy> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_AbsoluteExternalPositionalAccuracy> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQAccTimeMeas"> + <DQ_AccuracyOfATimeMeasurement> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_AccuracyOfATimeMeasurement> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQCompComm"> + <DQ_CompletenessCommission> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_CompletenessCommission> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQCompOm"> + <DQ_CompletenessOmission> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_CompletenessOmission> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQConcConsis"> + <DQ_ConceptualConsistency> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_ConceptualConsistency> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQDomConsis"> + <DQ_DomainConsistency> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_DomainConsistency> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQFormConsis"> + <DQ_FormatConsistency> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_FormatConsistency> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQGridDataPosAcc"> + <DQ_GriddedDataPositionalAccuracy> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_GriddedDataPositionalAccuracy> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQNonQuanAttAcc"> + <DQ_NonQuantitativeAttributeAccuracy> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_NonQuantitativeAttributeAccuracy> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQQuanAttAcc"> + <DQ_QuantitativeAttributeAccuracy> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_QuantitativeAttributeAccuracy> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQRelIntPosAcc"> + <DQ_RelativeInternalPositionalAccuracy> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_RelativeInternalPositionalAccuracy> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQTempConsis"> + <DQ_TemporalConsistency> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_TemporalConsistency> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQTempValid"> + <DQ_TemporalValidity> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_TemporalValidity> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQThemClassCor"> + <DQ_ThematicClassificationCorrectness> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_ThematicClassificationCorrectness> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="DQTopConsis"> + <DQ_TopologicalConsistency> + <xsl:apply-templates select="." mode="DQElement"/> + </DQ_TopologicalConsistency> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="DQElement"> + + <xsl:for-each select="measName"> + <nameOfMeasure> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </nameOfMeasure> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="measId"> + <measureIdentification> + <xsl:apply-templates select="." mode="MdIdentTypes"/> + </measureIdentification> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="measureDescription"> + <measureDescription> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </measureDescription> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="evalMethType"> + <evaluationMethodType> + <DQ_EvaluationMethodTypeCode codeList="./resources/codeList.xml#DQ_EvaluationMethodTypeCode" codeListValue="{EvalMethTypeCd/@value}" /> + </evaluationMethodType> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="evalMethDesc"> + <evaluationMethodDescription> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </evaluationMethodDescription> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="evaluationProcedure"> + <evaluationProcedure> + <CI_Citation> + <xsl:apply-templates select="." mode="Citation"/> + </CI_Citation> + </evaluationProcedure> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="measDateTm"> + <dateTime> + <gco:DateTime><xsl:value-of select="."/></gco:DateTime> + </dateTime> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="measResult"> + <result> + <xsl:apply-templates select="." mode="ResultTypes"/> + </result> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="MdIdentTypes"> + + <xsl:for-each select="MdIdent"> + <MD_Identifier> + <xsl:apply-templates select="." mode="MdIdent"/> + </MD_Identifier> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="RS_Identifier"> + <RS_Identifier> + <xsl:apply-templates select="." mode="MdIdent"/> + </RS_Identifier> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="ResultTypes"> + + <xsl:for-each select="ConResult"> + <DQ_ConformanceResult> + <xsl:apply-templates select="." mode="ConResult"/> + </DQ_ConformanceResult> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="QuanResult"> + <DQ_QuantitativeResult> + <xsl:apply-templates select="." mode="QuanResult"/> + </DQ_QuantitativeResult> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="ConResult"> + + <specification> + <CI_Citation> + <xsl:apply-templates select="conSpec" mode="Citation"/> + </CI_Citation> + </specification> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <explanation> + <gco:CharacterString><xsl:value-of select="conExpl"/></gco:CharacterString> + </explanation> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <pass> + <gco:Boolean><xsl:value-of select="conPass"/></gco:Boolean> + </pass> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="QuanResult"> + + <xsl:for-each select="quanValType"> + <valueType> + <gco:RecordType><xsl:value-of select="."/></gco:RecordType> + </valueType> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="quanValUnit"> + <valueUnit> + <gco:Measure> + <xsl:apply-templates select="." mode="Measure"/> + </gco:Measure> + </valueUnit> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="errStat"> + <errorStatistic> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </errorStatistic> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="quanValue"> + <value> + <gco:Record><xsl:value-of select="."/></gco:Record> + </value> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + <!-- === Lineage === --> + <!-- ============================================================================= --> + + <xsl:template match="*" mode="Lineage"> + + <xsl:for-each select="statement"> + <statement> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </statement> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="prcStep"> + <processStep> + <LI_ProcessStep> + <xsl:apply-templates select="." mode="PrcessStep"/> + </LI_ProcessStep> + </processStep> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="dataSource"> + <source> + <LI_Source> + <xsl:apply-templates select="." mode="Source"/> + </LI_Source> + </source> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="PrcessStep"> + + <description> + <gco:CharacterString><xsl:value-of select="stepDesc"/></gco:CharacterString> + </description> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="stepRat"> + <rationale> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </rationale> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="stepDateTm"> + <dateTime> + <gco:DateTime><xsl:value-of select="."/></gco:DateTime> + </dateTime> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="stepProc"> + <processor> + <CI_ResponsibleParty> + <xsl:apply-templates select="." mode="RespParty"/> + </CI_ResponsibleParty> + </processor> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="stepSrc"> + <source> + <LI_Source> + <xsl:apply-templates select="." mode="Source"/> + </LI_Source> + </source> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template match="*" mode="Source"> + + <xsl:for-each select="srcDesc"> + <description> + <gco:CharacterString><xsl:value-of select="."/></gco:CharacterString> + </description> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="srcScale"> + <scaleDenominator> + <MD_RepresentativeFraction> + <denominator> + <gco:Integer><xsl:value-of select="rfDenom"/></gco:Integer> + </denominator> + </MD_RepresentativeFraction> + </scaleDenominator> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="srcRefSys"> + <sourceReferenceSystem> + <MD_ReferenceSystem> + <xsl:apply-templates select="." mode="RefSystemTypes"/> + </MD_ReferenceSystem> + </sourceReferenceSystem> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="srcCitatn"> + <sourceCitation> + <CI_Citation> + <xsl:apply-templates select="." mode="Citation"/> + </CI_Citation> + </sourceCitation> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="srcExt"> + <sourceExtent> + <EX_Extent> + <xsl:apply-templates select="." mode="Extent"/> + </EX_Extent> + </sourceExtent> + </xsl:for-each> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:for-each select="srcStep"> + <sourceStep> + <LI_ProcessStep> + <xsl:apply-templates select="." mode="PrcessStep"/> + </LI_ProcessStep> + </sourceStep> + </xsl:for-each> + + </xsl:template> + + <!-- ============================================================================= --> + +</xsl:stylesheet> Added: trunk/web/conversion/iso19115-to-iso19139/distribution.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/distribution.xsl (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/distribution.xsl 2007-03-27 20:12:45 UTC (rev 347) @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" xmlns ="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:... [truncated message content] |
From: <aca...@us...> - 2007-04-03 15:40:18
|
Revision: 356 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=356&view=rev Author: acarboni Date: 2007-04-03 08:40:13 -0700 (Tue, 03 Apr 2007) Log Message: ----------- Added variables substitution at startup Modified Paths: -------------- trunk/installer/installer-config.xml trunk/src/org/fao/geonet/Geonetwork.java trunk/src/org/fao/geonet/services/util/z3950/Server.java Added Paths: ----------- trunk/web/xml/repositories.xml.tem Removed Paths: ------------- trunk/web/xml/repositories.xml Modified: trunk/installer/installer-config.xml =================================================================== --- trunk/installer/installer-config.xml 2007-04-03 13:08:58 UTC (rev 355) +++ trunk/installer/installer-config.xml 2007-04-03 15:40:13 UTC (rev 356) @@ -94,8 +94,7 @@ <executable targetfile="$INSTALL_PATH/bin/stop-geonetwork.sh" /> <executable targetfile="$INSTALL_PATH/bin/start-gast.sh" /> - <parsable targetfile="$INSTALL_PATH/docs/post-install.txt" type="plain"/> - <parsable targetfile="$INSTALL_PATH/web/xml/repositories.xml" type="xml"/> + <parsable targetfile="$INSTALL_PATH/docs/post-install.txt" type="plain"/> <executable targetfile="$INSTALL_PATH/gast/gast.jar" type ="jar" Modified: trunk/src/org/fao/geonet/Geonetwork.java =================================================================== --- trunk/src/org/fao/geonet/Geonetwork.java 2007-04-03 13:08:58 UTC (rev 355) +++ trunk/src/org/fao/geonet/Geonetwork.java 2007-04-03 15:40:13 UTC (rev 356) @@ -95,9 +95,9 @@ //--- Initialize thesaurus logger.info(" - Thesaurus..."); - + String thesauriDir = handlerConfig.getMandatoryValue(Geonet.Config.CODELIST_DIR); - + thesaurusMan = new ThesaurusManager(path, thesauriDir); @@ -151,6 +151,7 @@ boolean z3950Enable = settingMan.getValueAsBool("system/z3950/enable", false); String z3950port = settingMan.getValue("system/z3950/port"); + String host = settingMan.getValue("system/server/host"); String schemaMappings = handlerConfig.getMandatoryValue(Geonet.Config.SCHEMA_MAPPINGS); if (!z3950Enable) @@ -163,7 +164,7 @@ session.authenticate(null, "z39.50", "", "", "Guest"); context.setUserSession(session); context.setIpAddress("127.0.0.1"); - Server.init(z3950port, path, schemaMappings, context); + Server.init(host, z3950port, path, schemaMappings, context); } //------------------------------------------------------------------------ Modified: trunk/src/org/fao/geonet/services/util/z3950/Server.java =================================================================== --- trunk/src/org/fao/geonet/services/util/z3950/Server.java 2007-04-03 13:08:58 UTC (rev 355) +++ trunk/src/org/fao/geonet/services/util/z3950/Server.java 2007-04-03 15:40:13 UTC (rev 356) @@ -28,8 +28,12 @@ import java.io.FileOutputStream; import java.util.Properties; import jeeves.constants.Jeeves; +import jeeves.resources.dbms.Dbms; import jeeves.server.context.ServiceContext; import jeeves.utils.Xml; +import org.fao.geonet.GeonetContext; +import org.fao.geonet.constants.Geonet; +import org.fao.geonet.kernel.setting.SettingManager; import org.jdom.Document; import org.jdom.Element; @@ -46,14 +50,25 @@ /** initializes the server */ - public static void init(String port, String appPath, String schemaMappings, - ServiceContext srvContext) throws Exception + public static void init(String host, String port, String appPath, + String schemaMappings, ServiceContext context) throws Exception { + //--- fix schema-mappings.xml file + String tempSchema = appPath + Jeeves.Path.XML + schemaMappings +".tem"; String realSchema = appPath + Jeeves.Path.XML + schemaMappings; fixSchemaFile(tempSchema, realSchema); + //--- fix repositories.xml file + + String tempRepo = appPath + Jeeves.Path.XML + "repositories.xml" +".tem"; + String realRepo = appPath + Jeeves.Path.XML + "repositories.xml"; + + fixRepositoriesFile(tempRepo, realRepo, host, port); + + //--- normal processing + String evaluator = "org.fao.geonet.services.util.z3950.GNSearchable"; String configurator = "com.k_int.IR.Syntaxes.Conversion.XMLConfigurator"; @@ -62,7 +77,7 @@ props.setProperty("evaluator", evaluator); props.setProperty("XSLConverterConfiguratorClassName", configurator); props.setProperty("ConvertorConfigFile", realSchema); - props.put("srvContext", srvContext); + props.put("srvContext", context); _server = new ZServer(props); _server.start(); @@ -97,6 +112,31 @@ Xml.writeResponse(new Document(root), os); os.close(); } + + //-------------------------------------------------------------------------- + + private static void fixRepositoriesFile(String src, String des, String host, + String z3950port) throws Exception + { + Element root = Xml.loadFile(src); + Element repo = root.getChild("Repository"); + + for (Object o : repo.getChildren("RepositoryProperty")) + { + Element rp = (Element) o; + String name = rp.getAttributeValue("name"); + + if ("ServiceHost".equals(name)) + rp.setAttribute("value", host); + + else if ("ServicePort".equals(name)) + rp.setAttribute("value", z3950port); + } + + FileOutputStream os = new FileOutputStream(des); + Xml.writeResponse(new Document(root), os); + os.close(); + } } //============================================================================= Deleted: trunk/web/xml/repositories.xml =================================================================== --- trunk/web/xml/repositories.xml 2007-04-03 13:08:58 UTC (rev 355) +++ trunk/web/xml/repositories.xml 2007-04-03 15:40:13 UTC (rev 356) @@ -1,784 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<RepositoryDirectory> - - <!-- Collections and repositories must appear here before instance entries - The collection_dn values are the strings you can actally use in an IRQuery as - values in the collections vector. The searchable object will deal with resolving - that collection-dn into a specific instance of a collection at a repository and - make the appropriate connection using the right database name for that repository. - --> - - <TypeMapping type="Z3950" class="com.k_int.z3950.IRClient.Z3950Origin"/> - <TypeMapping type="HSS" class="com.k_int.srw.client.SRWSearchable"/> - - <!-- - localhost - --> - <Collection collection_dn="localhost:2100/geonetwork" - collection_name="Local GeoNetwork"/> - - <Collection collection_dn="193.43.36.137:2100/geonetwork" - collection_name="Food and Agriculture Organization GeoNetwork (FAO-UN)"/> - - <Collection collection_dn="62.152.116.79:2100/geonetwork" - collection_name="World Food Program VAM GeoNetwork (WFP-UN)"/> - - <Collection collection_dn="193.220.24.180:2100/geonetwork" - collection_name="SETSAN Mozambique GeoNetwork"/> - - <Collection collection_dn="196.36.132.196:2100/geonetwork" - collection_name="WFP South Africa GeoNetwork"/> - - <Collection collection_dn="193.108.214.8:2100/geonetwork" - collection_name="WFP Uganda GeoNetwork ODK"/> - - <Collection collection_dn="152.61.128.66:2210/GRID" - collection_name="United Nations Environment Programme / GRID - Sioux Falls"/> - - <Collection collection_dn="193.247.37.161:5210/FGDCmeta" - collection_name="United Nations Environment Programme / DEWA / GRID-Geneva"/> - - <Collection collection_dn="128.39.158.8:210/gridarendal" - collection_name="UNEP/GRID-Arendal UNEP.Net node"/> - - <Collection collection_dn="198.102.62.179:6668/Browse_Metadata" - collection_name="Geography Network"/> - - <Collection collection_dn="160.91.10.159:210/landval" - collection_name="NASA ORNL DAAC EOS Land Validation - Earth Observing System Land Validation Program"/> - - <Collection collection_dn="216.27.158.75:5210/topp" - collection_name="CIESIN New York City Dataset"/> - - <Collection collection_dn="129.236.39.52:6001/sedac" - collection_name="CIESIN/NASA - Socioeconomic Data and Applications Center"/> - - <Collection collection_dn="152.61.128.66:5210/adds" - collection_name="Africa Data Dissemination Service"/> - - <Collection collection_dn="152.61.128.18:2210/emis" - collection_name="African Geospatial Data Sets"/> - - <Collection collection_dn="193.132.208.19:210/Water" - collection_name="African Water Information"/> - - <Collection collection_dn="70.246.189.162:210/isitedb" - collection_name="Alamo Area Council of Governments"/> - - <Collection collection_dn="130.118.181.36:210/AGDC" - collection_name="Alaska Geospatial Data Clearinghouse"/> - - <Collection collection_dn="204.89.222.35:5210/asgdc" - collection_name="Alaska State Geospatial Data Clearinghouse (ASGDC)"/> - - <Collection collection_dn="209.193.41.78:210/MoaMeta" - collection_name="Anchorage Alaska Geospatial Data Clearinghouse Node"/> - - <Collection collection_dn="200.63.19.202:6668/igm" - collection_name="Argentina - IGM - Instituto Geografico Militar"/> - - <Collection collection_dn="128.196.156.169:5333/Arizona" - collection_name="Arizona Clearinghouse Node for Spatial Data"/> - - <Collection collection_dn="130.184.75.191:5000/arkgcn" - collection_name="Arkansas GeoLibrary"/> - - <Collection collection_dn="203.11.121.51:6668/eis" - collection_name="Australia - WALIS Interragator - Environmental Impact Statements"/> - - <Collection collection_dn="203.11.121.51:6668/agency" - collection_name="Australia - WALIS Interragator - Spatial Data"/> - - <Collection collection_dn="152.91.17.31:210/act" - collection_name="Australia - ACT Spatial Data Directory"/> - - <Collection collection_dn="143.174.16.7:6668/auslig" - collection_name="Australia - AUSLIG Data Directory"/> - - <Collection collection_dn="203.49.66.2:5550/product" - collection_name="Australia - Australian Hydrographic Service - Product Metadata Directory"/> - - <Collection collection_dn="152.91.17.31:210/comm" - collection_name="Australia - BRS - Incorparating Other Commonwealth Data"/> - - <Collection collection_dn="134.178.13.14:6668/bom_meta" - collection_name="Australia - Bureau of Meteorology"/> - - <Collection collection_dn="155.187.2.2:6668/edd" - collection_name="Australia - EA Environmental Data Directory (Green Pages)"/> - - <Collection collection_dn="65.77.211.93:6668/dataset" - collection_name="Australia - IndexGeo Pty Ltd - Eco Companion Catalogue"/> - - <Collection collection_dn="203.3.193.251:6668/nrdd" - collection_name="Australia - NSW Natural Resources Data Directory"/> - - <Collection collection_dn="150.191.80.24:210/NTSDD" - collection_name="Australia - NT Spatial Data Directory"/> - - <Collection collection_dn="203.56.118.1:6668/qsiis_prod" - collection_name="Australia - Qld Spatial Data (QSIIS)"/> - - <Collection collection_dn="203.46.162.95:5550/qsii2" - collection_name="Australia - Queensland Department of Natural Resources and Mines Spatial Data"/> - - <Collection collection_dn="143.216.198.138:6668/sa" - collection_name="Australia - South Australia Spatial Information Directory"/> - - <Collection collection_dn="203.11.140.26:6668/vicsdd" - collection_name="Australia - Victorian Spatial Data Directory"/> - - <Collection collection_dn="203.11.121.51:6668/airphoto" - collection_name="Australia - WALIS Interragator - Aerial Photography"/> - - <Collection collection_dn="203.11.121.51:6668/biblio" - collection_name="Australia - WALIS Interragator - Agricultural Bibliography"/> - - <Collection collection_dn="203.11.121.51:6668/nrm" - collection_name="Australia - WALIS Interragator - Natural Resource Monitoring"/> - - <Collection collection_dn="147.66.8.9:5550/prod" - collection_name="Australian Antarctic Data Centre"/> - - <!-- The type parameter is used when looking for factories to create instances of - Searchable capable of searching the identified repository --> - - <!-- - localhost - --> - <Repository repository_dn="localhost:2100/geonetwork" name="Local GeoNetwork" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="localhost" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="193.43.36.137:2100/geonetwork" name="Food and Agriculture Organization GeoNetwork (FAO-UN)" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="193.43.36.137" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.fao.org/geonetwork/images/logos/fao_logo_small.gif" /> - </Repository> - - <Repository repository_dn="62.152.116.79:2100/geonetwork" name="World Food Program VAM GeoNetwork (WFP-UN)" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="62.152.116.79" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="193.220.24.180:2100/geonetwork" name="SETSAN Mozambique GeoNetwork" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.setsan.org.mz" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="196.36.132.196:2100/geonetwork" name="WFP South Africa GeoNetwork" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="196.36.132.196" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="193.108.214.8:2100/geonetwork" name="WFP Uganda GeoNetwork ODK" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="193.108.214.8" /> - <RepositoryProperty name="ServicePort" value="2100" /> - <RepositoryProperty name="service_short_name" value="geonetwork" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="152.61.128.66:2210/GRID" name="United Nations Environment Programme / GRID - Sioux Falls" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="edclxs25.cr.usgs.gov" /> - <RepositoryProperty name="ServicePort" value="2210" /> - <RepositoryProperty name="service_short_name" value="GRID" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="193.247.37.161:5210/FGDCmeta" name="United Nations Environment Programme / DEWA / GRID-Geneva" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="unepnet.grid.unep.ch" /> - <RepositoryProperty name="ServicePort" value="5210" /> - <RepositoryProperty name="service_short_name" value="FGDCmeta" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="128.39.158.8:210/gridarendal" name="UNEP/GRID-Arendal UNEP.Net node" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.grida.no" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="gridarendal" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="198.102.62.179:6668/Browse_Metadata" name="Geography Network" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="clearinghouse2.esri.com" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="Browse_Metadata" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="160.91.10.159:210/landval" name="NASA ORNL DAAC EOS Land Validation - Earth Observing System Land Validation Program" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="mercury2.ornl.gov" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="landval" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="216.27.158.75:5210/topp" name="CIESIN New York City Dataset" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="beta.openplans.org" /> - <RepositoryProperty name="ServicePort" value="5210" /> - <RepositoryProperty name="service_short_name" value="topp" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="129.236.39.52:6001/sedac" name="CIESIN/NASA - Socioeconomic Data and Applications Center" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="wwwgateway.ciesin.columbia.edu" /> - <RepositoryProperty name="ServicePort" value="6001" /> - <RepositoryProperty name="service_short_name" value="sedac" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="152.61.128.66:5210/adds" name="Africa Data Dissemination Service" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="edclxs25.cr.usgs.gov" /> - <RepositoryProperty name="ServicePort" value="5210" /> - <RepositoryProperty name="service_short_name" value="adds" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="152.61.128.18:2210/emis" name="African Geospatial Data Sets" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="edcsns16.cr.usgs.gov" /> - <RepositoryProperty name="ServicePort" value="2210" /> - <RepositoryProperty name="service_short_name" value="emis" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="193.132.208.19:210/Water" name="African Water Information" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="geoinfo.uneca.org" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="Water" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="70.246.189.162:210/isitedb" name="Alamo Area Council of Governments" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="aacis.net" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="isitedb" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="130.118.181.36:210/AGDC" name="Alaska Geospatial Data Clearinghouse" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="geoserver2.wr.usgs.gov" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="AGDC" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="204.89.222.35:5210/asgdc" name="Alaska State Geospatial Data Clearinghouse (ASGDC)" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="denali.dnr.state.ak.us" /> - <RepositoryProperty name="ServicePort" value="5210" /> - <RepositoryProperty name="service_short_name" value="asgdc" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="209.193.41.78:210/MoaMeta" name="Anchorage Alaska Geospatial Data Clearinghouse Node" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="209.193.41.78" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="MoaMeta" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="200.63.19.202:6668/igm" name="Argentina - IGM - Instituto Geografico Militar" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="200.63.19.202" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="igm" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="128.196.156.169:5333/Arizona" name="Arizona Clearinghouse Node for Spatial Data" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="grotto.srnr.arizona.edu" /> - <RepositoryProperty name="ServicePort" value="5333" /> - <RepositoryProperty name="service_short_name" value="Arizona" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="130.184.75.191:5000/arkgcn" name="Arkansas GeoLibrary" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="web2.cast.uark.edu" /> - <RepositoryProperty name="ServicePort" value="5000" /> - <RepositoryProperty name="service_short_name" value="arkgcn" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.121.51:6668/eis" name="Australia - WALIS Interragator - Environmental Impact Statements" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.walis.wa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="eis" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.121.51:6668/agency" name="Australia - WALIS Interragator - Spatial Data" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.walis.wa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="agency" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="152.91.17.31:210/act" name="Australia - ACT Spatial Data Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.brs.gov.au" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="act" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="143.174.16.7:6668/auslig" name="Australia - AUSLIG Data Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.auslig.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="auslig" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.49.66.2:5550/product" name="Australia - Australian Hydrographic Service - Product Metadata Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.hydro.gov.au" /> - <RepositoryProperty name="ServicePort" value="5550" /> - <RepositoryProperty name="service_short_name" value="product" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="152.91.17.31:210/comm" name="Australia - BRS - Incorparating Other Commonwealth Data" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.brs.gov.au" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="comm" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="134.178.13.14:6668/bom_meta" name="Australia - Bureau of Meteorology" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www1.ho.bom.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="bom_meta" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="155.187.2.2:6668/edd" name="Australia - EA Environmental Data Directory (Green Pages)" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="environment.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="edd" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="65.77.211.93:6668/dataset" name="Australia - IndexGeo Pty Ltd - Eco Companion Catalogue" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="indexgeo.com.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="dataset" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.3.193.251:6668/nrdd" name="Australia - NSW Natural Resources Data Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="is.dlwc.nsw.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="nrdd" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="150.191.80.24:210/NTSDD" name="Australia - NT Spatial Data Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.ntlis.nt.gov.au" /> - <RepositoryProperty name="ServicePort" value="210" /> - <RepositoryProperty name="service_short_name" value="NTSDD" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.56.118.1:6668/qsiis_prod" name="Australia - Qld Spatial Data (QSIIS)" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.gso.qld.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="qsiis_prod" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.46.162.95:5550/qsii2" name="Australia - Queensland Department of Natural Resources and Mines Spatial Data" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.nrm.qld.gov.au" /> - <RepositoryProperty name="ServicePort" value="5550" /> - <RepositoryProperty name="service_short_name" value="qsii2" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="143.216.198.138:6668/sa" name="Australia - South Australia Spatial Information Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.asdd.sa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="sa" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.140.26:6668/vicsdd" name="Australia - Victorian Spatial Data Directory" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.ogdc.vic.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="vicsdd" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.121.51:6668/airphoto" name="Australia - WALIS Interragator - Aerial Photography" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.walis.wa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="airphoto" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.121.51:6668/biblio" name="Australia - WALIS Interragator - Agricultural Bibliography" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.walis.wa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="biblio" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="203.11.121.51:6668/nrm" name="Australia - WALIS Interragator - Natural Resource Monitoring" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="www.walis.wa.gov.au" /> - <RepositoryProperty name="ServicePort" value="6668" /> - <RepositoryProperty name="service_short_name" value="nrm" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <Repository repository_dn="147.66.8.9:5550/prod" name="Australian Antarctic Data Centre" type="Z3950" can_multiplex_sessions="no" > - <RepositoryProperty name="ServiceHost" value="aadc-db.antdiv.gov.au" /> - <RepositoryProperty name="ServicePort" value="5550" /> - <RepositoryProperty name="service_short_name" value="prod" /> - <RepositoryProperty name="default_record_syntax" value="xml" /> - <RepositoryProperty name="default_element_set_name" value="s" /> - <RepositoryProperty name="full_element_set_name" value="f" /> - <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> - </Repository> - - <!-- Map logical collection-dn strings on to physical instances of databases at targets (in z-speak) --> - - <!-- - localhost - --> - <Instance instance_dn="localhost:2100/geonetwork" - collection_dn="localhost:2100/geonetwork" - repository_dn="localhost:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="193.43.36.137:2100/geonetwork" - collection_dn="193.43.36.137:2100/geonetwork" - repository_dn="193.43.36.137:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="62.152.116.79:2100/geonetwork" - collection_dn="62.152.116.79:2100/geonetwork" - repository_dn="62.152.116.79:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="193.220.24.180:2100/geonetwork" - collection_dn="193.220.24.180:2100/geonetwork" - repository_dn="193.220.24.180:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="196.36.132.196:2100/geonetwork" - collection_dn="196.36.132.196:2100/geonetwork" - repository_dn="196.36.132.196:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="193.108.214.8:2100/geonetwork" - collection_dn="193.108.214.8:2100/geonetwork" - repository_dn="193.108.214.8:2100/geonetwork" - local_name="geonetwork" /> - - <Instance instance_dn="152.61.128.5:210/adds" - collection_dn="152.61.128.5:210/adds" - repository_dn="152.61.128.5:210/adds" - local_name="adds" /> - - <Instance instance_dn="152.61.128.66:2210/GRID" - collection_dn="152.61.128.66:2210/GRID" - repository_dn="152.61.128.66:2210/GRID" - local_name="GRID" /> - - <Instance instance_dn="193.247.37.161:5210/FGDCmeta" - collection_dn="193.247.37.161:5210/FGDCmeta" - repository_dn="193.247.37.161:5210/FGDCmeta" - local_name="FGDCmeta" /> - - <Instance instance_dn="128.39.158.8:210/gridarendal" - collection_dn="128.39.158.8:210/gridarendal" - repository_dn="128.39.158.8:210/gridarendal" - local_name="gridarendal" /> - - <Instance instance_dn="198.102.62.179:6668/Browse_Metadata" - collection_dn="198.102.62.179:6668/Browse_Metadata" - repository_dn="198.102.62.179:6668/Browse_Metadata" - local_name="Browse_Metadata" /> - - <Instance instance_dn="160.91.10.159:210/landval" - collection_dn="160.91.10.159:210/landval" - repository_dn="160.91.10.159:210/landval" - local_name="landval" /> - - <Instance instance_dn="216.27.158.75:5210/topp" - collection_dn="216.27.158.75:5210/topp" - repository_dn="216.27.158.75:5210/topp" - local_name="topp" /> - - <Instance instance_dn="129.236.39.52:6001/sedac" - collection_dn="129.236.39.52:6001/sedac" - repository_dn="129.236.39.52:6001/sedac" - local_name="sedac" /> - - <Instance instance_dn="152.61.128.18:2210/emis" - collection_dn="152.61.128.18:2210/emis" - repository_dn="152.61.128.18:2210/emis" - local_name="emis" /> - - <Instance instance_dn="193.132.208.19:210/Water" - collection_dn="193.132.208.19:210/Water" - repository_dn="193.132.208.19:210/Water" - local_name="Water" /> - - <Instance instance_dn="70.246.189.162:210/isitedb" - collection_dn="70.246.189.162:210/isitedb" - repository_dn="70.246.189.162:210/isitedb" - local_name="isitedb" /> - - <Instance instance_dn="130.118.181.36:210/AGDC" - collection_dn="130.118.181.36:210/AGDC" - repository_dn="130.118.181.36:210/AGDC" - local_name="AGDC" /> - - <Instance instance_dn="204.89.222.35:5210/asgdc" - collection_dn="204.89.222.35:5210/asgdc" - repository_dn="204.89.222.35:5210/asgdc" - local_name="asgdc" /> - - <Instance instance_dn="209.193.41.78:210/MoaMeta" - collection_dn="209.193.41.78:210/MoaMeta" - repository_dn="209.193.41.78:210/MoaMeta" - local_name="MoaMeta" /> - - <Instance instance_dn="200.63.19.202:6668/igm" - collection_dn="200.63.19.202:6668/igm" - repository_dn="200.63.19.202:6668/igm" - local_name="igm" /> - - <Instance instance_dn="128.196.156.169:5333/Arizona" - collection_dn="128.196.156.169:5333/Arizona" - repository_dn="128.196.156.169:5333/Arizona" - local_name="Arizona" /> - - <Instance instance_dn="130.184.75.191:5000/arkgcn" - collection_dn="130.184.75.191:5000/arkgcn" - repository_dn="130.184.75.191:5000/arkgcn" - local_name="arkgcn" /> - - <Instance instance_dn="203.11.121.51:6668/eis" - collection_dn="203.11.121.51:6668/eis" - repository_dn="203.11.121.51:6668/eis" - local_name="eis" /> - - <Instance instance_dn="203.11.121.51:6668/agency" - collection_dn="203.11.121.51:6668/agency" - repository_dn="203.11.121.51:6668/agency" - local_name="agency" /> - - <Instance instance_dn="152.91.17.31:210/act" - collection_dn="152.91.17.31:210/act" - repository_dn="152.91.17.31:210/act" - local_name="act" /> - - <Instance instance_dn="143.174.16.7:6668/auslig" - collection_dn="143.174.16.7:6668/auslig" - repository_dn="143.174.16.7:6668/auslig" - local_name="auslig" /> - - <Instance instance_dn="203.49.66.2:5550/product" - collection_dn="203.49.66.2:5550/product" - repository_dn="203.49.66.2:5550/product" - local_name="product" /> - - <Instance instance_dn="152.91.17.31:210/comm" - collection_dn="152.91.17.31:210/comm" - repository_dn="152.91.17.31:210/comm" - local_name="comm" /> - - <Instance instance_dn="134.178.13.14:6668/bom_meta" - collection_dn="134.178.13.14:6668/bom_meta" - repository_dn="134.178.13.14:6668/bom_meta" - local_name="bom_meta" /> - - <Instance instance_dn="155.187.2.2:6668/edd" - collection_dn="155.187.2.2:6668/edd" - repository_dn="155.187.2.2:6668/edd" - local_name="edd" /> - - <Instance instance_dn="65.77.211.93:6668/dataset" - collection_dn="65.77.211.93:6668/dataset" - repository_dn="65.77.211.93:6668/dataset" - local_name="dataset" /> - - <Instance instance_dn="203.3.193.251:6668/nrdd" - collection_dn="203.3.193.251:6668/nrdd" - repository_dn="203.3.193.251:6668/nrdd" - local_name="nrdd" /> - - <Instance instance_dn="150.191.80.24:210/NTSDD" - collection_dn="150.191.80.24:210/NTSDD" - repository_dn="150.191.80.24:210/NTSDD" - local_name="NTSDD" /> - - <Instance instance_dn="203.56.118.1:6668/qsiis_prod" - collection_dn="203.56.118.1:6668/qsiis_prod" - repository_dn="203.56.118.1:6668/qsiis_prod" - local_name="qsiis_prod" /> - - <Instance instance_dn="203.46.162.95:5550/qsii2" - collection_dn="203.46.162.95:5550/qsii2" - repository_dn="203.46.162.95:5550/qsii2" - local_name="qsii2" /> - - <Instance instance_dn="143.216.198.138:6668/sa" - collection_dn="143.216.198.138:6668/sa" - repository_dn="143.216.198.138:6668/sa" - local_name="sa" /> - - <Instance instance_dn="203.11.140.26:6668/vicsdd" - collection_dn="203.11.140.26:6668/vicsdd" - repository_dn="203.11.140.26:6668/vicsdd" - local_name="vicsdd" /> - - <Instance instance_dn="203.11.121.51:6668/airphoto" - collection_dn="203.11.121.51:6668/airphoto" - repository_dn="203.11.121.51:6668/airphoto" - local_name="airphoto" /> - - <Instance instance_dn="203.11.121.51:6668/biblio" - collection_dn="203.11.121.51:6668/biblio" - repository_dn="203.11.121.51:6668/biblio" - local_name="biblio" /> - - <Instance instance_dn="203.11.121.51:6668/nrm" - collection_dn="203.11.121.51:6668/nrm" - repository_dn="203.11.121.51:6668/nrm" - local_name="nrm" /> - - <Instance instance_dn="147.66.8.9:5550/prod" - collection_dn="147.66.8.9:5550/prod" - repository_dn="147.66.8.9:5550/prod" - local_name="prod" /> - -</RepositoryDirectory> Added: trunk/web/xml/repositories.xml.tem =================================================================== --- trunk/web/xml/repositories.xml.tem (rev 0) +++ trunk/web/xml/repositories.xml.tem 2007-04-03 15:40:13 UTC (rev 356) @@ -0,0 +1,784 @@ +<?xml version="1.0" encoding="UTF-8"?> +<RepositoryDirectory> + + <!-- Collections and repositories must appear here before instance entries + The collection_dn values are the strings you can actally use in an IRQuery as + values in the collections vector. The searchable object will deal with resolving + that collection-dn into a specific instance of a collection at a repository and + make the appropriate connection using the right database name for that repository. + --> + + <TypeMapping type="Z3950" class="com.k_int.z3950.IRClient.Z3950Origin"/> + <TypeMapping type="HSS" class="com.k_int.srw.client.SRWSearchable"/> + + <!-- + localhost + --> + <Collection collection_dn="localhost:2100/geonetwork" + collection_name="Local GeoNetwork"/> + + <Collection collection_dn="193.43.36.137:2100/geonetwork" + collection_name="Food and Agriculture Organization GeoNetwork (FAO-UN)"/> + + <Collection collection_dn="62.152.116.79:2100/geonetwork" + collection_name="World Food Program VAM GeoNetwork (WFP-UN)"/> + + <Collection collection_dn="193.220.24.180:2100/geonetwork" + collection_name="SETSAN Mozambique GeoNetwork"/> + + <Collection collection_dn="196.36.132.196:2100/geonetwork" + collection_name="WFP South Africa GeoNetwork"/> + + <Collection collection_dn="193.108.214.8:2100/geonetwork" + collection_name="WFP Uganda GeoNetwork ODK"/> + + <Collection collection_dn="152.61.128.66:2210/GRID" + collection_name="United Nations Environment Programme / GRID - Sioux Falls"/> + + <Collection collection_dn="193.247.37.161:5210/FGDCmeta" + collection_name="United Nations Environment Programme / DEWA / GRID-Geneva"/> + + <Collection collection_dn="128.39.158.8:210/gridarendal" + collection_name="UNEP/GRID-Arendal UNEP.Net node"/> + + <Collection collection_dn="198.102.62.179:6668/Browse_Metadata" + collection_name="Geography Network"/> + + <Collection collection_dn="160.91.10.159:210/landval" + collection_name="NASA ORNL DAAC EOS Land Validation - Earth Observing System Land Validation Program"/> + + <Collection collection_dn="216.27.158.75:5210/topp" + collection_name="CIESIN New York City Dataset"/> + + <Collection collection_dn="129.236.39.52:6001/sedac" + collection_name="CIESIN/NASA - Socioeconomic Data and Applications Center"/> + + <Collection collection_dn="152.61.128.66:5210/adds" + collection_name="Africa Data Dissemination Service"/> + + <Collection collection_dn="152.61.128.18:2210/emis" + collection_name="African Geospatial Data Sets"/> + + <Collection collection_dn="193.132.208.19:210/Water" + collection_name="African Water Information"/> + + <Collection collection_dn="70.246.189.162:210/isitedb" + collection_name="Alamo Area Council of Governments"/> + + <Collection collection_dn="130.118.181.36:210/AGDC" + collection_name="Alaska Geospatial Data Clearinghouse"/> + + <Collection collection_dn="204.89.222.35:5210/asgdc" + collection_name="Alaska State Geospatial Data Clearinghouse (ASGDC)"/> + + <Collection collection_dn="209.193.41.78:210/MoaMeta" + collection_name="Anchorage Alaska Geospatial Data Clearinghouse Node"/> + + <Collection collection_dn="200.63.19.202:6668/igm" + collection_name="Argentina - IGM - Instituto Geografico Militar"/> + + <Collection collection_dn="128.196.156.169:5333/Arizona" + collection_name="Arizona Clearinghouse Node for Spatial Data"/> + + <Collection collection_dn="130.184.75.191:5000/arkgcn" + collection_name="Arkansas GeoLibrary"/> + + <Collection collection_dn="203.11.121.51:6668/eis" + collection_name="Australia - WALIS Interragator - Environmental Impact Statements"/> + + <Collection collection_dn="203.11.121.51:6668/agency" + collection_name="Australia - WALIS Interragator - Spatial Data"/> + + <Collection collection_dn="152.91.17.31:210/act" + collection_name="Australia - ACT Spatial Data Directory"/> + + <Collection collection_dn="143.174.16.7:6668/auslig" + collection_name="Australia - AUSLIG Data Directory"/> + + <Collection collection_dn="203.49.66.2:5550/product" + collection_name="Australia - Australian Hydrographic Service - Product Metadata Directory"/> + + <Collection collection_dn="152.91.17.31:210/comm" + collection_name="Australia - BRS - Incorparating Other Commonwealth Data"/> + + <Collection collection_dn="134.178.13.14:6668/bom_meta" + collection_name="Australia - Bureau of Meteorology"/> + + <Collection collection_dn="155.187.2.2:6668/edd" + collection_name="Australia - EA Environmental Data Directory (Green Pages)"/> + + <Collection collection_dn="65.77.211.93:6668/dataset" + collection_name="Australia - IndexGeo Pty Ltd - Eco Companion Catalogue"/> + + <Collection collection_dn="203.3.193.251:6668/nrdd" + collection_name="Australia - NSW Natural Resources Data Directory"/> + + <Collection collection_dn="150.191.80.24:210/NTSDD" + collection_name="Australia - NT Spatial Data Directory"/> + + <Collection collection_dn="203.56.118.1:6668/qsiis_prod" + collection_name="Australia - Qld Spatial Data (QSIIS)"/> + + <Collection collection_dn="203.46.162.95:5550/qsii2" + collection_name="Australia - Queensland Department of Natural Resources and Mines Spatial Data"/> + + <Collection collection_dn="143.216.198.138:6668/sa" + collection_name="Australia - South Australia Spatial Information Directory"/> + + <Collection collection_dn="203.11.140.26:6668/vicsdd" + collection_name="Australia - Victorian Spatial Data Directory"/> + + <Collection collection_dn="203.11.121.51:6668/airphoto" + collection_name="Australia - WALIS Interragator - Aerial Photography"/> + + <Collection collection_dn="203.11.121.51:6668/biblio" + collection_name="Australia - WALIS Interragator - Agricultural Bibliography"/> + + <Collection collection_dn="203.11.121.51:6668/nrm" + collection_name="Australia - WALIS Interragator - Natural Resource Monitoring"/> + + <Collection collection_dn="147.66.8.9:5550/prod" + collection_name="Australian Antarctic Data Centre"/> + + <!-- The type parameter is used when looking for factories to create instances of + Searchable capable of searching the identified repository --> + + <!-- + localhost + --> + <Repository repository_dn="localhost:2100/geonetwork" name="Local GeoNetwork" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="*** automatically changed on startup ***" /> + <RepositoryProperty name="ServicePort" value="*** automatically changed on startup ***" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="193.43.36.137:2100/geonetwork" name="Food and Agriculture Organization GeoNetwork (FAO-UN)" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="193.43.36.137" /> + <RepositoryProperty name="ServicePort" value="2100" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.fao.org/geonetwork/images/logos/fao_logo_small.gif" /> + </Repository> + + <Repository repository_dn="62.152.116.79:2100/geonetwork" name="World Food Program VAM GeoNetwork (WFP-UN)" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="62.152.116.79" /> + <RepositoryProperty name="ServicePort" value="2100" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="193.220.24.180:2100/geonetwork" name="SETSAN Mozambique GeoNetwork" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="www.setsan.org.mz" /> + <RepositoryProperty name="ServicePort" value="2100" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="196.36.132.196:2100/geonetwork" name="WFP South Africa GeoNetwork" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="196.36.132.196" /> + <RepositoryProperty name="ServicePort" value="2100" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="193.108.214.8:2100/geonetwork" name="WFP Uganda GeoNetwork ODK" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="193.108.214.8" /> + <RepositoryProperty name="ServicePort" value="2100" /> + <RepositoryProperty name="service_short_name" value="geonetwork" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="152.61.128.66:2210/GRID" name="United Nations Environment Programme / GRID - Sioux Falls" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="edclxs25.cr.usgs.gov" /> + <RepositoryProperty name="ServicePort" value="2210" /> + <RepositoryProperty name="service_short_name" value="GRID" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="193.247.37.161:5210/FGDCmeta" name="United Nations Environment Programme / DEWA / GRID-Geneva" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="unepnet.grid.unep.ch" /> + <RepositoryProperty name="ServicePort" value="5210" /> + <RepositoryProperty name="service_short_name" value="FGDCmeta" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="128.39.158.8:210/gridarendal" name="UNEP/GRID-Arendal UNEP.Net node" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="www.grida.no" /> + <RepositoryProperty name="ServicePort" value="210" /> + <RepositoryProperty name="service_short_name" value="gridarendal" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name="default_element_set_name" value="s" /> + <RepositoryProperty name="full_element_set_name" value="f" /> + <RepositoryProperty name="logo_src" value="http://www.k-int.com/collection_ico/sif.gif" /> + </Repository> + + <Repository repository_dn="198.102.62.179:6668/Browse_Metadata" name="Geography Network" type="Z3950" can_multiplex_sessions="no" > + <RepositoryProperty name="ServiceHost" value="clearinghouse2.esri.com" /> + <RepositoryProperty name="ServicePort" value="6668" /> + <RepositoryProperty name="service_short_name" value="Browse_Metadata" /> + <RepositoryProperty name="default_record_syntax" value="xml" /> + <RepositoryProperty name=... [truncated message content] |
From: <aca...@us...> - 2007-04-05 14:29:58
|
Revision: 370 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=370&view=rev Author: acarboni Date: 2007-04-05 07:29:59 -0700 (Thu, 05 Apr 2007) Log Message: ----------- Now it is possible to remove groups and categories when they have fkey relationships. Affected metadata are reindexed Modified Paths: -------------- trunk/src/org/fao/geonet/services/category/Remove.java trunk/src/org/fao/geonet/services/group/Remove.java trunk/web/xsl/category-list.xsl trunk/web/xsl/group-list.xsl Modified: trunk/src/org/fao/geonet/services/category/Remove.java =================================================================== --- trunk/src/org/fao/geonet/services/category/Remove.java 2007-04-05 12:32:13 UTC (rev 369) +++ trunk/src/org/fao/geonet/services/category/Remove.java 2007-04-05 14:29:59 UTC (rev 370) @@ -29,8 +29,10 @@ import jeeves.server.ServiceConfig; import jeeves.server.context.ServiceContext; import jeeves.utils.Util; +import org.fao.geonet.GeonetContext; import org.fao.geonet.constants.Geonet; import org.fao.geonet.constants.Params; +import org.fao.geonet.kernel.DataManager; import org.jdom.Element; //============================================================================= @@ -54,11 +56,27 @@ Dbms dbms = (Dbms) context.getResourceManager().open (Geonet.Res.MAIN_DB); - dbms.execute ("DELETE FROM CategoriesDes WHERE idDes=" + id); - dbms.execute ("DELETE FROM Categories WHERE id=" + id); + String query = "SELECT metadataId FROM MetadataCateg WHERE categoryId="+id; - // FIXME: should reindex metadata belonging to the category + java.util.List reindex = dbms.select(query).getChildren(); + dbms.execute ("DELETE FROM MetadataCateg WHERE categoryId=" + id); + dbms.execute ("DELETE FROM CategoriesDes WHERE idDes=" + id); + dbms.execute ("DELETE FROM Categories WHERE id=" + id); + + //--- reindex affected metadata + + GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); + DataManager dm = gc.getDataManager(); + + for (Object o : reindex) + { + Element md = (Element) o; + String mdId = md.getChildText("metadataid"); + + dm.indexMetadata(dbms, mdId); + } + return new Element(Jeeves.Elem.RESPONSE) .addContent(new Element(Jeeves.Elem.OPERATION).setText(Jeeves.Text.REMOVED)); } Modified: trunk/src/org/fao/geonet/services/group/Remove.java =================================================================== --- trunk/src/org/fao/geonet/services/group/Remove.java 2007-04-05 12:32:13 UTC (rev 369) +++ trunk/src/org/fao/geonet/services/group/Remove.java 2007-04-05 14:29:59 UTC (rev 370) @@ -29,8 +29,10 @@ import jeeves.server.ServiceConfig; import jeeves.server.context.ServiceContext; import jeeves.utils.Util; +import org.fao.geonet.GeonetContext; import org.fao.geonet.constants.Geonet; import org.fao.geonet.constants.Params; +import org.fao.geonet.kernel.DataManager; import org.jdom.Element; //============================================================================= @@ -55,11 +57,28 @@ Dbms dbms = (Dbms) context.getResourceManager().open (Geonet.Res.MAIN_DB); - dbms.execute ("DELETE FROM GroupsDes WHERE idDes=" + id); - dbms.execute ("DELETE FROM Groups WHERE id=" + id); + String query = "SELECT DISTINCT metadataId FROM OperationAllowed WHERE groupId="+id; - // FIXME: should reindex metadata belonging to the group + java.util.List reindex = dbms.select(query).getChildren(); + dbms.execute("DELETE FROM OperationAllowed WHERE groupId="+ id); + dbms.execute("DELETE FROM UserGroups WHERE groupId="+ id); + dbms.execute("DELETE FROM GroupsDes WHERE idDes=" + id); + dbms.execute("DELETE FROM Groups WHERE id=" + id); + + //--- reindex affected metadata + + GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); + DataManager dm = gc.getDataManager(); + + for (Object o : reindex) + { + Element md = (Element) o; + String mdId = md.getChildText("metadataid"); + + dm.indexMetadata(dbms, mdId); + } + return new Element(Jeeves.Elem.RESPONSE) .addContent(new Element(Jeeves.Elem.OPERATION).setText(Jeeves.Text.REMOVED)); } Modified: trunk/web/xsl/category-list.xsl =================================================================== --- trunk/web/xsl/category-list.xsl 2007-04-05 12:32:13 UTC (rev 369) +++ trunk/web/xsl/category-list.xsl 2007-04-05 14:29:59 UTC (rev 370) @@ -8,19 +8,10 @@ --> <xsl:template mode="script" match="/"> <script type="text/javascript" language="JavaScript"> - function edit(a) + function delete1(url) { - document.categoryEditForm.id.value=a; - document.categoryEditForm.submit(); - } - - function delete1(b) - { if(confirm("Delete the category ?")) - { - document.categoryDeleteForm.id.value=b; - document.categoryDeleteForm.submit(); - } + load(url); } </script> </xsl:template> @@ -57,7 +48,7 @@ <td class="padded"> <button class="content" onclick="load('{/root/gui/locService}/category.get?id={id}')"><xsl:value-of select="/root/gui/strings/edit"/></button>   - <button class="content" onclick="load('{/root/gui/locService}/category.remove?id={id}')"><xsl:value-of select="/root/gui/strings/delete"/></button> + <button class="content" onclick="delete1('{/root/gui/locService}/category.remove?id={id}')"><xsl:value-of select="/root/gui/strings/delete"/></button> </td> </tr> </xsl:for-each> Modified: trunk/web/xsl/group-list.xsl =================================================================== --- trunk/web/xsl/group-list.xsl 2007-04-05 12:32:13 UTC (rev 369) +++ trunk/web/xsl/group-list.xsl 2007-04-05 14:29:59 UTC (rev 370) @@ -8,19 +8,10 @@ --> <xsl:template mode="script" match="/"> <script type="text/javascript" language="JavaScript"> - function edit(a) + function delete1(url) { - document.groupEditForm.id.value=a; - document.groupEditForm.submit(); - } - - function delete1(b) - { if(confirm("Delete the group ?")) - { - document.groupDeleteForm.id.value=b; - document.groupDeleteForm.submit(); - } + load(url); } </script> </xsl:template> @@ -61,7 +52,7 @@ <td class="padded"> <button class="content" onclick="load('{/root/gui/locService}/group.get?id={id}')"><xsl:value-of select="/root/gui/strings/edit"/></button>   - <button class="content" onclick="load('{/root/gui/locService}/group.remove?id={id}')"><xsl:value-of select="/root/gui/strings/delete"/></button> + <button class="content" onclick="delete1('{/root/gui/locService}/group.remove?id={id}')"><xsl:value-of select="/root/gui/strings/delete"/></button> </td> </tr> </xsl:for-each> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-04-05 16:04:28
|
Revision: 371 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=371&view=rev Author: acarboni Date: 2007-04-05 09:04:25 -0700 (Thu, 05 Apr 2007) Log Message: ----------- Added alert if no group is selected, showed mandatory fields Modified Paths: -------------- trunk/src/org/fao/geonet/services/user/Update.java trunk/web/xsl/user-update.xsl Modified: trunk/src/org/fao/geonet/services/user/Update.java =================================================================== --- trunk/src/org/fao/geonet/services/user/Update.java 2007-04-05 14:29:59 UTC (rev 370) +++ trunk/src/org/fao/geonet/services/user/Update.java 2007-04-05 16:04:25 UTC (rev 371) @@ -61,8 +61,8 @@ String id = params.getChildText(Params.ID); String username = Util.getParam(params, Params.USERNAME); String password = Util.getParam(params, Params.PASSWORD); - String surname = Util.getParam(params, Params.SURNAME); - String name = Util.getParam(params, Params.NAME); + String surname = Util.getParam(params, Params.SURNAME, ""); + String name = Util.getParam(params, Params.NAME, ""); String profile = Util.getParam(params, Params.PROFILE); String address = Util.getParam(params, Params.ADDRESS, ""); String state = Util.getParam(params, Params.STATE, ""); Modified: trunk/web/xsl/user-update.xsl =================================================================== --- trunk/web/xsl/user-update.xsl 2007-04-05 14:29:59 UTC (rev 370) +++ trunk/web/xsl/user-update.xsl 2007-04-05 16:04:25 UTC (rev 371) @@ -14,12 +14,12 @@ var invalid = " "; // Invalid character is a space var minLength = 6; // Minimum length - if (document.userupdateform.username.value.length < 1 || document.userupdateform.surname.value.length < 1 || - document.userupdateform.name.value.length < 1 || document.userupdateform.profile.value.length < 1 ) + if (document.userupdateform.username.value.length == 0) { - alert('All fields are mandatory and must be filled in. Please try again.'); + alert('The username field is mandatory.'); return; } + var pw1 = document.userupdateform.password.value; var pw2 = document.userupdateform.password2.value; @@ -47,6 +47,14 @@ alert ("You did not enter the same new password twice. Please re-enter your password."); return; } + + // check at least one group selected + if ($F('groups') == '') + { + alert('Please, select at least one group'); + return; + } + // all ok, proceed document.userupdateform.submit(); }//update @@ -100,15 +108,15 @@ </xsl:if> <table> <tr> - <th class="padded"><xsl:value-of select="/root/gui/strings/username"/></th> + <th class="padded"><xsl:value-of select="/root/gui/strings/username"/> (*)</th> <td class="padded"><input class="content" type="text" name="username" value="{/root/response/record/username}"/></td> </tr> <tr> - <th class="padded"><xsl:value-of select="/root/gui/strings/password"/></th> + <th class="padded"><xsl:value-of select="/root/gui/strings/password"/> (*)</th> <td class="padded"><input class="content" type="password" name="password" value="{/root/response/record/password}"/></td> </tr> <tr> - <th class="padded"><xsl:value-of select="/root/gui/strings/confirmPassword"/></th> + <th class="padded"><xsl:value-of select="/root/gui/strings/confirmPassword"/> (*)</th> <td class="padded"><input class="content" type="password" name="password2" value="{/root/response/record/password}"/></td> </tr> <tr> @@ -229,7 +237,7 @@ <tr id="group.list"> <th class="padded"><xsl:value-of select="/root/gui/strings/groups"/></th> <td class="padded"> - <select class="content" size="7" name="groups" multiple=""> + <select class="content" size="7" name="groups" multiple="" id="groups"> <xsl:for-each select="/root/gui/groups/record"> <option value="{id}"> <xsl:variable name="aGroup" select="id"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-04-11 12:11:56
|
Revision: 376 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=376&view=rev Author: acarboni Date: 2007-04-11 05:11:57 -0700 (Wed, 11 Apr 2007) Log Message: ----------- Changed group's combobox to a list Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/DataManager.java trunk/src/org/fao/geonet/services/metadata/Create.java trunk/web/xsl/metadata-create.xsl trunk/web/xsl/metadata-duplicate.xsl Modified: trunk/src/org/fao/geonet/kernel/DataManager.java =================================================================== --- trunk/src/org/fao/geonet/kernel/DataManager.java 2007-04-10 12:27:57 UTC (rev 375) +++ trunk/src/org/fao/geonet/kernel/DataManager.java 2007-04-11 12:11:57 UTC (rev 376) @@ -357,7 +357,7 @@ /** Create a new metadata duplicating an existing template */ - public String createMetadata(Dbms dbms, String templateId, String groupId, + public String createMetadata(Dbms dbms, String templateId, Set<String> groups, SerialFactory sf, String source) throws Exception { String query = "SELECT schemaId, data FROM Metadata WHERE id="+ templateId; @@ -382,7 +382,8 @@ String id = XmlSerializer.insert(dbms, schema, xml, serial, source, uuid); - copyDefaultPrivForGroup(dbms, id, groupId); + for (String groupId : groups) + copyDefaultPrivForGroup(dbms, id, groupId); //--- store metadata categories copying them from the template Modified: trunk/src/org/fao/geonet/services/metadata/Create.java =================================================================== --- trunk/src/org/fao/geonet/services/metadata/Create.java 2007-04-10 12:27:57 UTC (rev 375) +++ trunk/src/org/fao/geonet/services/metadata/Create.java 2007-04-11 12:11:57 UTC (rev 376) @@ -23,11 +23,11 @@ package org.fao.geonet.services.metadata; +import java.util.HashSet; import jeeves.constants.Jeeves; import jeeves.interfaces.Service; import jeeves.resources.dbms.Dbms; import jeeves.server.ServiceConfig; -import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import jeeves.utils.Util; import org.fao.geonet.GeonetContext; @@ -56,15 +56,22 @@ GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); String template = Util.getParam(params, Params.ID); - String group = Util.getParam(params, Params.GROUP); + HashSet<String> groups = new HashSet<String>(); + + for (Object g : params.getChildren(Params.GROUP)) + { + Element group = (Element) g; + groups.add(group.getText()); + } + //--- query the data manager Dbms dbms = (Dbms) context.getResourceManager().open(Geonet.Res.MAIN_DB); DataManager dm = gc.getDataManager(); - String mdId = dm.createMetadata(dbms, template, group, context.getSerialFactory(), gc.getSiteId()); + String mdId = dm.createMetadata(dbms, template, groups, context.getSerialFactory(), gc.getSiteId()); return new Element(Jeeves.Elem.RESPONSE) .addContent(new Element(Geonet.Elem.ID).setText(mdId)); Modified: trunk/web/xsl/metadata-create.xsl =================================================================== --- trunk/web/xsl/metadata-create.xsl 2007-04-10 12:27:57 UTC (rev 375) +++ trunk/web/xsl/metadata-create.xsl 2007-04-11 12:11:57 UTC (rev 376) @@ -42,9 +42,9 @@ <xsl:variable name="lang" select="/root/gui/language"/> <tr> - <th class="padded"><xsl:value-of select="/root/gui/strings/group"/></th> + <th class="padded"><xsl:value-of select="/root/gui/strings/groups"/></th> <td class="padded"> - <select class="content" name="group" size="1"> + <select class="content" name="group" size="10" multiple=""> <xsl:for-each select="/root/gui/groups/record"> <option value="{id}"> <xsl:value-of select="label/child::*[name() = $lang]"/> Modified: trunk/web/xsl/metadata-duplicate.xsl =================================================================== --- trunk/web/xsl/metadata-duplicate.xsl 2007-04-10 12:27:57 UTC (rev 375) +++ trunk/web/xsl/metadata-duplicate.xsl 2007-04-11 12:11:57 UTC (rev 376) @@ -30,9 +30,9 @@ </td> </tr> <tr> - <th class="padded"><xsl:value-of select="/root/gui/strings/group"/></th> + <th class="padded"><xsl:value-of select="/root/gui/strings/groups"/></th> <td class="padded"> - <select class="content" name="group" size="1"> + <select class="content" size="7" name="group" multiple=""> <xsl:for-each select="/root/gui/groups/record"> <option value="{id}"> <xsl:value-of select="name"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-04-12 13:27:19
|
Revision: 378 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=378&view=rev Author: acarboni Date: 2007-04-12 06:27:09 -0700 (Thu, 12 Apr 2007) Log Message: ----------- Changed language to a char 3 code. Added a dropdown to choose from. Updated migration stylesheets from 19115 -> 19139 Modified Paths: -------------- trunk/gast/setup/database.druid trunk/gast/setup/sample-data/iso-19139.mef trunk/gast/setup/sql/create-db-mckoi.sql trunk/gast/setup/sql/create-db-mysql.sql trunk/gast/setup/sql/create-db-oracle.sql trunk/gast/setup/sql/create-db-postgres.sql trunk/gast/setup/templates/iso19139/metadata.xml trunk/web/WEB-INF/config-metadata.xml trunk/web/WEB-INF/config.xml trunk/web/xsl/metadata-iso19139.xsl Added Paths: ----------- trunk/src/org/fao/geonet/apps/MakeISO.java trunk/src/org/fao/geonet/guiservices/isolanguages/ trunk/src/org/fao/geonet/guiservices/isolanguages/Get.java Modified: trunk/gast/setup/database.druid =================================================================== --- trunk/gast/setup/database.druid 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/database.druid 2007-04-12 13:27:09 UTC (rev 378) @@ -2,8 +2,8 @@ <project version="2"> <attribs> - <attrib name="build">130</attrib> - <attrib name="serial">62093</attrib> + <attrib name="build">131</attrib> + <attrib name="serial">62683</attrib> </attribs> <database> <attribs> @@ -139,9 +139,6 @@ </list> </sqlMapping> </oraSql> - <mckoiSql> - <output>/my/work/fao/geonetwork/cvs/geonetwork/trunk/gast/setup/sql/create-db-mckoi.sql</output> - </mckoiSql> <pgSql> <output>/my/work/fao/geonetwork/cvs/geonetwork/trunk/gast/setup/sql/create-db-postgres.sql</output> <sqlMapping type="l"> @@ -157,6 +154,9 @@ </list> </sqlMapping> </pgSql> + <mckoiSql> + <output>/my/work/fao/geonetwork/cvs/geonetwork/trunk/gast/setup/sql/create-db-mckoi.sql</output> + </mckoiSql> </SqlGenModule> </modsConfig> <modsUsage> @@ -580,6 +580,27 @@ </list> </domain> </alias> + <alias> + <attribs> + <attrib name="name">ISO639-2Code</attrib> + <attrib name="ddEquiv"/> + <attrib name="id">62540</attrib> + <attrib name="size">3</attrib> + </attribs> + <domain> + <attribs> + <attrib name="minValue"/> + <attrib name="outRange">false</attrib> + <attrib name="maxValue"/> + <attrib name="type">none</attrib> + </attribs> + <list> + <header> + <elem>value</elem> + </header> + </list> + </domain> + </alias> </aliases> </type> </varFolder> @@ -882,42 +903,42 @@ </idx> <ts>0</ts> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> @@ -1601,42 +1622,42 @@ </list> </idx> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> @@ -1776,42 +1797,42 @@ </idx> <ts>0</ts> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> @@ -2003,42 +2024,42 @@ </list> </idx> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> @@ -2266,7 +2287,86 @@ <attrib name="tempOther"/> <attrib name="sqlCommands"/> </attribs> - <modsConfig/> + <modsConfig> + <SqlGenModule> + <stdSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </stdSql> + <oraSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="i">ts</elem> + <elem type="b">bitmap</elem> + <elem type="b">stats</elem> + <elem type="b">noSort</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>0</elem> + <elem>false</elem> + <elem>false</elem> + <elem>false</elem> + </row> + </list> + </idx> + </oraSql> + <pgSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>default</elem> + <elem/> + </row> + </list> + </idx> + </pgSql> + <mckoiSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </mckoiSql> + </SqlGenModule> + </modsConfig> <field> <fieldAttribs> <attribs> @@ -2629,42 +2729,42 @@ </idx> <ts>0</ts> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> @@ -2737,6 +2837,329 @@ <modsConfig/> </field> </table> + <table> + <vars> + <list> + <header> + <elem>name</elem> + <elem>type</elem> + <elem>value</elem> + <elem>descr</elem> + </header> + </list> + </vars> + <triggers/> + <rules/> + <attribs> + <attrib name="comment"/> + <attrib name="name">IsoLanguages</attrib> + <attrib name="id">62094</attrib> + <attrib name="schema"/> + <attrib name="tempPK"/> + <attrib name="tempFK"/> + <attrib name="tempOther"/> + <attrib name="sqlCommands"/> + </attribs> + <modsConfig> + <SqlGenModule> + <stdSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </stdSql> + <oraSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="i">ts</elem> + <elem type="b">bitmap</elem> + <elem type="b">stats</elem> + <elem type="b">noSort</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>0</elem> + <elem>false</elem> + <elem>false</elem> + <elem>false</elem> + </row> + </list> + </idx> + </oraSql> + <pgSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>default</elem> + <elem/> + </row> + </list> + </idx> + </pgSql> + <mckoiSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </mckoiSql> + </SqlGenModule> + </modsConfig> + <field> + <fieldAttribs> + <attribs> + <attrib name="54374"/> + <attrib name="61528">false</attrib> + <attrib name="17">false</attrib> + <attrib name="15">true</attrib> + <attrib name="340">false</attrib> + </attribs> + </fieldAttribs> + <attribs> + <attrib name="comment"/> + <attrib name="matchType">s</attrib> + <attrib name="refField">0</attrib> + <attrib name="name">id</attrib> + <attrib name="id">62105</attrib> + <attrib name="onDelete">n</attrib> + <attrib name="onUpdate">n</attrib> + <attrib name="refTable">0</attrib> + <attrib name="type">8</attrib> + </attribs> + <modsConfig/> + </field> + <field> + <fieldAttribs> + <attribs> + <attrib name="54374"/> + <attrib name="61528">false</attrib> + <attrib name="17">true</attrib> + <attrib name="15">false</attrib> + <attrib name="340">true</attrib> + </attribs> + </fieldAttribs> + <attribs> + <attrib name="comment"/> + <attrib name="matchType">s</attrib> + <attrib name="refField">0</attrib> + <attrib name="name">code</attrib> + <attrib name="id">62539</attrib> + <attrib name="onDelete">n</attrib> + <attrib name="onUpdate">n</attrib> + <attrib name="refTable">0</attrib> + <attrib name="type">62540</attrib> + </attribs> + <modsConfig/> + </field> + </table> + <table> + <vars> + <list> + <header> + <elem>name</elem> + <elem>type</elem> + <elem>value</elem> + <elem>descr</elem> + </header> + </list> + </vars> + <triggers/> + <rules/> + <attribs> + <attrib name="comment"/> + <attrib name="name">IsoLanguagesDes</attrib> + <attrib name="id">62106</attrib> + <attrib name="schema"/> + <attrib name="tempPK"/> + <attrib name="tempFK"/> + <attrib name="tempOther"/> + <attrib name="sqlCommands"/> + </attribs> + <modsConfig> + <SqlGenModule> + <stdSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </stdSql> + <oraSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="i">ts</elem> + <elem type="b">bitmap</elem> + <elem type="b">stats</elem> + <elem type="b">noSort</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>0</elem> + <elem>false</elem> + <elem>false</elem> + <elem>false</elem> + </row> + </list> + </idx> + </oraSql> + <pgSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + <elem>default</elem> + <elem/> + </row> + </list> + </idx> + </pgSql> + <mckoiSql> + <idx type="l"> + <list> + <header> + <elem type="i">id</elem> + <elem type="s">index</elem> + <elem type="s">name</elem> + </header> + <row> + <elem>61528</elem> + <elem>Idx1</elem> + <elem/> + </row> + </list> + </idx> + </mckoiSql> + </SqlGenModule> + </modsConfig> + <field> + <fieldAttribs> + <attribs> + <attrib name="54374"/> + <attrib name="61528">false</attrib> + <attrib name="17">false</attrib> + <attrib name="15">true</attrib> + <attrib name="340">false</attrib> + </attribs> + </fieldAttribs> + <attribs> + <attrib name="comment"/> + <attrib name="name">idDes</attrib> + <attrib name="refField">62105</attrib> + <attrib name="matchType">s</attrib> + <attrib name="id">62112</attrib> + <attrib name="onDelete">n</attrib> + <attrib name="onUpdate">n</attrib> + <attrib name="refTable">62094</attrib> + <attrib name="type">0</attrib> + </attribs> + <modsConfig/> + </field> + <field> + <fieldAttribs> + <attribs> + <attrib name="54374"/> + <attrib name="61528">false</attrib> + <attrib name="17">false</attrib> + <attrib name="15">true</attrib> + <attrib name="340">false</attrib> + </attribs> + </fieldAttribs> + <attribs> + <attrib name="comment"/> + <attrib name="name">langId</attrib> + <attrib name="refField">57906</attrib> + <attrib name="matchType">s</attrib> + <attrib name="id">62392</attrib> + <attrib name="onDelete">n</attrib> + <attrib name="onUpdate">n</attrib> + <attrib name="refTable">57905</attrib> + <attrib name="type">0</attrib> + </attribs> + <modsConfig/> + </field> + <field> + <fieldAttribs> + <attribs> + <attrib name="54374"/> + <attrib name="61528">false</attrib> + <attrib name="17">true</attrib> + <attrib name="15">false</attrib> + <attrib name="340">false</attrib> + </attribs> + </fieldAttribs> + <attribs> + <attrib name="comment"/> + <attrib name="name">label</attrib> + <attrib name="refField">0</attrib> + <attrib name="matchType">s</attrib> + <attrib name="id">62396</attrib> + <attrib name="onDelete">n</attrib> + <attrib name="onUpdate">n</attrib> + <attrib name="refTable">0</attrib> + <attrib name="type">61541</attrib> + </attribs> + <modsConfig/> + </field> + </table> </folder> <folder> <attribs> @@ -2948,42 +3371,42 @@ </list> </idx> </oraSql> - <pgSql> + <mckoiSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> - <elem type="s">access</elem> - <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> - <elem>default</elem> - <elem/> </row> </list> </idx> - </pgSql> - <mckoiSql> + </mckoiSql> + <pgSql> <idx type="l"> <list> <header> <elem type="i">id</elem> <elem type="s">index</elem> <elem type="s">name</elem> + <elem type="s">access</elem> + <elem type="s">where</elem> </header> <row> <elem>61528</elem> <elem>Idx1</elem> <elem/> + <elem>default</elem> + <elem/> </row> </list> </idx> - </mckoiSql> + </pgSql> </SqlGenModule> </modsConfig> <field> Modified: trunk/gast/setup/sample-data/iso-19139.mef =================================================================== (Binary files differ) Modified: trunk/gast/setup/sql/create-db-mckoi.sql =================================================================== --- trunk/gast/setup/sql/create-db-mckoi.sql 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/sql/create-db-mckoi.sql 2007-04-12 13:27:09 UTC (rev 378) @@ -1,7 +1,7 @@ -- ====================================================================== -- === Sql Script for Database : Geonet -- === --- === Build : 129 +-- === Build : 131 -- ====================================================================== CREATE TABLE Metadata @@ -100,6 +100,31 @@ -- ====================================================================== +CREATE TABLE IsoLanguages + ( + id int, + code varchar(3) not null, + + primary key(id), + unique(code) + ); + +-- ====================================================================== + +CREATE TABLE IsoLanguagesDes + ( + idDes int, + langId varchar(5), + label varchar(64) not null, + + primary key(idDes,langId), + + foreign key(idDes) references IsoLanguages(id), + foreign key(langId) references Languages(id) + ); + +-- ====================================================================== + CREATE TABLE Regions ( id int, Modified: trunk/gast/setup/sql/create-db-mysql.sql =================================================================== --- trunk/gast/setup/sql/create-db-mysql.sql 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/sql/create-db-mysql.sql 2007-04-12 13:27:09 UTC (rev 378) @@ -1,7 +1,7 @@ -- ====================================================================== -- === Sql Script for Database : Geonet -- === --- === Build : 129 +-- === Build : 131 -- ====================================================================== CREATE TABLE Metadata @@ -100,6 +100,31 @@ -- ====================================================================== +CREATE TABLE IsoLanguages + ( + id int, + code varchar(3) not null, + + primary key(id), + unique(code) + ); + +-- ====================================================================== + +CREATE TABLE IsoLanguagesDes + ( + idDes int, + langId varchar(5), + label varchar(64) not null, + + primary key(idDes,langId), + + foreign key(idDes) references IsoLanguages(id), + foreign key(langId) references Languages(id) + ); + +-- ====================================================================== + CREATE TABLE Regions ( id int, Modified: trunk/gast/setup/sql/create-db-oracle.sql =================================================================== --- trunk/gast/setup/sql/create-db-oracle.sql 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/sql/create-db-oracle.sql 2007-04-12 13:27:09 UTC (rev 378) @@ -1,7 +1,7 @@ REM ====================================================================== REM === Sql Script for Database : Geonet REM === -REM === Build : 129 +REM === Build : 131 REM ====================================================================== CREATE TABLE Metadata @@ -91,6 +91,28 @@ REM ====================================================================== +CREATE TABLE IsoLanguages + ( + id int, + code varchar(3) not null, + primary key(id), + unique(code) + ); + +REM ====================================================================== + +CREATE TABLE IsoLanguagesDes + ( + idDes int, + langId varchar(5), + label varchar(64) not null, + primary key(idDes,langId), + foreign key(idDes) references IsoLanguages(id), + foreign key(langId) references Languages(id) + ); + +REM ====================================================================== + CREATE TABLE Regions ( id int, Modified: trunk/gast/setup/sql/create-db-postgres.sql =================================================================== --- trunk/gast/setup/sql/create-db-postgres.sql 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/sql/create-db-postgres.sql 2007-04-12 13:27:09 UTC (rev 378) @@ -1,7 +1,7 @@ -- ====================================================================== -- === Sql Script for Database : Geonet -- === --- === Build : 129 +-- === Build : 131 -- ====================================================================== CREATE TABLE Metadata @@ -100,6 +100,31 @@ -- ====================================================================== +CREATE TABLE IsoLanguages + ( + id int, + code varchar(3) not null, + + primary key(id), + unique(code) + ); + +-- ====================================================================== + +CREATE TABLE IsoLanguagesDes + ( + idDes int, + langId varchar(5), + label varchar(64) not null, + + primary key(idDes,langId), + + foreign key(idDes) references IsoLanguages(id), + foreign key(langId) references Languages(id) + ); + +-- ====================================================================== + CREATE TABLE Regions ( id int, Modified: trunk/gast/setup/templates/iso19139/metadata.xml =================================================================== --- trunk/gast/setup/templates/iso19139/metadata.xml 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/gast/setup/templates/iso19139/metadata.xml 2007-04-12 13:27:09 UTC (rev 378) @@ -5,7 +5,7 @@ <gco:CharacterString/> </gmd:fileIdentifier> <gmd:language> - <gco:CharacterString>en</gco:CharacterString> + <gco:CharacterString>eng</gco:CharacterString> </gmd:language> <gmd:characterSet> <gmd:MD_CharacterSetCode codeList="./resources/codeList.xml#MD_CharacterSetCode" codeListValue="utf8" /> @@ -112,7 +112,7 @@ </gmd:MD_Keywords> </gmd:descriptiveKeywords> <gmd:language> - <gco:CharacterString>en</gco:CharacterString> + <gco:CharacterString>eng</gco:CharacterString> </gmd:language> <gmd:characterSet> <gmd:MD_CharacterSetCode codeList="./resources/codeList.xml#MD_CharacterSetCode" codeListValue="utf8" /> Added: trunk/src/org/fao/geonet/apps/MakeISO.java =================================================================== --- trunk/src/org/fao/geonet/apps/MakeISO.java (rev 0) +++ trunk/src/org/fao/geonet/apps/MakeISO.java 2007-04-12 13:27:09 UTC (rev 378) @@ -0,0 +1,137 @@ +//============================================================================== +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.apps; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.util.HashSet; +import jeeves.utils.Xml; +import org.dlib.tools.FullTokenizer; +import org.jdom.Document; +import org.jdom.Element; + +//============================================================================== + +public class MakeISO +{ + public static void main(String args[]) throws Exception + { + // check args + if (args.length != 1) + { + System.err.println("usage: makeISO file"); + System.exit(1); + } + + FileInputStream is = new FileInputStream(new File(args[0])); + FileOutputStream os = new FileOutputStream(new File(args[0]+".sql")); + + BufferedReader ir = new BufferedReader(new InputStreamReader(is)); +// BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(os)); + + String line; + + int id =1; + +// DbmsPool pool = Util.getDbmsPool("../config.xml"); +// Dbms dbms = (Dbms)pool.open(); + + Element root = new Element("mapping"); + + HashSet<String> set = new HashSet<String>(); + + while ((line = ir.readLine()) != null) + { + FullTokenizer ft = new FullTokenizer(line, "|"); + +// String code = ft.nextToken(); +// ft.nextToken(); +// ft.nextToken(); +// String engDes = ft.nextToken().trim(); +// String fraDes = ft.nextToken().trim(); + +// ow.write("INSERT INTO IsoLanguages(id, code) VALUES ("+ id +",\""+ code +"\");\n"); +// ow.write("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES ("+ id +",\"en\", \""+up(engDes)+"\");\n"); +// ow.write("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES ("+ id +",\"es\", \""+up(engDes)+"\");\n"); +// ow.write("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES ("+ id +",\"cn\", \""+up(engDes)+"\");\n"); +// ow.write("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES ("+ id +",\"fr\", \""+up(fraDes)+"\");\n"); +// ow.write("\n"); + +// dbms.execute("INSERT INTO IsoLanguages(id, code) VALUES (?,?)", id, code); +// dbms.execute("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES (?,?,?)", id, "en", up(engDes)); +// dbms.execute("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES (?,?,?)", id, "es", up(engDes)); +// dbms.execute("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES (?,?,?)", id, "cn", up(engDes)); +// dbms.execute("INSERT INTO IsoLanguagesDes(idDes, langId, label) VALUES (?,?,?)", id, "fr", up(fraDes)); +// dbms.commit(); + + String longCode = ft.nextToken(); + ft.nextToken(); + String shortCode = ft.nextToken(); + + if (shortCode.length() == 2) + { + if (set.contains(shortCode)) + System.out.println("Skipped short code : "+shortCode); + else + { + set.add(shortCode); + + Element elem = new Element("map"); + elem.setAttribute("longCode", longCode); + elem.setAttribute("shortCode", shortCode); + root.addContent(elem); + } + } +// id++; + } + + String xml = Xml.getString(new Document(root)); + BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); + ow.write(xml); + +// pool.close(dbms); + ir.close(); + ow.close(); + } + + //------------------------------------------------------------------------------- + + private static String up(String s) + { + char c = s.charAt(0); + + if (Character.isLowerCase(c)) + return Character.toUpperCase(c) + s.substring(1); + + return s; + } +} + +//============================================================================== + Added: trunk/src/org/fao/geonet/guiservices/isolanguages/Get.java =================================================================== --- trunk/src/org/fao/geonet/guiservices/isolanguages/Get.java (rev 0) +++ trunk/src/org/fao/geonet/guiservices/isolanguages/Get.java 2007-04-12 13:27:09 UTC (rev 378) @@ -0,0 +1,62 @@ +//============================================================================= +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.guiservices.isolanguages; + +import jeeves.interfaces.Service; +import jeeves.resources.dbms.Dbms; +import jeeves.server.ServiceConfig; +import jeeves.server.context.ServiceContext; +import org.fao.geonet.constants.Geonet; +import org.fao.geonet.lib.Lib; +import org.jdom.Element; + +//============================================================================= + +public class Get implements Service +{ + public void init(String appPath, ServiceConfig params) throws Exception {} + + //-------------------------------------------------------------------------- + //--- + //--- Service + //--- + //-------------------------------------------------------------------------- + + public Element exec(Element params, ServiceContext context) throws Exception + { + Dbms dbms = (Dbms) context.getResourceManager().open (Geonet.Res.MAIN_DB); + + if (languages == null) + languages = Lib.local.retrieve(dbms, "IsoLanguages"); + + return (Element) languages.clone(); + } + + //-------------------------------------------------------------------------- + + private Element languages; +} + +//============================================================================= + Modified: trunk/web/WEB-INF/config-metadata.xml =================================================================== --- trunk/web/WEB-INF/config-metadata.xml 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/web/WEB-INF/config-metadata.xml 2007-04-12 13:27:09 UTC (rev 378) @@ -22,7 +22,7 @@ <call name="services" class="jeeves.guiservices.services.Get"/> <call name="currTab" class=".guiservices.util.GetCurrentMDTab"/> <call name="sources" class=".guiservices.util.Sources"/> - <xml name="isoLang" file="xml/iso-languages.xml" /> + <call name="isoLang" class=".guiservices.isolanguages.Get"/> </output> <error id="operation-not-allowed" sheet="error.xsl"> @@ -39,12 +39,12 @@ <call name="currTab" class =".guiservices.util.GetCurrentMDTab"/> <call name="groups" class =".guiservices.groups.GetMine"/> <call name="regions" class =".guiservices.regions.Get"/> - <call name="sources" class=".guiservices.util.Sources"/> + <call name="sources" class =".guiservices.util.Sources"/> + <call name="isoLang" class =".guiservices.isolanguages.Get"/> <call name="subtemplates" class ="jeeves.services.db.Select"> <param name="db" value="main-db"/> <param name="query" value="SELECT id, schemaId, root, title FROM Metadata WHERE isTemplate='s' ORDER BY root, title"/> </call> - <xml name="isoLang" file ="xml/iso-languages.xml" /> </output> </service> Modified: trunk/web/WEB-INF/config.xml =================================================================== --- trunk/web/WEB-INF/config.xml 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/web/WEB-INF/config.xml 2007-04-12 13:27:09 UTC (rev 378) @@ -172,10 +172,10 @@ <output sheet="search-results.xsl"> <call name="searchDefaults" class=".guiservices.search.GetDefaults" /> - <call name="groups" class=".guiservices.groups.GetMine" /> - <call name="sources" class=".guiservices.util.Sources" /> - <call name="services" class="jeeves.guiservices.services.Get" /> - <xml name="repositories" file="xml/repositories.xml" localized="false" /> + <call name="groups" class=".guiservices.groups.GetMine" /> + <call name="sources" class=".guiservices.util.Sources" /> + <call name="services" class="jeeves.guiservices.services.Get" /> + <xml name="repositories" file ="xml/repositories.xml" localized="false" /> </output> </service> @@ -187,10 +187,9 @@ </class> <output sheet="remote-show.xsl"> - <call name="services" class="jeeves.guiservices.services.Get" /> - <call name="currTab" class=".guiservices.util.GetCurrentMDTab" /> - <xml name="isoLang" file="xml/iso-languages.xml" /> - <xml name="repositories" file="xml/repositories.xml" localized="false" /> + <call name="services" class="jeeves.guiservices.services.Get" /> + <call name="currTab" class=".guiservices.util.GetCurrentMDTab" /> + <xml name="repositories" file ="xml/repositories.xml" localized="false" /> </output> </service> Modified: trunk/web/xsl/metadata-iso19139.xsl =================================================================== --- trunk/web/xsl/metadata-iso19139.xsl 2007-04-11 16:34:56 UTC (rev 377) +++ trunk/web/xsl/metadata-iso19139.xsl 2007-04-12 13:27:09 UTC (rev 378) @@ -9,9 +9,10 @@ <xsl:variable name="codelists" select="document('../xml/schemas/iso19139/schema/resources/Codelist/gmxCodelists.xml')"/> - <!-- - default: in simple mode just a flat list - --> + <!-- ============================================================================= --> + <!-- default: in simple mode just a flat list --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="*|@*"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -44,9 +45,10 @@ </xsl:template> - <!-- - these elements should be boxed - --> + <!-- ============================================================================= --> + <!-- these elements should be boxed --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:contact|gmd:identificationInfo|gmd:distributionInfo|gmd:graphicOverview|gmd:descriptiveKeywords|gmd:spatialRepresentationInfo|gmd:pointOfContact|gmd:dataQualityInfo|gmd:referenceSystemInfo|gmd:equivalentScale|gmd:projection|gmd:ellipsoid|gmd:extent|gmd:geographicBox|gmd:MD_Distributor"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -57,9 +59,10 @@ </xsl:apply-templates> </xsl:template> - <!-- - some gco: elements - --> + <!-- ============================================================================= --> + <!-- some gco: elements --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:*[gco:CharacterString|gco:Date|gco:DateTime|gco:Integer|gco:Decimal|gco:Boolean]"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -70,6 +73,8 @@ </xsl:call-template> </xsl:template> + <!-- ============================================================================= --> + <xsl:template name="iso19139String"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -107,9 +112,10 @@ </xsl:apply-templates> </xsl:template> - <!-- - codelists - --> + <!-- ============================================================================= --> + <!-- codelists --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:*[*/@codeList]"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -120,6 +126,8 @@ </xsl:call-template> </xsl:template> + <!-- ============================================================================= --> + <xsl:template name="iso19139Codelist"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -136,6 +144,8 @@ </xsl:apply-templates> </xsl:template> + <!-- ============================================================================= --> + <xsl:template mode="iso19139GetAttributeText" match="@*"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -179,6 +189,7 @@ --> </xsl:template> + <!-- ============================================================================= --> <!-- make the following fields always not editable: dateStamp @@ -187,6 +198,8 @@ fileIdentifier characterSet --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:dateStamp|gmd:metadataStandardName|gmd:metadataStandardVersion|gmd:fileIdentifier" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -207,9 +220,10 @@ </xsl:call-template> </xsl:template> - <!-- - electronicMailAddress - --> + <!-- ============================================================================= --> + <!-- electronicMailAddress --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:electronicMailAddress" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -232,9 +246,10 @@ </xsl:choose> </xsl:template> - <!-- - descriptiveKeywords - --> + <!-- ============================================================================= --> + <!-- descriptiveKeywords --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:descriptiveKeywords"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -266,9 +281,10 @@ </xsl:choose> </xsl:template> - <!-- - place keyword; only called in edit mode (see descriptiveKeywords template) - --> + <!-- ============================================================================= --> + <!-- place keyword; only called in edit mode (see descriptiveKeywords template) --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:keyword[following-sibling::gmd:type/gmd:MD_KeywordTypeCode/@codeListValue='place']"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -303,9 +319,10 @@ </xsl:apply-templates> </xsl:template> - <!-- - EX_GeographicBoundingBox - --> + <!-- ============================================================================= --> + <!-- EX_GeographicBoundingBox --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:EX_GeographicBoundingBox" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -375,6 +392,8 @@ </xsl:choose> </xsl:template> + <!-- ============================================================================= --> + <xsl:template mode="iso19139GeoBox" match="*"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -435,6 +454,8 @@ </table> </xsl:template> + <!-- ============================================================================= --> + <xsl:template mode="iso19139VertElement" match="*"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -470,9 +491,10 @@ </xsl:call-template> </xsl:template> - <!-- - abstract - --> + <!-- ============================================================================= --> + <!-- abstract --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:abstract" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -484,10 +506,10 @@ </xsl:call-template> </xsl:template> - <!-- - supplementalInformation - purpose - --> + <!-- ============================================================================= --> + <!-- supplementalInformation | purpose --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:supplementalInformation|gmd:purpose" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -499,11 +521,14 @@ </xsl:call-template> </xsl:template> + <!-- ============================================================================= --> <!-- dateTime (format = %Y-%m-%dT%H:%M:00) usageDateTime plannedAvailableDateTime --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:dateTime|gmd:usageDateTime|gmd:plannedAvailableDateTime" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -567,12 +592,15 @@ </xsl:choose> </xsl:template> + <!-- ============================================================================= --> <!-- date (format = %Y-%m-%d) editionDate dateOfNextUpdate mdDateSt is not editable (!we use DateTime instead of only Date!) --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:date[gco:DateTime]|gmd:editionDate|gmd:dateOfNextUpdate" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -635,7 +663,10 @@ </xsl:choose> </xsl:template> + <!-- ============================================================================= --> <!-- subtemplates --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="*[geonet:info/isTemplate='s']" priority="3"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -646,6 +677,7 @@ </xsl:apply-templates> </xsl:template> + <!-- ============================================================================= --> <!-- placeholder <xsl:template mode="iso19139" match="TAG"> @@ -655,10 +687,12 @@ BODY </xsl:template> --> + <!-- ============================================================================= --> - <!-- - Metadata - --> + <!-- ============================================================================= --> + <!-- Metadata --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:MD_Metadata"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -798,6 +832,7 @@ </xsl:choose> </xsl:template> + <!-- ============================================================================= --> <!-- simple mode; ISO order is: - gmd:fileIdentifier @@ -829,6 +864,8 @@ + gmd:featureType + gmd:featureAttribute --> + <!-- ============================================================================= --> + <xsl:template name="iso19139Simple"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -902,6 +939,57 @@ </xsl:template> + <!-- ============================================================================= --> + + <xsl:template mode="iso19139" match="//gmd:language"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <xsl:apply-templates mode="iso19139GetIsoLanguage" select="gco:CharacterString"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:with-param> + </xsl:apply-templates> + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template mode="iso19139GetIsoLanguage" match="*"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="lang" select="/root/gui/language"/> + <xsl:variable name="value" select="string(.)"/> + + <xsl:choose> + <xsl:when test="$edit=true()"> + <select class="md" name="_{geonet:element/@ref}" size="1"> + <option name=""/> + + <xsl:for-each select="/root/gui/isoLang/record"> + <option value="{code}"> + <xsl:if test="code = $value"> + <xsl:attribute name="selected"/> + </xsl:if> + <xsl:value-of select="label/child::*[name() = $lang]"/> + </option> + </xsl:for-each> + </select> + </xsl:when> + + <xsl:otherwise> + <xsl:value-of select="/root/gui/isoLang/record[code=$value]/label/child::*[name() = $lang]"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ============================================================================= --> + <xsl:template name="iso19139Simple2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1023,6 +1111,7 @@ </xsl:template> + <!-- ============================================================================= --> <!-- FIXME rpCntInfo: ISO order is: @@ -1032,6 +1121,8 @@ - rpCntInfo - role --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="mdContact|idPoC"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1088,9 +1179,10 @@ </xsl:template> - <!-- - online resources - --> + <!-- ============================================================================= --> + <!-- online resources --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:CI_OnlineResource" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1121,6 +1213,8 @@ </xsl:choose> </xsl:template> + <!-- ============================================================================= --> + <xsl:template mode="iso19139EditOnlineRes" match="*"> <xsl:param name="schema"/> @@ -1177,9 +1271,10 @@ </xsl:apply-templates> </xsl:template> - <!-- - online resources: WMS get map - --> + <!-- ============================================================================= --> + <!-- online resources: WMS get map --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:CI_OnlineResource[starts-with(gmd:protocol/gco:CharacterString,'OGC:WMS-') and contains(gmd:protocol/gco:CharacterString,'-get-map') and gmd:name]" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1211,9 +1306,10 @@ </xsl:choose> </xsl:template> - <!-- - online resources: WMS get capabilities - --> + <!-- ============================================================================= --> + <!-- online resources: WMS get capabilities --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:CI_OnlineResource[starts-with(gmd:protocol/gco:CharacterString,'OGC:WMS-') and contains(gmd:protocol/gco:CharacterString,'-get-capabilities') and gmd:name]" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1245,9 +1341,10 @@ </xsl:choose> </xsl:template> - <!-- - online resources: ARCIMS - --> + <!-- ============================================================================= --> + <!-- online resources: ARCIMS --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:CI_OnlineResource[starts-with(gmd:protocol/gco:CharacterString,'ESRI:AIMS-') and contains(gmd:protocol/gco:CharacterString,'-get-image') and gmd:name]" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1279,9 +1376,10 @@ </xsl:choose> </xsl:template> - <!-- - online resources: download - --> + <!-- ============================================================================= --> + <!-- online resources: download --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:CI_OnlineResource[starts-with(gmd:protocol/gco:CharacterString,'WWW:DOWNLOAD-') and contains(gmd:protocol/gco:CharacterString,'http--download') and gmd:name]" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1313,9 +1411,10 @@ </xsl:choose> </xsl:template> - <!-- - protocol - --> + <!-- ============================================================================= --> + <!-- protocol --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="gmd:protocol" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1352,10 +1451,10 @@ </xsl:choose> </xsl:template> - <!-- - FIXME - graphOver - --> + <!-- ============================================================================= --> + <!-- FIXME graphOver --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="graphOver"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1367,9 +1466,10 @@ </xsl:if> </xsl:template> - <!-- - FIXME - --> + <!-- ============================================================================= --> + <!-- FIXME --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139EditGraphOver" match="*"> <xsl:param name="schema"/> @@ -1406,10 +1506,10 @@ </xsl:apply-templates> </xsl:template> - <!-- - FIXME - bgFileDesc - --> + <!-- ============================================================================= --> + <!-- FIXME bgFileDesc --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139" match="bgFileDesc"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -1445,9 +1545,10 @@ </xsl:choose> </xsl:template> - <!-- - file upload/download utilities - --> + <!-- ============================================================================= --> + <!-- file upload/download utilities --> + <!-- ============================================================================= --> + <xsl:template mode="iso19139FileUpload" match="*"> <xsl:param name="access" select="'public'"/> @@ -1464,6 +1565,8 @@ </xsl:call-template> </xsl:template> + <!-- ============================================================================= --> + <xsl:template mode="iso19139FileRemove" match="*"> <xsl:param name="access" select="'public'"/> @@ -1578,10 +1681,9 @@ </xsl:template> <!-- ============================================================================= --> - - <!-- - iso19139 complete tab template - --> + <!-- iso19139 complete tab template --> + <!-- ============================================================================= --> + <xsl:template name="iso19139CompleteTab"> <xsl:param name="tabLink"/> @@ -1663,9 +1765,9 @@ </xsl:template> - <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <!-- ============================================================================= --> <!-- utilities --> - <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <!-- ============================================================================= --> <xsl:template mode="iso19139IsEmpty" match="*|@*|text()"> <xsl:choose> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-04-12 13:28:41
|
Revision: 379 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=379&view=rev Author: acarboni Date: 2007-04-12 06:28:39 -0700 (Thu, 12 Apr 2007) Log Message: ----------- Changed language to a char 3 code. Added a dropdown to choose from. Updated migration stylesheets from 19115 -> 19139 Modified Paths: -------------- trunk/web/conversion/iso19115-to-iso19139/content.xsl trunk/web/conversion/iso19115-to-iso19139/identification.xsl trunk/web/conversion/iso19115-to-iso19139/main.xsl Added Paths: ----------- trunk/gast/setup/db/IsoLanguages.ddf trunk/gast/setup/db/IsoLanguagesDes.ddf trunk/web/conversion/iso19115-to-iso19139/iso-mapping.xml Added: trunk/gast/setup/db/IsoLanguages.ddf =================================================================== --- trunk/gast/setup/db/IsoLanguages.ddf (rev 0) +++ trunk/gast/setup/db/IsoLanguages.ddf 2007-04-12 13:28:39 UTC (rev 379) @@ -0,0 +1,495 @@ +#--------------------------------------------------------- +#--- File exported in DDF format on 2007-04-11 18:29:33 +#--- +#--- SELECT id,code FROM APP.IsoLanguages +#--------------------------------------------------------- + +[FIELDS] +id, INTEGER +code, VARCHAR + +[DATA] +1 aar +2 abk +3 ace +4 ach +5 ada +6 ady +7 afa +8 afh +9 afr +10 ain +11 aka +12 akk +13 alb +14 ale +15 alg +16 alt +17 amh +18 ang +19 anp +20 apa +21 ara +22 arc +23 arg +24 arm +25 arn +26 arp +27 art +28 arw +29 asm +30 ast +31 ath +32 aus +33 ava +34 ave +35 awa +36 aym +37 aze +38 bad +39 bai +40 bak +41 bal +42 bam +43 ban +44 baq +45 bas +46 bat +47 bej +48 bel +49 bem +50 ben +51 ber +52 bho +53 bih +54 bik +55 bin +56 bis +57 bla +58 bnt +59 bos +60 bra +61 bre +62 btk +63 bua +64 bug +65 bul +66 bur +67 byn +68 cad +69 cai +70 car +71 cat +72 cau +73 ceb +74 cel +75 cha +76 chb +77 che +78 chg +79 chi +80 chk +81 chm +82 chn +83 cho +84 chp +85 chr +86 chu +87 chv +88 chy +89 cmc +90 cop +91 cor +92 cos +93 cpe +94 cpf +95 cpp +96 cre +97 crh +98 crp +99 csb +100 cus +101 cze +102 dak +103 dan +104 dar +105 day +106 del +107 den +108 dgr +109 din +110 div +111 doi +112 dra +113 dsb +114 dua +115 dum +116 dut +117 dyu +118 dzo +119 efi +120 egy +121 eka +122 elx +123 eng +124 enm +125 epo +126 est +127 ewe +128 ewo +129 fan +130 fao +131 fat +132 fij +133 fil +134 fin +135 fiu +136 fon +137 fre +138 frm +139 fro +140 frr +141 frs +142 fry +143 ful +144 fur +145 gaa +146 gay +147 gba +148 gem +149 geo +150 ger +151 gez +152 gil +153 gla +154 gle +155 glg +156 glv +157 gmh +158 goh +159 gon +160 gor +161 got +162 grb +163 grc +164 gre +165 grn +166 gsw +167 guj +168 gwi +169 hai +170 hat +171 hau +172 haw +173 heb +174 her +175 hil +176 him +177 hin +178 hit +179 hmn +180 hmo +181 hsb +182 hun +183 hup +184 iba +185 ibo +186 ice +187 ido +188 iii +189 ijo +190 iku +191 ile +192 ilo +193 ina +194 inc +195 ind +196 ine +197 inh +198 ipk +199 ira +200 iro +201 ita +202 jav +203 jbo +204 jpn +205 jpr +206 jrb +207 kaa +208 kab +209 kac +210 kal +211 kam +212 kan +213 kar +214 kas +215 kau +216 kaw +217 kaz +218 kbd +219 kha +220 khi +221 khm +222 kho +223 kik +224 kin +225 kir +226 kmb +227 kok +228 kom +229 kon +230 kor +231 kos +232 kpe +233 krc +234 krl +235 kro +236 kru +237 kua +238 kum +239 kur +240 kut +241 lad +242 lah +243 lam +244 lao +245 lat +246 lav +247 lez +248 lim +249 lin +250 lit +251 lol +252 loz +253 ltz +254 lua +255 lub +256 lug +257 lui +258 lun +259 luo +260 lus +261 mac +262 mad +263 mag +264 mah +265 mai +266 mak +267 mal +268 man +269 mao +270 map +271 mar +272 mas +273 may +274 mdf +275 mdr +276 men +277 mga +278 mic +279 min +280 mis +281 mkh +282 mlg +283 mlt +284 mnc +285 mni +286 mno +287 moh +288 mol +289 mon +290 mos +291 mul +292 mun +293 mus +294 mwl +295 mwr +296 myn +297 myv +298 nah +299 nai +300 nap +301 nau +302 nav +303 nbl +304 nde +305 ndo +306 nds +307 nep +308 new +309 nia +310 nic +311 niu +312 nno +313 nob +314 nog +315 non +316 nor +317 nso +318 nub +319 nwc +320 nya +321 nym +322 nyn +323 nyo +324 nzi +325 oci +326 oji +327 ori +328 orm +329 osa +330 oss +331 ota +332 oto +333 paa +334 pag +335 pal +336 pam +337 pan +338 pap +339 pau +340 peo +341 per +342 phi +343 phn +344 pli +345 pol +346 pon +347 por +348 pra +349 pro +350 pus +351 qaa +352 que +353 raj +354 rap +355 rar +356 roa +357 roh +358 rom +359 rum +360 run +361 rup +362 rus +363 sad +364 sag +365 sah +366 sai +367 sal +368 sam +369 san +370 sas +371 sat +372 scc +373 scn +374 sco +375 scr +376 sel +377 sem +378 sga +379 sgn +380 shn +381 sid +382 sin +383 sio +384 sit +385 sla +386 slo +387 slv +388 sma +389 sme +390 smi +391 smj +392 smn +393 smo +394 sms +395 sna +396 snd +397 snk +398 sog +399 som +400 son +401 sot +402 spa +403 srd +404 srn +405 srr +406 ssa +407 ssw +408 suk +409 sun +410 sus +411 sux +412 swa +413 swe +414 syr +415 tah +416 tai +417 tam +418 tat +419 tel +420 tem +421 ter +422 tet +423 tgk +424 tgl +425 tha +426 tib +427 tig +428 tir +429 tiv +430 tkl +431 tlh +432 tli +433 tmh +434 tog +435 ton +436 tpi +437 tsi +438 tsn +439 tso +440 tuk +441 tum +442 tup +443 tur +444 tut +445 tvl +446 twi +447 tyv +448 udm +449 uga +450 uig +451 ukr +452 umb +453 und +454 urd +455 uzb +456 vai +457 ven +458 vie +459 vol +460 vot +461 wak +462 wal +463 war +464 was +465 wel +466 wen +467 wln +468 wol +469 xal +470 xho +471 yao +472 yap +473 yid +474 yor +475 ypk +476 zap +477 zen +478 zha +479 znd +480 zul +481 zun +482 zxx +483 nqo +484 zza Added: trunk/gast/setup/db/IsoLanguagesDes.ddf =================================================================== --- trunk/gast/setup/db/IsoLanguagesDes.ddf (rev 0) +++ trunk/gast/setup/db/IsoLanguagesDes.ddf 2007-04-12 13:28:39 UTC (rev 379) @@ -0,0 +1,1948 @@ +#--------------------------------------------------------- +#--- File exported in DDF format on 2007-04-11 18:29:41 +#--- +#--- SELECT idDes,langId,label FROM APP.IsoLanguagesDes +#--------------------------------------------------------- + +[FIELDS] +idDes, INTEGER +langId, VARCHAR +label, VARCHAR + +[DATA] +1 en Afar +1 es Afar +1 cn Afar +1 fr Afar +2 en Abkhazian +2 es Abkhazian +2 cn Abkhazian +2 fr Abkhaze +3 en Achinese +3 es Achinese +3 cn Achinese +3 fr Aceh +4 en Acoli +4 es Acoli +4 cn Acoli +4 fr Acoli +5 en Adangme +5 es Adangme +5 cn Adangme +5 fr Adangme +6 en Adyghe; Adygei +6 es Adyghe; Adygei +6 cn Adyghe; Adygei +6 fr Adygh~00E9 +7 en Afro-Asiatic (Other) +7 es Afro-Asiatic (Other) +7 cn Afro-Asiatic (Other) +7 fr Afro-asiatiques, autres langues +8 en Afrihili +8 es Afrihili +8 cn Afrihili +8 fr Afrihili +9 en Afrikaans +9 es Afrikaans +9 cn Afrikaans +9 fr Afrikaans +10 en Ainu +10 es Ainu +10 cn Ainu +10 fr A~00EFnou +11 en Akan +11 es Akan +11 cn Akan +11 fr Akan +12 en Akkadian +12 es Akkadian +12 cn Akkadian +12 fr Akkadien +13 en Albanian +13 es Albanian +13 cn Albanian +13 fr Albanais +14 en Aleut +14 es Aleut +14 cn Aleut +14 fr Al~00E9oute +15 en Algonquian languages +15 es Algonquian languages +15 cn Algonquian languages +15 fr Algonquines, langues +16 en Southern Altai +16 es Southern Altai +16 cn Southern Altai +16 fr Altai du Sud +17 en Amharic +17 es Amharic +17 cn Amharic +17 fr Amharique +18 en English, Old (ca.450-1100) +18 es English, Old (ca.450-1100) +18 cn English, Old (ca.450-1100) +18 fr Anglo-saxon (ca.450-1100) +19 en Angika +19 es Angika +19 cn Angika +19 fr Angika +20 en Apache languages +20 es Apache languages +20 cn Apache languages +20 fr Apache +21 en Arabic +21 es Arabic +21 cn Arabic +21 fr Arabe +22 en Aramaic +22 es Aramaic +22 cn Aramaic +22 fr Aram~00E9en +23 en Aragonese +23 es Aragonese +23 cn Aragonese +23 fr Aragonais +24 en Armenian +24 es Armenian +24 cn Armenian +24 fr Arm~00E9nien +25 en Mapudungun; Mapuche +25 es Mapudungun; Mapuche +25 cn Mapudungun; Mapuche +25 fr Mapudungun; mapuche; mapuce +26 en Arapaho +26 es Arapaho +26 cn Arapaho +26 fr Arapaho +27 en Artificial (Other) +27 es Artificial (Other) +27 cn Artificial (Other) +27 fr Artificielles, autres langues +28 en Arawak +28 es Arawak +28 cn Arawak +28 fr Arawak +29 en Assamese +29 es Assamese +29 cn Assamese +29 fr Assamais +30 en Asturian; Bable +30 es Asturian; Bable +30 cn Asturian; Bable +30 fr Asturien; bable +31 en Athapascan languages +31 es Athapascan languages +31 cn Athapascan languages +31 fr Athapascanes, langues +32 en Australian languages +32 es Australian languages +32 cn Australian languages +32 fr Australiennes, langues +33 en Avaric +33 es Avaric +33 cn Avaric +33 fr Avar +34 en Avestan +34 es Avestan +34 cn Avestan +34 fr Avestique +35 en Awadhi +35 es Awadhi +35 cn Awadhi +35 fr Awadhi +36 en Aymara +36 es Aymara +36 cn Aymara +36 fr Aymara +37 en Azerbaijani +37 es Azerbaijani +37 cn Azerbaijani +37 fr Az~00E9ri +38 en Banda languages +38 es Banda languages +38 cn Banda languages +38 fr Banda, langues +39 en Bamileke languages +39 es Bamileke languages +39 cn Bamileke languages +39 fr Bamil~00E9k~00E9s, langues +40 en Bashkir +40 es Bashkir +40 cn Bashkir +40 fr Bachkir +41 en Baluchi +41 es Baluchi +41 cn Baluchi +41 fr Baloutchi +42 en Bambara +42 es Bambara +42 cn Bambara +42 fr Bambara +43 en Balinese +43 es Balinese +43 cn Balinese +43 fr Balinais +44 en Basque +44 es Basque +44 cn Basque +44 fr Basque +45 en Basa +45 es Basa +45 cn Basa +45 fr Basa +46 en Baltic (Other) +46 es Baltic (Other) +46 cn Baltic (Other) +46 fr Baltiques, autres langues +47 en Beja +47 es Beja +47 cn Beja +47 fr Bedja +48 en Belarusian +48 es Belarusian +48 cn Belarusian +48 fr Bi~00E9lorusse +49 en Bemba +49 es Bemba +49 cn Bemba +49 fr Bemba +50 en Bengali +50 es Bengali +50 cn Bengali +50 fr Bengali +51 en Berber (Other) +51 es Berber (Other) +51 cn Berber (Other) +51 fr Berb~00E8res, autres langues +52 en Bhojpuri +52 es Bhojpuri +52 cn Bhojpuri +52 fr Bhojpuri +53 en Bihari +53 es Bihari +53 cn Bihari +53 fr Bihari +54 en Bikol +54 es Bikol +54 cn Bikol +54 fr Bikol +55 en Bini; Edo +55 es Bini; Edo +55 cn Bini; Edo +55 fr Bini; edo +56 en Bislama +56 es Bislama +56 cn Bislama +56 fr Bichlamar +57 en Siksika +57 es Siksika +57 cn Siksika +57 fr Blackfoot +58 en Bantu (Other) +58 es Bantu (Other) +58 cn Bantu (Other) +58 fr Bantoues, autres langues +59 en Bosnian +59 es Bosnian +59 cn Bosnian +59 fr Bosniaque +60 en Braj +60 es Braj +60 cn Braj +60 fr Braj +61 en Breton +61 es Breton +61 cn Breton +61 fr Breton +62 en Batak languages +62 es Batak languages +62 cn Batak languages +62 fr Batak, langues +63 en Buriat +63 es Buriat +63 cn Buriat +63 fr Bouriate +64 en Buginese +64 es Buginese +64 cn Buginese +64 fr Bugi +65 en Bulgarian +65 es Bulgarian +65 cn Bulgarian +65 fr Bulgare +66 en Burmese +66 es Burmese +66 cn Burmese +66 fr Birman +67 en Blin; Bilin +67 es Blin; Bilin +67 cn Blin; Bilin +67 fr Blin; bilen +68 en Caddo +68 es Caddo +68 cn Caddo +68 fr Caddo +69 en Central American Indian (Other) +69 es Central American Indian (Other) +69 cn Central American Indian (Other) +69 fr Indiennes d'Am~00E9rique centrale, autres langues +70 en Galibi Carib +70 es Galibi Carib +70 cn Galibi Carib +70 fr Karib; galibi; carib +71 en Catalan; Valencian +71 es Catalan; Valencian +71 cn Catalan; Valencian +71 fr Catalan; valencien +72 en Caucasian (Other) +72 es Caucasian (Other) +72 cn Caucasian (Other) +72 fr Caucasiennes, autres langues +73 en Cebuano +73 es Cebuano +73 cn Cebuano +73 fr Cebuano +74 en Celtic (Other) +74 es Celtic (Other) +74 cn Celtic (Other) +74 fr Celtiques, autres langues +75 en Chamorro +75 es Chamorro +75 cn Chamorro +75 fr Chamorro +76 en Chibcha +76 es Chibcha +76 cn Chibcha +76 fr Chibcha +77 en Chechen +77 es Chechen +77 cn Chechen +77 fr Tch~00E9tch~00E8ne +78 en Chagatai +78 es Chagatai +78 cn Chagatai +78 fr Djaghata~00EF +79 en Chinese +79 es Chinese +79 cn Chinese +79 fr Chinois +80 en Chuukese +80 es Chuukese +80 cn Chuukese +80 fr Chuuk +81 en Mari +81 es Mari +81 cn Mari +81 fr Mari +82 en Chinook jargon +82 es Chinook jargon +82 cn Chinook jargon +82 fr Chinook, jargon +83 en Choctaw +83 es Choctaw +83 cn Choctaw +83 fr Choctaw +84 en Chipewyan +84 es Chipewyan +84 cn Chipewyan +84 fr Chipewyan +85 en Cherokee +85 es Cherokee +85 cn Cherokee +85 fr Cherokee +86 en Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic +86 es Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic +86 cn Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic +86 fr Slavon d'~00E9glise; vieux slave; slavon liturgique; vieux bulgare +87 en Chuvash +87 es Chuvash +87 cn Chuvash +87 fr Tchouvache +88 en Cheyenne +88 es Cheyenne +88 cn Cheyenne +88 fr Cheyenne +89 en Chamic languages +89 es Chamic languages +89 cn Chamic languages +89 fr Chames, langues +90 en Coptic +90 es Coptic +90 cn Coptic +90 fr Copte +91 en Cornish +91 es Cornish +91 cn Cornish +91 fr Cornique +92 en Corsican +92 es Corsican +92 cn Corsican +92 fr Corse +93 en Creoles and pidgins, English based (Other) +93 es Creoles and pidgins, English based (Other) +93 cn Creoles and pidgins, English based (Other) +93 fr Cr~00E9oles et pidgins anglais, autres +94 en Creoles and pidgins, French-based (Other) +94 es Creoles and pidgins, French-based (Other) +94 cn Creoles and pidgins, French-based (Other) +94 fr Cr~00E9oles et pidgins fran~00E7ais, autres +95 en Creoles and pidgins, Portuguese-based (Other) +95 es Creoles and pidgins, Portuguese-based (Other) +95 cn Creoles and pidgins, Portuguese-based (Other) +95 fr Cr~00E9oles et pidgins portugais, autres +96 en Cree +96 es Cree +96 cn Cree +96 fr Cree +97 en Crimean Tatar; Crimean Turkish +97 es Crimean Tatar; Crimean Turkish +97 cn Crimean Tatar; Crimean Turkish +97 fr Tatar de Crim~00E9 +98 en Creoles and pidgins (Other) +98 es Creoles and pidgins (Other) +98 cn Creoles and pidgins (Other) +98 fr Cr~00E9oles et pidgins divers +99 en Kashubian +99 es Kashubian +99 cn Kashubian +99 fr Kachoube +100 en Cushitic (Other) +100 es Cushitic (Other) +100 cn Cushitic (Other) +100 fr Couchitiques, autres langues +101 en Czech +101 es Czech +101 cn Czech +101 fr Tch~00E8que +102 en Dakota +102 es Dakota +102 cn Dakota +102 fr Dakota +103 en Danish +103 es Danish +103 cn Danish +103 fr Danois +104 en Dargwa +104 es Dargwa +104 cn Dargwa +104 fr Dargwa +105 en Land Dayak languages +105 es Land Dayak languages +105 cn Land Dayak languages +105 fr Dayak, langues +106 en Delaware +106 es Delaware +106 cn Delaware +106 fr Delaware +107 en Slave (Athapascan) +107 es Slave (Athapascan) +107 cn Slave (Athapascan) +107 fr Esclave (athapascan) +108 en Dogrib +108 es Dogrib +108 cn Dogrib +108 fr Dogrib +109 en Dinka +109 es Dinka +109 cn Dinka +109 fr Dinka +110 en Divehi; Dhivehi; Maldivian +110 es Divehi; Dhivehi; Maldivian +110 cn Divehi; Dhivehi; Maldivian +110 fr Maldivien +111 en Dogri +111 es Dogri +111 cn Dogri +111 fr Dogri +112 en Dravidian (Other) +112 es Dravidian (Other) +112 cn Dravidian (Other) +112 fr Dravidiennes, autres langues +113 en Lower Sorbian +113 es Lower Sorbian +113 cn Lower Sorbian +113 fr Bas-sorabe +114 en Duala +114 es Duala +114 cn Duala +114 fr Douala +115 en Dutch, Middle (ca.1050-1350) +115 es Dutch, Middle (ca.1050-1350) +115 cn Dutch, Middle (ca.1050-1350) +115 fr N~00E9erlandais moyen (ca. 1050-1350) +116 en Dutch; Flemish +116 es Dutch; Flemish +116 cn Dutch; Flemish +116 fr N~00E9erlandais; flamand +117 en Dyula +117 es Dyula +117 cn Dyula +117 fr Dioula +118 en Dzongkha +118 es Dzongkha +118 cn Dzongkha +118 fr Dzongkha +119 en Efik +119 es Efik +119 cn Efik +119 fr Efik +120 en Egyptian (Ancient) +120 es Egyptian (Ancient) +120 cn Egyptian (Ancient) +120 fr ~00C9gyptien +121 en Ekajuk +121 es Ekajuk +121 cn Ekajuk +121 fr Ekajuk +122 en Elamite +122 es Elamite +122 cn Elamite +122 fr ~00C9lamite +123 en English +123 es English +123 cn English +123 fr Anglais +124 en English, Middle (1100-1500) +124 es English, Middle (1100-1500) +124 cn English, Middle (1100-1500) +124 fr Anglais moyen (1100-1500) +125 en Esperanto +125 es Esperanto +125 cn Esperanto +125 fr Esp~00E9ranto +126 en Estonian +126 es Estonian +126 cn Estonian +126 fr Estonien +127 en Ewe +127 es Ewe +127 cn Ewe +127 fr ~00C9w~00E9 +128 en Ewondo +128 es Ewondo +128 cn Ewondo +128 fr ~00C9wondo +129 en Fang +129 es Fang +129 cn Fang +129 fr Fang +130 en Faroese +130 es Faroese +130 cn Faroese +130 fr F~00E9ro~00EFen +131 en Fanti +131 es Fanti +131 cn Fanti +131 fr Fanti +132 en Fijian +132 es Fijian +132 cn Fijian +132 fr Fidjien +133 en Filipino; Pilipino +133 es Filipino; Pilipino +133 cn Filipino; Pilipino +133 fr Filipino; pilipino +134 en Finnish +134 es Finnish +134 cn Finnish +134 fr Finnois +135 en Finno-Ugrian (Other) +135 es Finno-Ugrian (Other) +135 cn Finno-Ugrian (Other) +135 fr Finno-ougriennes, autres langues +136 en Fon +136 es Fon +136 cn Fon +136 fr Fon +137 en French +137 es French +137 cn French +137 fr Fran~00E7ais +138 en French, Middle (ca.1400-1600) +138 es French, Middle (ca.1400-1600) +138 cn French, Middle (ca.1400-1600) +138 fr Fran~00E7ais moyen (1400-1600) +139 en French, Old (842-ca.1400) +139 es French, Old (842-ca.1400) +139 cn French, Old (842-ca.1400) +139 fr Fran~00E7ais ancien (842-ca.1400) +140 en Northern Frisian +140 es Northern Frisian +140 cn Northern Frisian +140 fr Frison septentrional +141 en Eastern Frisian +141 es Eastern Frisian +141 cn Eastern Frisian +141 fr Frison oriental +142 en Western Frisian +142 es Western Frisian +142 cn Western Frisian +142 fr Frison occidental +143 en Fulah +143 es Fulah +143 cn Fulah +143 fr Peul +144 en Friulian +144 es Friulian +144 cn Friulian +144 fr Frioulan +145 en Ga +145 es Ga +145 cn Ga +145 fr Ga +146 en Gayo +146 es Gayo +146 cn Gayo +146 fr Gayo +147 en Gbaya +147 es Gbaya +147 cn Gbaya +147 fr Gbaya +148 en Germanic (Other) +148 es Germanic (Other) +148 cn Germanic (Other) +148 fr Germaniques, autres langues +149 en Georgian +149 es Georgian +149 cn Georgian +149 fr G~00E9orgien +150 en German +150 es German +150 cn German +150 fr Allemand +151 en Geez +151 es Geez +151 cn Geez +151 fr Gu~00E8ze +152 en Gilbertese +152 es Gilbertese +152 cn Gilbertese +152 fr Kiribati +153 en Gaelic; Scottish Gaelic +153 es Gaelic; Scottish Gaelic +153 cn Gaelic; Scottish Gaelic +153 fr Ga~00E9lique; ga~00E9lique ~00E9cossais +154 en Irish +154 es Irish +154 cn Irish +154 fr Irlandais +155 en Galician +155 es Galician +155 cn Galician +155 fr Galicien +156 en Manx +156 es Manx +156 cn Manx +156 fr Manx; mannois +157 en German, Middle High (ca.1050-1500) +157 es German, Middle High (ca.1050-1500) +157 cn German, Middle High (ca.1050-1500) +157 fr Allemand, moyen haut (ca. 1050-1500) +158 en German, Old High (ca.750-1050) +158 es German, Old High (ca.750-1050) +158 cn German, Old High (ca.750-1050) +158 fr Allemand, vieux haut (ca. 750-1050) +159 en Gondi +159 es Gondi +159 cn Gondi +159 fr Gond +160 en Gorontalo +160 es Gorontalo +160 cn Gorontalo +160 fr Gorontalo +161 en Gothic +161 es Gothic +161 cn Gothic +161 fr Gothique +162 en Grebo +162 es Grebo +162 cn Grebo +162 fr Grebo +163 en Greek, Ancient (to 1453) +163 es Greek, Ancient (to 1453) +163 cn Greek, Ancient (to 1453) +163 fr Grec ancien (jusqu'~00E0 1453) +164 en Greek, Modern (1453-) +164 es Greek, Modern (1453-) +164 cn Greek, Modern (1453-) +164 fr Grec moderne (apr~00E8s 1453) +165 en Guarani +165 es Guarani +165 cn Guarani +165 fr Guarani +166 en Swiss German; Alemannic +166 es Swiss German; Alemannic +166 cn Swiss German; Alemannic +166 fr Al~00E9manique +167 en Gujarati +167 es Gujarati +167 cn Gujarati +167 fr Goudjrati +168 en Gwich'in +168 es Gwich'in +168 cn Gwich'in +168 fr Gwich'in +169 en Haida +169 es Haida +169 cn Haida +169 fr Haida +170 en Haitian; Haitian Creole +170 es Haitian; Haitian Creole +170 cn Haitian; Haitian Creole +170 fr Ha~00EFtien; cr~00E9ole ha~00EFtien +171 en Hausa +171 es Hausa +171 cn Hausa +171 fr Haoussa +172 en Hawaiian +172 es Hawaiian +172 cn Hawaiian +172 fr Hawa~00EFen +173 en Hebrew +173 es Hebrew +173 cn Hebrew +173 fr H~00E9breu +174 en Herero +174 es Herero +174 cn Herero +174 fr Herero +175 en Hiligaynon +175 es Hiligaynon +175 cn Hiligaynon +175 fr Hiligaynon +176 en Himachali +176 es Himachali +176 cn Himachali +176 fr Himachali +177 en Hindi +177 es Hindi +177 cn Hindi +177 fr Hindi +178 en Hittite +178 es Hittite +178 cn Hittite +178 fr Hittite +179 en Hmong +179 es Hmong +179 cn Hmong +179 fr Hmong +180 en Hiri Motu +180 es Hiri Motu +180 cn Hiri Motu +180 fr Hiri motu +181 en Upper Sorbian +181 es Upper Sorbian +181 cn Upper Sorbian +181 fr Haut-sorabe +182 en Hungarian +182 es Hungarian +182 cn Hungarian +182 fr Hongrois +183 en Hupa +183 es Hupa +183 cn Hupa +183 fr Hupa +184 en Iban +184 es Iban +184 cn Iban +184 fr Iban +185 en Igbo +185 es Igbo +185 cn Igbo +185 fr Igbo +186 en Icelandic +186 es Icelandic +186 cn Icelandic +186 fr Islandais +187 en Ido +187 es Ido +187 cn Ido +187 fr Ido +188 en Sichuan Yi +188 es Sichuan Yi +188 cn Sichuan Yi +188 fr Yi de Sichuan +189 en Ijo languages +189 es Ijo languages +189 cn Ijo languages +189 fr Ijo, langues +190 en Inuktitut +190 es Inuktitut +190 cn Inuktitut +190 fr Inuktitut +191 en Interlingue +191 es Interlingue +191 cn Interlingue +191 fr Interlingue +192 en Iloko +192 es Iloko +192 cn Iloko +192 fr Ilocano +193 en Interlingua (International Auxiliary Language Association) +193 es Interlingua (International Auxiliary Language Association) +193 cn Interlingua (International Auxiliary Language Association) +193 fr Interlingua (langue auxiliaire internationale) +194 en Indic (Other) +194 es Indic (Other) +194 cn Indic (Other) +194 fr Indo-aryennes, autres langues +195 en Indonesian +195 es Indonesian +195 cn Indonesian +195 fr Indon~00E9sien +196 en Indo-European (Other) +196 es Indo-European (Other) +196 cn Indo-European (Other) +196 fr Indo-europ~00E9ennes, autres langues +197 en Ingush +197 es Ingush +197 cn Ingush +197 fr Ingouche +198 en Inupiaq +198 es Inupiaq +198 cn Inupiaq +198 fr Inupiaq +199 en Iranian (Other) +199 es Iranian (Other) +199 cn Iranian (Other) +199 fr Iraniennes, autres langues +200 en Iroquoian languages +200 es Iroquoian languages +200 cn Iroquoian languages +200 fr Iroquoises, langues (famille) +201 en Italian +201 es Italian +201 cn Italian +201 fr Italien +202 en Javanese +202 es Javanese +202 cn Javanese +202 fr Javanais +203 en Lojban +203 es Lojban +203 cn Lojban +203 fr Lojban +204 en Japanese +204 es Japanese +204 cn Japanese +204 fr Japonais +205 en Judeo-Persian +205 es Judeo-Persian +205 cn Judeo-Persian +205 fr Jud~00E9o-persan +206 en Judeo-Arabic +206 es Judeo-Arabic +206 cn Judeo-Arabic +206 fr Jud~00E9o-arabe +207 en Kara-Kalpak +207 es Kara-Kalpak +207 cn Kara-Kalpak +207 fr Karakalpak +208 en Kabyle +208 es Kabyle +208 cn Kabyle +208 fr Kabyle +209 en Kachin; Jingpho +209 es Kachin; Jingpho +209 cn Kachin; Jingpho +209 fr Kachin; jingpho +210 en Kalaallisut; Greenlandic +210 es Kalaallisut; Greenlandic +210 cn Kalaallisut; Greenlandic +210 fr Groenlandais +211 en Kamba +211 es Kamba +211 cn Kamba +211 fr Kamba +212 en Kannada +212 es Kannada +212 cn Kannada +212 fr Kannada +213 en Karen languages +213 es Karen languages +213 cn Karen languages +213 fr Karen, langues +214 en Kashmiri +214 es Kashmiri +214 cn Kashmiri +214 fr Kashmiri +215 en Kanuri +215 es Kanuri +215 cn Kanuri +215 fr Kanouri +216 en Kawi +216 es Kawi +216 cn Kawi +216 fr Kawi +217 en Kazakh +217 es Kazakh +217 cn Kazakh +217 fr Kazakh +218 en Kabardian +218 es Kabardian +218 cn Kabardian +218 fr Kabardien +219 en Khasi +219 es Khasi +219 cn Khasi +219 fr Khasi +220 en Khoisan (Other) +220 es Khoisan (Other) +220 cn Khoisan (Other) +220 fr Khoisan, autres langues +221 en Central Khmer +221 es Central Khmer +221 cn Central Khmer +221 fr Khmer central +222 en Khotanese +222 es Khotanese +222 cn Khotanese +222 fr Khotanais +223 en Kikuyu; Gikuyu +223 es Kikuyu; Gikuyu +223 cn Kikuyu; Gikuyu +223 fr Kikuyu +224 en Kinyarwanda +224 es Kinyarwanda +224 cn Kinyarwanda +224 fr Rwanda +225 en Kirghiz; Kyrgyz +225 es Kirghiz; Kyrgyz +225 cn Kirghiz; Kyrgyz +225 fr Kirghiz +226 en Kimbundu +226 es Kimbundu +226 cn Kimbundu +226 fr Kimbundu +227 en Konkani +227 es Konkani +227 cn Konkani +227 fr Konkani +228 en Komi +228 es Komi +228 cn Komi +228 fr Kom +229 en Kongo +229 es Kongo +229 cn Kongo +229 fr Kongo +230 en Korean +230 es Korean +230 cn Korean +230 fr Cor~00E9en +231 en Kosraean +231 es Kosraean +231 cn Kosraean +231 fr Kosrae +232 en Kpelle +232 es Kpelle +232 cn Kpelle +232 fr Kpell~00E9 +233 en Karachay-Balkar +233 es Karachay-Balkar +233 cn Karachay-Balkar +233 fr Karatchai balkar +234 en Karelian +234 es Karelian +234 cn Karelian +234 fr Car~00E9lien +235 en Kru languages +235 es Kru languages +235 cn Kru languages +235 fr Krou, langues +236 en Kurukh +236 es Kurukh +236 cn Kurukh +236 fr Kurukh +237 en Kuanyama; Kwanyama +237 es Kuanyama; Kwanyama +237 cn Kuanyama; Kwanyama +237 fr Kuanyama; kwanyama +238 en Kumyk +238 es Kumyk +238 cn Kumyk +238 fr Koumyk +239 en Kurdish +239 es Kurdish +239 cn Kurdish +239 fr Kurde +240 en Kutenai +240 es Kutenai +240 cn Kutenai +240 fr Kutenai +241 en Ladino +241 es Ladino +241 cn Ladino +241 fr Jud~00E9o-espagnol +242 en Lahnda +242 es Lahnda +242 cn Lahnda +242 fr Lahnda +243 en Lamba +243 es Lamba +243 cn Lamba +243 fr Lamba +244 en Lao +244 es Lao +244 cn Lao +244 fr Lao +245 en Latin +245 es Latin +245 cn Latin +245 fr Latin +246 en Latvian +246 es Latvian +246 cn Latvian +246 fr Letton +247 en Lezghian +247 es Lezghian +247 cn Lezghian +247 fr Lezghien +248 en Limburgan; Limburger; Limburgish +248 es Limburgan; Limburger; Limburgish +248 cn Limburgan; Limburger; Limburgish +248 fr Limbourgeois +249 en Lingala +249 es Lingala +249 cn Lingala +249 fr Lingala +250 en Lithuanian +250 es Lithuanian +250 cn Lithuanian +250 fr Lituanien +251 en Mongo +251 es Mongo +251 cn Mongo +251 fr Mongo +252 en Lozi +252 es Lozi +252 cn Lozi +252 fr Lozi +253 en Luxembourgish; Letzeburgesch +253 es Luxembourgish; Letzeburgesch +253 cn Luxembourgish; Letzeburgesch +253 fr Luxembourgeois +254 en Luba-Lulua +254 es Luba-Lulua +254 cn Luba-Lulua +254 fr Luba-lulua +255 en Luba-Katanga +255 es Luba-Katanga +255 cn Luba-Katanga +255 fr Luba-katanga +256 en Ganda +256 es Ganda +256 cn Ganda +256 fr Ganda +257 en Luiseno +257 es Luiseno +257 cn Luiseno +257 fr Luiseno +258 en Lunda +258 es Lunda +258 cn Lunda +258 fr Lunda +259 en Luo (Kenya and Tanzania) +259 es Luo (Kenya and Tanzania) +259 cn Luo (Kenya and Tanzania) +259 fr Luo (Kenya et Tanzanie) +260 en Lushai +260 es Lushai +260 cn Lushai +260 fr Lushai +261 en Macedonian +261 es Macedonian +261 cn Macedonian +261 fr Mac~00E9donien +262 en Madurese +262 es Madurese +262 cn Madurese +262 fr Madourais +263 en Magahi +263 es Magahi +263 cn Magahi +263 fr Magahi +264 en Marshallese +264 es Marshallese +264 cn Marshallese +264 fr Marshall +265 en Maithili +265 es Maithili +265 cn Maithili +265 fr Maithili +266 en Makasar +266 es Makasar +266 cn Makasar +266 fr Makassar +267 en Malayalam +267 es Malayalam +267 cn Malayalam +267 fr Malayalam +268 en Mandingo +268 es Mandingo +268 cn Mandingo +268 fr Mandingue +269 en Maori +269 es Maori +269 cn Maori +269 fr Maori +270 en Austronesian (Other) +270 es Austronesian (Other) +270 cn Austronesian (Other) +270 fr Malayo-polyn~00E9siennes, autres langues +271 en Marathi +271 es Marathi +271 cn Marathi +271 fr Marathe +272 en Masai +272 es Masai +272 cn Masai +272 fr Massa~00EF +273 en Malay +273 es Malay +273 cn Malay +273 fr Malais +274 en Moksha +274 es Moksha +274 cn Moksha +274 fr Moksa +275 en Mandar +275 es Mandar +275 cn Mandar +275 fr Mandar +276 en Mende +276 es Mende +276 cn Mende +276 fr Mend~00E9 +277 en Irish, Middle (900-1200) +277 es Irish, Middle (900-1200) +277 cn Irish, Middle (900-1200) +277 fr Irlandais moyen (900-1200) +278 en Mi'kmaq; Micmac +278 es Mi'kmaq; Micmac +278 cn Mi'kmaq; Micmac +278 fr Mi'kmaq; micmac +279 en Minangkabau +279 es Minangkabau +279 cn Minangkabau +279 fr Minangkabau +280 en Miscellaneous languages +280 es Miscellaneous languages +280 cn Miscellaneous languages +280 fr Diverses, langues +281 en Mon-Khmer (Other) +281 es Mon-Khmer (Other) +281 cn Mon-Khmer (Other) +281 fr M~00F4n-khmer, autres langues +282 en Malagasy +282 es Malagasy +282 cn Malagasy +282 fr Malgache +283 en Maltese +283 es Maltese +283 cn Maltese +283 fr Maltais +284 en Manchu +284 es Manchu +284 cn Manchu +284 fr Mandchou +285 en Manipuri +285 es Manipuri +285 cn Manipuri +285 fr Manipuri +286 en Manobo languages +286 es Manobo languages +286 cn Manobo languages +286 fr Manobo, langues +287 en Mohawk +287 es Mohawk +287 cn Mohawk +287 fr Mohawk +288 en Moldavian +288 es Moldavian +288 cn Moldavian +288 fr Moldave +289 en Mongolian +289 es Mongolian +289 cn Mongolian +289 fr Mongol +290 en Mossi +290 es Mossi +290 cn Mossi +290 fr Mor~00E9 +291 en Multiple languages +291 es Multiple languages +291 cn Multiple languages +291 fr Multilingue +292 en Munda languages +292 es Munda languages +292 cn Munda languages +292 fr Mounda, langues +293 en Creek +293 es Creek +293 cn Creek +293 fr Muskogee +294 en Mirandese +294 es Mirandese +294 cn Mirandese +294 fr Mirandais +295 en Marwari +295 es Marwari +295 cn Marwari +295 fr Marvari +296 en Mayan languages +296 es Mayan languages +296 cn Mayan languages +296 fr Maya, langues +297 en Erzya +297 es Erzya +297 cn Erzya +297 fr Erza +298 en Nahuatl languages +298 es Nahuatl languages +298 cn Nahuatl languages +298 fr Nahuatl, langues +299 en North American Indian +299 es North American Indian +299 cn North American Indian +299 fr Indiennes d'Am~00E9rique du Nord, autres langues +300 en Neapolitan +300 es Neapolitan +300 cn Neapolitan +300 fr Napolitain +301 en Nauru +301 es Nauru +301 cn Nauru +301 fr Nauruan +302 en Navajo; Navaho +302 es Navajo; Navaho +302 cn Navajo; Navaho +302 fr Navaho +303 en Ndebele, South; South Ndebele +303 es Ndebele, South; South Ndebele +303 cn Ndebele, South; South Ndebele +303 fr Nd~00E9b~00E9l~00E9 du Sud +304 en Ndebele, North; North Ndebele +304 es Ndebele, North; North Ndebele +304 cn Ndebele, North; North Ndebele +304 fr Nd~00E9b~00E9l~00E9 du Nord +305 en Ndonga +305 es Ndonga +305 cn Ndonga +305 fr Ndonga +306 en Low German; Low Saxon; German, Low; Saxon, Low +306 es Low German; Low Saxon; German, Low; Saxon, Low +306 cn Low German; Low Saxon; German, Low; Saxon, Low +306 fr Bas allemand; bas saxon; allemand, bas; saxon, bas +307 en Nepali +307 es Nepali +307 cn Nepali +307 fr N~00E9palais +308 en Nepal Bhasa; Newari +308 es Nepal Bhasa; Newari +308 cn Nepal Bhasa; Newari +308 fr Nepal bhasa; newari +309 en Nias +309 es Nias +309 cn Nias +309 fr Nias +310 en Niger-Kordofanian (Other) +310 es Niger-Kordofanian (Other) +310 cn Niger-Kordofanian (Other) +310 fr Nig~00E9ro-congolaises, autres langues +311 en Niuean +311 es Niuean +311 cn Niuean +311 fr Niu~00E9 +312 en Norwegian Nynorsk; Nynorsk, Norwegian +312 es Norwegian Nynorsk; Nynorsk, Norwegian +312 cn Norwegian Nynorsk; Nynorsk, Norwegian +312 fr Norv~00E9gien nynorsk; nynorsk, norv~00E9gien +313 en Bokm~00E5l, Norwegian; Norwegian Bokm~00E5l +313 es Bokm~00E5l, Norwegian; Norwegian Bokm~00E5l +313 cn Bokm~00E5l, Norwegian; Norwegian Bokm~00E5l +313 fr Norv~00E9gien bokm~00E5l +314 en Nogai +314 es Nogai +314 cn Nogai +314 fr Noga~00EF; nogay +315 en Norse, Old +315 es Norse, Old +315 cn Norse, Old +315 fr Norrois, vieux +316 en Norwegian +316 es Norwegian +316 cn Norwegian +316 fr Norv~00E9gien +317 en Pedi; Sepedi; Northern Sotho +317 es Pedi; Sepedi; Northern Sotho +317 cn Pedi; Sepedi; Northern Sotho +317 fr Pedi; sepedi; sotho du Nord +318 en Nubian languages +318 es Nubian languages +318 cn Nubian languages +318 fr Nubiennes, langues +319 en Classical Newari; Old Newari; Classical Nepal Bhasa +319 es Classical Newari; Old Newari; Classical Nepal Bhasa +319 cn Classical Newari; Old Newari; Classical Nepal Bhasa +319 fr Newari classique +320 en Chichewa; Chewa; Nyanja +320 es Chichewa; Chewa; Nyanja +320 cn Chichewa; Chewa; Nyanja +320 fr Chichewa; chewa; nyanja +321 en Nyamwezi +321 es Nyamwezi +321 cn Nyamwezi +321 fr Nyamwezi +322 en Nyankole +322 es Nyankole +322 cn Nyankole +322 fr Nyankol~00E9 +323 en Nyoro +323 es Nyoro +323 cn Nyoro +323 fr Nyoro +324 en Nzima +324 es Nzima +324 cn Nzima +324 fr Nzema +325 en Occitan (post 1500); Proven~00E7al +325 es Occitan (post 1500); Proven~00E7al +325 cn Occitan (post 1500); Proven~00E7al +325 fr Occitan (apr~00E8s 1500); proven~00E7al +326 en Ojibwa +326 es Ojibwa +326 cn Ojibwa +326 fr Ojibwa +327 en Oriya +327 es Oriya +327 cn Oriya +327 fr Oriya +328 en Oromo +328 es Oromo +328 cn Oromo +328 fr Galla +329 en Osage +329 es Osage +329 cn Osage +329 fr Osage +330 en Ossetian; Ossetic +330 es Ossetian; Ossetic +330 cn Ossetian; Ossetic +330 fr Oss~00E8te +331 en Turkish, Ottoman (1500-1928) +331 es Turkish, Ottoman (1500-1928) +331 cn Turkish, Ottoman (1500-1928) +331 fr Turc ottoman (1500-1928) +332 en Otomian languages +332 es Otomian languages +332 cn Otomian languages +332 fr Otomangue, langues +333 en Papuan (Other) +333 es Papuan (Other) +333 cn Papuan (Other) +333 fr Papoues, autres langues +334 en Pangasinan +334 es Pangasinan +334 cn Pangasinan +334 fr Pangasinan +335 en Pahlavi +335 es Pahlavi +335 cn Pahlavi +335 fr Pahlavi +336 en Pampanga +336 es Pampanga +336 cn Pampanga +336 fr Pampangan +337 en Panjabi; Punjabi +337 es Panjabi; Punjabi +337 cn Panjabi; Punjabi +337 fr Pendjabi +338 en Papiamento +338 es Papiamento +338 cn Papiamento +338 fr Papiamento +339 en Palauan +339 es Palauan +339 cn Palauan +339 fr Palau +340 en Persian, Old (ca.600-400 B.C.) +340 es Persian, Old (ca.600-400 B.C.) +340 cn Persian, Old (ca.600-400 B.C.) +340 fr Perse, vieux (ca. 600-400 av. J.-C.) +341 en Persian +341 es Persian +341 cn Persian +341 fr Persan +342 en Philippine (Other) +342 es Philippine (Other) +342 cn Philippine (Other) +342 fr Philippines, autres langues +343 en Phoenician +343 es Phoenician +343 cn Phoenician +343 fr Ph~00E9nicien +344 en Pali +344 es Pali +344 cn Pali +344 fr Pali +345 en Polish +345 es Polish +345 cn Polish +345 fr Polonais +346 en Pohnpeian +346 es Pohnpeian +346 cn Pohnpeian +346 fr Pohnpei +347 en Portuguese +347 es Portuguese +347 cn Portuguese +347 fr Portugais +348 en Prakrit languages +348 es Prakrit languages +348 cn Prakrit languages +348 fr Pr~00E2krit +349 en Proven~00E7al, Old (to 1500) +349 es Proven~00E7al, Old (to 1500) +349 cn Proven~00E7al, Old (to 1500) +349 fr Proven~00E7al ancien (jusqu'~00E0 1500) +350 en Pushto +350 es Pushto +350 cn Pushto +350 fr Pachto +351 en Reserved for local use +351 es Reserved for local use +351 cn Reserved for local use +351 fr R~00E9serv~00E9e ~00E0 l'usage local +352 en Quechua +352 es Quechua +352 cn Quechua +352 fr Quechua +353 en Rajasthani +353 es Rajasthani +353 cn Rajasthani +353 fr Rajasthani +354 en Rapanui +354 es Rapanui +354 cn Rapanui +354 fr Rapanui +355 en Rarotongan; Cook Islands Maori +355 es Rarotongan; Cook Islands Maori +355 cn Rarotongan; Cook Islands Maori +355 fr Rarotonga; maori des ~00EEles Cook +356 en Romance (Other) +356 es Romance (Other) +356 cn Romance (Other) +356 fr Romanes, autres langues +357 en Romansh +357 es Romansh +357 cn Romansh +357 fr Romanche +358 en Romany +358 es Romany +358 cn Romany +358 fr Tsigane +359 en Romanian +359 es Romanian +359 cn Romanian +359 fr Roumain +360 en Rundi +360 es Rundi +360 cn Rundi +360 fr Rundi +361 en Aromanian; Arumanian; Macedo-Romanian +361 es Aromanian; Arumanian; Macedo-Romanian +361 cn Aromanian; Arumanian; Macedo-Romanian +361 fr Aroumain; mac~00E9do-roumain +362 en Russian +362 es Russian +362 cn Russian +362 fr Russe +363 en Sandawe +363 es Sandawe +363 cn Sandawe +363 fr Sandawe +364 en Sango +364 es Sango +364 cn Sango +364 fr Sango +365 en Yakut +365 es Yakut +365 cn Yakut +365 fr Iakoute +366 en South American Indian (Other) +366 es South American Indian (Other) +366 cn South American Indian (Other) +366 fr Indiennes d'Am~00E9rique du Sud, autres langues +367 en Salishan languages +367 es Salishan languages +367 cn Salishan languages +367 fr Salish, langues +368 en Samaritan Aramaic +368 es Samaritan Aramaic +368 cn Samaritan Aramaic +368 fr Samaritain +369 en Sanskrit +369 es Sanskrit +369 cn Sanskrit +369 fr Sanskrit +370 en Sasak +370 es Sasak +370 cn Sasak +370 fr Sasak +371 en Santali +371 es Santali +371 cn Santali +371 fr Santal +372 en Serbian +372 es Serbian +372 cn Serbian +372 fr Serbe +373 en Sicilian +373 es Sicilian +373 cn Sicilian +373 fr Sicilien +374 en Scots +374 es Scots +374 cn Scots +374 fr ~00C9cossais +375 en Croatian +375 es Croatian +375 cn Croatian +375 fr Croate +376 en Selkup +376 es Selkup +376 cn Selkup +376 fr Selkoupe +377 en Semitic (Other) +377 es Semitic (Other) +377 cn Semitic (Other) +377 fr S~00E9mitiques, autres langues +378 en Irish, Old (to 900) +378 es Irish, Old (to 900) +378 cn Irish, Old (to 900) +378 fr Irlandais ancien (jusqu'~00E0 900) +379 en Sign Languages +379 es Sign Languages +379 cn Sign Languages +379 fr Langues des signes +380 en Shan +380 es Shan +380 cn Shan +380 fr Chan +381 en Sidamo +381 es Sidamo +381 cn Sidamo +381 fr Sidamo +382 en Sinhala; Sinhalese +382 es Sinhala; Sinhalese +382 cn Sinhala; Sinhalese +382 fr Singhalais +383 en Siouan languages +383 es Siouan languages +383 cn Siouan languages +383 fr Sioux, langues +384 en Sino-Tibetan (Other) +384 es Sino-Tibetan (Other) +384 cn Sino-Tibetan (Other) +384 fr Sino-tib~00E9taines, autres langues +385 en Slavic (Other) +385 es Slavic (Other) +385 cn Slavic (Other) +385 fr Slaves, autres langues +386 en Slovak +386 es Slovak +386 cn Slovak +386 fr Slovaque +387 en Slovenian +387 es Slovenian +387 cn Slovenian +387 fr Slov~00E8ne +388 en Southern Sami +388 es Southern Sami +388 cn Southern Sami +388 fr Sami du Sud +389 en Northern Sami +389 es Northern Sami +389 cn Northern Sami +389 fr Sami du Nord +390 en Sami languages (Other) +390 es Sami languages (Other) +390 cn Sami languages (Other) +390 fr Sami, autres langues +391 en Lule Sami +391 es Lule Sami +391 cn Lule Sami +391 fr Sami de Lule +392 en Inari Sami +392 es Inari Sami +392 cn Inari Sami +392 fr Sami d'Inari +393 en Samoan +393 es Samoan +393 cn Samoan +393 fr Samoan +394 en Skolt Sami +394 es Skolt Sami +394 cn Skolt Sami +394 fr Sami skolt +395 en Shona +395 es Shona +395 cn Shona +395 fr Shona +396 en Sindhi +396 es Sindhi +396 cn Sindhi +396 fr Sindhi +397 en Soninke +397 es Soninke +397 cn Soninke +397 fr Sonink~00E9 +398 en Sogdian +398 es Sogdian +398 cn Sogdian +398 fr Sogdien +399 en Somali +399 es Somali +399 cn Somali +399 fr Somali +400 en Songhai languages +400 es Songhai languages +400 cn Songhai languages +400 fr Songhai, langues +401 en Sotho, Southern +401 es Sotho, Southern +401 cn Sotho, Southern +401 fr Sotho du Sud +402 en Spanish; Castilian +402 es Spanish; Castilian +402 cn Spanish; Castilian +402 fr Espagnol; castillan +403 en Sardinian +403 es Sardinian +403 cn Sardinian +403 fr Sarde +404 en Sranan Tongo +404 es Sranan Tongo +404 cn Sranan Tongo +404 fr Sranan tongo +405 en Serer +405 es Serer +405 cn Serer +405 fr S~00E9r~00E8re +406 en Nilo-Saharan (Other) +406 es Nilo-Saharan (Other) +406 cn Nilo-Saharan (Other) +406 fr Nilo-sahariennes, autres langues +407 en Swati +407 es Swati +407 cn Swati +407 fr Swati +408 en Sukuma +408 es Sukuma +408 cn Sukuma +408 fr Sukuma +409 en Sundanese +409 es Sundanese +409 cn Sundanese +409 fr Soundanais +410 en Susu +410 es Susu +410 cn Susu +410 fr Soussou +411 en Sumerian +411 es Sumerian +411 cn Sumerian +411 fr Sum~00E9rien +412 en Swahili +412 es Swahili +412 cn Swahili +412 fr Swahili +413 en Swedish +413 es Swedish +413 cn Swedish +413 fr Su~00E9dois +414 en Syriac +414 es Syriac +414 cn Syriac +414 fr Syriaque +415 en Tahitian +415 es Tahitian +415 cn Tahitian +415 fr Tahitien +416 en Tai (Other) +416 es Tai (Other) +416 cn Tai (Other) +416 fr Tha~00EFes, autres langues +417 en Tamil +417 es Tamil +417 cn Tamil +417 fr Tamoul +418 en Tatar +418 es Tatar +418 cn Tatar +418 fr Tatar +419 en Telugu +419 es Telugu +419 cn Telugu +419 fr T~00E9lougou +420 en Timne +420 es Timne +420 cn Timne +420 fr Temne +421 en Tereno +421 es Tereno +421 cn Tereno +421 fr Tereno +422 en Tetum +422 es Tetum +422 cn Tetum +422 fr Tetum +423 en Tajik +423 es Tajik +423 cn Tajik +423 fr Tadjik +424 en Tagalog +424 es Tagalog +424 cn Tagalog +424 fr Tagalog +425 en Thai +425 es Thai +425 cn Thai +425 fr Tha~00EF +426 en Tibetan +426 es Tibetan +426 cn Tibetan +426 fr Tib~00E9tain +427 en Tigre +427 es Tigre +427 cn Tigre +427 fr Tigr~00E9 +428 en Tigrinya +428 es Tigrinya +428 cn Tigrinya +428 fr Tigrigna +429 en Tiv +429 es Tiv +429 cn Tiv +429 fr Tiv +430 en Tokelau +430 es Tokelau +430 cn Tokelau +430 fr Tokelau +431 en Klingon; tlhIngan-Hol +431 es Klingon; tlhIngan-Hol +431 cn Klingon; tlhIngan-Hol +431 fr Klingon +432 en Tlingit +432 es Tlingit +432 cn Tlingit +432 fr Tlingit +433 en Tamashek +433 es Tamashek +433 cn Tamashek +433 fr Tamacheq +434 en Tonga (Nyasa) +434 es Tonga (Nyasa) +434 cn Tonga (Nyasa) +434 fr Tonga (Nyasa) +435 en Tonga (Tonga Islands) +435 es Tonga (Tonga Islands) +435 cn Tonga (Tonga Islands) +435 fr Tongan (~00CEles Tonga) +436 en Tok Pisin +436 es Tok Pisin +436 cn Tok Pisin +436 fr Tok pisin +437 en Tsimshian +437 es Tsimshian +437 cn Tsimshian +437 fr Tsimshian +438 en Tswana +438 es Tswana +438 cn Tswana +438 fr Tswana +439 en Tsonga +439 es Tsonga +439 cn Tsonga +439 fr Tsonga +440 en Turkmen +440 es Turkmen +440 cn Turkmen +440 fr Turkm~00E8ne +441 en Tumbuka +441 es Tumbuka +441 cn Tumbuka +441 fr Tumbuka +442 en Tupi languages +442 es Tupi languages +442 cn Tupi languages +442 fr Tupi, langues +443 en Turkish +443 es Turkish +443 cn Turkish +443 fr Turc +444 en Altaic (Other) +444 es Altaic (Other) +444 cn Altaic (Other) +444 fr Alta~00EFques, autres langues +445 en Tuvalu +445 es Tuvalu +445 cn Tuvalu +445 fr Tuvalu +446 en Twi +446 es Twi +446 cn Twi +446 fr Twi +447 en Tuvinian +447 es Tuvinian +447 cn Tuvinian +447 fr Touva +448 en Udmurt +448 es Udmurt +448 cn Udmurt +448 fr Oudmourte +449 en Ugaritic +449 es Ugaritic +449 cn Ugaritic +449 fr Ougaritique +450 en Uighur; Uyghur +450 es Uighur; Uyghur +450 cn Uighur; Uyghur +450 fr Ou~00EFgour +451 en Ukrainian +451 es Ukrainian +451 cn Ukrainian +451 fr Ukrainien +452 en Umbundu +452 es Umbundu +452 cn Umbundu +452 fr Umbundu +453 en Undetermined +453 es Undetermined +453 cn Undetermined +453 fr Ind~00E9termin~00E9e +454 en Urdu +454 es Urdu +454 cn Urdu +454 fr Ourdou +455 en Uzbek +455 es Uzbek +455 cn Uzbek +455 fr Ouszbek +456 en Vai +456 es Vai +456 cn Vai +456 fr Va~00EF +457 en Venda +457 es Venda +457 cn Venda +457 fr Venda +458 en Vietnamese +458 es Vietnamese +458 cn Vietnamese +458 fr Vietnamien +459 en Volap~00FCk +459 es Volap~00FCk +459 cn Volap~00FCk +459 fr Volap~00FCk +460 en Votic +460 es Votic +460 cn Votic +460 fr Vote +461 en Wakashan languages +461 es Wakashan languages +461 cn Wakashan languages +461 fr Wakashennes, langues +462 en Walamo +462 es Walamo +462 cn Walamo +462 fr Walamo +463 en Waray +463 es Waray +463 cn Waray +463 fr Waray +464 en Washo +464 es Washo +464 cn Washo +464 fr Washo +465 en Welsh +465 es Welsh +465 cn Welsh +465 fr Gallois +466 en Sorbian languages +466 es Sorbian languages +466 cn Sorbian languages +466 fr Sorabes, langues +467 en Walloon +467 es Walloon +467 cn Walloon +467 fr Wallon +468 en Wolof +468 es Wolof +468 cn Wolof +468 fr Wolof +469 en Kalmyk; Oirat +469 es Kalmyk; Oirat +469 cn Kalmyk; Oirat +469 fr Kalmouk; o~00EFrat +470 en Xhosa +470 es Xhosa +470 cn Xhosa +470 fr Xhosa +471 en Yao +471 es Yao +471 cn Yao +471 fr Yao +472 en Yapese +472 es Yapese +472 cn Yapese +472 fr Yapois +473 en Yiddish +473 es Yiddish +473 cn Yiddish +473 fr Yiddish +474 en Yoruba +474 es Yoruba +474 cn Yoruba +474 fr Yoruba +475 en Yupik languages +475 es Yupik languages +475 cn Yupik languages +475 fr Yupik, langues +476 en Zapotec +476 es Zapotec +476 cn Zapotec +476 fr Zapot~00E8que +477 en Zenaga +477 es Zenaga +477 cn Zenaga +477 fr Zenaga +478 en Zhuang; Chuang +478 es Zhuang; Chuang +478 cn Zhuang; Chuang +478 fr Zhuang; chuang +479 en Zande languages +479 es Zande languages +479 cn Zande languages +479 fr Zand~00E9, langues +480 en Zulu +480 es Zulu +480 cn Zulu +480 fr Zoulou +481 en Zuni +481 es Zuni +481 cn Zuni +481 fr Zuni +482 en No linguistic content +482 es No linguistic content +482 cn No linguistic content +482 fr Pas de contenu linguistique +483 en N'Ko +483 es N'Ko +483 cn N'Ko +483 fr N'ko +484 en Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki +484 es Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki +484 cn Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki +484 fr Zaza; dimili; dimli; kirdki; kirmanjki; zazaki Modified: trunk/web/conversion/iso19115-to-iso19139/content.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/content.xsl 2007-04-12 13:27:09 UTC (rev 378) +++ trunk/web/conversion/iso19115-to-iso19139/content.xsl 2007-04-12 13:28:39 UTC (rev 379) @@ -222,7 +222,11 @@ <xsl:for-each select="catLang"> <language> - <gco:CharacterString><xsl:value-of select="languageCode/@value"/></gco:CharacterString> + <gco:CharacterString> + <xsl:call-template name="convertLanguage"> + <xsl:with-param name="code" select="languageCode/@value"/> + </xsl:call-template> + </gco:CharacterString> </language> </xsl:for-each> Modified: trunk/web/conversion/iso19115-to-iso19139/identification.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/identification.xsl 2007-04-12 13:27:09 UTC (rev 378) +++ trunk/web/conversion/iso19115-to-iso19139/identification.xsl 2007-04-12 13:28:39 UTC (rev 379) @@ -136,7 +136,11 @@ <xsl:for-each select="dataLang"> <language> - <gco:CharacterString><xsl:value-of select="languageCode/@value"/></gco:CharacterString> + <gco:CharacterString> + <xsl:call-template name="convertLanguage"> + <xsl:with-param name="code" select="languageCode/@value"/> + </xsl:call-template> + </gco:CharacterString> </language> </xsl:for-each> Added: trunk/web/conversion/iso19115-to-iso19139/iso-mapping.xml =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/iso-mapping.xml (rev 0) +++ trunk/web/conversion/iso19115-to-iso19139/iso-mapping.xml 2007-04-12 13:28:39 UTC (rev 379) @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mapping> + <map longCode="aar" shortCode="aa" /> + <map longCode="abk" shortCode="ab" /> + <map longCode="afr" shortCode="af" /> + <map longCode="aka" shortCode="ak" /> + <map longCode="alb" shortCode="sq" /> + <map longCode="amh" shortCode="am" /> + <map longCode="ara" shortCode="ar" /> + <map longCode="arg" shortCode="an" /> + <map longCode="arm" shortCode="hy" /> + <map longCode="asm" shortCode="as" /> + <map longCode="ava" shortCode="av" /> + <map longCode="ave" shortCode="ae" /> + <map longCode="aym" shortCode="ay" /> + <map longCode="aze" shortCode="az" /> + <map longCode="bak" shortCode="ba" /> + <map longCode="bam" shortCode="bm" /> + <map longCode="baq" shortCode="eu" /> + <map longCode="bel" shortCode="be" /> + <map longCode="ben" shortCode="bn" /> + <map longCode="bih" shortCode="bh" /> + <map longCode="bis" shortCode="bi" /> + <map longCode="bos" shortCode="bs" /> + <map longCode="bre" shortCode="br" /> + <map longCode="bul" shortCode="bg" /> + <map longCode="bur" shortCode="my" /> + <map longCode="cat" shortCode="ca" /> + <map longCode="cha" shortCode="ch" /> + <map longCode="che" shortCode="ce" /> + <map longCode="chi" shortCode="zh" /> + <map longCode="chu" shortCode="cu" /> + <map longCode="chv" shortCode="cv" /> + <map longCode="cor" shortCode="kw" /> + <map longCode="cos" shortCode="co" /> + <map longCode="cre" shortCode="cr" /> + <map longCode="cze" shortCode="cs" /> + <map longCode="dan" shortCode="da" /> + <map longCode="div" shortCode="dv" /> + <map longCode="dut" shortCode="nl" /> + <map longCode="dzo" shortCode="dz" /> + <map longCode="eng" shortCode="en" /> + <map longCode="epo" shortCode="eo" /> + <map longCode="est" shortCode="et" /> + <map longCode="ewe" shortCode="ee" /> + <map longCode="fao" shortCode="fo" /> + <map longCode="fij" shortCode="fj" /> + <map longCode="fin" shortCode="fi" /> + <map longCode="fre" shortCode="fr" /> + <map longCode="fry" shortCode="fy" /> + <map longCode="ful" shortCode="ff" /> + <map longCode="geo" shortCode="ka" /> + <map longCode="ger" shortCode="de" /> + <map longCode="gla" shortCode="gd" /> + <map longCode="gle" shortCode="ga" /> + <map longCode="glg" shortCode="gl" /> + <map longCode="glv" shortCode="gv" /> + <map longCode="gre" shortCode="el" /> + <map longCode="grn" shortCode="gn" /> + <map longCode="guj" shortCode="gu" /> + <map longCode="hat" shortCode="ht" /> + <map longCode="hau" shortCode="ha" /> + <map longCode="heb" shortCode="he" /> + <map longCode="her" shortCode="hz" /> + <map longCode="hin" shortCode="hi" /> + <map longCode="hmo" shortCode="ho" /> + <map longCode="hun" shortCode="hu" /> + <map longCode="ibo" shortCode="ig" /> + <map longCode="ice" shortCode="is" /> + <map longCode="ido" shortCode="io" /> + <map longCode="iii" shortCode="ii" /> + <map longCode="iku" shortCode="iu" /> + <map longCode="ile" shortCode="ie" /> + <map longCode="ina" shortCode="ia" /> + <map longCode="ind" shortCode="id" /> + <map longCode="ipk" shortCode="ik" /> + <map longCode="ita" shortCode="it" /> + <map longCode="jav" shortCode="jv" /> + <map longCode="jpn" shortCode="ja" /> + <map longCode="kal" shortCode="kl" /> + <map longCode="kan" shortCode="kn" /> + <map longCode="kas" shortCode="ks" /> + <map longCode="kau" shortCode="kr" /> + <map longCode="kaz" shortCode="kk" /> + <map longCode="khm" shortCode="km" /> + <map longCode="kik" shortCode="ki" /> + <map longCode="kin" shortCode="rw" /> + <map longCode="kir" shortCode="ky" /> + <map longCode="kom" shortCode="kv" /> + <map longCode="kon" shortCode="kg" /> + <map longCode="kor" shortCode="ko" /> + <map longCode="kua" shortCode="kj" /> + <map longCode="kur" shortCode="ku" /> + <map longCode="lao" shortCode="lo" /> + <map longCode="lat" shortCode="la" /> + <map longCode="lav" shortCode="lv" /> + <map longCode="lim" shortCode="li" /> + <map longCode="lin" shortCode="ln" /> + <map longCode="lit" shortCode="lt" /> + <map longCode="ltz" shortCode="lb" /> + <map longCode="lub" shortCode="lu" /> + <map longCode="lug" shortCode="lg" /> + <map longCode="mac" shortCode="mk" /> + <map longCode="mah" shortCode="mh" /> + <map longCode="mal" shortCode="ml" /> + <map longCode="mao" shortCode="mi" /> + <map longCode="mar" shortCode="mr" /> + <map longCode="may" shortCode="ms" /> + <map longCode="mlg" shortCode="mg" /> + <map longCode="mlt" shortCode="mt" /> + <map longCode="mol" shortCode="mo" /> + <map longCode="mon" shortCode="mn" /> + <map longCode="nau" shortCode="na" /> + <map longCode="nav" shortCode="nv" /> + <map longCode="nbl" shortCode="nr" /> + <map longCode="nde" shortCode="nd" /> + <map longCode="ndo" shortCode="ng" /> + <map longCode="nep" shortCode="ne" /> + <map longCode="nno" shortCode="nn" /> + <map longCode="nob" shortCode="nb" /> + <map longCode="nor" shortCode="no" /> + <map longCode="nya" shortCode="ny" /> + <map longCode="oci" shortCode="oc" /> + <map longCode="oji" shortCode="oj" /> + <map longCode="ori" shortCode="or" /> + <map longCode="orm" shortCode="om" /> + <map longCode="oss" shortCode="os" /> + <map longCode="pan" shortCode="pa" /> + <map longCode="per" shortCode="fa" /> + <map longCode="pli" shortCode="pi" /> + <map longCode="pol" shortCode="pl" /> + <map longCode="por" shortCode="pt" /> + <map longCode="pus" shortCode="ps" /> + <map longCode="que" shortCode="qu" /> + <map longCode="roh" shortCode="rm" /> + <map longCode="rum" shortCode="ro" /> + <map longCode="run" shortCode="rn" /> + <map longCode="rus" shortCode="ru" /> + <map longCode="sag" shortCode="sg" /> + <map longCode="san" shortCode="sa" /> + <map longCode="scc" shortCode="sr" /> + <map longCode="scr" shortCode="hr" /> + <map longCode="sin" shortCode="si" /> + <map longCode="slo" shortCode="sk" /> + <map longCode="slv" shortCode="sl" /> + <map longCode="sme" shortCode="se" /> + <map longCode="smo" shortCode="sm" /> + <map longCode="sna" shortCode="sn" /> + <map longCode="snd" shortCode="sd" /> + <map longCode="som" shortCode="so" /> + <map longCode="sot" shortCode="st" /> + <map longCode="spa" shortCode="es" /> + <map longCode="srd" shortCode="sc" /> + <map longCode="ssw" shortCode="ss" /> + <map longCode="sun" shortCode="su" /> + <map longCode="swa" shortCode="sw" /> + <map longCode="swe" shortCode="sv" /> + <map longCode="tah" shortCode="ty" /> + <map longCode="tam" shortCode="ta" /> + <map longCode="tat" shortCode="tt" /> + <map longCode="tel" shortCode="te" /> + <map longCode="tgk" shortCode="tg" /> + <map longCode="tgl" shortCode="tl" /> + <map longCode="tha" shortCode="th" /> + <map longCode="tib" shortCode="bo" /> + <map longCode="tir" shortCode="ti" /> + <map longCode="ton" shortCode="to" /> + <map longCode="tsn" shortCode="tn" /> + <map longCode="tso" shortCode="ts" /> + <map longCode="tuk" shortCode="tk" /> + <map longCode="tur" shortCode="tr" /> + <map longCode="twi" shortCode="tw" /> + <map longCode="uig" shortCode="ug" /> + <map longCode="ukr" shortCode="uk" /> + <map longCode="urd" shortCode="ur" /> + <map longCode="uzb" shortCode="uz" /> + <map longCode="ven" shortCode="ve" /> + <map longCode="vie" shortCode="vi" /> + <map longCode="vol" shortCode="vo" /> + <map longCode="wel" shortCode="cy" /> + <map longCode="wln" shortCode="wa" /> + <map longCode="wol" shortCode="wo" /> + <map longCode="xho" shortCode="xh" /> + <map longCode="yid" shortCode="yi" /> + <map longCode="yor" shortCode="yo" /> + <map longCode="zha" shortCode="za" /> + <map longCode="zul" shortCode="zu" /> +</mapping> + Modified: trunk/web/conversion/iso19115-to-iso19139/main.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/main.xsl 2007-04-12 13:27:09 UTC (rev 378) +++ trunk/web/conversion/iso19115-to-iso19139/main.xsl 2007-04-12 13:28:39 UTC (rev 379) @@ -28,6 +28,10 @@ <!-- ============================================================================= --> + <xsl:variable name="mapping" select="document('iso-mapping.xml')/mapping"/> + + <!-- ============================================================================= --> + <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> @@ -49,7 +53,11 @@ <xsl:for-each select="mdLang"> <language> - <gco:CharacterString><xsl:value-of select="languageCode/@value"/></gco:CharacterString> + <gco:CharacterString> + <xsl:call-template name="convertLanguage"> + <xsl:with-param name="code" select="languageCode/@value"/> + </xsl:call-template> + </gco:CharacterString> </language> </xsl:for-each> @@ -224,4 +232,28 @@ <!-- ============================================================================= --> + <xsl:template name="convertLanguage"> + <xsl:param name="code"/> + + <xsl:choose> + <xsl:when test="string-length($code) < 3"> + <xsl:variable name="mapped" select="$mapping/map[@shortCode=$code]/@longCode"/> + + <xsl:choose> + <xsl:when test="$mapped"> + <xsl:value-of select="$mapped"/> + </xsl:when> + + <xsl:otherwise>eng</xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:otherwise> + <xsl:value-of select="$code"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ============================================================================= --> + </xsl:stylesheet> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-04-20 15:42:59
|
Revision: 406 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=406&view=rev Author: acarboni Date: 2007-04-20 08:43:01 -0700 (Fri, 20 Apr 2007) Log Message: ----------- Fixed TopicCategoryCode Modified Paths: -------------- trunk/gast/setup/sample-data/iso-19139.mef trunk/gast/setup/templates/iso19139/metadata.xml trunk/web/conversion/iso19115-to-iso19139/identification.xsl Modified: trunk/gast/setup/sample-data/iso-19139.mef =================================================================== (Binary files differ) Modified: trunk/gast/setup/templates/iso19139/metadata.xml =================================================================== --- trunk/gast/setup/templates/iso19139/metadata.xml 2007-04-20 15:37:41 UTC (rev 405) +++ trunk/gast/setup/templates/iso19139/metadata.xml 2007-04-20 15:43:01 UTC (rev 406) @@ -118,7 +118,7 @@ <gmd:MD_CharacterSetCode codeList="./resources/codeList.xml#MD_CharacterSetCode" codeListValue="utf8" /> </gmd:characterSet> <gmd:topicCategory> - <gmd:MD_TopicCategoryCode codeList="./resources/codeList.xml#MD_TopicCategoryCode" codeListValue="geoscientificInformation" /> + <gmd:MD_TopicCategoryCode>geoscientificInformation</gmd:MD_TopicCategoryCode> </gmd:topicCategory> </gmd:MD_DataIdentification> </gmd:identificationInfo> Modified: trunk/web/conversion/iso19115-to-iso19139/identification.xsl =================================================================== --- trunk/web/conversion/iso19115-to-iso19139/identification.xsl 2007-04-20 15:37:41 UTC (rev 405) +++ trunk/web/conversion/iso19115-to-iso19139/identification.xsl 2007-04-20 15:43:01 UTC (rev 406) @@ -156,7 +156,7 @@ <xsl:for-each select="tpCat"> <topicCategory> - <MD_TopicCategoryCode codeList="./resources/codeList.xml#MD_TopicCategoryCode" codeListValue="{TopicCatCd/@value}" /> + <MD_TopicCategoryCode><xsl:value-of select="TopicCatCd/@value" /></MD_TopicCategoryCode> </topicCategory> </xsl:for-each> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-19 17:05:35
|
Revision: 423 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=423&view=rev Author: acarboni Date: 2007-05-19 10:05:31 -0700 (Sat, 19 May 2007) Log Message: ----------- Some fixes Modified Paths: -------------- trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java trunk/web/xml/mappings/Metadata_to_xml_brief.xsl trunk/web/xml/mappings/Metadata_to_xml_full.xsl trunk/web/xml/mappings/Metadata_to_xml_summary.xsl trunk/web/xml/search/z3950Server.xsl Modified: trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java =================================================================== --- trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java 2007-05-10 21:57:27 UTC (rev 422) +++ trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java 2007-05-19 17:05:31 UTC (rev 423) @@ -198,12 +198,13 @@ result.removeChildren("summary"); List list = result.getChildren(); + Log.debug(Geonet.Z3950_SERVER, "Set name asked:"+ spec.getSetname()); + // save other records to fragment for(int i = 0; i < count; i++) { Element md = (Element)list.get(0); md.detach(); - md.removeChild(Edit.RootChild.INFO, Edit.NAMESPACE); Log.debug(Geonet.Z3950_SERVER, "Returning fragment:\n"+ Xml.getString(md)); @@ -213,6 +214,7 @@ null, getRecord(md), new RecordFormatSpecification("xml", "meta", "f")); +// new RecordFormatSpecification("xml", "meta", spec.getSetname().toString())); } _srvContext.getResourceManager().close(); } Modified: trunk/web/xml/mappings/Metadata_to_xml_brief.xsl =================================================================== --- trunk/web/xml/mappings/Metadata_to_xml_brief.xsl 2007-05-10 21:57:27 UTC (rev 422) +++ trunk/web/xml/mappings/Metadata_to_xml_brief.xsl 2007-05-19 17:05:31 UTC (rev 423) @@ -1,12 +1,30 @@ <?xml version="1.0"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:xalan = "http://xml.apache.org/xalan"> <xsl:output method="xml"/> -<xsl:template match="@*|node()"> - <xsl:copy> - <xsl:apply-templates select="@*|node()"/> - </xsl:copy> +<xsl:template match="/"> + + <xsl:variable name="md"> + <xsl:apply-templates mode="brief" select="."/> + </xsl:variable> + <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> +<xsl:message><xsl:copy-of select="."/></xsl:message> + <!-- + B: includes the Title (title) element. + --> + <metadata> + <idinfo> + <citation> + <citeinfo> + <title><xsl:value-of select="$metadata/title"/></title> + </citeinfo> + </citation> + </idinfo> + </metadata> + </xsl:template> </xsl:stylesheet> Modified: trunk/web/xml/mappings/Metadata_to_xml_full.xsl =================================================================== --- trunk/web/xml/mappings/Metadata_to_xml_full.xsl 2007-05-10 21:57:27 UTC (rev 422) +++ trunk/web/xml/mappings/Metadata_to_xml_full.xsl 2007-05-19 17:05:31 UTC (rev 423) @@ -1,12 +1,21 @@ <?xml version="1.0"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:geonet="http://www.fao.org/geonetwork"> <xsl:output method="xml"/> +<!-- +F: contains all elements available in the record. +The server should include in the retrieved record all of the elements +for which there is data available in the database record and which can +be encoded in the requested record syntax (e.g., some types of +locally-defined binary data may not be encodable in a USMARC or SUTRS record). +--> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> +<xsl:template match="geonet:info"/> + </xsl:stylesheet> Modified: trunk/web/xml/mappings/Metadata_to_xml_summary.xsl =================================================================== --- trunk/web/xml/mappings/Metadata_to_xml_summary.xsl 2007-05-10 21:57:27 UTC (rev 422) +++ trunk/web/xml/mappings/Metadata_to_xml_summary.xsl 2007-05-19 17:05:31 UTC (rev 423) @@ -1,12 +1,76 @@ <?xml version="1.0"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:xalan = "http://xml.apache.org/xalan"> <xsl:output method="xml"/> -<xsl:template match="@*|node()"> - <xsl:copy> - <xsl:apply-templates select="@*|node()"/> - </xsl:copy> +<xsl:template match="/"> + + <xsl:variable name="md"> + <xsl:apply-templates mode="brief" select="."/> + </xsl:variable> + <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> + + <!-- + S: includes the following elements: + Title (title), + Online Linkage (onlink), + Bounding Coordinates (bounding), + Extent (extent), + Publication Date (pubdate), + Beginning Date (begtime), + Ending Date (enddate), + Browse Graphic (browse), + Entity Type Label (enttypl), + Attribute Label (attrlabl), + and Data Set G-Polygon (dsgpoly). + The Browse Graphic (browse) should appear as groups of + Browse Graphic File Name (browsen), + Browse Graphic File Description (browsed), + and Browse Graphic File Type (browset). + --> + <metadata xmlns:geonet="http://www.fao.org/geonetwork"> + <idinfo> + <citation> + <citeinfo> + <title><xsl:value-of select="$metadata/title"/></title> + <pubdate><xsl:value-of select="$metadata/geonet:info/createDate"/></pubdate> + <xsl:for-each select="$metadata/link[@type='url']"> + <onlink><xsl:value-of select="$metadata/link"/></onlink> + </xsl:for-each> + </citeinfo> + </citation> + <descript> + <abstract><xsl:value-of select="$metadata/abstract"/></abstract> <!-- not mandatory for summary format --/> + </descript> + <timeperd> + <timeinfo> + <rngdates> + <begdate/> + <enddate/> + </rngdates> + </timeinfo> + <current/> + </timeperd> + <spdom> + <bounding> + <westbc><xsl:value-of select="$metadata/geoBox/westBL"/></westbc> + <eastbc><xsl:value-of select="$metadata/geoBox/eastBL"/></eastbc> + <northbc><xsl:value-of select="$metadata/geoBox/northBL"/></northbc> + <southbc><xsl:value-of select="$metadata/geoBox/southBL"/></southbc> + </bounding> + </spdom> + <xsl:for-each select="$metadata/image"> + <browse> + <browsen><xsl:value-of select="$metadata/image"/></browsen> + <browsed><xsl:value-of select="$metadata/image/@type"/></browsed> +<!-- <browset></browset> --> + </browse> + </xsl:for-each> + </idinfo> + </metadata> + </xsl:template> </xsl:stylesheet> Modified: trunk/web/xml/search/z3950Server.xsl =================================================================== --- trunk/web/xml/search/z3950Server.xsl 2007-05-10 21:57:27 UTC (rev 422) +++ trunk/web/xml/search/z3950Server.xsl 2007-05-19 17:05:31 UTC (rev 423) @@ -4,7 +4,7 @@ <xsl:import href="parser.xsl"/> <xsl:import href="lucene-utils.xsl"/> - + <xsl:variable name="opView" select="'_op0'"/> <!-- @@ -24,19 +24,23 @@ <xsl:template match="/"> <BooleanQuery> - + <BooleanClause required="true" prohibited="false"> <xsl:call-template name="compile"> <xsl:with-param name="expr" select="/request/query"/> - </xsl:call-template> + </xsl:call-template> </BooleanClause> - + <!-- view privileges --> <xsl:call-template name="orFields"> <xsl:with-param name="expr" select="/request/group"/> <xsl:with-param name="field" select="$opView"/> </xsl:call-template> - + + <BooleanClause required="true" prohibited="false"> + <TermQuery fld="_isTemplate" txt="n"/> + </BooleanClause> + </BooleanQuery> </xsl:template> @@ -45,7 +49,7 @@ --> <xsl:template name="compile"> <xsl:param name="expr"/> - + <xsl:call-template name="doCompile"> <xsl:with-param name="expr" select="xalan:nodeset($expr)"/> </xsl:call-template> @@ -56,7 +60,7 @@ --> <xsl:template name="doCompile"> <xsl:param name="expr"/> - + <xsl:choose> <!-- query: recurse --> <xsl:when test="name($expr)='query'"> @@ -64,7 +68,7 @@ <xsl:with-param name="expr" select="$expr/*"/> </xsl:call-template> </xsl:when> - + <!-- and: build a boolean query --> <xsl:when test="name($expr)='and'"> <BooleanQuery> @@ -77,7 +81,7 @@ </xsl:for-each> </BooleanQuery> </xsl:when> - + <!-- or: build a boolean query --> <xsl:when test="name($expr)='or'"> <BooleanQuery> @@ -90,7 +94,7 @@ </xsl:for-each> </BooleanQuery> </xsl:when> - + <!-- not: build a boolean query --> <xsl:when test="name($expr)='not'"> <BooleanQuery> @@ -110,7 +114,7 @@ </xsl:for-each> </BooleanQuery> </xsl:when> - + <!-- title --> <xsl:when test="name($expr)='term' and $expr/@use='4'"> <xsl:call-template name="wordListTerm"> @@ -118,7 +122,7 @@ <xsl:with-param name="field" select="'title'"/> </xsl:call-template> </xsl:when> - + <!-- abstract --> <xsl:when test="name($expr)='term' and $expr/@use='62'"> <xsl:call-template name="wordListTerm"> @@ -126,7 +130,7 @@ <xsl:with-param name="field" select="'abstract'"/> </xsl:call-template> </xsl:when> - + <!-- any --> <xsl:when test="name($expr)='term' and $expr/@use='1016'"> <xsl:call-template name="wordListTerm"> @@ -134,57 +138,57 @@ <xsl:with-param name="field" select="'any'"/> </xsl:call-template> </xsl:when> - + <!-- keywords --> <xsl:when test="name($expr)='term' and $expr/@use='2002'"> <TermQuery fld="keyword" txt="{$expr/text()}"/> </xsl:when> - + <!-- bounding box --> <xsl:when test="name($expr)='term' and $expr/@use='2060'"> - + <!-- bounding box --> <xsl:if test="$boundingBox"> <xsl:choose> - + <!-- equal --> <xsl:when test="$expr/@relation=3"> <BooleanQuery> <xsl:call-template name="equal"/> </BooleanQuery> </xsl:when> - + <!-- overlaps --> <xsl:when test="$expr/@relation=7"> <BooleanQuery> <xsl:call-template name="overlaps"/> </BooleanQuery> </xsl:when> - + <!-- fullyOutsideOf --> <xsl:when test="$expr/@relation=10"> <BooleanQuery> <xsl:call-template name="fullyOutsideOf"/> </BooleanQuery> </xsl:when> - + <!-- encloses --> <xsl:when test="$expr/@relation=9"> <BooleanQuery> <xsl:call-template name="encloses"/> </BooleanQuery> </xsl:when> - + <!-- fullyEnclosedWithin --> <xsl:when test="$expr/@relation=8"> <BooleanQuery> <xsl:call-template name="fullyEnclosedWithin"/> </BooleanQuery> </xsl:when> - + </xsl:choose> </xsl:if> - + </xsl:when> </xsl:choose> @@ -193,7 +197,7 @@ <xsl:template name="wordListTerm"> <xsl:param name="expr"/> <xsl:param name="field"/> - + <PhraseQuery> <xsl:call-template name="phraseQueryArgs"> <xsl:with-param name="expr" select="$expr"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rgi...@us...> - 2007-05-21 17:29:21
|
Revision: 424 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=424&view=rev Author: rgiaccio Date: 2007-05-21 10:29:18 -0700 (Mon, 21 May 2007) Log Message: ----------- Z39.50 server correctly implements brief and summary format Z39.50 full format does not contain anymore the geonet:info block improved compatibility with version 2.0.x servers (geonet:info block mistakenly returned is skipped) Z39.50 requests to other servers are always in full format; this can be changed if compatibility problems will arise clicking a metadata in the results list now opens the correct metadata the left tabs (default, complex, xml) now works while showing remote metadata Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/search/Z3950Searcher.java trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java trunk/web/WEB-INF/config.xml trunk/web/xml/mappings/Metadata_to_xml_brief.xsl trunk/web/xml/mappings/Metadata_to_xml_summary.xsl trunk/web/xsl/remote-show.xsl trunk/web/xsl/search-results.xsl Modified: trunk/src/org/fao/geonet/kernel/search/Z3950Searcher.java =================================================================== --- trunk/src/org/fao/geonet/kernel/search/Z3950Searcher.java 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/src/org/fao/geonet/kernel/search/Z3950Searcher.java 2007-05-21 17:29:18 UTC (rev 424) @@ -78,13 +78,12 @@ request.addContent(Lib.db.select(dbms, "Regions", "region")); Element xmlQuery = _sm.transform(_styleSheetName, request); - Log.debug(Geonet.SEARCH_ENGINE, "XML QUERY:\n"+ Xml.getString(xmlQuery)); + + Log.debug(Geonet.SEARCH_ENGINE, "OUTGOING XML QUERY:\n"+ Xml.getString(xmlQuery)); - // System.out.println("XML QUERY:\n" + jeeves.utils.Xml.getString(xmlQuery)); // DEBUG - String query = newQuery(xmlQuery); - // System.out.println("QUERY: " + query); // DEBUG + Log.debug(Geonet.SEARCH_ENGINE, "OUTGOING QUERY: " + query); // get request parameters Vector servers = new Vector(); Modified: trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java =================================================================== --- trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/src/org/fao/geonet/services/util/z3950/GNSearchTask.java 2007-05-21 17:29:18 UTC (rev 424) @@ -133,10 +133,12 @@ { try { + Log.debug(Geonet.Z3950_SERVER, "INCOMING QUERY:\n" + _query.getQueryModel()); + RemoteQueryDecoder queryDecoder = new RemoteQueryDecoder(_query.getQueryModel()); Element request = new Element("request"); - // System.out.println("QUERY:\n" + Xml.getString(queryDecoder.getQuery())); // DEBUG + Log.debug(Geonet.Z3950_SERVER, "INCOMING XML QUERY:\n" + Xml.getString(queryDecoder.getQuery())); request.addContent(queryDecoder.getQuery()); ServiceConfig config = new ServiceConfig(); Modified: trunk/web/WEB-INF/config.xml =================================================================== --- trunk/web/WEB-INF/config.xml 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/web/WEB-INF/config.xml 2007-05-21 17:29:18 UTC (rev 424) @@ -64,17 +64,15 @@ <name>main-db</name> <provider>jeeves.resources.dbms.DbmsPool</provider> <config> - <user>qbzZlRdy</user> - <password>Qp1PgFDy</password> + <user>o1Ra5kE3</user> + <password>HdAAC8lT</password> <driver>com.mckoi.JDBCDriver</driver> <url>jdbc:mckoi://localhost:9157/</url> <poolSize>10</poolSize> </config> - <activator class="org.fao.geonet.activators.McKoiActivator"> - <configFile>WEB-INF/db/db.conf</configFile> - </activator> - </resource> + + <activator class="org.fao.geonet.activators.McKoiActivator"><configFile>WEB-INF/db/db.conf</configFile></activator></resource> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- mysql --> @@ -168,14 +166,15 @@ <service name="main.present"> <class name=".services.main.Result"> <param name="maxRecords" value="10" /> + <param name="syntax" value="f" /> </class> <output sheet="search-results.xsl"> <call name="searchDefaults" class=".guiservices.search.GetDefaults" /> - <call name="groups" class=".guiservices.groups.GetMine" /> - <call name="sources" class=".guiservices.util.Sources" /> - <call name="services" class="jeeves.guiservices.services.Get" /> - <xml name="repositories" file ="xml/repositories.xml" localized="false" /> + <call name="groups" class=".guiservices.groups.GetMine" /> + <call name="sources" class=".guiservices.util.Sources" /> + <call name="services" class="jeeves.guiservices.services.Get" /> + <xml name="repositories" file="xml/repositories.xml" localized="false" /> </output> </service> @@ -183,13 +182,13 @@ <service name="remote.show"> <class name=".services.main.RemoteShow"> - <param name="syntax" value="s" /> + <param name="syntax" value="f" /> </class> <output sheet="remote-show.xsl"> - <call name="services" class="jeeves.guiservices.services.Get" /> - <call name="currTab" class=".guiservices.util.GetCurrentMDTab" /> - <xml name="repositories" file ="xml/repositories.xml" localized="false" /> + <call name="services" class="jeeves.guiservices.services.Get" /> + <call name="currTab" class=".guiservices.util.GetCurrentMDTab" /> + <xml name="repositories" file="xml/repositories.xml" localized="false" /> </output> </service> @@ -686,7 +685,7 @@ <output sheet="thesaurus-autosearchlist.xsl" /> </service> <service name="xml.search.keywordlink" type="xml"> - <class name=".services.thesaurus.GetNarrowerBroader"/> + <class name=".services.thesaurus.GetNarrowerBroader" /> <output sheet="thesaurus-autosearchlist.xsl" /> </service> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> Modified: trunk/web/xml/mappings/Metadata_to_xml_brief.xsl =================================================================== --- trunk/web/xml/mappings/Metadata_to_xml_brief.xsl 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/web/xml/mappings/Metadata_to_xml_brief.xsl 2007-05-21 17:29:18 UTC (rev 424) @@ -5,13 +5,15 @@ xmlns:xalan = "http://xml.apache.org/xalan"> <xsl:output method="xml"/> +<xsl:include href="../../xsl/metadata-utils.xsl"/> + <xsl:template match="/"> - + <xsl:variable name="md"> - <xsl:apply-templates mode="brief" select="."/> + <xsl:apply-templates mode="brief" select="*"/> </xsl:variable> <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> -<xsl:message><xsl:copy-of select="."/></xsl:message> + <!-- B: includes the Title (title) element. --> Modified: trunk/web/xml/mappings/Metadata_to_xml_summary.xsl =================================================================== --- trunk/web/xml/mappings/Metadata_to_xml_summary.xsl 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/web/xml/mappings/Metadata_to_xml_summary.xsl 2007-05-21 17:29:18 UTC (rev 424) @@ -5,10 +5,12 @@ xmlns:xalan = "http://xml.apache.org/xalan"> <xsl:output method="xml"/> +<xsl:include href="../../xsl/metadata-utils.xsl"/> + <xsl:template match="/"> <xsl:variable name="md"> - <xsl:apply-templates mode="brief" select="."/> + <xsl:apply-templates mode="brief" select="*"/> </xsl:variable> <xsl:variable name="metadata" select="xalan:nodeset($md)/*[1]"/> @@ -30,7 +32,7 @@ Browse Graphic File Description (browsed), and Browse Graphic File Type (browset). --> - <metadata xmlns:geonet="http://www.fao.org/geonetwork"> + <metadata> <idinfo> <citation> <citeinfo> @@ -42,7 +44,7 @@ </citeinfo> </citation> <descript> - <abstract><xsl:value-of select="$metadata/abstract"/></abstract> <!-- not mandatory for summary format --/> + <abstract><xsl:value-of select="$metadata/abstract"/></abstract> <!-- not mandatory for summary format --> </descript> <timeperd> <timeinfo> @@ -61,13 +63,15 @@ <southbc><xsl:value-of select="$metadata/geoBox/southBL"/></southbc> </bounding> </spdom> + <!-- <xsl:for-each select="$metadata/image"> <browse> <browsen><xsl:value-of select="$metadata/image"/></browsen> <browsed><xsl:value-of select="$metadata/image/@type"/></browsed> -<!-- <browset></browset> --> + <browset></browset> </browse> </xsl:for-each> + --> </idinfo> </metadata> Modified: trunk/web/xsl/remote-show.xsl =================================================================== --- trunk/web/xsl/remote-show.xsl 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/web/xsl/remote-show.xsl 2007-05-21 17:29:18 UTC (rev 424) @@ -32,7 +32,7 @@ --> <xsl:template name="content"> - <xsl:apply-templates mode="remoteHit" select="/root/*[name(.)!='gui']"/> <!-- just one --> + <xsl:apply-templates mode="remoteHit" select="/root/*[name(.)!='gui' and name(.)!='request']"/> <!-- just one --> </xsl:template> @@ -40,7 +40,7 @@ <table width="100%" height="100%"> <tr height="100%"> - <td class="blue-content" width="100" valign="top"> + <td class="blue-content" width="150" valign="top"> <xsl:call-template name="tab"> <xsl:with-param name="tabLink" select="concat(/root/gui/locService,'/remote.show')"/> </xsl:call-template> @@ -50,14 +50,13 @@ <xsl:variable name="server" select="geonet:info/server"/> <xsl:variable name="name" select="/root/gui/repositories/Collection[@collection_dn=$server]/@collection_name"/> - <tr><td class="padded-content"><h1><xsl:value-of select="geonet:info/id"/><xsl:text> - </xsl:text><xsl:value-of select="$name"/></h1></td></tr> + <tr><td class="padded-content"><h1><xsl:value-of select="geonet:info[server]/id"/><xsl:text> - </xsl:text><xsl:value-of select="$name"/></h1></td></tr> <tr><td class="dots"/></tr> <tr><td class="padded-content"> - <table class="md"> - + <table class="md" width="100%"> <form name="mainForm" accept-charset="UTF-8" method="POST" action="{/root/gui/locService}/remote.show"> - <input type="hidden" name="id" value="{geonet:info/id}"/> + <input type="hidden" name="id" value="{geonet:info[server]/id}"/> <input type="hidden" name="currTab" value="{/root/gui/currTab}"/> <xsl:choose> Modified: trunk/web/xsl/search-results.xsl =================================================================== --- trunk/web/xsl/search-results.xsl 2007-05-19 17:05:31 UTC (rev 423) +++ trunk/web/xsl/search-results.xsl 2007-05-21 17:29:18 UTC (rev 424) @@ -96,7 +96,7 @@ <xsl:variable name="port" select="substring-before($rest,'/')"/> <xsl:variable name="db" select="substring-after($rest,'/')"/> <td class="padded" colspan="2"> - <h1 align="left"><a href="{/root/gui/locService}/remote.show?id={$metadata/geonet:info/id}&currTab=simple"><xsl:value-of select="concat($metadata/geonet:info/id,' - ',$metadata/title)"/></a></h1> + <h1 align="left"><a href="{/root/gui/locService}/remote.show?id={$metadata/geonet:info[server]/id}&currTab=simple"><xsl:value-of select="concat($metadata/geonet:info/id,' - ',$metadata/title)"/></a></h1> <xsl:variable name="server" select="$metadata/geonet:info/server"/> <xsl:variable name="name" select="/root/gui/repositories/Collection[@collection_dn=$server]/@collection_name"/> <font class="green-neg"><xsl:value-of select="$name"/></font> @@ -170,7 +170,7 @@ <xsl:value-of select="substring ($metadata/abstract, 0, $maxAbstract)"/> <xsl:choose> <xsl:when test="$remote=true()"> - <a href="{/root/gui/locService}/remote.show?id={$metadata/geonet:info/id}&currTab=simple"> + <a href="{/root/gui/locService}/remote.show?id={$metadata/geonet:info[server]/id}&currTab=simple"> ...<xsl:value-of select="/root/gui/strings/more"/>... </a> </xsl:when> @@ -227,7 +227,7 @@ <xsl:if test="$metadata/geonet:info/view='true'"> <xsl:choose> <xsl:when test="$remote=true()"> - <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info/id}&currTab=simple')"><xsl:value-of select="/root/gui/strings/show"/></button> + <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info[server]/id}&currTab=simple')"><xsl:value-of select="/root/gui/strings/show"/></button> </xsl:when> <xsl:otherwise> <button class="content" onclick="load('{/root/gui/locService}/metadata.show?id={$metadata/geonet:info/id}&currTab=simple')"><xsl:value-of select="/root/gui/strings/show"/></button> @@ -242,7 +242,7 @@ <xsl:when test="count($metadata/link[@type='download'])>1"> <xsl:choose> <xsl:when test="$remote=true()"> - <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/download"/></button> + <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info[server]/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/download"/></button> </xsl:when> <xsl:otherwise> <button class="content" onclick="load('{/root/gui/locService}/metadata.show?id={$metadata/geonet:info/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/download"/></button> @@ -263,7 +263,7 @@ <xsl:when test="$count>1"> <xsl:choose> <xsl:when test="$remote=true()"> - <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/interactiveMap"/></button> + <button class="content" onclick="load('{/root/gui/locService}/remote.show?id={$metadata/geonet:info[server]/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/interactiveMap"/></button> </xsl:when> <xsl:otherwise> <button class="content" onclick="load('{/root/gui/locService}/metadata.show?id={$metadata/geonet:info/id}&currTab=distribution')"><xsl:value-of select="/root/gui/strings/interactiveMap"/></button> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-26 17:16:38
|
Revision: 429 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=429&view=rev Author: acarboni Date: 2007-05-26 10:16:39 -0700 (Sat, 26 May 2007) Log Message: ----------- Massive Javascript refactoring to accomodate harvesting needs Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/harvest/Common.java trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java Removed Paths: ------------- trunk/src/org/fao/geonet/kernel/harvest/harvester/webfolder/ trunk/web/scripts/harvesting.js Modified: trunk/src/org/fao/geonet/kernel/harvest/Common.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/Common.java 2007-05-26 17:14:02 UTC (rev 428) +++ trunk/src/org/fao/geonet/kernel/harvest/Common.java 2007-05-26 17:16:39 UTC (rev 429) @@ -61,37 +61,6 @@ } //--------------------------------------------------------------------------- - //--- Type - //--------------------------------------------------------------------------- - - public enum Type - { - GEONETWORK("geonetwork"), WEB_FOLDER("webFolder"); - - //------------------------------------------------------------------------ - - private Type(String type) { this.type = type; } - - //------------------------------------------------------------------------ - - public String toString() { return type; } - - //------------------------------------------------------------------------ - - public static Type parse(String type) throws BadParameterEx - { - if ("geonetwork".equals(type)) return GEONETWORK; - if ("webFolder" .equals(type)) return WEB_FOLDER; - - throw new BadParameterEx("type", type); - } - - //------------------------------------------------------------------------ - - private String type; - } - - //--------------------------------------------------------------------------- //--- Result //--------------------------------------------------------------------------- Modified: trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java 2007-05-26 17:14:02 UTC (rev 428) +++ trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java 2007-05-26 17:16:39 UTC (rev 429) @@ -27,17 +27,15 @@ import java.util.HashMap; import java.util.Iterator; import jeeves.exceptions.BadInputEx; +import jeeves.exceptions.JeevesException; import jeeves.exceptions.MissingParameterEx; import jeeves.resources.dbms.Dbms; import jeeves.server.context.ServiceContext; -import jeeves.server.resources.ProviderManager; import jeeves.utils.Log; -import jeeves.utils.SerialFactory; import jeeves.utils.Xml; import org.fao.geonet.constants.Geonet; import org.fao.geonet.kernel.DataManager; import org.fao.geonet.kernel.harvest.Common.OperResult; -import org.fao.geonet.kernel.harvest.Common.Type; import org.fao.geonet.kernel.harvest.harvester.AbstractHarvester; import org.fao.geonet.kernel.setting.SettingManager; import org.jdom.Element; @@ -70,7 +68,7 @@ while (i.hasNext()) { Element entry = (Element) i.next(); - Type type = Type.parse(entry.getAttributeValue("type")); + String type = entry.getAttributeValue("type"); AbstractHarvester ah = AbstractHarvester.create(type, context, sm, dm); ah.init(entry); @@ -110,21 +108,14 @@ //--------------------------------------------------------------------------- - public String add(Dbms dbms, Element node) throws BadInputEx, SQLException + public String add(Dbms dbms, Element node) throws JeevesException, SQLException { Log.debug(Geonet.HARVEST_MAN, "Adding harvesting node : \n"+ Xml.getString(node)); String type = node.getAttributeValue("type"); - if (type == null) - throw new MissingParameterEx("attribute:type", node); + AbstractHarvester ah = AbstractHarvester.create(type, context, settingMan, dataMan); - //--- raises an exception if type is unknown - - Type nodeType = Type.parse(type); - - AbstractHarvester ah = AbstractHarvester.create(nodeType, context, settingMan, dataMan); - ah.add(dbms, node); hmHarvesters.put(ah.getID(), ah); Log.debug(Geonet.HARVEST_MAN, "Added node with id : \n"+ ah.getID()); Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java 2007-05-26 17:14:02 UTC (rev 428) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java 2007-05-26 17:16:39 UTC (rev 429) @@ -23,10 +23,14 @@ package org.fao.geonet.kernel.harvest.harvester; +import java.lang.reflect.Method; import java.sql.SQLException; +import java.util.HashMap; import java.util.Map; import jeeves.exceptions.BadInputEx; +import jeeves.exceptions.BadParameterEx; import jeeves.exceptions.JeevesException; +import jeeves.exceptions.OperationAbortedEx; import jeeves.interfaces.Logger; import jeeves.resources.dbms.Dbms; import jeeves.server.context.ServiceContext; @@ -36,9 +40,9 @@ import org.fao.geonet.kernel.DataManager; import org.fao.geonet.kernel.harvest.Common.OperResult; import org.fao.geonet.kernel.harvest.Common.Status; -import org.fao.geonet.kernel.harvest.Common.Type; import org.fao.geonet.kernel.harvest.harvester.geonet.GeonetHarvester; -import org.fao.geonet.kernel.harvest.harvester.webfolder.WAFHarvester; +import org.fao.geonet.kernel.harvest.harvester.geonet20.Geonet20Harvester; +import org.fao.geonet.kernel.harvest.harvester.webdav.WebDavHarvester; import org.fao.geonet.kernel.setting.SettingManager; import org.fao.geonet.util.ISODate; import org.jdom.Element; @@ -55,31 +59,60 @@ public static void staticInit(ServiceContext context) throws Exception { - GeonetHarvester.init(context); - WAFHarvester .init(context); + register(context, GeonetHarvester .class); + register(context, WebDavHarvester .class); + register(context, Geonet20Harvester.class); } //--------------------------------------------------------------------------- - public static AbstractHarvester create(Type type, ServiceContext context, + private static void register(ServiceContext context, Class harvester) throws Exception + { + try + { + Method initMethod = harvester.getMethod("init", context.getClass()); + initMethod.invoke(null, context); + + AbstractHarvester ah = (AbstractHarvester) harvester.newInstance(); + + hsHarvesters.put(ah.getType(), harvester); + } + catch(Exception e) + { + throw new Exception("Cannot register harvester : "+harvester, e); + } + } + + //--------------------------------------------------------------------------- + + public static AbstractHarvester create(String type, ServiceContext context, SettingManager sm, DataManager dm) + throws BadParameterEx, OperationAbortedEx { - AbstractHarvester ah = null; + //--- raises an exception if type is null - if (type == Type.GEONETWORK) - ah = new GeonetHarvester(); + if (type == null) + throw new BadParameterEx("type", type); - else if (type == Type.WEB_FOLDER) - ah = new WAFHarvester(); + Class c = hsHarvesters.get(type); - if (ah == null) - throw new IllegalArgumentException("Unknown type : "+ type); + if (c == null) + throw new BadParameterEx("type", type); - ah.context = context; - ah.settingMan = sm; - ah.dataMan = dm; + try + { + AbstractHarvester ah = (AbstractHarvester) c.newInstance(); - return ah; + ah.context = context; + ah.settingMan = sm; + ah.dataMan = dm; + + return ah; + } + catch(Exception e) + { + throw new OperationAbortedEx("Cannot instantiate harvester", e); + } } //-------------------------------------------------------------------------- @@ -302,6 +335,8 @@ //--- //--------------------------------------------------------------------------- + public abstract String getType(); + protected abstract void doInit(Element entry) throws BadInputEx; /** Called when the harvesting entry is removed from the system. @@ -356,6 +391,8 @@ protected ServiceContext context; protected SettingManager settingMan; protected DataManager dataMan; + + private static Map<String, Class> hsHarvesters = new HashMap<String, Class>(); } //============================================================================= Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-05-26 17:14:02 UTC (rev 428) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-05-26 17:16:39 UTC (rev 429) @@ -44,7 +44,6 @@ import jeeves.utils.XmlRequest; import org.fao.geonet.constants.Geonet; import org.fao.geonet.kernel.harvest.Common.Status; -import org.fao.geonet.kernel.harvest.Common.Type; import org.fao.geonet.kernel.harvest.harvester.AbstractHarvester; import org.fao.geonet.kernel.harvest.harvester.CategoryMapper; import org.fao.geonet.kernel.harvest.harvester.GroupMapper; @@ -90,6 +89,14 @@ //-------------------------------------------------------------------------- //--- + //--- Harvesting type + //--- + //-------------------------------------------------------------------------- + + public String getType() { return "geonetwork"; } + + //-------------------------------------------------------------------------- + //--- //--- Init //--- //-------------------------------------------------------------------------- @@ -142,7 +149,7 @@ //--- setup geonetwork node - String id = settingMan.add(dbms, "harvesting", "node", Type.GEONETWORK); + String id = settingMan.add(dbms, "harvesting", "node", getType()); String path = "id:"+ id; String siteID = settingMan.add(dbms, path, "site", ""); Deleted: trunk/web/scripts/harvesting.js =================================================================== --- trunk/web/scripts/harvesting.js 2007-05-26 17:14:02 UTC (rev 428) +++ trunk/web/scripts/harvesting.js 2007-05-26 17:16:39 UTC (rev 429) @@ -1,545 +0,0 @@ -//===================================================================================== -//=== -//=== API methods -//=== -//===================================================================================== - -var harvesting = new Harvesting(); -var xmlLoader = new XMLLoader(Env.locUrl +'/xml/harvesting.xml'); -var view = new HarvestView(xmlLoader); - -//===================================================================================== - -function init() -{ - view.init(); - harvesting.refresh(); - harvesting.refreshGroups(); -} - -//===================================================================================== -//=== -//=== Harvesting class -//=== -//===================================================================================== - -function Harvesting() {} - -//===================================================================================== - -Harvesting.prototype.edit = function(id) -{ - var req = gn.createRequest('id', id); - - gn.send('xml.harvesting.get', req, gn.wrap(this, this.editSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.editSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotGet'), xml); - else - view.edit(xml); -} - -//===================================================================================== - -Harvesting.prototype.update = function() -{ - if (!view.isEditDataValid()) - return; - - //--- create request - - var data = view.getEditData(); - var template= this.getTemplate(); - var request = gn.substitute(template, data); - - //--- add search list to request (in case of a 'geonetwork' node) - - var list = data.SEARCH_LIST; - - if (list) - { - var text = ''; - - for (var i=0; i<list.length; i++) - text += gn.substitute(searchTemp_GN, list[i]); - - request = gn.replace(request, '{SEARCHES}', text); - } - - //--- add privileges to request (in case of a 'webFolder' node) - - var list = data.PRIVILEGES; - - if (list) - { - var text = ''; - - for (var i=0; i<list.length; i++) - { - var groupID = list[i].GROUP; - var operList= list[i].OPERATIONS; - - text += '<group id="'+ groupID +'">'; - - for (var j=0; j<operList.length; j++) - text += '<operation name="'+operList[j]+'"/>'; - - text += '</group>'; - } - - request = gn.replace(request, '{PRIVIL_LIST}', text); - } - - //--- send add/update request - - if (view.isAdding()) - gn.send('xml.harvesting.add', request, gn.wrap(this, this.addSuccess), true); - else - gn.send('xml.harvesting.update', request, gn.wrap(this, this.updateSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.addSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotAdd'), xml); - else - { - view.append(xml); - view.show(SHOW.LIST); - } -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.updateSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotUpdate'), xml); - else - { - view.refresh(xml); - view.show(SHOW.LIST); - } -} - -//===================================================================================== - -Harvesting.prototype.remove = function() -{ - var idList = view.getIdList(); - var request= gn.createRequest('id', idList); - - if (idList.length == 0) - alert(xmlLoader.getText('pleaseSelect')); - else - { - if (confirm(xmlLoader.getText('confirmRemove')) == false) - return; - - gn.send('xml.harvesting.remove', request, gn.wrap(this, this.removeSuccess), true); - } -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.removeSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotRemove'), xml); - else - { - var ids = xml.getElementsByTagName('id'); - - for (var i=0; i<ids.length; i++) - { - var id = ids[i].firstChild.nodeValue; - - //--- if the status is not ok we ignore it. Maybe the entry has been already - //--- removed or maybe the id is simply wrong. In this case a simple refresh - //--- should be enough. - - view.remove(id); - } - } -} - -//===================================================================================== - -Harvesting.prototype.refresh = function() -{ - view.removeAll(); - gn.send('xml.harvesting.get', '<request/>', gn.wrap(this, this.refreshSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.refreshSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotGet'), xml); - else - { - var entries = gn.children(xml); - - //--- add all harvesting entries to list - - for (var i=0; i<entries.length; i++) - view.append(entries[i]); - } -} - -//===================================================================================== - -Harvesting.prototype.start = function() -{ - var idList = view.getIdList(); - var request= gn.createRequest('id', idList); - - if (idList.length == 0) - alert(xmlLoader.getText('pleaseSelect')); - else - gn.send('xml.harvesting.start', request, gn.wrap(this, this.startSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.startSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotStart'), xml); - else - { - var ids = xml.getElementsByTagName('id'); - - for (var i=0; i<ids.length; i++) - { - var id = ids[i].firstChild.nodeValue; - var status = ids[i].getAttribute('status'); - - if (status == 'ok' || status=='already-active') - { - view.unselect(id); - view.setStarted(id); - } - } - } -} - -//===================================================================================== - -Harvesting.prototype.stop = function() -{ - var idList = view.getIdList(); - var request= gn.createRequest('id', idList); - - if (idList.length == 0) - alert(xmlLoader.getText('pleaseSelect')); - else - gn.send('xml.harvesting.stop', request, gn.wrap(this, this.stopSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.stopSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotStop'), xml); - else - { - var ids = xml.getElementsByTagName('id'); - - for (var i=0; i<ids.length; i++) - { - var id = ids[i].firstChild.nodeValue; - var status = ids[i].getAttribute('status'); - - if (status == 'ok' || status=='already-inactive') - { - view.unselect(id); - view.setStopped(id); - } - } - } -} - -//===================================================================================== - -Harvesting.prototype.run = function() -{ - var idList = view.getIdList(); - var request= gn.createRequest('id', idList); - - if (idList.length == 0) - alert(xmlLoader.getText('pleaseSelect')); - else - gn.send('xml.harvesting.run', request, gn.wrap(this, this.runSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.runSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotRun'), xml); - else - { - var ids = xml.getElementsByTagName('id'); - - for (var i=0; i<ids.length; i++) - { - var id = ids[i].firstChild.nodeValue; - var status = ids[i].getAttribute('status'); - - if (status == 'ok' || status=='already-running') - { - view.unselect(id); - view.setRunning(id); - } - } - } -} - -//===================================================================================== - -Harvesting.prototype.addSearch = function() -{ - var siteName = view.getSiteName(); - var siteId = view.getSiteId(); - - if (siteName == null) - alert(xmlLoader.getText('pleaseRetrieve')); - else - view.addEmptySearch(siteName, siteId); -} - -//===================================================================================== - -Harvesting.prototype.retrieveSites = function() -{ - var data = view.getHostData(); - - if (data.HOST == '') - alert(xmlLoader.getText('supplyHost')); - - else if (data.SERVLET == '') - alert(xmlLoader.getText('supplyServlet')); - - else - { - var url = 'http://'+ data.HOST; - - if (data.PORT != '') - url += ':'+data.PORT; - - url += '/'+data.SERVLET+'/srv/en/xml.info'; - - var request = gn.substitute(retrieveTemplate, { URL : url }); - - gn.send('xml.forward', request, gn.wrap(this, this.retrieveSuccess), true); - } -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.retrieveSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotRetrieve'), xml); - else - { - view.clearSiteId(); - - var xmlSite = xml.getElementsByTagName('site') [0]; - var xmlNodes = xml.getElementsByTagName('harvestingNodes')[0]; - - var name = gn.textContent(xmlSite.getElementsByTagName('name') [0]); - var siteId = gn.textContent(xmlSite.getElementsByTagName('siteId')[0]); - - view.addSiteId(siteId, name); - - var nodeList = xmlNodes.getElementsByTagName('node'); - - for (var i=0; i<nodeList.length; i++) - { - xmlNode = nodeList[i]; - - name = gn.textContent(xmlNode.getElementsByTagName('name') [0]); - siteId = gn.textContent(xmlNode.getElementsByTagName('siteId') [0]); - count = gn.textContent(xmlNode.getElementsByTagName('metadata')[0]); - - if (count == '') - count = '0'; - - view.addSiteId(siteId, name +' ('+count+')'); - } - } -} - -//===================================================================================== -//=== WAF group methods -//===================================================================================== - -Harvesting.prototype.refreshGroups = function() -{ - var request = gn.createRequest('type', 'groups'); - - gn.send('xml.info', request, gn.wrap(this, this.refreshGroupsSuccess), true); -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.refreshGroupsSuccess = function(xml) -{ - if (xml.nodeName == 'error') - gn.showError(xmlLoader.getText('cannotRetrieve'), xml); - else - { - view.clearGroups(); - - var groups = xml.getElementsByTagName('group'); - - this.refreshGroupsAdd('0', groups); - this.refreshGroupsAdd('1', groups); - - for (var i=0; i<groups.length; i++) - { - var group = groups[i]; - - var id = group.getAttribute('id'); - var name= gn.textContent(group.getElementsByTagName(Env.lang)[0]); - - if (id != '0' && id != '1') - view.addGroup(id, name); - } - } -} - -//------------------------------------------------------------------------------------- - -Harvesting.prototype.refreshGroupsAdd = function(selId, groups) -{ - for (var i=0; i<groups.length; i++) - { - var group = groups[i]; - - var id = group.getAttribute('id'); - var name= gn.textContent(group.getElementsByTagName(Env.lang)[0]); - - if (id == selId) - view.addGroup(id, name); - } -} - -//===================================================================================== - -Harvesting.prototype.addGroup = function() -{ - var groups = view.getSelectedGroups(); - - if (groups.length == 0) alert(xmlLoader.getText('pleaseSelectGroup')); - else view.addEmptyGroupRows(groups); -} - -//===================================================================================== -//=== Private methods (or, at least, they should be so...) -//===================================================================================== - -Harvesting.prototype.getTemplate = function(xml) -{ - var type = view.getEditType(); - - if (type == 'geonetwork') - return updateTemp_GN; - - if (type == 'webFolder') - return updateTemp_WAF; - - throw 'getEditTemplate : Unknown type : '+ type; -} - -//===================================================================================== - -var updateTemp_GN = -' <node id="{ID}" name="{NAME}" type="{TYPE}">'+ -' <site>'+ -' <host>{HOST}</host>'+ -' <port>{PORT}</port>'+ -' <servlet>{SERVLET}</servlet>'+ -' <account>'+ -' <use>{USE_ACCOUNT}</use>'+ -' <username>{USERNAME}</username>'+ -' <password>{PASSWORD}</password>'+ -' </account>'+ -' </site>'+ - -' <searches>'+ -' {SEARCHES}'+ -' </searches>'+ - -' <options>'+ -' <every>{EVERY}</every>'+ -' <createGroups>{CREATE_GROUPS}</createGroups>'+ -' <createCateg>{CREATE_CATEG}</createCateg>'+ -' <oneRunOnly>{ONE_RUN_ONLY}</oneRunOnly>'+ -' </options>'+ -' </node>'; - -//===================================================================================== - -var searchTemp_GN = -' <search>'+ -' <freeText>{TEXT}</freeText>'+ -' <title>{TITLE}</title>'+ -' <abstract>{ABSTRACT}</abstract>'+ -' <keywords>{KEYWORDS}</keywords>'+ -' <digital>{DIGITAL}</digital>'+ -' <hardcopy>{HARDCOPY}</hardcopy>'+ -' <siteId>{SITE_ID}</siteId>'+ -' </search>'; - -//===================================================================================== - -var updateTemp_WAF = -' <node id="{ID}" name="{NAME}" type="{TYPE}">'+ -' <site>'+ -' <url>{URL}</url>'+ -' <account>'+ -' <use>{USE_ACCOUNT}</use>'+ -' <username>{USERNAME}</username>'+ -' <password>{PASSWORD}</password>'+ -' </account>'+ -' </site>'+ - -' <options>'+ -' <every>{EVERY}</every>'+ -' <oneRunOnly>{ONE_RUN_ONLY}</oneRunOnly>'+ -' <structure>{STRUCTURE}</structure>'+ -' <validate>{VALIDATE}</validate>'+ -' </options>'+ - -' <privileges>'+ -' {PRIVIL_LIST}'+ -' </privileges>'+ -' </node>'; - -//===================================================================================== - -var retrieveTemplate = -'<request>'+ -' <url>{URL}</url>'+ -' <params>'+ -' <request>'+ -' <type>site</type>'+ -' <type>harvestingNodes</type>'+ -' </request>'+ -' </params>'+ -'</request>'; - -//===================================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-26 17:18:09
|
Revision: 430 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=430&view=rev Author: acarboni Date: 2007-05-26 10:18:11 -0700 (Sat, 26 May 2007) Log Message: ----------- Massive Javascript refactoring to accomodate harvesting needs Added Paths: ----------- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/ trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavHarvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavParams.java trunk/web/scripts/harvesting/ trunk/web/scripts/harvesting/geonet/ trunk/web/scripts/harvesting/geonet/geonetwork.js trunk/web/scripts/harvesting/geonet/model.js trunk/web/scripts/harvesting/geonet/view.js trunk/web/scripts/harvesting/geonet20/ trunk/web/scripts/harvesting/harvester.js trunk/web/scripts/harvesting/harvesting.js trunk/web/scripts/harvesting/model.js trunk/web/scripts/harvesting/util.js trunk/web/scripts/harvesting/view.js trunk/web/scripts/harvesting/webdav/ trunk/web/scripts/harvesting/webdav/model.js trunk/web/scripts/harvesting/webdav/view.js trunk/web/scripts/harvesting/webdav/webdav.js Added: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java (rev 0) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java 2007-05-26 17:18:11 UTC (rev 430) @@ -0,0 +1,825 @@ +//============================================================================= +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.kernel.harvest.harvester.geonet20; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import jeeves.exceptions.BadParameterEx; +import jeeves.interfaces.Logger; +import jeeves.resources.dbms.Dbms; +import jeeves.server.context.ServiceContext; +import jeeves.utils.BinaryFile; +import jeeves.utils.XmlRequest; +import org.fao.geonet.constants.Edit; +import org.fao.geonet.constants.Geonet; +import org.fao.geonet.kernel.AccessManager; +import org.fao.geonet.kernel.DataManager; +import org.fao.geonet.kernel.harvest.harvester.CategoryMapper; +import org.fao.geonet.kernel.harvest.harvester.GroupMapper; +import org.fao.geonet.kernel.harvest.harvester.UUIDMapper; +import org.fao.geonet.kernel.mef.MEFLib; +import org.fao.geonet.kernel.mef.MEFVisitor; +import org.fao.geonet.lib.Lib; +import org.fao.geonet.util.ISODate; +import org.jdom.Element; + +//============================================================================= + +public class Aligner +{ + //-------------------------------------------------------------------------- + //--- + //--- Constructor + //--- + //-------------------------------------------------------------------------- + + public Aligner(Logger log, XmlRequest req, GeonetParams params, DataManager dm, + Dbms dbms, ServiceContext sc, CategoryMapper cm, GroupMapper gm, + Element remoteInfo) + { + this.log = log; + this.req = req; + this.params = params; + this.dataMan = dm; + this.dbms = dbms; + this.context = sc; + this.localCateg = cm; + this.localGroups= gm; + + //--- save remote categories and groups into hashmaps for a fast access + + List list = remoteInfo.getChild("categories").getChildren("category"); + setupLocEntity(list, hmRemoteCateg); + + list = remoteInfo.getChild("groups").getChildren("group"); + setupLocEntity(list, hmRemoteGroups); + } + + //-------------------------------------------------------------------------- + + private void setupLocEntity(List list, HashMap<String, HashMap<String, String>> hmEntity) + { + + for (int i=0; i<list.size(); i++) + { + Element entity= (Element) list.get(i); + String name = entity.getChildText("name"); + + HashMap<String, String> hm = new HashMap<String, String>(); + hmEntity.put(name, hm); + + List labels = entity.getChild("label").getChildren(); + + for (int j=0; j<labels.size(); j++) + { + Element el = (Element) labels.get(j); + hm.put(el.getName(), el.getText()); + } + } + } + + //-------------------------------------------------------------------------- + //--- + //--- Alignment method + //--- + //-------------------------------------------------------------------------- + + public AlignerResult align(Element result, String siteId) throws Exception + { + log.info("Start of alignment for site-id="+ siteId); + + this.result = new AlignerResult(); + this.result.siteId = siteId; + + List mdList = result.getChildren("metadata"); + + //----------------------------------------------------------------------- + //--- retrieve local uuids for given site-id + + localUuids = new UUIDMapper(dbms, siteId); + + //----------------------------------------------------------------------- + //--- remove old metadata + + for (String uuid : localUuids.getUUIDs()) + if (!exists(mdList, uuid)) + { + String id = localUuids.getID(uuid); + + log.debug(" - Removing old metadata with id="+ id); + dataMan.deleteMetadata(dbms, id); + dbms.commit(); + this.result.locallyRemoved++; + } + + //----------------------------------------------------------------------- + //--- insert/update new metadata + + for(Iterator i=mdList.iterator(); i.hasNext(); ) + { + Element info = ((Element) i.next()).getChild("info", Edit.NAMESPACE); + + String remoteId = info.getChildText("id"); + String remoteUuid= info.getChildText("uuid"); + String schema = info.getChildText("schema"); + String changeDate= info.getChildText("changeDate"); + + this.result.totalMetadata++; + + log.debug("Obtained remote id="+ remoteId +", changeDate="+ changeDate); + + if (!dataMan.existsSchema(schema)) + { + log.debug(" - Skipping unsupported schema : "+ schema); + this.result.schemaSkipped++; + } + else + { + String id = dataMan.getMetadataId(dbms, remoteUuid); + + File mefFile = retrieveMEF(remoteUuid); + + try + { + if (id == null) id = addMetadata(siteId, info, mefFile); + else updateMetadata(siteId, info, id, mefFile); + } + finally + { + mefFile.delete(); + } + + dbms.commit(); + dataMan.indexMetadata(dbms, id); + } + } + + log.info("End of alignment for site-id="+ siteId); + + return this.result; + } + + //-------------------------------------------------------------------------- + //--- + //--- Private methods : addMetadata + //--- + //-------------------------------------------------------------------------- + + private String addMetadata(final String siteId, final Element info, + File mefFile) throws Exception + { + final String id[] = { "" }; + + //--- import metadata from MEF file + + MEFLib.visit(mefFile, new MEFVisitor() + { + public void handleMetadata(Element md) throws Exception + { + String remoteId = info.getChildText("id"); + String remoteUuid = info.getChildText("uuid"); + String schema = info.getChildText("schema"); + String createDate = info.getChildText("createDate"); + String changeDate = info.getChildText("changeDate"); + String isTemplate = info.getChildText("isTemplate"); + + log.debug(" - Adding metadata with remote id="+ remoteId); + + id[0] = dataMan.insertMetadataExt(dbms, schema, md, context.getSerialFactory(), + siteId, createDate, changeDate, remoteUuid, null); + + int iId = Integer.parseInt(id[0]); + + dataMan.setTemplate(dbms, iId, isTemplate, null); + dataMan.setHarvestedBit(dbms, iId, true); + + String pubDir = Lib.resource.getDir(context, "public", id[0]); + String priDir = Lib.resource.getDir(context, "private", id[0]); + + new File(pubDir).mkdirs(); + new File(priDir).mkdirs(); + + result.addedMetadata++; + } + + //-------------------------------------------------------------------- + + public void handleInfo(Element info) throws Exception + { + addCategories(id[0], info.getChild("categories")); + addPrivileges(id[0], info.getChild("privileges")); + } + + //-------------------------------------------------------------------- + + public void handlePublicFile(String file, String changeDate, InputStream is) throws IOException + { + log.debug(" - Adding remote public file with name="+ file); + String pubDir = Lib.resource.getDir(context, "public", id[0]); + + File outFile = new File(pubDir, file); + FileOutputStream os = new FileOutputStream(outFile); + BinaryFile.copy(is, os, false, true); + outFile.setLastModified(new ISODate(changeDate).getSeconds() * 1000); + } + + //-------------------------------------------------------------------- + + public void handlePrivateFile(String file, String changeDate, InputStream is) {} + }); + + return id[0]; + } + + //-------------------------------------------------------------------------- + //--- Categories + //-------------------------------------------------------------------------- + + private void addCategories(String id, Element categ) throws Exception + { + List list = categ.getChildren("category"); + + for(Iterator j=list.iterator(); j.hasNext();) + { + String catName = ((Element) j.next()).getAttributeValue("name"); + String catId = localCateg.getID(catName); + + if (catId != null) + { + //--- remote category exists locally + + log.debug(" - Setting category : "+ catName); + dataMan.setCategory(dbms, id, catId); + } + + else if (params.createCateg) + { + //--- the remote category does not exist locally : create it + + log.debug(" - Creating local category : "+ catName); + catId = createCategory(catName) +""; + + log.debug(" - Setting category : "+ catName); + dataMan.setCategory(dbms, id, catId); + } + } + } + + //-------------------------------------------------------------------------- + + private int createCategory(String name) throws Exception + { + Map<String, String> hm = hmRemoteCateg.get(name); + + if (hm == null) + throw new BadParameterEx("Specified category was not found remotely", name); + + int id = context.getSerialFactory().getSerial(dbms, "Categories"); + + dbms.execute("INSERT INTO Categories(id, name) VALUES (?, ?)", id, name); + Lib.local.insert(dbms, "Categories", id, hm, "<"+name+">"); + + localCateg.add(name, id+""); + + return id; + } + + //-------------------------------------------------------------------------- + //--- Privileges + //-------------------------------------------------------------------------- + + private void addPrivileges(String id, Element privil) throws Exception + { + List list = privil.getChildren("group"); + + for (int i=0; i<list.size(); i++) + { + Element group = (Element) list.get(i); + String grpName = group.getAttributeValue("name"); + String grpId = localGroups.getID(grpName); + + if (grpId != null) + { + //--- remote group exists locally + + log.debug(" - Setting privileges for group : "+ grpName); + addOperations(group, id, grpId); + } + + else if (params.createGroups) + { + //--- the remote group does not exist locally : create it + + log.debug(" - Creating local group : "+ grpName); + grpId = createGroup(grpName) +""; + + log.debug(" - Setting privileges for group : "+ grpName); + addOperations(group, id, grpId); + } + } + } + + //-------------------------------------------------------------------------- + + private void addOperations(Element group, String id, String grpId) throws Exception + { + List opers = group.getChildren("operation"); + + for (int j=0; j<opers.size(); j++) + { + Element oper = (Element) opers.get(j); + String opName = oper.getAttributeValue("name"); + + int opId = dataMan.getAccessManager().getPrivilegeId(opName); + + log.debug(" --> "+ opName); + dataMan.setOperation(dbms, id, grpId, opId +""); + } + } + + //-------------------------------------------------------------------------- + + private int createGroup(String name) throws Exception + { + Map<String, String> hm = hmRemoteGroups.get(name); + + if (hm == null) + throw new BadParameterEx("Specified group was not found remotely", name); + + int id = context.getSerialFactory().getSerial(dbms, "Groups"); + + dbms.execute("INSERT INTO Groups(id, name) VALUES (?, ?)", id, name); + Lib.local.insert(dbms, "Groups", id, hm, "<"+name+">"); + + localGroups.add(name, id +""); + + return id; + } + + //-------------------------------------------------------------------------- + //--- + //--- Private methods : updateMetadata + //--- + //-------------------------------------------------------------------------- + + private void updateMetadata(String siteId, Element info, final String id, + File mefFile) throws Exception + { + //String remoteId = info.getChildText("id"); + final String remoteUuid= info.getChildText("uuid"); + final String changeDate= info.getChildText("changeDate"); + + final Element thumbs[] = { null }; + + if (localUuids.getID(remoteUuid) == null) + { + log.error(" - Warning! The remote uuid '"+ remoteUuid +"' does not belong to site '"+ siteId+"'"); + log.error(" - The site id of this metadata has been changed."); + log.error(" - The metadata update will be skipped."); + + result.uuidSkipped++; + } + else + { + MEFLib.visit(mefFile, new MEFVisitor() + { + public void handleMetadata(Element md) throws Exception + { + updateMetadata(id, md, remoteUuid, changeDate); + } + + //----------------------------------------------------------------- + + public void handleInfo(Element info) throws Exception + { + updateCategories(id, info.getChild("categories")); + updatePrivileges(id, info.getChild("privileges")); + thumbs[0] = info.getChild("thumbnails"); + } + + //----------------------------------------------------------------- + + public void handlePublicFile(String file, String changeDate, InputStream is) throws IOException + { + updateFile(id, file, changeDate, is, thumbs[0]); + } + + //----------------------------------------------------------------- + + public void handlePrivateFile(String file, String changeDate, InputStream is) {} + }); + } + } + + //-------------------------------------------------------------------------- + + private void updateMetadata(String id, Element md, String remoteUuid, + String changeDate) throws Exception + { + String date = localUuids.getChangeDate(remoteUuid); + + if (!updateCondition(date, changeDate)) + { + log.debug(" - XML not changed to local metadata with id="+ id); + result.unchangedMetadata++; + } + else + { + log.debug(" - Updating local metadata with id="+ id); + dataMan.updateMetadataExt(dbms, id, md, changeDate); + + result.updatedMetadata++; + } + } + + //-------------------------------------------------------------------------- + + private void updateCategories(String id, Element categs) throws Exception + { + List catList = categs.getChildren("category"); + + //--- remove old categories + + List locCateg = dataMan.getCategories(dbms, id).getChildren(); + + for (int i=0; i<locCateg.size(); i++) + { + Element el = (Element) locCateg.get(i); + + String catId = el.getChildText("id"); + String catName = el.getChildText("name"); + + if (!existsCategory(catList, catName)) + { + log.debug(" - Unsetting category : "+ catName); + dataMan.unsetCategory(dbms, id, catId); + } + } + + //--- add new categories + + for (Iterator j=catList.iterator(); j.hasNext();) + { + Element categ = (Element) j.next(); + String catName = categ.getAttributeValue("name"); + String catId = localCateg.getID(catName); + + if (catId != null) + { + //--- it is not necessary to query the db. Anyway... + if (!dataMan.isCategorySet(dbms, id, catId)) + { + log.debug(" - Setting category : "+ catName); + dataMan.setCategory(dbms, id, catId); + } + } + + else if (params.createCateg) + { + //--- the remote category does not exist locally : create it + + log.debug(" - Creating local category : "+ catName); + catId = createCategory(catName) +""; + + log.debug(" - Setting category : "+ catName); + dataMan.setCategory(dbms, id, catId); + } + } + } + + //-------------------------------------------------------------------------- + + private boolean existsCategory(List catList, String name) + { + for(Iterator i=catList.iterator(); i.hasNext();) + { + Element categ = (Element) i.next(); + String catName = categ.getAttributeValue("name"); + + if (catName.equals(name)) + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + + private void updatePrivileges(String id, Element privil) throws Exception + { + List grpList = privil.getChildren("group"); + + //--- remove old operations + + List locOper = getOperations(dbms, id).getChildren(); + + for (int i=0; i<locOper.size(); i++) + { + Element oper = (Element) locOper.get(i); + String grpName = oper.getChildText("grpname"); + String operName = oper.getChildText("opname"); + + int grpId = Integer.parseInt(oper.getChildText("grpid")); + int operId = Integer.parseInt(oper.getChildText("opid")); + + if (!existsOperation(grpList, grpName, operName)) + { + log.debug(" - Unsetting operation : "+ grpName +"/"+ operName); + dataMan.unsetOperation(dbms, new Integer(id), grpId, operId); + } + } + + //--- add new operations + + for (int i=0; i<grpList.size(); i++) + { + Element group = (Element) grpList.get(i); + String grpName = group.getAttributeValue("name"); + String grpId = localGroups.getID(grpName); + + if (grpId != null) + updateOperations(group, id, grpId, grpName, locOper); + + else if (params.createGroups) + { + //--- the remote group does not exist locally : create it + + log.debug(" - Creating local group : "+ grpName); + grpId = createGroup(grpName) +""; + + log.debug(" - Setting privileges for group : "+ grpName); + addOperations(group, id, grpId); + } + } + } + + //-------------------------------------------------------------------------- + + private Element getOperations(Dbms dbms, String mdId) throws Exception + { + String query = "SELECT G.id as grpId, O.id as opId, G.name AS grpName, O.name as opName "+ + "FROM Groups G, Operations O, OperationAllowed "+ + "WHERE G.id=groupId AND O.id=operationId AND metadataId=?"; + + return dbms.select(query, new Integer(mdId)); + } + + //-------------------------------------------------------------------------- + + private void updateOperations(Element group, String id, String grpId, + String grpName, List locOper) throws Exception + { + List opers = group.getChildren("operation"); + + for (int j=0; j<opers.size(); j++) + { + Element oper = (Element) opers.get(j); + String opName = oper.getAttributeValue("name"); + String opId = dataMan.getAccessManager().getPrivilegeId(opName) +""; + + if (!isOperationSet(locOper, grpId, opId)) + { + log.debug(" - Setting operation : "+ grpName +"/"+ opName); + dataMan.setOperation(dbms, id, grpId, opId +""); + } + } + } + + //-------------------------------------------------------------------------- + + private boolean existsOperation(List list, String grpName, String operName) + { + for (int i=0; i<list.size(); i++) + { + Element group = (Element) list.get(i); + + if (grpName.equals(group.getAttributeValue("name"))) + { + List operList = group.getChildren("operation"); + + for (int j=0; j<operList.size(); j++) + { + Element oper = (Element) operList.get(j); + + if (operName.equals(oper.getAttributeValue("name"))) + return true; + } + + //--- there can be only 1 group with a given name + return false; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + + private boolean isOperationSet(List locOpers, String grpId, String operId) + { + for (int i=0; i<locOpers.size(); i++) + { + Element oper = (Element) locOpers.get(i); + + String gId = oper.getChildText("grpid"); + String oId = oper.getChildText("opid"); + + if (grpId.equals(gId) && operId.equals(oId)) + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + //--- Public file update methods + //-------------------------------------------------------------------------- + + private void updateFile(String id, String file, String changeDate, InputStream is, + Element files) throws IOException + { + if (files == null) + log.debug(" - No 'public' element in info.xml. Cannot update public file :"+ file); + else + { + removeOldFile(id, files); + updateChangedFile(id, file, changeDate, is); + } + } + + //-------------------------------------------------------------------------- + + private void removeOldFile(String id, Element infoFiles) + { + File pubDir = new File(Lib.resource.getDir(context, "public", id)); + + File files[] = pubDir.listFiles(); + + if (files == null) + log.error(" - Cannot scan directory for public files : "+ pubDir.getAbsolutePath()); + + else for (File file : files) + if (!existsFile(file.getName(), infoFiles)) + { + log.debug(" - Removing old public file with name="+ file.getName()); + file.delete(); + } + } + + //-------------------------------------------------------------------------- + + private boolean existsFile(String fileName, Element files) + { + List list = files.getChildren("file"); + + for (int i=0; i<list.size(); i++) + { + Element elem = (Element) list.get(i); + String name = elem.getAttributeValue("name"); + + if (fileName.equals(name)) + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + + private void updateChangedFile(String id, String file, String changeDate, + InputStream is) throws IOException + { + String pubDir = Lib.resource.getDir(context, "public", id); + File locFile = new File(pubDir, file); + + ISODate locIsoDate = new ISODate(locFile.lastModified()); + ISODate remIsoDate = new ISODate(changeDate); + + if (!locFile.exists() || remIsoDate.sub(locIsoDate) > 0) + { + log.debug(" - Adding remote public file with name="+ file); + + FileOutputStream os = new FileOutputStream(locFile); + BinaryFile.copy(is, os, false, true); + locFile.setLastModified(remIsoDate.getSeconds() * 1000); + } + else + { + log.debug(" - Nothing to do to public file with name="+ file); + } + } + + //-------------------------------------------------------------------------- + //--- + //--- Private methods + //--- + //-------------------------------------------------------------------------- + + /** Return true if the sourceId is present in the remote site */ + + private boolean exists(List mdList, String uuid) + { + for(Iterator i=mdList.iterator(); i.hasNext(); ) + { + Element elInfo = ((Element) i.next()).getChild("info", Edit.NAMESPACE); + + if (uuid.equals(elInfo.getChildText("uuid"))) + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + + private File retrieveMEF(String uuid) throws IOException + { + req.clearParams(); + req.addParam("uuid", uuid); + req.addParam("format", "partial"); + + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.MEF_EXPORT); + + File tempFile = File.createTempFile("temp-", ".dat"); + req.executeLarge(tempFile); + + return tempFile; + } + + //-------------------------------------------------------------------------- + + private boolean updateCondition(String localDate, String remoteDate) + { + ISODate local = new ISODate(localDate); + ISODate remote= new ISODate(remoteDate); + + //--- accept if remote date is greater than local date + + return (remote.sub(local) > 0); + } + + //-------------------------------------------------------------------------- + //--- + //--- Variables + //--- + //-------------------------------------------------------------------------- + + private Dbms dbms; + private Logger log; + private XmlRequest req; + private GeonetParams params; + private DataManager dataMan; + private ServiceContext context; + private CategoryMapper localCateg; + private GroupMapper localGroups; + private UUIDMapper localUuids; + private AlignerResult result; + + private HashMap<String, HashMap<String, String>> hmRemoteCateg = new HashMap<String, HashMap<String, String>>(); + private HashMap<String, HashMap<String, String>> hmRemoteGroups = new HashMap<String, HashMap<String, String>>(); +} + +//============================================================================= + +class AlignerResult +{ + public String siteId; + + public int totalMetadata; + public int addedMetadata; + public int updatedMetadata; + public int unchangedMetadata; + public int locallyRemoved; + public int schemaSkipped; + public int uuidSkipped; +} + +//============================================================================= + Added: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java (rev 0) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java 2007-05-26 17:18:11 UTC (rev 430) @@ -0,0 +1,407 @@ +//============================================================================= +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.kernel.harvest.harvester.geonet20; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import jeeves.exceptions.BadInputEx; +import jeeves.exceptions.BadServerResponseEx; +import jeeves.exceptions.UserNotFoundEx; +import jeeves.interfaces.Logger; +import jeeves.resources.dbms.Dbms; +import jeeves.server.context.ServiceContext; +import jeeves.server.resources.ResourceManager; +import jeeves.utils.Xml; +import jeeves.utils.XmlRequest; +import org.fao.geonet.constants.Geonet; +import org.fao.geonet.kernel.harvest.Common.Status; +import org.fao.geonet.kernel.harvest.harvester.AbstractHarvester; +import org.fao.geonet.kernel.harvest.harvester.CategoryMapper; +import org.fao.geonet.kernel.harvest.harvester.GroupMapper; +import org.fao.geonet.lib.Lib; +import org.jdom.Element; + +//============================================================================= + +public class Geonet20Harvester extends AbstractHarvester +{ + //-------------------------------------------------------------------------- + //--- + //--- Static init + //--- + //-------------------------------------------------------------------------- + + public static void init(ServiceContext context) throws Exception + { + } + + //-------------------------------------------------------------------------- + //--- + //--- Harvesting type + //--- + //-------------------------------------------------------------------------- + + public String getType() { return "geonetwork20"; } + + //-------------------------------------------------------------------------- + //--- + //--- Init + //--- + //-------------------------------------------------------------------------- + + protected void doInit(Element node) + { + params.init(node); + } + + //--------------------------------------------------------------------------- + //--- + //--- Destroy + //--- + //--------------------------------------------------------------------------- + + protected void doDestroy(Dbms dbms) throws SQLException + { + String getQuery = "SELECT id FROM Metadata WHERE source = ?"; + + String opAllQuery = "DELETE FROM OperationAllowed WHERE metadataId = ?"; + String mdCatQuery = "DELETE FROM MetadataCateg WHERE metadataId = ?"; + String mdQuery = "DELETE FROM Metadata WHERE source = ?"; + + for (Search s : params.getSearches()) + { + for (Object o : dbms.select(getQuery, s.siteId).getChildren()) + { + Element el = (Element) o; + int id = Integer.parseInt(el.getChildText("id")); + + dbms.execute(opAllQuery, id); + dbms.execute(mdCatQuery, id); + } + + dbms.execute(mdQuery, s.siteId); + } + } + + //--------------------------------------------------------------------------- + //--- + //--- Add + //--- + //--------------------------------------------------------------------------- + + protected String doAdd(Dbms dbms, Element node) throws BadInputEx, SQLException + { + //--- retrieve/initialize information + + params.create(node); + + //--- setup geonetwork node + + String id = settingMan.add(dbms, "harvesting", "node", getType()); + String path = "id:"+ id; + + String siteID = settingMan.add(dbms, path, "site", ""); + String optionsID = settingMan.add(dbms, path, "options", ""); + String infoID = settingMan.add(dbms, path, "info", ""); + + //--- setup site node ---------------------------------------- + + settingMan.add(dbms, "id:"+siteID, "name", node.getAttributeValue("name")); + settingMan.add(dbms, "id:"+siteID, "host", params.host); + settingMan.add(dbms, "id:"+siteID, "port", params.port); + settingMan.add(dbms, "id:"+siteID, "servlet", params.servlet); + + String useAccID = settingMan.add(dbms, "id:"+siteID, "useAccount", params.useAccount); + + settingMan.add(dbms, "id:"+useAccID, "username", params.username); + settingMan.add(dbms, "id:"+useAccID, "password", params.password); + + //--- setup search nodes --------------------------------------- + + addSearches(dbms, path, params); + + //--- setup options node --------------------------------------- + + settingMan.add(dbms, "id:"+optionsID, "every", params.every); + settingMan.add(dbms, "id:"+optionsID, "createGroups", params.createGroups); + settingMan.add(dbms, "id:"+optionsID, "createCateg", params.createCateg); + settingMan.add(dbms, "id:"+optionsID, "oneRunOnly", params.oneRunOnly); + settingMan.add(dbms, "id:"+optionsID, "status", Status.INACTIVE); + + //--- setup stats node ---------------------------------------- + + settingMan.add(dbms, "id:"+infoID, "lastRun", ""); + + return id; + } + + //--------------------------------------------------------------------------- + //--- + //--- Update + //--- + //--------------------------------------------------------------------------- + + protected void doUpdate(Dbms dbms, String id, Element node) throws BadInputEx, SQLException + { + //--- update variables + + GeonetParams copy = params.copy(); + copy.update(node); + + //--- update database + + Element site = node.getChild("site"); + Element opt = node.getChild("options"); + Element searches = node.getChild("searches"); + Element account = (site == null) ? null : site.getChild("account"); + + String path = "harvesting/id:"+ id; + String name = node.getAttributeValue("name"); + + Map<String, Object> values = new HashMap<String, Object>(); + + if (name != null) + values.put(path +"/site/name", name); + + setValue(values, path +"/site/host", site, "host"); + setValue(values, path +"/site/port", site, "port"); + setValue(values, path +"/site/servlet", site, "servlet"); + + setValue(values, path +"/site/useAccount", account, "use"); + setValue(values, path +"/site/useAccount/username", account, "username"); + setValue(values, path +"/site/useAccount/password", account, "password"); + + setValue(values, path +"/options/every", opt, "every"); + setValue(values, path +"/options/createGroups", opt, "createGroups"); + setValue(values, path +"/options/createCateg", opt, "createCateg"); + setValue(values, path +"/options/oneRunOnly", opt, "oneRunOnly"); + + settingMan.setValues(dbms, values); + + //--- update the search entry if some 'search' elements are provided + + if (searches != null) + { + //--- remove all search entries + + Iterator oldSearches = settingMan.get(path ,1).getChild("children").getChildren("search").iterator(); + + while (oldSearches.hasNext()) + { + Element search = (Element) oldSearches.next(); + String searchId = search.getAttributeValue("id"); + + settingMan.remove(dbms, path +"/id:"+ searchId); + } + + //--- add new search entries + + addSearches(dbms, path, copy); + } + + //--- we update a copy first because if there is an exception GeonetParams + //--- could be half updated and so it could be in an inconsistent state + + params = copy; + } + + //--------------------------------------------------------------------------- + + private void addSearches(Dbms dbms, String path, GeonetParams params) throws SQLException + { + for (Search s : params.getSearches()) + { + String searchID = settingMan.add(dbms, path, "search", ""); + + settingMan.add(dbms, "id:"+searchID, "freeText", s.freeText); + settingMan.add(dbms, "id:"+searchID, "title", s.title); + settingMan.add(dbms, "id:"+searchID, "abstract", s.abstrac); + settingMan.add(dbms, "id:"+searchID, "keywords", s.keywords); + settingMan.add(dbms, "id:"+searchID, "digital", s.digital); + settingMan.add(dbms, "id:"+searchID, "hardcopy", s.hardcopy); + settingMan.add(dbms, "id:"+searchID, "siteId", s.siteId); + } + } + + //--------------------------------------------------------------------------- + //--- + //--- GetTimeout + //--- + //--------------------------------------------------------------------------- + + protected int doGetEvery() { return params.every; } + + //--------------------------------------------------------------------------- + + protected boolean doIsOneRunOnly() { return params.oneRunOnly; } + + //--------------------------------------------------------------------------- + //--- + //--- AddInfo + //--- + //--------------------------------------------------------------------------- + + protected void doAddInfo(Element node) + { + Element info = node.getChild("info"); + Element searches = node.getChild("searches"); + + //--- if the harvesting is not started yet, we don't have any info + + if (result == null) + return; + + //--- ok, add proper info + + for (AlignerResult ar : result.alResult) + { + Element site = new Element("search"); + site.setAttribute("siteId", ar.siteId); + + add(site, "total", ar.totalMetadata); + add(site, "added", ar.addedMetadata); + add(site, "updated", ar.updatedMetadata); + add(site, "unchanged", ar.unchangedMetadata); + add(site, "skipped", ar.schemaSkipped+ ar.uuidSkipped); + add(site, "removed", ar.locallyRemoved); + + info.addContent(site); + } + } + + //--------------------------------------------------------------------------- + + private void add(Element el, String name, int value) + { + el.addContent(new Element(name).setText(Integer.toString(value))); + } + + //--------------------------------------------------------------------------- + //--- + //--- Harvest + //--- + //--------------------------------------------------------------------------- + + protected void doHarvest(Logger log, ResourceManager rm) throws Exception + { + Dbms dbms = (Dbms) rm.open(Geonet.Res.MAIN_DB); + + CategoryMapper localCateg = new CategoryMapper(dbms); + GroupMapper localGroups= new GroupMapper(dbms); + + XmlRequest req = new XmlRequest(params.host, params.port); + + Lib.net.setupProxy(context, req); + + //--- login + + if (params.useAccount) + { + log.info("Login into : "+ getName()); + + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_LOGIN); + req.addParam("username", params.username); + req.addParam("password", params.password); + + Element response = req.execute(); + + if (!response.getName().equals("ok")) + throw new UserNotFoundEx(params.username); + } + + //--- retrieve info on categories and groups + + log.info("Retrieving info on categories and groups from : "+ getName()); + + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_INFO); + req.clearParams(); + req.addParam("type", "site"); + req.addParam("type", "categories"); + req.addParam("type", "groups"); + req.addParam("type", "knownNodes"); + + Element remoteInfo = req.execute(); + + if (!remoteInfo.getName().equals("info")) + throw new BadServerResponseEx(remoteInfo); + + //--- search + + result = new GeonetResult(); + + Aligner aligner = new Aligner(log, req, params, dataMan, dbms, context, + localCateg, localGroups, remoteInfo); + + for(Search s : params.getSearches()) + { + log.info("Searching on : "+ getName() +"/"+ s.siteId); + + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_SEARCH); + + Element searchResult = req.execute(s.createRequest()); + + log.debug("Obtained:\n"+Xml.getString(searchResult)); + + //--- site alignment + AlignerResult ar = aligner.align(searchResult, s.siteId); + + //--- collect some stats + result.alResult.add(ar); + } + + //--- logout + + if (params.useAccount) + { + log.info("Logout from : "+ getName()); + + req.clearParams(); + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_LOGOUT); + } + + dbms.commit(); + } + + //--------------------------------------------------------------------------- + //--- + //--- Variables + //--- + //--------------------------------------------------------------------------- + + private GeonetParams params = new GeonetParams(); + private GeonetResult result = null; +} + +//============================================================================= + +class GeonetResult +{ + public ArrayList<AlignerResult> alResult = new ArrayList<AlignerResult>(); +} + +//============================================================================= + Added: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java (rev 0) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java 2007-05-26 17:18:11 UTC (rev 430) @@ -0,0 +1,310 @@ +//============================================================================= +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.kernel.harvest.harvester.geonet20; + +import java.util.ArrayList; +import java.util.Iterator; +import jeeves.exceptions.BadInputEx; +import jeeves.exceptions.BadParameterEx; +import org.fao.geonet.kernel.harvest.harvester.AbstractParams; +import org.fao.geonet.lib.Lib; +import org.jdom.Element; + +//============================================================================= + +public class GeonetParams extends AbstractParams +{ + //-------------------------------------------------------------------------- + //--- + //--- Init : called when an entry is read from database. Vars are initialized + //--- from the given entry + //--- + //-------------------------------------------------------------------------- + + public void init(Element node) + { + Element site = node.getChild("site"); + Element opt = node.getChild("options"); + Element searches = node.getChild("searches"); + Element account = site.getChild("account"); + + host = site.getChildText("host"); + port = Integer.parseInt(site.getChildText("port")); + servlet = site.getChildText("servlet"); + + useAccount = account.getChildText("use").equals("true"); + username = account.getChildText("username"); + password = account.getChildText("password"); + + every = Integer.parseInt(opt.getChildText("every")); + createGroups = opt.getChildText("createGroups").equals("true"); + createCateg = opt.getChildText("createCateg") .equals("true"); + oneRunOnly = opt.getChildText("oneRunOnly") .equals("true"); + + //--- add searches + + alSearches.clear(); + + Iterator i = searches.getChildren("search").iterator(); + + while (i.hasNext()) + { + Element search = (Element) i.next(); + + Search s = new Search(); + + s.freeText = search.getChildText("freeText"); + s.title = search.getChildText("title"); + s.abstrac = search.getChildText("abstract"); + s.keywords = search.getChildText("keywords"); + s.digital = search.getChildText("digital") .equals("true"); + s.hardcopy = search.getChildText("hardcopy").equals("true"); + s.siteId = search.getChildText("siteId"); + + alSearches.add(s); + } + } + + //--------------------------------------------------------------------------- + //--- + //--- Create : called when a new entry must be added. Reads values from the + //--- provided entry, providing default values + //--- + //--------------------------------------------------------------------------- + + public void create(Element node) throws BadInputEx + { + Element site = node.getChild("site"); + Element opt = node.getChild("options"); + Element searches = node.getChild("searches"); + Element account = (site == null) ? null : site.getChild("account"); + + host = getValue(site, "host", ""); + port = getValue(site, "port", 80); + servlet = getValue(site, "servlet", "geonetwork"); + + useAccount = getValue(account, "use", false); + username = getValue(account, "username", ""); + password = getValue(account, "password", ""); + + createGroups = getValue(opt, "createGroups", true ); + createCateg = getValue(opt, "createCateg", true ); + oneRunOnly = getValue(opt, "oneRunOnly", false); + every = getValue(opt, "every", 90 ); + + checkEvery(every); + checkPort(port); + addSearches(searches); + } + + //--------------------------------------------------------------------------- + //--- + //--- Update : called when an entry has changed and variables must be updated + //--- + //--------------------------------------------------------------------------- + + public void update(Element node) throws BadInputEx + { + Element site = node.getChild("site"); + Element opt = node.getChild("options"); + Element searches = node.getChild("searches"); + Element account = (site == null) ? null : site.getChild("account"); + + host = getValue(site, "host", host); + port = getValue(site, "port", port); + servlet = getValue(site, "servlet", servlet); + + useAccount = getValue(account, "use", useAccount); + username = getValue(account, "username", username); + password = getValue(account, "password", password); + + every = getValue(opt, "every", every); + createGroups = getValue(opt, "createGroups", createGroups); + createCateg = getValue(opt, "createCateg", createCateg); + oneRunOnly = getValue(opt, "oneRunOnly", oneRunOnly); + + checkEvery(every); + checkPort(port); + + //--- if some search queries are given, we drop the previous ones and + //--- set these new ones + + if (searches != null) + addSearches(searches); + } + + //--------------------------------------------------------------------------- + //--- + //--- Other API methods + //--- + //--------------------------------------------------------------------------- + + public Iterable<Search> getSearches() { return alSearches; } + + //--------------------------------------------------------------------------- + + public GeonetParams copy() + { + GeonetParams copy = new GeonetParams(); + + copy.host = host; + copy.port = port; + copy.servlet = servlet; + + copy.useAccount = useAccount; + copy.username = username; + copy.password = password; + + copy.every = every; + copy.createGroups = createGroups; + copy.createCateg = createCateg; + copy.oneRunOnly = oneRunOnly; + + for (Search s : alSearches) + copy.alSearches.add(s.copy()); + + return copy; + } + + //--------------------------------------------------------------------------- + //--- + //--- Private methods + //--- + //--------------------------------------------------------------------------- + + private void addSearches(Element searches) throws BadInputEx + { + alSearches.clear(); + + if (searches == null) + return; + + Iterator searchList = searches.getChildren("search").iterator(); + + while (searchList.hasNext()) + { + Element search = (Element) searchList.next(); + + Search s = new Search(); + + s.freeText = getValue(search, "freeText", ""); + s.title = getValue(search, "title", ""); + s.abstrac = getValue(search, "abstract", ""); + s.keywords = getValue(search, "keywords", ""); + s.digital = getValue(search, "digital", false); + s.hardcopy = getValue(search, "hardcopy", false); + s.siteId = getValue(search, "siteId", ""); + + alSearches.add(s); + + if (s.siteId.equals("")) + throw new BadParameterEx("siteId", ""); + } + } + + //--------------------------------------------------------------------------- + //--- + //--- Variables + //--- + //--------------------------------------------------------------------------- + + public String host; + public int port; + public String servlet; + + public boolean useAccount; + public String username; + public String password; + + public int every; + public boolean createGroups; + public boolean createCateg; + public boolean oneRunOnly; + + private ArrayList<Search> alSearches = new ArrayList<Search>(); +} + +//============================================================================= + +class Search +{ + //--------------------------------------------------------------------------- + //--- + //--- API methods + //--- + //--------------------------------------------------------------------------- + + public Search copy() + { + Search s = new Search(); + + s.freeText = freeText; + s.title = title; + s.abstrac = abstrac; + s.keywords = keywords; + s.digital = digital; + s.hardcopy = hardcopy; + s.siteId = siteId; + + return s; + } + + //--------------------------------------------------------------------------- + + public Element createRequest() + { + Element req = new Element("request"); + + Lib.element.add(req, "any", freeText); + Lib.element.add(req, "title", title); + Lib.element.add(req, "abstract", abstrac); + Lib.element.add(req, "themekey", keywords); + Lib.element.add(req, "siteId", siteId); + + if (digital) + Lib.element.add(req, "digital", "on"); + + if (hardcopy) + Lib.element.add(req, "paper", "on"); + + return req; + } + + //--------------------------------------------------------------------------- + //--- + //--- Variables + //--- + //--------------------------------------------------------------------------- + + public String freeText; + public String title; + public String abstrac; + public String keywords; + public boolean digital; + public boolean hardcopy; + public String siteId; +} + +//============================================================================= + Added: trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavHarvester.java (rev 0) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavHarvester.java 2007-05-26 17:18:11 UTC (rev 430) @@ -0,0 +1,256 @@ +//============================================================================= +//=== Copyright (C) 2001-2007 Food and Agriculture Organization of the +//=== United Nations (FAO-UN), United Nations World Food Programme (WFP) +//=== and United Nations Environment Programme (UNEP) +//=== +//=== This program is free software; you can redistribute it and/or modify +//=== it under the terms of the GNU General Public License as published by +//=== the Free Software Foundation; either version 2 of the License, or (at +//=== your option) any later version. +//=== +//=== This program is distributed in the hope that it will be useful, but +//=== WITHOUT ANY WARRANTY; without even the implied warranty of +//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +//=== General Public License for more details. +//=== +//=== You should have received a copy of the GNU General Public License +//=== along with this program; if not, write to the Free Software +//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +//=== +//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, +//=== Rome - Italy. email: geo...@os... +//============================================================================== + +package org.fao.geonet.kernel.harvest.harvester.webdav; + +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; +import jeeves.exceptions.BadInputEx; +import jeeves.interfaces.Logger; +import jeeves.resources.dbms.Dbms; +import jeeves.server.context.ServiceContext; +import jeeves.server.resources.ResourceManager; +import org.fao.geonet.kernel.harvest.Common.Status; +import org.fao.geonet.kernel.harvest.harvester.AbstractHarvester; +import org.jdom.Element; + +//============================================================================= + +public class WebDavHarvester extends AbstractHarvester +{ + //-------------------------------------------------------------------------- + //--- + //--- Static init + //--- + //-------------------------------------------------------------------------- + + public static void init(ServiceContext context) throws Exception + { + } + + //-------------------------------------------------------------------------- + //--- + //--- Harvesting type + //--- + //-------------------------------------------------------------------------- + + public String getType() { return "webdav"; } + + //-------------------------------------------------------------------------- + //--- + //--- Init + //--- + //-------------------------------------------------------------------------- + + protected void doInit(Element node) throws BadInputEx + { + params = new WebDavParams(dataMan); + params.init(node); + } + + //--------------------------------------------------------------------------- + //--- + //--- Destroy + //--- + //--------------------------------------------------------------------------- + + protected void doDestroy(Dbms dbms) throws SQLException + { + String query = "DELETE FROM Metadata WHERE siteId = ?"; + + //TODO: + } + + //--------------------------------------------------------------------------- + //--- + //--- Add + //--- + //--------------------------------------------------------------------------- + + protected String doAdd(Dbms dbms, Element node) throws BadInputEx, SQLException + { + //--- retrieve/initialize information + + params = new WebDavParams(dataMan); + params.create(node); + + //--- setup waf node + + String id = settingMan.add(dbms, "harvesting", "node", getType()); + String path = "id:"+ id; + + String siteID = settingMan.add(dbms, path, "site", ""); + String privID = settingMan.add(dbms, path, "privileges", ""); + String optionsID = settingMan.add(dbms, path, "options", ""); + String infoID = settingMan.add(dbms, path, "info", ""); + + //--- setup site node + + settingMan.add(dbms, "id:"+siteID, "name", node.getAttributeValue("name")); + settingMan.add(dbms, "id:"+siteID, "url", params.url); + + String useAccID = settingMan.add(dbms, "id:"+siteID, "useAccount", params.useAccount); + + settingMan.add(dbms, "id:"+useAccID, "username", params.username); + settingMan.add(dbms, "id:"+useAccID, "password", params.password); + + //--- setup privileges --------------------------------------- + + addPrivileges(dbms, "id:"+ privID, params); + + //--- setup options node --------------------------------------- + + settingMan.add(dbms, "id:"+optionsID, "every", params.every); + settingMan.add(dbms, "id:"+optionsID, "oneRunOnly", params.oneRunOnly); + settingMan.add(dbms, "id:"+optionsID, "validate", params.validate); + settingMan.add(dbms, "id:"+optionsID, "structure", params.structure); + settingMan.add(dbms, "id:"+optionsID, "status", Status.INACTIVE); + + //--- setup stats node ---------------------------------------- + + settingMan.add(dbms, "id:"+infoID, "lastRun", ""); + + return id; + } + + //--------------------------------------------------------------------------- + //--- + //--- Update + //--- + //--------------------------------------------------------------------------- + + protected void doUpdate(Dbms dbms, String id, Element node) + throws BadInputEx, SQLException + { + //--- update variables + + WebDavParams copy = params.copy(); + copy.update(node); + + //--- update database + + Element site = node.getChild("site"); + Element opt = node.getChild("options"); + Element privil = node.getChild("privileges"); + Element account= (site == null) ? null : site.getChild("account"); + + String path = "harvesting/id:"+ id; + String name = node.getAttributeValue("name"); + + Map<String, Object> values = new HashMap<String, Object>(); + + if (name != null) + values.put(path +"/site/name", name); + + setValue(values, path +"/site/url", site, "url"); + setValue(values, path +"/site/useAccount", account, "use"); + setValue(values, path +"/site/useAccount/username", account, "username"); + setValue(values, path +"/site/useAccount/password", account, "password"); + + setValue(values, path +"/options/every", opt, "every"); + setValue(values, path +"/options/oneRunOnly", opt, "oneRunOnly"); + setValue(values, path +"/options/validate", opt, "validate"); + setValue(values, path +"/options/structure", opt, "structure"); + + settingMan.setValues(dbms, values); + + //--- update privileges if the 'privileges' element is provided + + if (privil != null) + { + //--- remove all previous privileges + + Element setPrivil = settingMan.get(path ,1).getChild("children").getChild("privileges"); + String privID = setPrivil.getAttributeValue("id"); + + settingMan.removeChildren(dbms, path +"/id:"+ privID); + + //--- add new privileges entries + + addPrivileges(dbms, path +"/id:"+ privID, copy); + } + + //--- we update a copy first because if there is an exception GeonetParams + //--- could be half updated and so it could be in an inconsistent state + + params = copy; + } + + //--------------------------------------------------------------------------- + + private void addPrivileges(Dbms dbms, String path, WebDavParams params) throws SQLException + { + for (Privilege p : params.getPrivileges()) + { + String groupID = settingMan.add(dbms, path, "group", p.groupID); + + for (int oper : p.getOperations()) + settingMan.add(dbms, "id:"+ groupID, "operation", oper); + } + } + + //--------------------------------------------------------------------------- + //--- + //--- GetTimeout + //--- + //--------------------------------------------------------------------------- + + protected int doGetEvery() { return params.every; } + + protected boolean doIsOneRunOnly() { return params.oneRunOnly; } + + //--------------------------------------------------------------------------- + //--- + //--- AddInfo + //--- + //--------------------------------------------------------------------------- + + protected void doAddInfo(Element node) {} + + //--------------------------------------------------------------------------- + //--- + //--- Harvest + //--- + //--------------------------------------------------------------------------- + + protected void doHarvest(Logger l, ResourceManager rm) {} + + //--------------------------------------------------------------------------- + //--- + //--- Variables + //--- + //--------------------------------------------------------------------------- + + private WebDavParams params; + private WebDavResult result; +} + +//============================================================================= + +class WebDavResult +{ +} + +//============================================================================= + Added: trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavParams.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavParams.java (rev 0) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/webdav/WebDavParams.java 2007-05-26 17:18:11 UTC (rev 430) @@ -0,0 +1,320 @@ +//========================================================... [truncated message content] |
From: <aca...@us...> - 2007-05-30 15:43:11
|
Revision: 442 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=442&view=rev Author: acarboni Date: 2007-05-30 08:42:48 -0700 (Wed, 30 May 2007) Log Message: ----------- Added password encryption Modified Paths: -------------- trunk/gast/setup/db/Users.ddf trunk/src/org/fao/geonet/services/user/PwUpdate.java trunk/src/org/fao/geonet/services/user/Update.java trunk/web/WEB-INF/lib/jeeves.jar trunk/web/xsl/user-update.xsl Modified: trunk/gast/setup/db/Users.ddf =================================================================== --- trunk/gast/setup/db/Users.ddf 2007-05-30 15:39:08 UTC (rev 441) +++ trunk/gast/setup/db/Users.ddf 2007-05-30 15:42:48 UTC (rev 442) @@ -20,4 +20,4 @@ kind, VARCHAR [DATA] -1 admin admin admin admin Administrator +1 admin d033e22ae348aeb566fc214aec3585c4da997 admin admin Administrator Modified: trunk/src/org/fao/geonet/services/user/PwUpdate.java =================================================================== --- trunk/src/org/fao/geonet/services/user/PwUpdate.java 2007-05-30 15:39:08 UTC (rev 441) +++ trunk/src/org/fao/geonet/services/user/PwUpdate.java 2007-05-30 15:42:48 UTC (rev 442) @@ -58,8 +58,8 @@ public Element exec(Element params, ServiceContext context) throws Exception { - String password = Util.getParam(params, Params.PASSWORD); - String newPassword = Util.getParam(params, Params.NEW_PASSWORD); + String password = Util.scramble(Util.getParam(params, Params.PASSWORD)); + String newPassword = Util.scramble(Util.getParam(params, Params.NEW_PASSWORD)); Dbms dbms = (Dbms) context.getResourceManager().open (Geonet.Res.MAIN_DB); Modified: trunk/src/org/fao/geonet/services/user/Update.java =================================================================== --- trunk/src/org/fao/geonet/services/user/Update.java 2007-05-30 15:39:08 UTC (rev 441) +++ trunk/src/org/fao/geonet/services/user/Update.java 2007-05-30 15:42:48 UTC (rev 442) @@ -108,7 +108,7 @@ "profile=?, address=?, state=?, zip=?, country=?, email=?," + "organisation=?, kind=? WHERE id=?"; - dbms.execute (query, username, password, surname, name, + dbms.execute (query, username, Util.scramble(password), surname, name, profile, address, state, zip, country, email, organ, kind, new Integer(id)); Modified: trunk/web/WEB-INF/lib/jeeves.jar =================================================================== (Binary files differ) Modified: trunk/web/xsl/user-update.xsl =================================================================== --- trunk/web/xsl/user-update.xsl 2007-05-30 15:39:08 UTC (rev 441) +++ trunk/web/xsl/user-update.xsl 2007-05-30 15:42:48 UTC (rev 442) @@ -7,6 +7,7 @@ additional scripts --> <xsl:template mode="script" match="/"> +<script type="text/javascript" src="{/root/gui/url}/scripts/prototype.js"/> <script type="text/javascript" language="JavaScript"> function update1() @@ -113,11 +114,11 @@ </tr> <tr> <th class="padded"><xsl:value-of select="/root/gui/strings/password"/> (*)</th> - <td class="padded"><input class="content" type="password" name="password" value="{/root/response/record/password}"/></td> + <td class="padded"><input class="content" type="password" name="password" value=""/></td> </tr> <tr> <th class="padded"><xsl:value-of select="/root/gui/strings/confirmPassword"/> (*)</th> - <td class="padded"><input class="content" type="password" name="password2" value="{/root/response/record/password}"/></td> + <td class="padded"><input class="content" type="password" name="password2" value=""/></td> </tr> <tr> <th class="padded"><xsl:value-of select="/root/gui/strings/surName"/></th> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-30 15:47:41
|
Revision: 443 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=443&view=rev Author: acarboni Date: 2007-05-30 08:47:33 -0700 (Wed, 30 May 2007) Log Message: ----------- Added possibility to harvest old geonetwork 2.0 nodes Modified Paths: -------------- trunk/src/org/fao/geonet/kernel/DataManager.java trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractParams.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java trunk/src/org/fao/geonet/services/harvesting/Remove.java trunk/src/org/fao/geonet/services/harvesting/Util.java trunk/src/org/fao/geonet/services/metadata/Delete.java trunk/web/loc/en/xml/harvesting.xml trunk/web/scripts/harvesting/harvesting.js Added Paths: ----------- trunk/web/scripts/harvesting/geonet20/geonetwork20.js trunk/web/scripts/harvesting/geonet20/model.js trunk/web/scripts/harvesting/geonet20/view.js Modified: trunk/src/org/fao/geonet/kernel/DataManager.java =================================================================== --- trunk/src/org/fao/geonet/kernel/DataManager.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/DataManager.java 2007-05-30 15:47:33 UTC (rev 443) @@ -906,11 +906,8 @@ /** Removes a metadata */ - public synchronized boolean deleteMetadata(Dbms dbms, String id) throws Exception + public synchronized void deleteMetadata(Dbms dbms, String id) throws Exception { - if (!existsMetadata(dbms, id)) - return false; - //--- remove operations deleteAllMetadataOper(dbms, id); @@ -922,8 +919,6 @@ //--- update search criteria searchMan.delete("_id", id+""); - - return true; } //-------------------------------------------------------------------------- @@ -1084,11 +1079,7 @@ { Object args[] = { new Integer(mdId), new Integer(categId) }; - String query = "SELECT metadataId FROM MetadataCateg WHERE metadataId=? AND categoryId=?"; - - Element elRes = dbms.select(query, args); - - if (elRes.getChildren().size() == 0) + if (!isCategorySet(dbms, mdId, categId)) dbms.execute("INSERT INTO MetadataCateg(metadataId, categoryId) VALUES(?,?)", args); } Modified: trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/HarvestManager.java 2007-05-30 15:47:33 UTC (rev 443) @@ -146,7 +146,7 @@ //--------------------------------------------------------------------------- /** This method must be synchronized because it cannot run if we are updating some entries */ - public synchronized OperResult remove(Dbms dbms, String id) throws SQLException + public synchronized OperResult remove(Dbms dbms, String id) throws Exception { Log.debug(Geonet.HARVEST_MAN, "Removing harvesting with id : "+ id); Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java 2007-05-30 15:47:33 UTC (rev 443) @@ -162,7 +162,7 @@ //-------------------------------------------------------------------------- - public synchronized void destroy(Dbms dbms) throws SQLException + public synchronized void destroy(Dbms dbms) throws Exception { if (executor != null) executor.terminate(); @@ -343,7 +343,7 @@ * It is used to remove harvested metadata. */ - protected abstract void doDestroy(Dbms dbms) throws SQLException; + protected abstract void doDestroy(Dbms dbms) throws Exception; protected abstract String doAdd(Dbms dbms, Element node) throws BadInputEx, SQLException; Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractParams.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractParams.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/AbstractParams.java 2007-05-30 15:47:33 UTC (rev 443) @@ -73,7 +73,7 @@ String value = el.getChildText(name); - if (value == null) + if (value == null || value.length() == 0) return defValue; try Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java 2007-05-30 15:47:33 UTC (rev 443) @@ -112,26 +112,20 @@ //--- //--------------------------------------------------------------------------- - protected void doDestroy(Dbms dbms) throws SQLException + protected void doDestroy(Dbms dbms) throws Exception { - String getQuery = "SELECT id FROM Metadata WHERE source = ?"; + String getQuery = "SELECT id FROM Metadata WHERE source = ?"; - String opAllQuery = "DELETE FROM OperationAllowed WHERE metadataId = ?"; - String mdCatQuery = "DELETE FROM MetadataCateg WHERE metadataId = ?"; - String mdQuery = "DELETE FROM Metadata WHERE source = ?"; - for (Search s : params.getSearches()) { for (Object o : dbms.select(getQuery, s.siteId).getChildren()) { Element el = (Element) o; - int id = Integer.parseInt(el.getChildText("id")); + String id = (String) el.getChildText("id"); - dbms.execute(opAllQuery, id); - dbms.execute(mdCatQuery, id); + dataMan.deleteMetadata(dbms, id); + dbms.commit(); } - - dbms.execute(mdQuery, s.siteId); } } @@ -327,8 +321,14 @@ for (AlignerResult ar : result.alResult) { + String siteName = htSiteIdName.get(ar.siteId); + + if (siteName != null) + siteName = "?"+ ar.siteId +"?"; + Element site = new Element("search"); - site.setAttribute("siteId", ar.siteId); + site.setAttribute("siteId", ar.siteId); + site.setAttribute("siteName", siteName); add(site, "total", ar.totalMetadata); add(site, "added", ar.addedMetadata); Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Aligner.java 2007-05-30 15:47:33 UTC (rev 443) @@ -23,30 +23,19 @@ package org.fao.geonet.kernel.harvest.harvester.geonet20; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; -import jeeves.exceptions.BadParameterEx; import jeeves.interfaces.Logger; import jeeves.resources.dbms.Dbms; import jeeves.server.context.ServiceContext; -import jeeves.utils.BinaryFile; +import jeeves.utils.Util; import jeeves.utils.XmlRequest; import org.fao.geonet.constants.Edit; import org.fao.geonet.constants.Geonet; -import org.fao.geonet.kernel.AccessManager; import org.fao.geonet.kernel.DataManager; import org.fao.geonet.kernel.harvest.harvester.CategoryMapper; import org.fao.geonet.kernel.harvest.harvester.GroupMapper; import org.fao.geonet.kernel.harvest.harvester.UUIDMapper; -import org.fao.geonet.kernel.mef.MEFLib; -import org.fao.geonet.kernel.mef.MEFVisitor; -import org.fao.geonet.lib.Lib; import org.fao.geonet.util.ISODate; import org.jdom.Element; @@ -61,8 +50,7 @@ //-------------------------------------------------------------------------- public Aligner(Logger log, XmlRequest req, GeonetParams params, DataManager dm, - Dbms dbms, ServiceContext sc, CategoryMapper cm, GroupMapper gm, - Element remoteInfo) + Dbms dbms, ServiceContext sc, CategoryMapper cm, GroupMapper gm) { this.log = log; this.req = req; @@ -72,40 +60,9 @@ this.context = sc; this.localCateg = cm; this.localGroups= gm; - - //--- save remote categories and groups into hashmaps for a fast access - - List list = remoteInfo.getChild("categories").getChildren("category"); - setupLocEntity(list, hmRemoteCateg); - - list = remoteInfo.getChild("groups").getChildren("group"); - setupLocEntity(list, hmRemoteGroups); } //-------------------------------------------------------------------------- - - private void setupLocEntity(List list, HashMap<String, HashMap<String, String>> hmEntity) - { - - for (int i=0; i<list.size(); i++) - { - Element entity= (Element) list.get(i); - String name = entity.getChildText("name"); - - HashMap<String, String> hm = new HashMap<String, String>(); - hmEntity.put(name, hm); - - List labels = entity.getChild("label").getChildren(); - - for (int j=0; j<labels.size(); j++) - { - Element el = (Element) labels.get(j); - hm.put(el.getName(), el.getText()); - } - } - } - - //-------------------------------------------------------------------------- //--- //--- Alignment method //--- @@ -164,18 +121,9 @@ { String id = dataMan.getMetadataId(dbms, remoteUuid); - File mefFile = retrieveMEF(remoteUuid); + if (id == null) id = addMetadata(siteId, info); + else updateMetadata(siteId, info, id); - try - { - if (id == null) id = addMetadata(siteId, info, mefFile); - else updateMetadata(siteId, info, id, mefFile); - } - finally - { - mefFile.delete(); - } - dbms.commit(); dataMan.indexMetadata(dbms, id); } @@ -192,83 +140,43 @@ //--- //-------------------------------------------------------------------------- - private String addMetadata(final String siteId, final Element info, - File mefFile) throws Exception + private String addMetadata(String siteId, Element info) throws Exception { - final String id[] = { "" }; + String remoteId = info.getChildText("id"); + String remoteUuid = info.getChildText("uuid"); + String schema = info.getChildText("schema"); + String createDate = info.getChildText("createDate"); + String changeDate = info.getChildText("changeDate"); - //--- import metadata from MEF file + log.debug(" - Adding metadata with remote id="+ remoteId); - MEFLib.visit(mefFile, new MEFVisitor() - { - public void handleMetadata(Element md) throws Exception - { - String remoteId = info.getChildText("id"); - String remoteUuid = info.getChildText("uuid"); - String schema = info.getChildText("schema"); - String createDate = info.getChildText("createDate"); - String changeDate = info.getChildText("changeDate"); - String isTemplate = info.getChildText("isTemplate"); + Element md = getRemoteMetadata(req, remoteId); - log.debug(" - Adding metadata with remote id="+ remoteId); + String id = dataMan.insertMetadataExt(dbms, schema, md, context.getSerialFactory(), + siteId, createDate, changeDate, remoteUuid, null); - id[0] = dataMan.insertMetadataExt(dbms, schema, md, context.getSerialFactory(), - siteId, createDate, changeDate, remoteUuid, null); + int iId = Integer.parseInt(id); - int iId = Integer.parseInt(id[0]); + dataMan.setTemplate(dbms, iId, "n", null); + dataMan.setHarvestedBit(dbms, iId, true); - dataMan.setTemplate(dbms, iId, isTemplate, null); - dataMan.setHarvestedBit(dbms, iId, true); + result.addedMetadata++; - String pubDir = Lib.resource.getDir(context, "public", id[0]); - String priDir = Lib.resource.getDir(context, "private", id[0]); + addCategories(id, info.getChildren("category")); + addPrivileges(id, info); - new File(pubDir).mkdirs(); - new File(priDir).mkdirs(); - - result.addedMetadata++; - } - - //-------------------------------------------------------------------- - - public void handleInfo(Element info) throws Exception - { - addCategories(id[0], info.getChild("categories")); - addPrivileges(id[0], info.getChild("privileges")); - } - - //-------------------------------------------------------------------- - - public void handlePublicFile(String file, String changeDate, InputStream is) throws IOException - { - log.debug(" - Adding remote public file with name="+ file); - String pubDir = Lib.resource.getDir(context, "public", id[0]); - - File outFile = new File(pubDir, file); - FileOutputStream os = new FileOutputStream(outFile); - BinaryFile.copy(is, os, false, true); - outFile.setLastModified(new ISODate(changeDate).getSeconds() * 1000); - } - - //-------------------------------------------------------------------- - - public void handlePrivateFile(String file, String changeDate, InputStream is) {} - }); - - return id[0]; + return id; } //-------------------------------------------------------------------------- //--- Categories //-------------------------------------------------------------------------- - private void addCategories(String id, Element categ) throws Exception + private void addCategories(String id, List categ) throws Exception { - List list = categ.getChildren("category"); - - for(Iterator j=list.iterator(); j.hasNext();) + for(Iterator j=categ.iterator(); j.hasNext();) { - String catName = ((Element) j.next()).getAttributeValue("name"); + String catName = ((Element) j.next()).getText(); String catId = localCateg.getID(catName); if (catId != null) @@ -278,126 +186,32 @@ log.debug(" - Setting category : "+ catName); dataMan.setCategory(dbms, id, catId); } - - else if (params.createCateg) - { - //--- the remote category does not exist locally : create it - - log.debug(" - Creating local category : "+ catName); - catId = createCategory(catName) +""; - - log.debug(" - Setting category : "+ catName); - dataMan.setCategory(dbms, id, catId); - } } } //-------------------------------------------------------------------------- - - private int createCategory(String name) throws Exception - { - Map<String, String> hm = hmRemoteCateg.get(name); - - if (hm == null) - throw new BadParameterEx("Specified category was not found remotely", name); - - int id = context.getSerialFactory().getSerial(dbms, "Categories"); - - dbms.execute("INSERT INTO Categories(id, name) VALUES (?, ?)", id, name); - Lib.local.insert(dbms, "Categories", id, hm, "<"+name+">"); - - localCateg.add(name, id+""); - - return id; - } - - //-------------------------------------------------------------------------- //--- Privileges //-------------------------------------------------------------------------- - private void addPrivileges(String id, Element privil) throws Exception + private void addPrivileges(String id, Element info) throws Exception { - List list = privil.getChildren("group"); - - for (int i=0; i<list.size(); i++) - { - Element group = (Element) list.get(i); - String grpName = group.getAttributeValue("name"); - String grpId = localGroups.getID(grpName); - - if (grpId != null) - { - //--- remote group exists locally - - log.debug(" - Setting privileges for group : "+ grpName); - addOperations(group, id, grpId); - } - - else if (params.createGroups) - { - //--- the remote group does not exist locally : create it - - log.debug(" - Creating local group : "+ grpName); - grpId = createGroup(grpName) +""; - - log.debug(" - Setting privileges for group : "+ grpName); - addOperations(group, id, grpId); - } - } + //--- set view privilege for both groups 'intranet' and 'all' + dataMan.setOperation(dbms, id, "0", "0"); + dataMan.setOperation(dbms, id, "1", "0"); } //-------------------------------------------------------------------------- - - private void addOperations(Element group, String id, String grpId) throws Exception - { - List opers = group.getChildren("operation"); - - for (int j=0; j<opers.size(); j++) - { - Element oper = (Element) opers.get(j); - String opName = oper.getAttributeValue("name"); - - int opId = dataMan.getAccessManager().getPrivilegeId(opName); - - log.debug(" --> "+ opName); - dataMan.setOperation(dbms, id, grpId, opId +""); - } - } - - //-------------------------------------------------------------------------- - - private int createGroup(String name) throws Exception - { - Map<String, String> hm = hmRemoteGroups.get(name); - - if (hm == null) - throw new BadParameterEx("Specified group was not found remotely", name); - - int id = context.getSerialFactory().getSerial(dbms, "Groups"); - - dbms.execute("INSERT INTO Groups(id, name) VALUES (?, ?)", id, name); - Lib.local.insert(dbms, "Groups", id, hm, "<"+name+">"); - - localGroups.add(name, id +""); - - return id; - } - - //-------------------------------------------------------------------------- //--- //--- Private methods : updateMetadata //--- //-------------------------------------------------------------------------- - private void updateMetadata(String siteId, Element info, final String id, - File mefFile) throws Exception + private void updateMetadata(String siteId, Element info, String id) throws Exception { - //String remoteId = info.getChildText("id"); - final String remoteUuid= info.getChildText("uuid"); - final String changeDate= info.getChildText("changeDate"); + String remoteId = info.getChildText("id"); + String remoteUuid= info.getChildText("uuid"); + String changeDate= info.getChildText("changeDate"); - final Element thumbs[] = { null }; - if (localUuids.getID(remoteUuid) == null) { log.error(" - Warning! The remote uuid '"+ remoteUuid +"' does not belong to site '"+ siteId+"'"); @@ -408,40 +222,14 @@ } else { - MEFLib.visit(mefFile, new MEFVisitor() - { - public void handleMetadata(Element md) throws Exception - { - updateMetadata(id, md, remoteUuid, changeDate); - } - - //----------------------------------------------------------------- - - public void handleInfo(Element info) throws Exception - { - updateCategories(id, info.getChild("categories")); - updatePrivileges(id, info.getChild("privileges")); - thumbs[0] = info.getChild("thumbnails"); - } - - //----------------------------------------------------------------- - - public void handlePublicFile(String file, String changeDate, InputStream is) throws IOException - { - updateFile(id, file, changeDate, is, thumbs[0]); - } - - //----------------------------------------------------------------- - - public void handlePrivateFile(String file, String changeDate, InputStream is) {} - }); + updateMetadata(id, remoteId, remoteUuid, changeDate); + updateCategories(id, info); } } //-------------------------------------------------------------------------- - private void updateMetadata(String id, Element md, String remoteUuid, - String changeDate) throws Exception + private void updateMetadata(String id, String remoteId, String remoteUuid, String changeDate) throws Exception { String date = localUuids.getChangeDate(remoteUuid); @@ -453,17 +241,19 @@ else { log.debug(" - Updating local metadata with id="+ id); - dataMan.updateMetadataExt(dbms, id, md, changeDate); + Element md = getRemoteMetadata(req, remoteId); + + dataMan.updateMetadataExt(dbms, id, md, changeDate); result.updatedMetadata++; } } //-------------------------------------------------------------------------- - private void updateCategories(String id, Element categs) throws Exception + private void updateCategories(String id, Element info) throws Exception { - List catList = categs.getChildren("category"); + List catList = info.getChildren("category"); //--- remove old categories @@ -492,25 +282,12 @@ String catId = localCateg.getID(catName); if (catId != null) - { //--- it is not necessary to query the db. Anyway... if (!dataMan.isCategorySet(dbms, id, catId)) { log.debug(" - Setting category : "+ catName); dataMan.setCategory(dbms, id, catId); } - } - - else if (params.createCateg) - { - //--- the remote category does not exist locally : create it - - log.debug(" - Creating local category : "+ catName); - catId = createCategory(catName) +""; - - log.debug(" - Setting category : "+ catName); - dataMan.setCategory(dbms, id, catId); - } } } @@ -521,7 +298,7 @@ for(Iterator i=catList.iterator(); i.hasNext();) { Element categ = (Element) i.next(); - String catName = categ.getAttributeValue("name"); + String catName = categ.getText(); if (catName.equals(name)) return true; @@ -531,217 +308,27 @@ } //-------------------------------------------------------------------------- - - private void updatePrivileges(String id, Element privil) throws Exception - { - List grpList = privil.getChildren("group"); - - //--- remove old operations - - List locOper = getOperations(dbms, id).getChildren(); - - for (int i=0; i<locOper.size(); i++) - { - Element oper = (Element) locOper.get(i); - String grpName = oper.getChildText("grpname"); - String operName = oper.getChildText("opname"); - - int grpId = Integer.parseInt(oper.getChildText("grpid")); - int operId = Integer.parseInt(oper.getChildText("opid")); - - if (!existsOperation(grpList, grpName, operName)) - { - log.debug(" - Unsetting operation : "+ grpName +"/"+ operName); - dataMan.unsetOperation(dbms, new Integer(id), grpId, operId); - } - } - - //--- add new operations - - for (int i=0; i<grpList.size(); i++) - { - Element group = (Element) grpList.get(i); - String grpName = group.getAttributeValue("name"); - String grpId = localGroups.getID(grpName); - - if (grpId != null) - updateOperations(group, id, grpId, grpName, locOper); - - else if (params.createGroups) - { - //--- the remote group does not exist locally : create it - - log.debug(" - Creating local group : "+ grpName); - grpId = createGroup(grpName) +""; - - log.debug(" - Setting privileges for group : "+ grpName); - addOperations(group, id, grpId); - } - } - } - + //--- + //--- Private methods + //--- //-------------------------------------------------------------------------- - private Element getOperations(Dbms dbms, String mdId) throws Exception + private Element getRemoteMetadata(XmlRequest req, String id) throws Exception { - String query = "SELECT G.id as grpId, O.id as opId, G.name AS grpName, O.name as opName "+ - "FROM Groups G, Operations O, OperationAllowed "+ - "WHERE G.id=groupId AND O.id=operationId AND metadataId=?"; + req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_METADATA_GET); + req.clearParams(); + req.addParam("id", id); - return dbms.select(query, new Integer(mdId)); - } + Element md = req.execute(); + Element info = md.getChild("info", Edit.NAMESPACE); - //-------------------------------------------------------------------------- + if (info != null) + info.detach(); - private void updateOperations(Element group, String id, String grpId, - String grpName, List locOper) throws Exception - { - List opers = group.getChildren("operation"); - - for (int j=0; j<opers.size(); j++) - { - Element oper = (Element) opers.get(j); - String opName = oper.getAttributeValue("name"); - String opId = dataMan.getAccessManager().getPrivilegeId(opName) +""; - - if (!isOperationSet(locOper, grpId, opId)) - { - log.debug(" - Setting operation : "+ grpName +"/"+ opName); - dataMan.setOperation(dbms, id, grpId, opId +""); - } - } + return md; } //-------------------------------------------------------------------------- - - private boolean existsOperation(List list, String grpName, String operName) - { - for (int i=0; i<list.size(); i++) - { - Element group = (Element) list.get(i); - - if (grpName.equals(group.getAttributeValue("name"))) - { - List operList = group.getChildren("operation"); - - for (int j=0; j<operList.size(); j++) - { - Element oper = (Element) operList.get(j); - - if (operName.equals(oper.getAttributeValue("name"))) - return true; - } - - //--- there can be only 1 group with a given name - return false; - } - } - - return false; - } - - //-------------------------------------------------------------------------- - - private boolean isOperationSet(List locOpers, String grpId, String operId) - { - for (int i=0; i<locOpers.size(); i++) - { - Element oper = (Element) locOpers.get(i); - - String gId = oper.getChildText("grpid"); - String oId = oper.getChildText("opid"); - - if (grpId.equals(gId) && operId.equals(oId)) - return true; - } - - return false; - } - - //-------------------------------------------------------------------------- - //--- Public file update methods - //-------------------------------------------------------------------------- - - private void updateFile(String id, String file, String changeDate, InputStream is, - Element files) throws IOException - { - if (files == null) - log.debug(" - No 'public' element in info.xml. Cannot update public file :"+ file); - else - { - removeOldFile(id, files); - updateChangedFile(id, file, changeDate, is); - } - } - - //-------------------------------------------------------------------------- - - private void removeOldFile(String id, Element infoFiles) - { - File pubDir = new File(Lib.resource.getDir(context, "public", id)); - - File files[] = pubDir.listFiles(); - - if (files == null) - log.error(" - Cannot scan directory for public files : "+ pubDir.getAbsolutePath()); - - else for (File file : files) - if (!existsFile(file.getName(), infoFiles)) - { - log.debug(" - Removing old public file with name="+ file.getName()); - file.delete(); - } - } - - //-------------------------------------------------------------------------- - - private boolean existsFile(String fileName, Element files) - { - List list = files.getChildren("file"); - - for (int i=0; i<list.size(); i++) - { - Element elem = (Element) list.get(i); - String name = elem.getAttributeValue("name"); - - if (fileName.equals(name)) - return true; - } - - return false; - } - - //-------------------------------------------------------------------------- - - private void updateChangedFile(String id, String file, String changeDate, - InputStream is) throws IOException - { - String pubDir = Lib.resource.getDir(context, "public", id); - File locFile = new File(pubDir, file); - - ISODate locIsoDate = new ISODate(locFile.lastModified()); - ISODate remIsoDate = new ISODate(changeDate); - - if (!locFile.exists() || remIsoDate.sub(locIsoDate) > 0) - { - log.debug(" - Adding remote public file with name="+ file); - - FileOutputStream os = new FileOutputStream(locFile); - BinaryFile.copy(is, os, false, true); - locFile.setLastModified(remIsoDate.getSeconds() * 1000); - } - else - { - log.debug(" - Nothing to do to public file with name="+ file); - } - } - - //-------------------------------------------------------------------------- - //--- - //--- Private methods - //--- - //-------------------------------------------------------------------------- - /** Return true if the sourceId is present in the remote site */ private boolean exists(List mdList, String uuid) @@ -759,22 +346,6 @@ //-------------------------------------------------------------------------- - private File retrieveMEF(String uuid) throws IOException - { - req.clearParams(); - req.addParam("uuid", uuid); - req.addParam("format", "partial"); - - req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.MEF_EXPORT); - - File tempFile = File.createTempFile("temp-", ".dat"); - req.executeLarge(tempFile); - - return tempFile; - } - - //-------------------------------------------------------------------------- - private boolean updateCondition(String localDate, String remoteDate) { ISODate local = new ISODate(localDate); @@ -801,9 +372,6 @@ private GroupMapper localGroups; private UUIDMapper localUuids; private AlignerResult result; - - private HashMap<String, HashMap<String, String>> hmRemoteCateg = new HashMap<String, HashMap<String, String>>(); - private HashMap<String, HashMap<String, String>> hmRemoteGroups = new HashMap<String, HashMap<String, String>>(); } //============================================================================= Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/Geonet20Harvester.java 2007-05-30 15:47:33 UTC (rev 443) @@ -84,26 +84,20 @@ //--- //--------------------------------------------------------------------------- - protected void doDestroy(Dbms dbms) throws SQLException + protected void doDestroy(Dbms dbms) throws Exception { - String getQuery = "SELECT id FROM Metadata WHERE source = ?"; + String getQuery = "SELECT id FROM Metadata WHERE source = ?"; - String opAllQuery = "DELETE FROM OperationAllowed WHERE metadataId = ?"; - String mdCatQuery = "DELETE FROM MetadataCateg WHERE metadataId = ?"; - String mdQuery = "DELETE FROM Metadata WHERE source = ?"; - for (Search s : params.getSearches()) { for (Object o : dbms.select(getQuery, s.siteId).getChildren()) { Element el = (Element) o; - int id = Integer.parseInt(el.getChildText("id")); + String id = (String) el.getChildText("id"); - dbms.execute(opAllQuery, id); - dbms.execute(mdCatQuery, id); + dataMan.deleteMetadata(dbms, id); + dbms.commit(); } - - dbms.execute(mdQuery, s.siteId); } } @@ -147,8 +141,6 @@ //--- setup options node --------------------------------------- settingMan.add(dbms, "id:"+optionsID, "every", params.every); - settingMan.add(dbms, "id:"+optionsID, "createGroups", params.createGroups); - settingMan.add(dbms, "id:"+optionsID, "createCateg", params.createCateg); settingMan.add(dbms, "id:"+optionsID, "oneRunOnly", params.oneRunOnly); settingMan.add(dbms, "id:"+optionsID, "status", Status.INACTIVE); @@ -196,8 +188,6 @@ setValue(values, path +"/site/useAccount/password", account, "password"); setValue(values, path +"/options/every", opt, "every"); - setValue(values, path +"/options/createGroups", opt, "createGroups"); - setValue(values, path +"/options/createCateg", opt, "createCateg"); setValue(values, path +"/options/oneRunOnly", opt, "oneRunOnly"); settingMan.setValues(dbms, values); @@ -333,28 +323,12 @@ throw new UserNotFoundEx(params.username); } - //--- retrieve info on categories and groups - - log.info("Retrieving info on categories and groups from : "+ getName()); - - req.setAddress("/"+ params.servlet +"/srv/en/"+ Geonet.Service.XML_INFO); - req.clearParams(); - req.addParam("type", "site"); - req.addParam("type", "categories"); - req.addParam("type", "groups"); - req.addParam("type", "knownNodes"); - - Element remoteInfo = req.execute(); - - if (!remoteInfo.getName().equals("info")) - throw new BadServerResponseEx(remoteInfo); - //--- search result = new GeonetResult(); Aligner aligner = new Aligner(log, req, params, dataMan, dbms, context, - localCateg, localGroups, remoteInfo); + localCateg, localGroups); for(Search s : params.getSearches()) { Modified: trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java =================================================================== --- trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/kernel/harvest/harvester/geonet20/GeonetParams.java 2007-05-30 15:47:33 UTC (rev 443) @@ -57,10 +57,8 @@ username = account.getChildText("username"); password = account.getChildText("password"); - every = Integer.parseInt(opt.getChildText("every")); - createGroups = opt.getChildText("createGroups").equals("true"); - createCateg = opt.getChildText("createCateg") .equals("true"); - oneRunOnly = opt.getChildText("oneRunOnly") .equals("true"); + every = Integer.parseInt(opt.getChildText("every")); + oneRunOnly = opt.getChildText("oneRunOnly") .equals("true"); //--- add searches @@ -108,8 +106,6 @@ username = getValue(account, "username", ""); password = getValue(account, "password", ""); - createGroups = getValue(opt, "createGroups", true ); - createCateg = getValue(opt, "createCateg", true ); oneRunOnly = getValue(opt, "oneRunOnly", false); every = getValue(opt, "every", 90 ); @@ -139,10 +135,8 @@ username = getValue(account, "username", username); password = getValue(account, "password", password); - every = getValue(opt, "every", every); - createGroups = getValue(opt, "createGroups", createGroups); - createCateg = getValue(opt, "createCateg", createCateg); - oneRunOnly = getValue(opt, "oneRunOnly", oneRunOnly); + every = getValue(opt, "every", every); + oneRunOnly = getValue(opt, "oneRunOnly", oneRunOnly); checkEvery(every); checkPort(port); @@ -176,10 +170,8 @@ copy.username = username; copy.password = password; - copy.every = every; - copy.createGroups = createGroups; - copy.createCateg = createCateg; - copy.oneRunOnly = oneRunOnly; + copy.every = every; + copy.oneRunOnly = oneRunOnly; for (Search s : alSearches) copy.alSearches.add(s.copy()); @@ -238,8 +230,6 @@ public String password; public int every; - public boolean createGroups; - public boolean createCateg; public boolean oneRunOnly; private ArrayList<Search> alSearches = new ArrayList<Search>(); Modified: trunk/src/org/fao/geonet/services/harvesting/Remove.java =================================================================== --- trunk/src/org/fao/geonet/services/harvesting/Remove.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/services/harvesting/Remove.java 2007-05-30 15:47:33 UTC (rev 443) @@ -54,7 +54,7 @@ { return Util.exec(params, context, new Util.Job() { - public OperResult execute(Dbms dbms, HarvestManager hm, String id) throws SQLException + public OperResult execute(Dbms dbms, HarvestManager hm, String id) throws Exception { return hm.remove(dbms, id); } Modified: trunk/src/org/fao/geonet/services/harvesting/Util.java =================================================================== --- trunk/src/org/fao/geonet/services/harvesting/Util.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/services/harvesting/Util.java 2007-05-30 15:47:33 UTC (rev 443) @@ -47,7 +47,7 @@ public interface Job { - public OperResult execute(Dbms dbms, HarvestManager hm, String id) throws SQLException; + public OperResult execute(Dbms dbms, HarvestManager hm, String id) throws Exception; } //-------------------------------------------------------------------------- Modified: trunk/src/org/fao/geonet/services/metadata/Delete.java =================================================================== --- trunk/src/org/fao/geonet/services/metadata/Delete.java 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/src/org/fao/geonet/services/metadata/Delete.java 2007-05-30 15:47:33 UTC (rev 443) @@ -81,8 +81,7 @@ //----------------------------------------------------------------------- //--- delete metadata and return status - if (!dataMan.deleteMetadata(dbms, id)) - throw new ConcurrentUpdateEx(id); + dataMan.deleteMetadata(dbms, id); Element elResp = new Element(Jeeves.Elem.RESPONSE); elResp.addContent(new Element(Geonet.Elem.ID).setText(id)); Modified: trunk/web/loc/en/xml/harvesting.xml =================================================================== --- trunk/web/loc/en/xml/harvesting.xml 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/web/loc/en/xml/harvesting.xml 2007-05-30 15:47:33 UTC (rev 443) @@ -12,10 +12,15 @@ <!-- harvesting types - - - - - - - - - - - - - - - - - - - - --> <info type="geonetwork"> - <short>Geonetwork</short> - <long>Geonetwork remote node</long> + <short>GeoNetwork</short> + <long>GeoNetwork remote node</long> </info> + <info type="geonetwork20"> + <short>GeoNetwork 2.0</short> + <long>Old GeoNetwork 2.0 remote node</long> + </info> + <info type="webdav"> <short>Web DAV</short> <long>Web DAV server</long> @@ -124,6 +129,7 @@ <cannotRetrieve>Unable to retrieve information</cannotRetrieve> <supplyHost>Please, provide the 'host' parameter</supplyHost> <supplyServlet>Please, provide the 'servlet' parameter</supplyServlet> + <pleaseSpecifySiteId>Please specify a non empty Site ID</pleaseSpecifySiteId> <oper> <op id="0">View</op> Added: trunk/web/scripts/harvesting/geonet20/geonetwork20.js =================================================================== --- trunk/web/scripts/harvesting/geonet20/geonetwork20.js (rev 0) +++ trunk/web/scripts/harvesting/geonet20/geonetwork20.js 2007-05-30 15:47:33 UTC (rev 443) @@ -0,0 +1,58 @@ +//===================================================================================== +//=== +//=== Geonetwork 2.0.x controller +//=== +//===================================================================================== + +ker.include('harvesting/geonet20/model.js'); +ker.include('harvesting/geonet20/view.js'); + +var gn20 = new Object(); + +//===================================================================================== + +function Geonetwork20(xmlLoader) +{ + //--- call super constructor + Harvester.call(this); + + var loader= xmlLoader; + var model = new gn20.Model(loader); + var view = new gn20.View(loader); + + //--- public methods + + this.addSearchRow = addSearchRow; + this.removeSearchRow = view.removeSearch; + this.getResultTip = view.getResultTip; + + this.model = model; + this.view = view; + +//===================================================================================== +//=== +//=== API methods +//=== +//===================================================================================== + +this.getType = function() { return "geonetwork20"; } +this.getLabel = function() { return loader.eval("info[@type='geonetwork20']/long"); } +this.getEditPanel = function() { return "gn20.editPanel"; } + +//===================================================================================== + +function addSearchRow() +{ + var siteId = view.getSiteId(); + + if (siteId == '') + alert(loader.getText('pleaseSpecifySiteId')); + else + { + view.addEmptySearch(siteId); + view.clearSiteId(); + } +} + +//===================================================================================== +} Added: trunk/web/scripts/harvesting/geonet20/model.js =================================================================== --- trunk/web/scripts/harvesting/geonet20/model.js (rev 0) +++ trunk/web/scripts/harvesting/geonet20/model.js 2007-05-30 15:47:33 UTC (rev 443) @@ -0,0 +1,68 @@ +//===================================================================================== +//=== +//=== Model (type:Geonetwork) +//=== +//===================================================================================== + +gn20.Model = function(xmlLoader) +{ + var loader = xmlLoader; + + this.getUpdateRequest = getUpdateRequest; + +//===================================================================================== + +function getUpdateRequest(data) +{ + var request = str.substitute(updateTemp, data); + + var list = data.SEARCH_LIST; + var text = ''; + + for (var i=0; i<list.length; i++) + text += str.substitute(searchTemp, list[i]); + + return str.replace(request, '{SEARCHES}', text); +} + +//===================================================================================== + +var updateTemp = +' <node id="{ID}" name="{NAME}" type="{TYPE}">'+ +' <site>'+ +' <host>{HOST}</host>'+ +' <port>{PORT}</port>'+ +' <servlet>{SERVLET}</servlet>'+ +' <account>'+ +' <use>{USE_ACCOUNT}</use>'+ +' <username>{USERNAME}</username>'+ +' <password>{PASSWORD}</password>'+ +' </account>'+ +' </site>'+ + +' <searches>'+ +' {SEARCHES}'+ +' </searches>'+ + +' <options>'+ +' <every>{EVERY}</every>'+ +' <oneRunOnly>{ONE_RUN_ONLY}</oneRunOnly>'+ +' </options>'+ +' </node>'; + +//===================================================================================== + +var searchTemp = +' <search>'+ +' <freeText>{TEXT}</freeText>'+ +' <title>{TITLE}</title>'+ +' <abstract>{ABSTRACT}</abstract>'+ +' <keywords>{KEYWORDS}</keywords>'+ +' <digital>{DIGITAL}</digital>'+ +' <hardcopy>{HARDCOPY}</hardcopy>'+ +' <siteId>{SITE_ID}</siteId>'+ +' </search>'; + + +//===================================================================================== +} Added: trunk/web/scripts/harvesting/geonet20/view.js =================================================================== --- trunk/web/scripts/harvesting/geonet20/view.js (rev 0) +++ trunk/web/scripts/harvesting/geonet20/view.js 2007-05-30 15:47:33 UTC (rev 443) @@ -0,0 +1,279 @@ +//===================================================================================== +//=== +//=== View (type:Geonetwork) +//=== +//===================================================================================== + +gn20.View = function(xmlLoader) +{ + var searchTransf = new XSLTransformer('harvesting/geonet20/client-search-row.xsl', xmlLoader); + var resultTransf = new XSLTransformer('harvesting/geonet20/client-result-tip.xsl', xmlLoader); + + var loader = xmlLoader; + var valid = new Validator(loader); + var shower = null; + + //--- public methods + + this.init = init; + this.setEmpty = setEmpty; + this.setData = setData; + this.getData = getData; + this.isDataValid = isDataValid; + this.getSiteId = getSiteId; + this.clearSiteId = clearSiteId; + this.getResultTip= getResultTip; + + this.addEmptySearch = addEmptySearch; + this.addSearch = addSearch; + this.removeSearch = removeSearch; + this.removeAllSearch = removeAllSearch; + +//===================================================================================== +//=== +//=== API methods +//=== +//===================================================================================== + +function init() +{ + valid.add( + [ + { id:'gn20.name', type:'length', minSize :1, maxSize :200 }, + { id:'gn20.host', type:'length', minSize :1, maxSize :200 }, + { id:'gn20.host', type:'hostname' }, + { id:'gn20.port', type:'integer', minValue:80, maxValue:65535, empty:true }, + { id:'gn20.servlet', type:'length', minSize :1, maxSize :200 }, + { id:'gn20.servlet', type:'alphanum' }, + { id:'gn20.username', type:'length', minSize :0, maxSize :200 }, + { id:'gn20.password', type:'length', minSize :0, maxSize :200 }, + + { id:'gn20.every.days', type:'integer', minValue:0, maxValue:99 }, + { id:'gn20.every.hours', type:'integer', minValue:0, maxValue:23 }, + { id:'gn20.every.mins', type:'integer', minValue:0, maxValue:59 } + ]); + + shower = new Shower('gn20.useAccount', 'gn20.account'); +} + +//===================================================================================== + +function setEmpty() +{ + removeAllSearch(); + + $('gn20.name') .value = ''; + $('gn20.host') .value = ''; + $('gn20.port') .value = ''; + $('gn20.servlet') .value = ''; + $('gn20.useAccount').checked = true; + $('gn20.username') .value = ''; + $('gn20.password') .value = ''; + + $('gn20.oneRunOnly') .checked = false; + + $('gn20.every.days') .value = '0'; + $('gn20.every.hours').value = '1'; + $('gn20.every.mins') .value = '30'; + + clearSiteId(); + shower.update(); +} + +//===================================================================================== + +function setData(node) +{ + var site = node.getElementsByTagName('site') [0]; + var searches = node.getElementsByTagName('searches')[0]; + var options = node.getElementsByTagName('options') [0]; + + var searchesList = searches.getElementsByTagName('search'); + + $('gn20.name').value = node.getAttribute('name'); + + hvutil.setOption(site, 'host', 'gn20.host'); + hvutil.setOption(site, 'port', 'gn20.port'); + hvutil.setOption(site, 'servlet', 'gn20.servlet'); + hvutil.setOption(site, 'use', 'gn20.useAccount'); + hvutil.setOption(site, 'username', 'gn20.username'); + hvutil.setOption(site, 'password', 'gn20.password'); + + //--- add search entries + + removeAllSearch(); + + for (var i=0; i<searchesList.length; i++) + addSearch(searchesList[i]); + + //--- setup other stuff + + hvutil.setOption(options, 'oneRunOnly', 'gn20.oneRunOnly'); + + var every = new Every(hvutil.find(options, 'every')); + + $('gn20.every.days') .value = every.days; + $('gn20.every.hours').value = every.hours; + $('gn20.every.mins') .value = every.mins; + + clearSiteId(); + shower.update(); +} + +//===================================================================================== + +function getData() +{ + var days = $('gn20.every.days') .value; + var hours = $('gn20.every.hours').value; + var mins = $('gn20.every.mins') .value; + + var data = + { + //--- site + NAME : $('gn20.name') .value, + HOST : $('gn20.host') .value, + PORT : $('gn20.port') .value, + SERVLET : $('gn20.servlet').value, + + USE_ACCOUNT: $('gn20.useAccount').checked, + USERNAME : $('gn20.username') .value, + PASSWORD : $('gn20.password') .value, + + //--- options + EVERY : Every.build(days, hours, mins), + ONE_RUN_ONLY : $('gn20.oneRunOnly') .checked + } + + //--- retrieve search information + + var searchData = []; + var searchList = $('gn20.searches').childNodes; + + for(var i=0; i<searchList.length; i++) + if (searchList[i].nodeType == Node.ELEMENT_NODE) + { + var divElem = searchList[i]; + + searchData.push( + { + TEXT : xml.getElementById(divElem, 'gn20.text') .value, + TITLE : xml.getElementById(divElem, 'gn20.title') .value, + ABSTRACT : xml.getElementById(divElem, 'gn20.abstract').value, + KEYWORDS : xml.getElementById(divElem, 'gn20.keywords').value, + DIGITAL : xml.getElementById(divElem, 'gn20.digital') .checked, + HARDCOPY : xml.getElementById(divElem, 'gn20.hardcopy').checked, + SITE_ID : divElem.getAttribute('id').substring(5) //---skip 'gn20.' prefix + }); + } + + data.SEARCH_LIST = searchData; + + return data; +} + +//===================================================================================== + +function isDataValid() +{ + if (!valid.validate()) + return false; + + var days = $('gn20.every.days') .value; + var hours = $('gn20.every.hours').value; + var mins = $('gn20.every.mins') .value; + + if (Every.build(days, hours, mins) == 0) + { + alert(loader.getText('everyZero')); + return false; + } + + return true; +} + +//===================================================================================== +//=== SiteId methods +//===================================================================================== + +function getSiteId() +{ + return $F('gn20.siteId'); +} + +//===================================================================================== + +function clearSiteId() +{ + $('gn20.siteId').value = ''; +} + +//===================================================================================== +//=== Search methods +//===================================================================================== + +function addEmptySearch(siteId) +{ + var doc = Sarissa.getDomDocument(); + + var xmlSearch = doc.createElement('search'); + var xmlSiteId = doc.createElement('siteId'); + + doc.appendChild(xmlSearch); + xmlSearch.appendChild(xmlSiteId); + xmlSiteId.appendChild(doc.createTextNode(siteId)); + + addSearch(xmlSearch); +} + +//===================================================================================== + +function addSearch(xmlSearch) +{ + var xslRes = searchTransf.transform(xmlSearch); + var siteId = xslRes.getAttribute('id'); + var div = xml.getElementById($('gn20.searches'), siteId); + + //--- we must avoid adding more searches on the same site-id + + if (div != null) + return; + + //--- add the new search in list + new Insertion.Bottom('gn20.searches', xml.toString(xslRes)); + + valid.add( + [ + { id:'gn20.text', type:'length', minSize :0, maxSize :200 }, + { id:'gn20.title', type:'length', minSize :0, maxSize :200 }, + { id:'gn20.abstract', type:'length', minSize :0, maxSize :200 }, + { id:'gn20.keywords', type:'length', minSize :0, maxSize :200 } + ], siteId); +} + +//===================================================================================== + +function removeSearch(siteId) +{ + valid.removeByParent(siteId); + Element.remove(siteId); +} + +//===================================================================================== + +function removeAllSearch() +{ + $('gn20.searches').innerHTML = ''; + valid.removeByParent(); +} + +//===================================================================================== + +function getResultTip(node) +{ + return xml.toString(resultTransf.transform(node)); +} + +//===================================================================================== +} + Modified: trunk/web/scripts/harvesting/harvesting.js =================================================================== --- trunk/web/scripts/harvesting/harvesting.js 2007-05-30 15:42:48 UTC (rev 442) +++ trunk/web/scripts/harvesting/harvesting.js 2007-05-30 15:47:33 UTC (rev 443) @@ -6,6 +6,7 @@ ker.include('harvesting/harvester.js'); ker.include('harvesting/geonet/geonetwork.js'); +ker.include('harvesting/geonet20/geonetwork20.js'); ker.include('harvesting/webdav/webdav.js'); ker.include('harvesting/model.js'); ker.include('harvesting/view.js'); @@ -33,13 +34,15 @@ //--- create subsystems and register them - var geonet = new Geonetwork(loader); - var webdav = new WebDav(loader); + var geonet = new Geonetwork(loader); + var geonet20 = new Geonetwork20(loader); + var webdav = new WebDav(loader); //--- public objects - this.geonet = geonet; - this.webdav = webdav; + this.geonet = geonet; + this.geonet20 = geonet20; + this.webdav = webdav; //--- public methods @@ -63,6 +66,7 @@ function init() { view.register(geonet); + view.register(geonet20); view.register(webdav); view.show(SHOW.LIST); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-31 14:45:31
|
Revision: 451 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=451&view=rev Author: acarboni Date: 2007-05-31 07:45:30 -0700 (Thu, 31 May 2007) Log Message: ----------- Minor changes Modified Paths: -------------- trunk/gast/data/gui.xml trunk/web/loc/en/xml/harvesting.xml trunk/web/xsl/harvesting/geonet20/geonetwork.xsl Modified: trunk/gast/data/gui.xml =================================================================== --- trunk/gast/data/gui.xml 2007-05-30 15:54:24 UTC (rev 450) +++ trunk/gast/data/gui.xml 2007-05-31 14:45:30 UTC (rev 451) @@ -245,7 +245,9 @@ <description> Once you have configured your DBMS in the 'configuration/dbms' panel, you have to use this panel to create tables and fill - them with initial data. + them with initial data. Please notice that if you did a checkout + from subversion, you have to select the 'configuration/dbms' + panel and press the 'save' button to update the configuration. </description> <button> Modified: trunk/web/loc/en/xml/harvesting.xml =================================================================== --- trunk/web/loc/en/xml/harvesting.xml 2007-05-30 15:54:24 UTC (rev 450) +++ trunk/web/loc/en/xml/harvesting.xml 2007-05-31 14:45:30 UTC (rev 451) @@ -130,7 +130,10 @@ <supplyHost>Please, provide the 'host' parameter</supplyHost> <supplyServlet>Please, provide the 'servlet' parameter</supplyServlet> <pleaseSpecifySiteId>Please specify a non empty Site ID</pleaseSpecifySiteId> - + <gn20Unsafe>Please notice that harvesting old GeoNetwork nodes is unsafe. + The old nodes do not have unique site ids and this could cause + unpredictable results (like removing nodes from other harvestings).</gn20Unsafe> + <oper> <op id="0">View</op> <op id="1">Download</op> Modified: trunk/web/xsl/harvesting/geonet20/geonetwork.xsl =================================================================== --- trunk/web/xsl/harvesting/geonet20/geonetwork.xsl 2007-05-30 15:54:24 UTC (rev 450) +++ trunk/web/xsl/harvesting/geonet20/geonetwork.xsl 2007-05-31 14:45:30 UTC (rev 451) @@ -11,6 +11,8 @@ <xsl:call-template name="site-GN20"/> <xsl:call-template name="search-GN20"/> <xsl:call-template name="options-GN20"/> + <p/> + <span style="color:red"><xsl:value-of select="/root/gui/harvesting/gn20Unsafe"/></span> </div> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aca...@us...> - 2007-05-31 15:51:04
|
Revision: 452 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=452&view=rev Author: acarboni Date: 2007-05-31 08:49:22 -0700 (Thu, 31 May 2007) Log Message: ----------- Moved creation of embedded db at boot phase to avoid problems with fresh checkouts Modified Paths: -------------- trunk/gast/data/gui.xml trunk/src/org/fao/gast/gui/MainFrame.java trunk/src/org/fao/gast/gui/panels/config/dbms/EmbeddedPanel.java Modified: trunk/gast/data/gui.xml =================================================================== --- trunk/gast/data/gui.xml 2007-05-31 14:45:30 UTC (rev 451) +++ trunk/gast/data/gui.xml 2007-05-31 15:49:22 UTC (rev 452) @@ -245,9 +245,7 @@ <description> Once you have configured your DBMS in the 'configuration/dbms' panel, you have to use this panel to create tables and fill - them with initial data. Please notice that if you did a checkout - from subversion, you have to select the 'configuration/dbms' - panel and press the 'save' button to update the configuration. + them with initial data. </description> <button> Modified: trunk/src/org/fao/gast/gui/MainFrame.java =================================================================== --- trunk/src/org/fao/gast/gui/MainFrame.java 2007-05-31 14:45:30 UTC (rev 451) +++ trunk/src/org/fao/gast/gui/MainFrame.java 2007-05-31 15:49:22 UTC (rev 452) @@ -83,11 +83,39 @@ GuiBuilder builder = new GuiBuilder(appPath, panView, panWork); builder.build("/gast/data/gui.xml"); + checkAndCreateDB(); + setSize(700, 500); setVisible(true); } //--------------------------------------------------------------------------- + + private void checkAndCreateDB() throws Exception + { + String user = Lib.embeddedDB.getUser(); + String pass = Lib.embeddedDB.getPassword(); + + if (user == null || pass == null) + { + //--- user & password can be null only if the data files of the + //--- embedded database are not there, so we create them + + Lib.embeddedDB.createDB(); + + user = Lib.embeddedDB.getUser(); + pass = Lib.embeddedDB.getPassword(); + + //--- then we store the generated account into the config.xml file + //--- and save it + + Lib.config.setDbmsUser (user); + Lib.config.setDbmsPassword(pass); + Lib.config.save(); + } + } + + //--------------------------------------------------------------------------- //--- //--- ActionListener //--- Modified: trunk/src/org/fao/gast/gui/panels/config/dbms/EmbeddedPanel.java =================================================================== --- trunk/src/org/fao/gast/gui/panels/config/dbms/EmbeddedPanel.java 2007-05-31 14:45:30 UTC (rev 451) +++ trunk/src/org/fao/gast/gui/panels/config/dbms/EmbeddedPanel.java 2007-05-31 15:49:22 UTC (rev 452) @@ -85,24 +85,6 @@ if (!Lib.type.isInteger(port)) throw new Exception("The port must be an integer"); - if (user == null || pass == null) - { - //--- user & password can be null only if the data files of the - //--- embedded database are not there, so we create them - - Lib.embeddedDB.createDB(); - - user = Lib.embeddedDB.getUser(); - pass = Lib.embeddedDB.getPassword(); - - //--- then we store the generated account into the config.xml file - //--- and save it - - Lib.config.setDbmsUser (user); - Lib.config.setDbmsPassword(pass); - Lib.config.save(); - } - Lib.config.setDbmsDriver ("com.mckoi.JDBCDriver"); Lib.config.setDbmsURL ("jdbc:mckoi://localhost:"+port+"/"); Lib.config.setDbmsUser (user); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |