Home

GeoNetwork Developer Manual

image

Contents

1. fil ServiceManager java ves server J lt at class 3 file Jeeves Engine java lt at class 3 ServiceManager line 377 method dispatch vesEngine line 621 method dispatch ves server sources http JeevesServlet xecServices gt gt gt gt 6 5 Metadata services 95 GeoNetwork Developer Manual Release 2 9 2 file JeevesServlet java line 174 method execute gt lt at class jeeves server sources http JeevesServlet file JeevesServlet java line 99 method doPost gt lt at class javax servlet http HttpServlet file HttpServlet java line 727 method service gt lt stack gt lt object gt lt xsderrors gt lt error gt lt message gt ERROR 1 org xml sax SAXParseException cvc datatype valid 1 2 1 is lt xpath gt gmd identificationInfo gmd MD Dataldentification gmd citation gmd CI Cite lt error gt lt error gt lt message gt ERROR 2 org xml sax SAXParseException cvc type 3 1 3 The value of lt xpath gt gmd identificationInfo gmd MD Dataldentification gmd citation gmd CI Cite lt error gt lt error gt lt message gt ERROR 3 org xml sax SAXParseException cvc datatype valid 1 2 1 is lt xpath gt gmd identificationInfo gmd MD_DataIdentification gmd spatialResol lt error gt lt error gt lt message gt ERROR 4 org xml sax SAXParseException
2. 6 2 Login and logout services 59 GeoNetwork Developer Manual Release 2 9 2 e system shib attrib profile User profile Values Administrator UserAdmin Reviewer Editor and Guest GeoNetwork checks if exists a user with the specified username in the users table creating it if not found 6 2 2 Logout service Logout xml user logout The xml user logout service clears user authentication session removing the JSESSIONID cookie Request Parameters e None This request requires no parameters just it s required sending the JSESSIONID cookie value Logout request example Uri http localhost 8080 geonetwork srv en xml user logout Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt Response Logout response example lt xml version 1 0 encoding UTF 8 gt lt ok gt 6 3 Group services 6 3 1 Groups retrieving Groups list xml group list The xml group list service can be used to retrieve the user groups avalaible in GeoNetwork Requires authentication No 60 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Request Parameters None Group list request example UEL http localhost 8080 geonetwork srv en xml group list ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt Response Here follows the structure of the response
3. lt xsl call template name displayTab gt lt xsl with param name tab select mcpCore gt lt xsl with param name text select ro0t gui strings iso19139 mcp mcpCore gt lt xsl with param name indent select amp xA0 amp xA0 HxA0 gt 34 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 lt xsl with param name tabLink select StabLink gt lt xsl call template gt lt xsl call template name displayTab gt lt xsl with param name tab select complete gt lt xsl with param name text select root gui strings iso19139 mcp mcpAll gt lt xsl with param name indent select amp xA0 amp xA0 HxA0 gt lt xsl with param name tabLink select StabLink gt lt xsl call template gt a same as for is019139CompleteTab in INSTALL DIR web geonetwork xml schemas isol9139 present metadata isol9139 xsl lt xsl template gt This template is called by the template named tab which also adds the default and XML View tabs in INSTALL DIR web geonetwork xsl metadata tab utils xsl using the schema name That XSLT also has the code for the displayTab template mcpMinimum mcpCore complete etc are the names of the tabs The name of the current or active tab is stored in the global variable currTab available to all presentation XSLTs Logic to decide wha
4. 2 1 Create a stable release for GeoNetwork 13 GeoNetwork Developer Manual Release 2 9 2 lt resource gt lt webResources gt 2 Build documentation In docs folder execute mvn clean install Note Building the GeoNetwork documentation requires the following be installed e Sphinx version 0 6 or greater e pdflatex utility to build PDF files e Make utility 3 Compile from the root of the source tree mvn clean install 2 1 9 WAR distribution After building the release articfacts in previous steps the war distribution of the new release is located in web target geonetwork war 2 1 10 Build installers To build the Windows and platform independent installers execute the next command in installer folder S ant The installers exe and jar are created in a folder geonetwork VERSION 2 1 11 Upload and release on SourceForge All of the artifacts generated so far need to be uploaded to the SourceForce File release System 1 WAR distribution 2 Installers exe and jar Note This step requires administrative privileges in SourceForge for the GeoNetwork opensource project 1 Log in to SourceForge 2 Go to the GeoNetwork Files section lt https sourceforge net projects geonetwork files GeoNetwork_opensource 3 Add the new v VERSION folder for this release 4 a Using the commandline secure copy is the simplest way for developers working under a NIX like system 14 Cha
5. Requires authentication Yes Request Parameters e sourceUser mandatory Identifier of the user to transfer the ownership of her metadata e sourceGroup mandatory Identifier of source group of the metadata to transfer ownership e targetUser mandatory Identifier of the user to get the set the new metadata ownership e targetGroup mandatory Identifier of target group of the transferred ownership metadata Example In the next example we are going to transfer the ownership and privileges of metadata owned of user John id 2 in group RWS id 5 to user Samantha id 7 in group NLR id 6 Transfer ownership request example Urls http localhost 8080 geonetwork srv en xml ownership transfer ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt sourceUser gt 2 lt sourceUser gt lt sourceGroup gt 5 lt sourceGroup gt lt targetUser gt 7 lt targetUser gt lt targetGroup gt 6 lt targetGroup gt lt request gt 90 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Response Here follows the structure of the response e response This is the container for the response privileges Transferred privileges metadata Transferred metadata records Transfer ownership response example lt xml version 1 0 encoding UTF 8 gt lt response gt lt privileges gt 4 lt privileges gt lt metadata gt 2 lt metadata gt lt response g
6. record This is the container for each group element returned id Group identifier name Human readable group name description Group description email Group email address label This is just a container to hold the group names translated in the languages supported by GeoNetwork Each translated label it s enclosed in a tag that identifies the language code Group list response example lt xml version 1 0 encoding UTF 8 gt lt response gt lt record gt lt id gt 2 lt id gt lt name gt sample lt name gt lt description gt lt email gt lt referrer gt lt label gt lt en gt Sample group lt en gt lt fr gt Sample group lt fr gt lt es gt Sample group lt es gt lt de gt Beispielgruppe lt de gt lt nl gt Voorbeeldgroep lt nl gt lt label gt lt record gt lt record gt lt id gt 3 lt id gt lt name gt RWS lt name gt lt description gt lt email gt 6 3 Group services 61 GeoNetwork Developer Manual Release 2 9 2 lt referrer gt lt label gt lt de gt RWS lt de gt lt fr gt RWS lt fr gt lt en gt RWS lt en gt lt es gt RWS lt es gt lt nl gt RWS lt nl gt lt label gt lt record gt lt response gt Group information group get Retrieves group information Non XML response 6 3 2 Groups maintenance Create update a group group update The group update service can be used to create new groups and update the information o
7. rule and profiles will use a finer or more specific rule such as 4 3 Example ISO19115 19139 Marine Community Profile MCP 27 GeoNetwork Developer Manual Release 2 9 2 attributes or elements After setting up schema ident xml our new GeoNetwork plugin schema for MCP contains schema ident xml 4 3 2 Creating the schema directory and schema xsd file The schema and schema xsd components are used by the GeoNetwork editor and validation functions GeoNetwork s editor uses the XSDs to build a form that will not only order the elements in a metadata document correctly but also offer options to create any elements that are not in the metadata document The idea behind this approach is twofold Firstly the editor can use the XML schema definition rules to help the user avoid creating a document that is structurally incorrect eg missing mandatory elements or elements not ordered correctly Secondly the same editor code can be used on any XML metadata document with a defined XSD If you are defining your own metadata schema then you can create an XML schema doc ument using the XSD language The elements of the language can be found online at http www w3schools com schema or you can refer to a textbook such as Priscilla Walmsley s Defini tive XML Schema Prentice Hall 2002 GeoNetwork s XML schema parsing code understands almost all of the XSD language with the exception of redefine any and anyAttribute althou
8. As an example suppose we have three schemas iso19139 mcp iso19139 mcp 1 4 and iso19139 mcp cmar with the following autodetect elements iso19139 mcp 1 4 lt autodetect xmlns mcp http bluenet3 antcrc utas edu au mcp xmlns gmd http www isotc211 org 2005 gmd xmlns gco http www isotc211 org 2005 gco gt lt elements gt lt gmd metadataStandardName gt lt gco CharacterString gt Australian Marine Community Profile of ISO 19115 2005 19139 lt gco CharacterString gt lt gmd metadataStandardName gt lt gmd metadataStandardVersion gt lt gco CharacterString gt MCP BlueNet V1 4 lt gco CharacterString gt lt gmd metadataStandardVersion gt lt elements gt lt autodetect gt iso19139 mcp cmar lt autodetect gt lt attributes xmlns mcp cmar http www marine csiro au schemas mcp cmar gt lt autodetect gt iso19139 mcp lt autodetect xmlns mcp http bluenet3 antcrc utas edu au mcp gt lt elements type root gt lt mep MD_Metadata gt lt elements gt lt autodetect gt A record going through autodetect processing eg on import would be checked against e iso19139 mcp cmar first as it has an attributes rule e then iso19139 mcp 1 4 as it has an elements rules e then finally against iso19139 mcp as it has a root element rule The idea behind this processing algorithm is that base schemas will use a root element rule or the more difficult to control namespaces
9. GeoNetwork pensource GeoNetwork Developer Manual Release 2 9 2 GeoNetwork Contents Software development 1 1 System Requirements 12e Tools iris a ir a cia ao 1 3 Check out source code 1 4 Build GeoNetwork 1 5 Creating the installer 4 nn oa dean e a 1 6 Eclipse s tup sc so atia au a oee Bae Rae Create GeoNetwork releases 2 1 Create a stable release for GeoNetwork Harvesting Sel SUCUT da io aa dd ee a nd 32 Datastorage ss ss cami muca nn dede 3 3 Guidelines x sico mes nm a dps Schema Plugins 4 1 Contents of a GeoNetwork schema 42 Preparation os 24 0 628 o a 4 3 Example ISO19115 19139 Marine Community Profile MCP Metadata Exchange Format Introduction e a ww a Calling specifications Del 5 2 5 3 5 4 XML Services 6 1 6 2 Login and logout services 6 3 6 4 6 5 6 6 6 7 6 8 6 9 Gro p SSFVICES ca u oan on aem ar or nt ae ed rd User SErVIOBS sai tn an nete ete dB sed we we eh asl Metadata services soa en ek a ee System configuration o o General services File download services Harvesting services sena 11 E are ree 11 17 Gat Grohe Sele ee Gok ie ae ae x 17 ee a osa add 19 A e da Belia Ee 19 21 vo E e Ae Gt ee Sek id EO eS 21 Dina a ales wate eee ed 23 DE UA ew OE we x 23 6 10 Schema nt
10. Here follows the structure of the response e record This is the container for each user element returned e id User identifier username Login name for the user password Password encoded in md5 surname User surname e name User name e profile User profile The profiles defined in GeoNetwork are Administrator User administrator Content Reviewer Editor Registered user address User physical address e city User address city 6 4 User services 65 GeoNetwork Developer Manual Release 2 9 2 e state User address state e zip User address zip e country User address country e email User email address e organisation User organisation department e kind Kind of organisation User list response example lt xml version 1 0 encoding UTF 8 gt lt response gt lt record gt lt id gt 1 lt id gt lt username gt admin lt username gt lt password gt d033e22ae348aeb566fc214aec3585c4da997 lt password gt lt surname gt admin lt surname gt lt name gt admin lt name gt lt profile gt Administrator lt profile gt lt address gt lt city gt lt state gt lt zip gt lt country gt lt email gt lt organisation gt lt kind gt lt record gt lt record gt lt id gt 2 lt id gt lt username gt editor lt username gt lt password gt ab41949825606da179db7c89ddcedcc167b64847 lt password gt lt surname gt Smith lt surname gt lt name gt John lt name gt lt profile gt Ed
11. Maven GeoNetwork uses Maven to manage the build process and the dependencies Once is installed you should have the mvn command in your path on Windows systems you have to open a shell to check Git GeoNetwork source code is stored and versioned in a Git repository on Github De pending on your operating system a variety of git clients are avalaible Check in http git sem com downloads guis for some alternatives Good documentation can be found on the git website http git scm com documentation and on the Github website https help github com Ant GeoNetwork uses Ant to build the installer Version 1 6 5 works but any other recent version should be OK Once installed you should have the ant command in your path on Windows systems you have to open a shell to check Sphinx To create the GeoNetwork documentation in a nice format Sphinx is used 1 3 Check out source code If you just want to quickly get the code the fastest way is to download the zip bundle https github com geonetwork core geonetwork zipball master However it is recommended that if you want to contribute back to Geonetwork you create a Github account fork the Geonetwork repository and work on your fork This is a huge benefit because you can push your changes to your repository as much as you want and when a feature is complete you can make a Pull Request Pull requests are the recommended method of contributing back to Geonetwork because Github h
12. group Filter metadata by group if missing search in all groups attrset dateFrom Filter metadata created after specified date dateTo Filter metadata created before specified date category Metadata category If not specified search all categories Request to search for all metadata example Ure http localhost 8080 geonetwork srv en xml search ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt Request with free text search example Url http localhost 8080 geonetwork srv en xml search ime type application xml Post request s lt xml version 1 0 encoding UTF 8 gt lt request gt lt any gt africa lt any gt lt request gt 76 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Request with a geographic search example Url http localhost 8080 geonetwork srv en xml search Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt any gt africa lt any gt lt eastBL gt 74 91574 lt eastBL gt lt southBL gt 29 40611 lt southBL gt lt northBL gt 38 47198 lt northBL gt lt westBL gt 60 50417 lt westBL gt lt relation gt overlaps lt relation gt lt sortBy gt relevance lt sortBy gt lt attrset gt geo lt attrset gt lt request gt Request to search using dates and keywords example Url http localhost 8080 geonetwork srv e
13. lt link href http localhost 8080 geonetwork srv en google kml uuid 5df54bf0 3a7d lt category gt Geographic metadata catalog lt category gt lt description gt lt CDATA gt lt description gt lt pubDate gt 06 Nov 2007 12 13 00 EST lt pubDate gt lt guid gt http localhost 8080 geonetwork uuid 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt lt media content url geonetwork srv en resources get id 118fname thumbnail_s gif s lt media text gt Major hydrological basins and their sub basins lt media text gt lt Bounding box in georss simplepoint format default http georss org gt lt georss point gt 16 9 1 8 lt georss point gt lt item gt lt channel gt lt rss gt 82 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 RSS latest Get latest updated metadata rss latest The rss latest service can be used to retrieve the latest added metadata records in RSS format This service can be configured in WEB INF config xml file setting the next parameters e maxltems Maximum number of RSS records to retrieve default 20 e timeBetweenUpdates Minutes to query database for new metadata default 60 Requires authentication Optional If not provided only public metadata records are retrieved Request Parameters e georss valid values are simple simplepoint and default See also http georss org simple Bounding box in geo
14. 112 9 43 8 112 9 9 0 lt gml coordinates gt lt gml LinearRing gt lt gml exterior gt lt gml Polygon gt lt gml GeometryCollection gt If there is more than one extent in the metadata record then they should also appear in this gml GeometryCollection element To find out more about gml see Lake Burggraf Trninic and Rae GML Geography Mark Up Lan guage Foundation for the Geo Web Wiley 2004 Finally a note on projections It is possible to have bounding polygons in an MCP record in a projection other than EPSG 4326 GeoNetwork transforms all projections known to GeoTools and encoded in a form that GeoTools understands to EPSG 4326 when writing the spatial extents to the shapefile or spatial database e extract uuid xsl this XSLT processes the metadata record and extracts the identifier for the record For the MCP and base ISO standard this information is held in the gmd fileldentifier element which is a child of mcp MD_Metadata These xslts can be tested by running them on a metadata record from the schema You should use the saxon xslt processor For example 30 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 java jar INSTALL _DIR web geonetwork WEB INF lib saxon 9 1 0 8b patch jar s testmcp xml o output xml extract qml xsl At this stage our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl schema ident xml s
15. Create request XMLxx Element request new Element request addContent new Element operation setText newuser addContent new Element username setText Samantha addContent new Element password setText editor2 addContent new Element profile setText Editor addContent new Element name setText Samantha addContent new Element city setText Amsterdam addContent new Element country setText Netherlands addContent new Element email setText Samantha mail net xx Create PostMethod specifying service urlx x String serviceUrl http localhost 8080 geonetwork srv en user update PostMethod post new PostMethod serviceUrl ELN A String postData Xml getString new Document request xx Set post data mime type and encodings post setRequestEntity new StringRequestEntity postData application xml UTF8 xx x Send request xx httpClient has been set in login request with JSESSIONID cookie xx int result httpclient executeMethod post xx Display status codex System out printin Create user response status code result if result HttpStatus SC_OK xx Process exception String responseBody post getResponseBodyAsString Element response Xml loadString responseBody false System out println Error code response
16. For the hard disk space you have to consider the space required for the application itself about 40 Mb and the space required for data maps which can require 50 GB or more A simple disk of 250 GB should be OK Maybe you can choose a fast one to reduce backup time but GeoNetwork itself does not speed up on a faster disk You also need some space for the search index which is located in WEB INF lucene Even with a lot of metadata the index is small so usually 10 20 Mb of space is enough The software is run in different ways depending on the servlet container you are using e Tomcat You can use the manager web application to start stop GeoNetwork You can also use the startup and shutdown scripts located into Tomcat s bin folder means sh or bat depending on your OS but this way you restart all applications you are running not only GeoNetwork After installation and before running GeoNetwork you must link it to Tomcat e Jetty If you use the provided container you can use the scripts into GeoNetwork s bin folder The scripts are start geonetwork and stop geonetwork and you must be inside the bin folder GeoNetwork Developer Manual Release 2 9 2 to run them You can use these scripts just after installation 1 2 Tools The following tools are required to be installed to setup a development environment for GeoNetwork e Java Developing with GeoNetwork requires a Java Development Kit JDK 1 5 or greater
17. cvc type 3 1 3 The val lt xpath gt gmd identificationInfo gmd MD_DataIdentification gmd spatialResol lt error gt lt xsderrors gt lt object gt lt request gt lt language gt en lt language gt lt service gt metadata insert lt service gt lt request gt lt error gt Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when mandatory parameters are not pro vided Returned 400 HTTP code bad parameter XXXX when a mandatory parameter is empty Returned 400 HTTP code ERROR duplicate key violates unique constraint metadata_uuid_key if exists another metadata record in catalog with the same uuid of the metadata provided to insert Update metadata metadata update The metadata update service allows to update the content of a metadata record in the catalog Requires authentication Yes Request Parameters 96 Chapter 6 XML Services lution gn ue of lution gn GeoNetwork Developer Manual Release 2 9 2 e id mandatory Identifier of the metadata to update e version mandatory This parameter is used to check if another user has updated the metadata after we retrieved it and before involking the update metadata service CHECK how to provide value to the user 66 e isTemplate indicates if the metadata co
18. featured Request metadata update operations allowed example POST Gies http localhost 8080 geonetwork srv en metadata admin Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 6 lt id gt lt _1_2 gt lt o f lt request gt GET Urls http localhost 8080 geonetwork srv en metadata admin id 66_1_2 amp 1 1 6 5 Metadata services 85 GeoNetwork Developer Manual Release 2 9 2 Response to metadata admin service The response contains the identifier of the metadata updated Response metadata update operations allowed example lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 6 lt id gt lt request gt Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Metadata not found error id metadata not found if not exists a metadata record with the identifier provided ERROR insert or update on table operationallowed violates foreign key operational lowed_operationid_fkey if an operation identifier provided is not valid e ERROR insert or update on table operationallowed violates foreign key operational lowed_groupid_fkey if a group identifier provided is not valid Massive update privilegies metadata massive update privileges The metadata massive update privileg
19. http www opengis net cat csw 2 0 2 service CSW versi SOAP request UL http localhost 8080 geonetwork srv en csw Content type application soap xml Post data lt xml version 1 0 encoding UTF 8 gt 6 13 CSW service 127 GeoNetwork Developer Manual Release 2 9 2 lt env Envelope xmlns env http www w3 org 2003 05 soap envelope gt lt env Body gt lt csw DescribeRecord xmlns csw http www opengis net cat csw 2 0 2 service CSW lt env Body gt lt env Envelope gt GetRecordByld GetRecordByld request retrieves the default representation of catalogue metadata records using their identifier To retrieve non public metadata a previous xml user login service invocation is required See login service Request examples GET request http localhost 8080 geonetwork srv en csw request Get RecordById service CSW amp version 2 POST request Url http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw GetRecordByld xmlns csw http www opengis net cat csw 2 0 2 service CSW vers lt csw Id gt 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt csw Id gt lt csw ElementSetName gt full lt csw ElementSetName gt lt esw GetRecordById gt SOAP request Url http localhost 8080 geonetwork srv en csw Content type application soap xml Post data lt xml version 1 0 encodi
20. insert or update on table operationallowed violates foreign key operational lowed_operationid_fkey if an operation identifier provided is not valid e ERROR insert or update on table operationallowed violates foreign key operational lowed_groupid_fkey if a group identifier provided is not valid 6 5 3 Metadata ownership services This services allow to manage the metadata ownership the user who created the metadata for example to get information about the users who created metadata records or transfer the ownership of metadata records to another user Only users with Administrator and UserAdmin profiles can execute these services 88 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Massive new owner metadata massive newowner The metadata massive newowner service allows to change the owner of a group of metadata This service requires a previous call to metadata select service to select the metadata records to update Requires authentication Yes Request to metadata select service Parameters e id Identifier of metadata to select can be multiple elements e selected Selection state Values add add all remove remove all Select metadata request example Url http localhost 8080 geonetwork srv en metadata select ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt selected gt add all lt selected gt lt
21. start When created a node is in the inactive state This operation makes it active that is the countdown is started and the harvesting will be performed at the timeout 3 stop Makes a node inactive Inactive nodes are never harvested 4 run Just start the harvester now Used to test the harvesting Request A set of ids to operate on Example lt request gt lt id gt 123 lt id gt lt id gt 456 lt id gt lt id gt 789 lt id gt lt request gt If the request is empty nothing is done Response The same as the request but every id has a status attribute indicating the success or failure of the opera tion For example the response to the previous request could be lt request gt lt id status 0k gt 123 lt id gt lt id status not found gt 456 lt id gt lt id status inactive gt 789 lt id gt lt request gt 6 9 Harvesting services 119 GeoNetwork Developer Manual Release 2 9 2 Summary of status values summarises for each service the possible status values Summary of status values Status value remove start stop run h vy v Y not found w Y w inactive lt lt lt already inactive w already active w x already running 6 10 Schema information 6 10 1 Introduction GeoNetwork is able to handle several metadata schema formats Up to now the supported schemas are e ISO 19115 iso19115 GeoNetwork implements an old version of the dr
22. www opengis net cat csw 2 0 2 gt lt csw TransactionSummary gt lt csw totalInserted gt 0 lt csw totallnserted gt lt csw totalUpdated gt 0 lt csw totalUpdated gt lt csw totalDeleted gt 1 lt csw totalDeleted gt lt csw TransactionSummary gt lt csw TransactionResponse gt Errors e User is not authenticated lt xml version 1 0 encoding UTF 8 gt lt ows ExceptionReport xmlns ows http www opengis net ows xmlns xsi http www w lt ows Exception exceptionCode NoApplicableCode gt lt ows ExceptionText gt Cannot process transaction User not authenticated lt ows Exc lt ows Exception gt lt ows ExceptionReport gt 6 13 CSW service 133 GeoNetwork Developer Manual Release 2 9 2 6 14 Java development with XML services In this chapter are shown some examples to access GeoNetwork XML services in Java Apache http commons library is used to send the requests and retrieve the results 6 14 1 Retrieve groups list This example shows a simple request without requiring authentication to retrieve the GeoNetwork groups Source package org geonetwork xmlservices client import import import import import public publ k k T ay xk st Po tE org apache com org apache com org apache com org jdom Docum org jdom Eleme class GetGroup ic mons httpclient HttpClient mons httpcelient methods PostMethod mons httpclient methods
23. 11T10 33 21 lt createDate gt lt changeDate gt 2006 12 14T08 44 43 lt changeDate gt lt siteld gt 0619cc50 708b 11da 8202 000d9335906e lt siteld gt lt siteName gt FAO main site lt siteName gt lt schema gt isol9139 lt schema gt lt format gt full lt format gt 52 Chapter 5 Metadata Exchange Format GeoNetwork Developer Manual Release 2 9 2 lt local1d gt 204 lt localld gt lt isTemplate gt false lt isTemplate gt lt general gt lt categories gt lt category name maps gt lt category name datasets gt lt categories gt lt privileges gt lt group name editors gt lt operation name view gt lt operation name download gt lt group gt lt privil lt public gt lt fil lt fil lt public gt leges gt le name small png changeDate 2006 10 07T13 44 32 gt name large png changeDate 2006 11 11T09 33 21 gt lt private gt lt fil le name map zip changeDate 2006 11 12T13 23 01 gt lt private gt lt info gt 5 4 The info xml file 53 GeoNetwork Developer Manual Release 2 9 2 54 Chapter 5 Metadata Exchange Format CHAPTER 6 XML Services 6 1 Calling specifications 6 1 1 Calling XML services GeoNetwork provides access to several internal structures through the use of XML services These are much like HTML addresses but return XML instead As an example consider the xml info servi
24. 7 3 Harvesting nodes 143 GeoNetwork Developer Manual Release 2 9 2 port integer servlet string e search 0 n Contains the search parameters If this element is missing an unconstrained search will be performed freeText string title string abstract string keywords string digital boolean hardcopy boolean source string e groupsCopyPolicy 0 n Represents a copy policy for a remote group It is used to maintain remote privileges on harvested metadata name string Internal name not localised of a remote group policy string Copy policy For the group all policies are copy copyToIntranet For all other groups policies are copy createAndCopy The Intranet group is not considered 7 3 2 Nodes of type GeoNetwork20 This type allows harvesting from older GeoNetwork 2 0 x nodes e site Contains host and account information host string port integer servlet string e search 0 n Contains the search parameters If this element is missing no harvesting will be performed but the host s parameters will be used to connect to the remote node freeText string title string abstract string keywords string digital boolean hardcopy boolean siteld string 7 3 3 Nodes of type WebDAV This harvesting type is capable of connecting to a web server which is WebDAV enabled 144 Chapt
25. Community Profile MCP 47 GeoNetwork Developer Manual Release 2 9 2 Descriptive keywords fa Resource specific usage Resource constraints Legal constraints gmd MD_LegalConstraints Aggregation Information Legal constraints gmd MD_LegalConstraints Spatial representation type Security constraints gmd MD_SecurityConstraints Commons License mcp MD_Commons Spatial resolution El X 4 3 10 Adding components to support conversion of metadata records to other schemas Creating the convert directory If the new GeoNetwork plugin schema is to support on the fly translation of metadata records to other schemas then the convert directory should be created and populated with appropriate XSLTs Supporting OAIPMH conversions The OAIPMH server in GeoNetwork can deliver metadata records from any of the schemas known to GeoNetwork It can also be configured to deliver schemas not known to GeoNetwork if an XSLT exists to convert a metadata record to that schema The file INSTALL DIR web geonetwork WEB INF config oai prefixes xml describes the schemas known as prefixes in OAI speak that can be produced by an XSLT A simple example of the content of this file is shown below lt schemas gt lt schema prefix oai_dc nsUrl http www openarchives org OAI 2 0 schemaLocation http www openarchives org OAI 2 0 oai_dce xsd gt lt schemas gt In the case of the prefix oai_dc shown above if an XSLT called oai_dc xsl exis
26. GeoNetwork Developer Manual Release 2 9 2 e the main template which must be called metadata lt schema name gt For the MCP pro file of iso19139 the main template would look like the following taken from metadata 1so19139 mcp xsl lt xsl template name metadata iso19139 mcp gt lt xsl param name schema gt lt xsl param name edit select false gt lt xsl param name embedded gt lt xsl apply templates mode iso19139 select gt lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl with param name embedded select Sembedded gt lt xsl apply templates gt lt xsl template gt Analyzing this template 1 The name metadata 1s019139 mcp is used by the main element processing template in meta data xsl elementEP The main metadata services show and edit end up calling metadata show xsl and metadata edit xsl respectively with the metadata record passed from the Java service Both these XSLTs process the metadata record by applying the elementEP template from metadata xsl to the root element The elementEP template calls this main schema template using the schema name iso19139 mcp 2 The job of this main template is set to process all the elements of the metadata record using templates declared with a mode name that matches the schema name or the name of the base schema in this case iso19139 This modal processing
27. If there are no groups or the actor does not have the concept of group the privileges element will be empty A group element without any operation element must be ignored by readers 4 public All metadata thumbnails and any other public file must be listed here This container contains a file element for each file Mandatory attributes of this element are name which repre sents the file s name and changeDate which contains the date of the latest change to the file The public element is optional but if present must contain all the files present in the metadata s public directory and any reader that imports these files must set the latest change date on these using the provided ones The purpose of this element is to provide more information in the case the MEF format is used for metadata harvesting 5 private This element has the same purpose and structure of the public element but is related to maps and all other private files Any other element or attribute should be ignored by readers that don t understand them This allows actors to add custom attributes or subtrees to the XML 5 4 1 Date format Unless differently specified all dates in this file must be in the ISO 8601 format The pattern must be Y Y Y Y MM DDTHH mm SS and the timezone should be the local one Example of info file lt info version 1 0 gt lt general gt lt UUID gt 0619abc0 708b da 8202 000d98959033 lt uuid gt lt createDate gt 2006 12
28. Metadata records from schemas that use DTDs cannot be edited in GeoNetwork 22 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 e schema ident xml Mandatory XML file that contains the schema name identifier version number and details on how to recognise metadata records that belong to this schema This file has an XML schema definition in INSTALL_DIR web geonetwork xml validation schemaPlugins schema ident xsd which is used to validate it when the schema is loaded schema substitutes xml Optional XML file that redefines the set of elements that can be used as substitutes for a specific element schema suggestions xml Optional XML file that tells the editor which child elements of a complex element to automatically expand in the editor To help in understanding what each of these components is and what is required we will now give a step by step example of how to build a schemaPlugin for GeoNetwork 4 2 Preparation In order to create a schema plugin for GeoNetwork you should check out the schemaPlugins directory from the GeoNetwork sourceforge subversion repository You can do this by installing subversion on your workstation and then executing the following command svn co https geonetwork svn sourceforge net svnroot geonetwork schemaPlugins trunk scl This will create a directory called schemaPlugins with some GeoNetwork schema plugins in it To work with the example shown here you should
29. Total time 1 minute 19 seconds INFO Finished at Tue Aug 03 16 49 15 CEST 2010 INFO Final Memory 79M 123M INFO and your local maven repository should contain the GeoNetwork artifacts created SHOME m2 repository org geonetwork opensource 1 4 Build GeoNetwork 5 GeoNetwork Developer Manual Release 2 9 2 Note Many Maven build options are available Please refer to the maven documentation for any other options Maven The Complete Reference For instance you would like to use following options Skip test mvn install Dmaven test skip true Offline use S mvn install o Please refer to the maven documentation for any other options Maven The Complete Reference 1 4 1 Run embedded jetty server Maven comes with built in support for Jetty via a plug in To run GeoNetwork with embedded jetty server you have to change directory to the root of the web module and then execute the following maven command mvn jetty run After a moment GeoNetwork should be accessible at http localhost 8080 geonetwork 1 4 2 Source code documentation The GeoNetwork Java source code is based on Javadoc Javadoc is a tool for generating API documen tation in HTML format from doc comments in source code To see documentation generated by the Javadoc tool go to e GeoNetwork opensource Javadoc 1 5 Creating the installer To run the build script that creates the installer you need the Ant tool You can gener
30. are visually arranged The widgets are prepared with some configuration options so you can select some of the visual aspects For example on the picture above you an select the number of tags on the cloud or the number of items shown on the latest section To add a widget you should wait for the page to be loaded This may be approached with the onReady function of ExtJS Ext onReady function new GeoNetwork TagCloudView catalogue catalogue query fast true amp summaryOnly true amp from 1 amp to 4 renderTo cloud tag onSuccess app loadResults y pP On this example we just have to set up four properties on the constructor the catalogue variable which makes all the query which will be sent to the server to provide the items to show the renderTo id of the 148 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 _ Nationaal Georegister Ge gt G Q D natien NGR er A Metals resultaat Online kaarten Downloadbare data C Data op aanvraag Toon uitgebreide zoekcriteria Welkom op het Nationaal georegister d vindplaats van geo informatie van Nederland Door een zoekterm in te voeren krijgt u een overzicht van beschikbare datasets en services Deze datasets kunt u in veel gevallen direct downloaden en de services kuntu bekijken of in uw eigen toepassing gebruiken Wilt u meer weten over hetzoeken in het Nationaal georegister Bekijk dan de i
31. create your new schema plugin in a subdirectory of this directory 4 3 Example 1S019115 19139 Marine Community Profile MCP The Marine Community Profile MCP is a profile of ISO19115 19139 developed for and with the Ma rine Community The profile extends the ISO19115 metadata standard and is implemented using an extension of the XML implementation of ISO19115 described in ISO19139 Both the ISO19115 meta data standard and its XML implementation ISO19139 are available through ISO distribution channels The documentation for the Marine Community Profile can be found at http www aodc gov au files MarineCommunityProfilev1 4 pdf The implementation of the Ma rine Community Profile as XML schema definitions is based on the approach described at https www seegrid csiro au wiki AppSchemas MetadataProfiles The XML schema definitions XSDs are available at the URL http bluenet3 antere utas edu au mcp 1 4 Looking at the XML schema definitions the profile adds a few new elements to the base ISO19139 standard So the basic idea in defining a plugin Marine Community Profile schema for GeoNetwork is to use as much of the basic ISO19139 schema definition supplied with GeoNetwork as possible We ll now describe in basic steps how to create each of the components of a plugin schema for GeoNet work that implements the MCP 4 3 1 Creating the schema ident xml file Now we need to provide the information necessary to identify the schema and me
32. error id error when the profile is not valid Returned 500 HTTP code ERROR duplicate key violates unique constraint users_username_key when trying to create a new user using an existing username Returned 500 HTTP code ERROR insert or update on table usergroups violates foreign key constraint user groups_groupid_fkey when the group identifier is not an existing group identifier Returned 500 HTTP code ERROR tried to add group id XX to user XXXX not allowed because you are not a mem ber of that group when the authenticated user has profile UserAdmin and tries to add the user to a group in which the UserAdmin user is not allowed to manage Returned 500 HTTP code ERROR you don t have rights to do this when the authenticated user has a profile that is not Administrator or UserAdmin Returned 500 HTTP code Reset user password user update The user update service can be used to create new users update user information and reset user pass word depending on the value of the operation parameter Only users with profiles Administrator or UserAdmin can reset users password Users with profile Administrator can reset the password for any user while users with profile UserAd min can reset the password for users only in the groups where they belong Requires authentication Yes Request Parameters operation mandatory resetpw id mandatory Identifier of the user to reset the password user
33. fixed info xsl supplied with iso19139 In particular e the parent elements may not be present in the metadata record e processing of the online resource elements for the metadata point of truth URL should not interfere with other processing of online resource elements Rather than describe the individual steps required to implement this and the decisions required in the XSLT language take a look at the update fixed info xsl already present for the MCP schema in the iso19139 mep directory and refer to the dot points above Creating the templates directory This is a simple directory Put XML metadata files to be used as templates in this directory Make sure they have a xml suffix Templates in this directory can be added to the catalog using the Administration menu Editor behaviour Adding schema suggestions xml and schema substitutes xml e schema suggestions xml The default behaviour of the GeoNetwork advanced editor when build ing the editor forms is to show elements that are not in the metadata record as unexpanded ele ments To add these elements to the record the user will have to click on the icon next to the element name This can be tedious especially as some metadata standards have elements nested in others ie complex elements The schema suggestions xml file allows you to specify elements that should be automatically expanded by the editor An example of this is the online resource information in the ISO19115 19139
34. for the user can be multiple groups elements e groupid Group identifier Remarks If an optional parameter it s not provided the value it s updated in the database with an empty string Update user information request example Url http localhost 8080 geonetwork srv en user update ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt operation gt xeditinfox lt operation gt lt id gt 5 lt id gt lt username gt samantha lt username gt lt password gt editor2 lt password gt lt profile gt Editor lt profile gt lt name gt Samantha lt name gt lt city gt Rotterdam lt city gt lt country gt Netherlands lt country gt lt email gt samantha mail net lt email gt lt request gt 70 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code Missing parameter error id missing parameter when the mandatory parameters are not provided Returned 400 HTTP code bad parameter when a mandatory field is empty Returned 400 HTTP code Unknow profile XXXX
35. format so that samples can have thumbnails or browse graphics as well as online resources 21 GeoNetwork Developer Manual Release 2 9 2 schema Optional Directory containing the official XSDs of the metadata schema If the schema is described by a DTD then this directory is optional Note that schemas described by a DTD cannot be edited by GeoNetwork templates Optional Directory containing template and subtemplate metadata records for this schema Template metadata records are usually metadata records with the set of elements and content that will be used for a specific purpose Eg iso19139 mcp schema has a Minimum Element template that has the mandatory elements for the schema and a example of the content that is expected The following stylesheets can be present extract date modified xsl Mandatory Extract the date of modification from the metadata record extract gml xsl Mandatory Extract the spatial extent from the metadata record as a GML Ge ometryCollection element extract thumbnails xsl Optional Extract the browse graphic thumbnail from the metadata record extract uuid xsl Mandatory Extract the UUID of the metadata record index fields xsl Mandatory Index the metadata record content in Lucene Creates the Lucene document used by GeoNetwork to index the metadata record content schematron rules xsl Optional XSLT created from schematron rules when building the schema plugin see sch
36. gco CharacterString gt lt gmd fileType gt lt gmd MD_BrowseGraphic gt lt gmd graphicOverview gt lt gmd graphicOverview gt lt gmd MD_BrowseGraphic gt lt gmd fileName gt lt gco CharacterString gt bluenet png lt gco Characterstring gt lt gmd fileName gt lt gmd fileDescription gt lt gco CharacterString gt large_thumbnail lt gco CharacterString gt lt gmd fileDescription gt lt gmd fileType gt lt gco CharacterString gt png lt gco CharacterString gt lt gmd fileType gt lt gmd MD_BrowseGraphic gt lt gmd graphicOverview gt When extract thumbnails xsl is run it creates a small XML hierarchy from this information which looks something like the following lt thumbnail gt lt large gt bluenet png lt large gt lt small gt bluenet_s png lt small gt lt thumbnail gt e set thumbnail xsl this XSLT does the opposite of extract thumbnails xsl It takes the simplified common XML structure used by GeoNetwork to describe the large and small thumbnails and 44 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 creates the elements of the metadata record that are needed to represent them This is a slightly more complex XSLT than extract thumbnails xsl because the existing elements in the metadata record need to be retained and the new elements need to be created in their correct places e unset thumbnail xsl this XSLT targets and removes e
37. gt lt xsl apply templates gt lt xsl when gt lt xsl otherwise gt lt xsl apply templates mode complexElement select gt lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl apply templates gt lt xsl otherwise gt lt xsl choose gt lt xsl template gt Analyzing this template 1 In view mode the individual keywords from the set are concatenated into a comma separated string with the name of the thesaurus in brackets at the end 2 In edit mode the keywordSet is handled as a complex element ie the user can add individual keyword elements with content and a single thesaurus name 3 This is an example of the type of processing that can be done on an element in a metadata record For profiles templates for elements can be defined in the same way except that the template will process in the mode of the base schema Here is an example showing the first few lines of a template for processing the mcp revisionDate element 4 3 Example 1S019115 19139 Marine Community Profile MCP 37 GeoNetwork Developer Manual Release 2 9 2 lt xsl template mode iso19139 match mcp revisionDate gt lt xsl param name schema gt lt xsl param name edit gt lt xsl choose gt lt xsl when test Sedit true gt lt xsl apply templates mode simpleElement select gt lt xsl with param name schema sele
38. gt false lt oneRunOnly gt lt options gt lt groupsCopyPolicy gt lt group name all policy copy gt lt group name mygroup policy createAndCopy gt lt groupsCopyPolicy gt lt categories gt lt category id 4 gt lt categories gt lt node gt WebDAV harvesting To create a web DAV node the following XML information should be provided e node The type attribute is mandatory and must be WebDAV site url string The URL to harvest from If provided must be a valid URL starting with HTTP x icon string default gif Icon file used to represent this node in the search results The icon must be present into the images harvesting folder options recurse boolean false When true folders are scanned recursively to find metadata x validate boolean false When true GeoNetwork will validate every metadata against its schema If the metadata is not valid it will not be imported This type supports both privileges and categories assignment Example of an xml harvesting add request for a WebDAV node lt node type webdav gt lt site gt lt name gt Asia remote node lt name gt lt url gt http www mynode org metadata lt url gt lt icon gt default gif lt icon gt lt account gt lt use gt true lt use gt lt username gt admin lt username gt lt password gt admin lt password gt lt account gt lt site gt lt options gt lt every g
39. id gt 2 lt id gt lt username gt samantha lt username gt lt name gt Samantha lt name gt lt surname gt Smith lt surname gt lt profile gt Editor lt profile gt lt editor gt lt root gt Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code Retrieve groups users allowed to transfer metadata ownership from a user xml ownership groups The xml ownership groups service can be used to retrieve the groups users to which can be transferred the metadata ownership privilegies from the specified user Request Parameters e id mandatory User identifier of the user to check to which groups users can be transferred the ownership privilegies of her metadata 92 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Retrieve ownership groups request example Url http localhost 8080 geonetwork srv en xml ownership groups Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 2 lt id gt lt request gt Response Here follows the structure of the response e response This is the container for the response targetGroup Allowed target group to transfer ownership of user metadata can be multiple targetGroup elements x id name description email referrer label Group information x editor Users of t
40. lt license gt lt html gt lt head gt lt link href http localhost 8080 geonetwork favicon ico rel shortcut lt link href http localhost 8080 geonetwork favicon ico rel icon tyg lt link rel stylesheet type text css href http localhost 8080 geone lt link rel stylesheet type text css href http localhost 8080 geone lt head gt lt body gt lt html gt lt license gt lt response gt The idea behind this service is that you will receive an HTML presentation of the constraints restrictions on the resource that you can show to a user for an accept decline response The HTML presentation is controlled by the server so together with the xml file download service this is the way that GeoNetwork can be used to provide a simple click through licensing system for file resources attached to metadata records To signify acceptance of the license and download the resources you should use the xml file download service Errors e IllegalArgumentException Request must contain a UUID or an ID parameter e IllegalArgumentException Metadata not found e OperationNowAllowedException you don t have download permission over this record 6 8 3 xml file download After your application has received any license conditions that go with the file resources attached to the metadata record from xml file disclaimer you can use this service to download the resources Note onl
41. lt schema gt isol9139 lt schema gt lt createDate gt 2007 07 19T14 45 07 lt createDate gt lt changeDate gt 2007 11 06T12 13 00 lt changeDate gt lt source gt 881a1630 d4e7 4c9c aa01 7a9 bbbbc47b2 lt source gt lt category gt maps lt category gt lt category gt datasets lt category gt lt category gt interactiveResources lt category gt lt score gt 0 9178859 lt score gt lt geonet info gt 78 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt metadata gt lt response gt Get metadata xml metadata get The xml metadata get service can be used to retrieve a metadata record stored in GeoNetwork Requires authentication Optional Request Parameters one of them mandatory e uuid Metadata Universally Unique Identifier UUID e id Metadata internal identifier Get metadata request example Url http localhost 8080 geonetwork srv en xml metadata get ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt uuid gt aa9bc613 8eef 4859 a9eb 4df35d8b21e4 lt uuid gt lt request gt Response The response is the metadata record with additional geonet info section The principal fields for geonet info are e schema Metadata schema e createDate Metadata creation date changeDate Metadata last modification date isTemplate Indicates if the metadata returned is a template ti
42. lt source gt lt UUID gt 0619cc50 708b 11da 8202 000d9335906e lt uuid gt lt name gt Food and Agriculture organisation lt name gt lt source gt lt search gt lt searches gt lt options gt lt every gt 90 lt every gt lt oneRunOnly gt false lt oneRunOnly gt lt status gt inactive lt status gt lt options gt lt info gt lt lastRun gt lt running gt false lt running gt lt info gt lt groupsCopyPolicy gt lt group name all policy copy gt lt group name mygroup policy createAndCopy gt lt groupsCopyPolicy gt lt categories gt lt category id 4 gt lt categories gt lt node gt 6 9 Harvesting services 111 GeoNetwork Developer Manual Release 2 9 2 lt nodes gt If you specify an id you get a response like the one below Example of an xml harvesting get response for a WebDAV node lt node id 165 type webdav gt lt site gt lt name gt test 1 lt name gt lt UUID gt 0619cc50 708b 11da 8202 000d9335aaae lt uuid gt lt url gt http www mynode org metadata lt url gt lt icon gt default gif lt icon gt lt account gt lt use gt true lt use gt lt username gt admin lt username gt lt password gt admin lt password gt lt account gt lt site gt lt options gt lt every gt 90 lt every gt lt oneRunOnly gt false lt oneRunOnly gt lt recurse gt false lt recurse gt lt validate gt true lt validate gt lt status gt inactive lt status
43. n A source known to the remote node x name Source s name x UUID Source s unique identifier Example response for a source lt sources gt lt source gt lt name gt My Host lt name gt lt UUID gt 0619cc50 708b 11da 8202 000d9335906e lt uuid gt lt source gt lt sources gt e users This is the container for user information user 0 n A user of the system id The local identifier of the user username The login name surname The user s surname Used for display purposes name The user s name Used for display purposes x profile User s profile like Administrator Editor UserAdmin etc x address The user s address state The user s state zip The user s address zip code country The user s country email The user s email address organisation The user s organisation x kind Example response for a user lt users gt lt user gt lt id gt 3 lt id gt lt username gt eddi lt username gt lt surname gt Smith lt surname gt lt name gt John lt name gt lt profile gt Editor lt profile gt lt address gt lt state gt lt zip gt lt country gt lt email gt lt organisation gt lt kind gt gov lt kind gt lt user gt lt users gt 106 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Localised entities Localised entities have a general label element which contains the localised strings in all supported l
44. on your user interface You should place them in some html structure so they are visually arranged The widgets are prepared with some configuration options so you can select some of the visual aspects For example on the picture above you an select the number of tags on the cloud or the number of items shown on the latest section To add a widget you should wait for the page to be loaded This may be approached with the onReady function of ExtJS Ext onReady function new GeoNetwork TagCloudView catalogue catalogue query fast true amp summaryOnly true amp from 1 amp to 4 150 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 E GeoCat 2 8 0 test server x S G a l newgui geocat net geonetwork apps tabsearch w ENS User name ssessese Login English Help Home List Map 0 Selected v Sort by vl zap Other actions Ed Geoscience Australia s Open Day Photographs 26th August 2007 2 During National Science Week on Sunday 26th August 2007 Geoscience Australia opened its doors to the community to showcase a diverse range of work activities Members of the public had the opportunity to discover how earthquakes are detected pan for gold tour the bui Physiographic Map of North and Central Eurasia Sample record please remove 20 Physiographic maps for the CIS and Baltic States CIS_BS Mongolia China and Taiwan Province of China Between th
45. outside GeoNetwork Although it is a testing functionality in fact you can use this same widgets on your own webpage You just have to make sure that all dependencies are fulfilled and the settings are properly set up 8 3 TabSearch 151 GeoNetwork Developer Manual Release 2 9 2 _ Nationaal Georegister bo S GS 0 nationem NGR Natonal m y ter Catalogus o E Welkom op het Nationaal georegister d vindplaats van geo informatie van Nederland Door een zoekterm in te voeren krijgt u een overzichtvan beschikbare datasets en services Deze datasets kunt u in veel gevallen direct downloaden en de services kunt u bekijken of in uw eigen toepassing gebruiken Wilt u meer weten over het zoeken in het Nationaal georegister Bekijk dan de instructiefilm geodata nationaalgeoregister nl kadastralekaart ows L Met als resultaat 3 Online kaarten Downloadbare data Data op aanvraag Toon uitgebreide zoekcriteria 152 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 As development will go on this functionality will be made easier and documentation will be filled up TODO some simple examples 8 4 HTML5UI To use this UI you have to compile the web project with html5ui profile activated like mvn clean package Phtml5ui WB My GeoNetwork catalogu x G wy D localhost 8080 geonetwork srv eng search debug fast index amp from 1 amp to 50 am
46. private documents and thumbnails 5 4 The info xml file This file contains general information about a metadata It must have an info root element with a manda tory version attribute This attribute must be in the X Y form where X represents the major version and Y the minor one The purpose of this attribute is to allow future changes of this format maintaining compatibility with older readers The policy behind the version is this 1 A change to Y means a minor change All existing elements in the previous version must be left unchanged only new elements or attributes may be added A reader capable of reading version X Y is also capable of reading version X Y with Y gt Y 2 A change to X means a major change Usually a reader of version X Y is not able to read version X Y with X gt X The root element must have the following children 1 general a container for general information It must have the following children a UUID this is the universally unique identifier assigned to the metadata and must be a valid UUID This element is optional and when omitted the reader should generate one A meta data without a UUID can be imported several times into the same system without breaking uniqueness constraints When missing the reader should also generate the siteld value b createDate This date indicates when the metadata was created c changeDate This date keeps track of the most recent change to the metadata d
47. schemas a brief summary or full element set can be requested These output schemas and element sets are implemented in GeoNetwork as XSLTs and they are stored in the csw subdirectory of the present directory The ogc output schema XSLTs are implemented as ogc brief xsl ogc summary and ogc full xsl The iso output schema XSLTs are implemented as iso brief xsl iso summary xsl and iso full xsl To create these XSLTs for the MCP the best option is to copy and modify the csw presentation XSLTs from the base schema iso19139 40 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 After creating the presentation XSLTs our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl loc present schema ident xml schema xsd schema 4 3 6 Creating the index fields xsl to index content from the metadata record This XSLT indexes the content of elements in the metadata record The essence of this XSLT is to select elements from the metadata record and map them to lucene index field names The lucene index field names used in GeoNetwork are as follows Lucene Index Field Description Name abstract Metadata abstract any Content from all metadata elements for free text changeDate Date that the metadata record was modified createDate Date that the metadata record was created denominator Scale denominator in data resolution download Does the metadata r
48. the normal exceptions management the service can encounter some errors trying to retrieve an element codelist information In this case the object is copied verbatim to the response with the addition of an error attribute that describes the encountered error Here follows an example of such response lt response gt lt element schema iso19139 name blablabla error not found gt lt response gt Possible errors returned by xml schema info service Error code Description unknown schema The specified schema is not supported unknown namespace The namespace of the specified prefix was not found not found The requested element codelist was not found 6 11 Relations 6 11 1 Introduction This chapter describes general services used to get and set relations between metadata records inside GeoNetwork The association is performed by a Relations table which stores a metadata id and a meta data relatedId fields Structure of table Relations Field Datatype Description 1d foreign key to Metadata id Source metadata whose relation is being described relatedId foreign key to Metadata id Metadata related to the source one 6 11 2 xml relation get This service retrieves all relations between metadata Request The request accepts an id and a relation parameters whose meaning is this e id integer This is the local GeoNetwork identifier of the metadata whose relations are re que
49. 11 org 2005 gco gt lt elements gt lt gmd metadataStandardName gt lt gco CharacterString gt Australian Marine Community Profile of ISO 19115 2005 19139 lt gco CharacterString gt lt gmd metadataStandardName gt lt gmd metadataStandardVersion gt lt gco CharacterString gt MCP BlueNet V1 5 lt gco CharacterString gt lt gmd metadataStandardVersion gt lt elements gt lt autodetect gt Some other points about elements autodetect e multiple elements can be specified eg as in the above both metadataStandardName and meta dataStandardVersion have been specified all must be match for the record to be recognized as belonging to this schema e if the elements have a namespace then the namespace s should be specified on the autodetect element or somewhere in the schema ident xml document before the element in which they are used eg in the above there are there namespace declarations on the autodetect element so as not to clutter the content 3 Root element root element of the document must match An example use case is the one used for the eml gbif schema Documents belonging to this schema always have root element of eml eml so the autodetect section for this schema is 4 3 Example ISO19115 19139 Marine Community Profile MCP 25 GeoNetwork Developer Manual Release 2 9 2 lt autodetect xmlns eml eml ecoinformatics org eml 2 1 1 gt lt elements type root gt lt eml eml gt lt eleme
50. 35 GeoNetwork Developer Manual Release 2 9 2 clause for the identification tab above or via a named template as in the metadata tab above For the MCP our template is similar to the one above for iso19139 except that the match would be on mcp MD_Metadata and the processing mode may differ see the section An alternative XSLT de sign for profiles below for more details e a brief template which must be called lt schema name gt Brief This template processes the meta data record and extracts from it a format neutral summary of the metadata for purposes such as displaying the search results Here is an example for the eml gbif schema because it is fairly short lt xsl template match eml gbifBrief gt lt xsl for each select metadata x 1 gt lt metadata gt lt title gt lt xsl value of select normalize space dataset title 1 gt lt title gt lt abstract gt lt xsl value of select dataset abstract gt lt abstract gt lt xsl for each select dataset keywordSet keyword gt lt xsl copy of select gt lt xsl for each gt lt geoBox gt lt westBL gt lt xsl value of select dataset coverage geographicCoverage boundingCoord lt eastBL gt lt xsl value of select dataset coverage geographicCoverage boundingCoord lt southBL gt lt xsl value of select dataset coverage geographicCoverage boundingCoorc lt northBL gt lt xsl value of select dataset coverage geographic
51. 8 User Interface There are four different user interfaces on geonetwork e Classic Perfect for hard environments uses less javascript e Search Uses the new widgets library More responsive than the classic UI Example Search e TabSearch Similar to the Search UI but desktop like as it uses tabs Example TabSearch e HTMLSUI Also based on widgets makes use of latest web technologies Compatibility table Compatibility IE Chrome Firefox Safari 7 18 9 10 Classic xX X X X X X Search X X X X X X TabSearch xX X X X X X HTMLSUI x X X X X X Full compatibility X Compatibility with penalties x Blank spaces means no information provided for that case 8 1 Classic This is the default user interface in GeoNetwork Itis a complete user interface with all the functionalities the rest of the user interfaces have but it is prepared to work on the hardest environments using as less javascript and Ajax as possible for example You don t have to do anything special to run this user interface as it is the default one 8 2 Search To use this UI you have to compile the web project with widgets profile activated like mvn clean package Pwidgets 147 GeoNetwork Developer Manual Release 2 9 2 A Geocat 2 8 0 test server x go 3 D newgui geocat net geonetwork apps search GeoCat 2 8 0 test server Discovery Visualization User name sees amp Logi
52. Codelist gmxCodelists xml These have also been added to the codelists xml file so that they can be localized overridden in profiles and include an extended description to provide more useful information when viewing the metadata record The iso19139 schema has additional templates in its presentation xslts to handlese codelists because they are specific to that schema These are discussed in the section on presentation XSLTs later in this manual 32 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 More on labels xml A localized copy of labels xml is made available on an XPath to the presentation XSLTs eg root gui schemas iso19139 labels for the iso19139 schema The labels xml file can also be used to provide helper values in the form of a drop down select list for free text fields As an example lt element name gmd credit id 27 0 gt lt label gt Credit lt label gt lt description gt Recognition of those who contributed to the resource s lt description gt lt helper gt lt option value University of Tasmania gt UTAS lt option gt lt option value University of Queensland gt UQ lt option gt lt helper gt lt element gt This would result in the Editor through the XSLT metadata xsl displaying the credit field with these helper options listed beside it in a drop down select menu something like the following Purpose C
53. Coverage boundingCoorc lt geoBox gt lt xsl copy of select geonet info gt lt metadata gt lt xsl for each gt lt xsl template gt Analyzing this template 1 The template matches on an element eml gbifBrief created by the mode brief template in metadata utils xsl The metadata record will be the first child in the metadata XPath 2 Then process metadata elements to produce a flat XML structure that is used by search results xhtml xsl to display a summary of the metadata record found by a search Once again for profiles of an existing schema it makes sense to use a slighlty different approach so that the profile need not duplicate templates Here is an example from metadata iso19139 mcp xsl lt xsl template match iso1l9139 mcpBrief gt lt metadata gt lt xsl for each select metadata x 1 gt lt call iso19139 brief gt lt xsl call template name iso19139 brief gt lt now brief elements for mcp specific elements gt lt xsl call template name iso19139 mcp brief gt lt xsl for each gt lt metadata gt lt xsl template gt This template splits the processing between the base iso19139 schema and a brief template that handles elements specific to the profile This assumes that 1 The base schema has separated the lt metadata gt element from the remainder of its brief processing so that it can be called by profi
54. GeoNetwork map MAIN_ MAP OPTIONS Used by the constructor of the main big map e GeoNetwork map MAP_OPTIONS When the user interface creates a new secondary map it uses this options on the constructor Right now it works for the mini map but will be used on each view a secondary map is shown Changing more complex features Debugging To debug javascript you only have to add a debug or debug true parameter to the url like this http srv eng search debug Adding more widgets Widgets are usually added on the file web client src main resources apps htm15ui js App js or one of its children see next section Global variable app App js creates the app global variable wich has or should have all the information needed for the app to run It also initializes some secondary objects which contains information and loads more widgets init function this initializeEnvironment Initialize utils this loginApp new GeoNetwork loginApp 8 4 HTML5UI 157 GeoNetwork Developer Manual Release 2 9 2 this loginApp init this mapApp new GeoNetwork mapApp this mapApp init this searchApp new GeoNetwork searchApp this searchApp init if urlParameters create undefined amp amp catalogue isIdentified var actionCtn Ext getCmp resultsPanel getTopToolbar actionCtn createMetadataAction handler apply actionCtn app loginApp S
55. ISO19119 gt lt xs import namespace http www isotc211 org 2005 srv schemaLocation schema srv srv xsd gt lt xs import namespace http www isotc211 org 2005 gmx schemaLocation schema gmx gmx xsd gt lt xs schema gt At this stage our new GeoNetwork plugin schema for MCP contains schema ident xml schema xsd schema 4 3 3 Creating the extract XSLTs GeoNetwork needs to extract certain information from a metadata record and translate it into a common simplified XML structure that is independent of the metadata schema Rather than do this with Java coded XPaths XSLTs are used to process the XML and return the common simplified XML structure The three xslts we ll create are e extract date modified xsl this XSLT processes the metadata record and extracts the date the metadata record was last modified For the MCP this information is held in the mcp revisionDate element which is a child of mcp MD_Metadata The easiest way to create this for MCP is to copy extract date modified xsl from the iso19139 schema and modify it to suit the MCP namespace and to use mcp revisionDate in place of gmd dateStamp e extract gml xsl this XSLT processes the metadata record and extracts the spatial extent as a gml GeometryCollection element The gml is passed to geotools for insertion into the spatial index either a shapefile or a spatial database For ISO19115 19139 and profiles this task is quite easy beca
56. P server s address port integer Main HTTP server s port can be empty Intranet specify the network of the Intranet network string Network s address netmask string Network s netmask 73950 A container for Z39 50 server parameters 141 GeoNetwork Developer Manual Release 2 9 2 enable boolean If true GeoNetwork will start the 230 50 server port integer The port opened by GeoNetwork to listen to 239 50 requests Usually is 2100 e proxy This container specify proxy configuration to use use boolean If true GeoNetwork will use the given proxy for outgoing connections host string Proxy s host port integer Proxy s port username string Proxy s credentials password string Proxy s credentials e feedback Feedback is sent with proper web form or when downloading a resource email string email address of a GeoNetwork administrator or someone else mailServer This container represents the mail server that will be used to send email x host string Address of the SMTP server to use port string SMTP port to use e removedMetadata This container contains settings about removed metadata dir This folder will contain removed metadata in MEF format It gets populated when the user deletes a metadata using the web interface e LDAP Parameters for LDAP authentication use boolean host string port integer def
57. StringRequestEntity ent nt sClient tatic void main String args Create reque st xmlxx s C ment request Create PostM ring serviceUrl http localhost 8080 geonetwork srv en xml group list stMethod post y String postData xx Set post d new Element request ethod specifying service urlx new PostMethod serviceUrl Xml getString new Document request ata mime type and encodingxx post setRequestEntity new StringRequestEntity postData application xml xx Send reque stxx HttpClient httpclient new HttpClient int result ht tpclient executeMethod post xx Display status codexx System out prin x Display re System out prin System out prin tln Response status code result sponsexx tln Response body tln post getResponseBodyAsString catch Exceptio nex ex printStackTrace finally x Release cu once you are post rel rrent connection to the connection pool donexx leaseConnection 134 Chapter 6 XML Services UTFS8 GeoNetwork Developer Manual Release 2 9 2 Output Response status code 200 Response body lt xml version 1 0 encoding UTF 8 gt lt response gt lt record gt lt id gt 2 lt id gt lt name gt sample lt name gt lt description gt Demo group lt description gt lt email gt gro
58. T request with a single mefFile parameter that must contain the MEF information Response If all goes well the service returns an OK element containing the local id of the created metadata Example lt ok gt 123 lt ok gt 6 12 4 Metadata ownership Version 1 0 of the MEF format does not take into account the metadata owner the creator and the group owner This implies that this information is not contained into the MEF file During import the user that is performing this operation will become the metadata owner and the group owner will be set to null 6 13 CSW service 6 13 1 Introduction GeoNetwork opensource catalog publishes metadata using CS W Catalog Services for the Web protocol supporting HTTP binding to invoke the operations The protocol operations are described in the document OpenGIS Catalogue Services Specification http portal opengeospatial org files artifact_id 20555 GeoNetwork is compliant with the 2 0 2 version of the specification supporting the following CSW Operations e GetCapabilities e DescribeRecord e GetRecordByld GetRecords 6 13 CSW service 125 GeoNetwork Developer Manual Release 2 9 2 e Harvest e Transaction This chapter briefly describes the different operations supported in GeoNetwork and gives some usage examples To get a complete reference of the operations and parameters of each CSW operation refer to the document OpenGIS Catalogue Services Specification The i
59. This is used by the JavaScript code which inherits from harvester view js to show the tool tip when the harvesting has been successful 4 client search row xsl Used in some harvesting types to generate the HTML for the search criteria panel As you may have guessed all client side stylesheets those used by JavaScript code start with the prefix client Another set of stylesheets are located in web src webapp xsl xml harvesting and are used by the xml harvesting get service This service is used by the JavaScript code to retrieve all the nodes the system is currently harvesting from This implies that a stylesheet one for each harvesting type must be provided to convert from the internal setting structure to an XML structure suitable to clients The last file to take into consideration contains all localised strings and is located at web src webapp loc XX xml harvesting xml where XX refers to a language code This file is used by both JavaScript code and the server 18 Chapter 3 Harvesting GeoNetwork Developer Manual Release 2 9 2 3 2 Data storage Harvesting nodes are stored inside the Settings table Further useful information can be found in the chapter Harvesting The SourceNames table is used to keep track of the uuid name couple when metadata get migrated to different sites 3 3 Guidelines To add a new harvesting type follow these steps 6 7 1 Add the proper folder in web src webapp scripts harves
60. aft which uses short names for elements This is not so standard so this schema is obsolete and will be removed in future releases e ISO 19139 iso19139 This is the XML encoding of the ISO 19115 2007 metadata and ISO 19119 service metadata specifications Dublin core dublin core This is a simple metadata schema based on a set of elements capable of describing any metadata e FGDC fgdc std It stands for Federal Geographic Data Committee and it is a metadata schema used in North America In parenthesis is indicated the name used by GeoNetwork to refer to that schema These schemas are handled through their XML schema files XSD which GeoNetwork loads and interprets to allow the editor to add and remove elements Beside its internal use GeoNetwork provides some useful XML services to find out some element properties like label description and so on 6 10 2 xml schema info This service returns information about a set of schema elements or codelists The returned information consists of a localised label a description conditions that the element must satisfy etc Request Due to its nature this service accepts only the POST binding with application XML content type The request can contain several element and codelist elements Each element indicate the will to retrieve information for that element Here follows the element descriptions 120 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 e
61. an change this behaviour and allow for example the big map to be shown at all times This is the same for all elements you see that disappear To change this behaviour you should take a look at GlobalFunctions js file For each view you have one function that shows it and hides it You can change them to allow for example that the big map is not hidden when results are shown e showBrowse e hideBrowse e showAdvancedSearch e hideAdvancedSearch e showBigMap If you add a new view you should update all this functions so the view is hidden or shown when you want Settings There are a few configurations of this user interface defined on two javascript files 156 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 js Settings js You can find here some global configuration settings for the UI Usually you won t have to change any of them There are constants like e GeoNetwork Settings facetListConfig used to configure the keywords for the facet search e OpenLayers ProxyHostURL relative or absolute path to url required by openlayers js map Settings js You can find here some specific map configuration settings for the UI You can use this file to set up the kind of projection and default base layers the maps will use There are constants like e GeoNetwork map PROJECTION Basic projection for maps EPSG 900913 by default e GeoNetwork map BACKGROUND LAYERS Base layers for the maps e
62. anguages reflect the lt label gt lt en gt l lt fr gt l lt es gt lt label gt 6 7 2 xm This is just This element has as many children as the supported languages Each child has a name that anguage code while its content is the localised text Here is an example of such elements Editors lt en gt Editeurs lt fr gt Editores lt es gt Lforward a router service It is used by JavaScript code to connect to a remote host because a JavaScript program cannot access a machine other than its server For example it is used by the harvesting web interface to Request query a remote host and retrieve the list of site ids The service s request lt request gt lt site gt lt url gt lt url gt lt type gt lt type gt lt account gt lt username gt lt username gt lt password gt lt password gt lt account gt lt site gt lt params gt lt params gt lt request gt Where 1 site A container for site information where the request will be forwarded 2 url Refers to the remote URL to connect to Usually it points to a GeoNetwork XML service but it can point to any XML service 3 type Its only purpose is to distinguish GeoNetwork nodes which use a different authentication scheme The value GeoNetwork refers to these nodes Any other value or if the element is missing refers to a generic node 4 account This element is optional If present the p
63. as code review tools and merges are much easier than trying to apply a patch attached to a ticket The Geonetwork Repository is at https github com geonetwork core geonetwork Follow the instructions on the Github website to get started make accounts how to fork etc http help github com Once you have the repository forked and cloned locally you can begin to work A clone contains all branches so you can list the branches with git branch a Just look at last section ignoring remotes origin To checkout a branch just git checkout 2 8 x Typically work is done on branches and merged back so when developing normally you will go change to the branch you want to work on create a branch from there work and then merge the changes back or make a Pull Request on Github There are many great guides See the links above but here is a quick sequence illustrating how to make a change and commit the change 4 Chapter 1 Software development GeoNetwork Developer Manual Release 2 9 2 git checkout master master is the trunk and main development branch the checkout command checks out the requested branch git checkout b myfeature the b requests that the branch be created git will list all the branches you have checked out locally at some point git a will list all branches in repository checked out or not work work work git status See what files have been modified or added bran
64. as some problems with it so we recommend to use Java 5 Being written in Java GeoNetwork can run on any platform that supports Java so it can run on Windows Linux and Mac OSX For the latter one make sure to use version 10 4 Tiger or newer Version 10 3 Panther has only Java 1 4 so it cannot run GeoNetwork Next you need a servlet container GeoNetwork comes with an embedded one Jetty which is fast and well suited for most applications If you need a stronger one you can install Tomcat from the Apache Software Foundation http tomcat apache org It provides load balance fault tolerance and other corporate needed stuff If you work for an organisation it is probable that you already have it up and running The tested version is 5 5 but GeoNetwork should work with all other versions Regarding storage you need a Database Management System DBMS like Oracle MySQL Postgresql and so on GeoNetwork comes with an embedded one McKoi which is used by default during instal lation This DBMS can be used for small or desktop installations where the speed is not an issue You can use this DBMS for several thousands of metadata If you manage more than 10 000 metadata it is better to use a professional stand alone DBMS In this case using a separate DBMS also frees up some memory for the application GeoNetwork does not require a strong machine to run A good performance can be obtained even with 128 Mb of RAM The suggested amount is 512 Mb
65. at This service is public but metadata access rules apply For a partial export the view privilege is enough but for a full export the download privilege is also required Without a login step only partial exports on public metadata are allowed This service uses the system s temporary directory to build the MEF file With full exports of big data maybe it is necessary to change this directory In this case use the Java s D command line option to set the new directory before running GeoNetwork if you use Jetty simply change the script into the bin directory Request This service accepts requests in GET POST and XML form The input parameters are e UUID the universal unique identifier of the metadata e format which format to use Can be one of simple partial full e skipUuid If provided tells the exporter to not export the metadata s UUID Without the UUID which is a unique key inside the database the metadata can be imported over and over again Can be one of true false The default value is false 124 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Response The service s response is a MEF file with these characteristics e the name of the file is the metadata s UUID e the extension of the file is mef 6 12 3 mef import This service is reserved to administrators and is used to import a metadata provided in the MEF format Request The service accepts a multipart form data POS
66. ate an installer by running the ant command inside the installer directory ant Buildfile build xml setProperties BUILD SUCCESSFUL Total time 31 seconds Both platform independent and Windows specific installers are generated by default Make sure you update version number and other relevant properties in the installer build xml file You can also create an installer that includes a Java Runtime Environment JRE for Windows This will allow GeoNetwork to run on a compatible embedded JRE and thus avoid error messages caused by JRE incompatibilities on the PC 6 Chapter 1 Software development GeoNetwork Developer Manual Release 2 9 2 Creating an installer with an embedded JRE requires you to first download and unzip the JRE in a folder jre1 5 0_12 at the project root level Refer to the installer config win jre xml file for exact configuration 1 5 1 Packaging GeoNetwork using Maven Using Maven you have the ability to package GeoNetwork in two different ways e WAR files geonetwork war geoserver war e Binary ZIP package with Jetty embedded The Assembly Plugin is used to create the packages using mvn package assembly assembly The Assembly Plugin configuration is in the release module See bin xml and zip war xml 1 6 Eclipse setup 1 6 1 Setting eclipse preferences e M2_REPO Classpath Variable e Navigate to Java gt Build Path gt Classpath Variable e Press New button e In Name field ent
67. ation name Short name for the operation reserved Can be y or n and is used to distinguish between system reserved and user defined operations x label The localised labels used to show the operation on screen See xml_response_operations Example response for operations lt operations gt lt operation id 0 gt lt name gt view lt name gt lt label gt lt en gt View lt en gt lt fr gt Voir lt fr gt lt label gt lt operation gt lt operations gt e regions This is the container for geographical regions region 0 n This is a region present into the system This element has an id attribute which represents the local identifier for the operation north North coordinate of the bounding box south South coordinate of the bounding box west West coordinate of the bounding box east east coordinate of the bounding box label The localised labels used to show the region on screen See xml_response_regions Example response for regions lt regions gt lt region id 303 gt lt north gt 82 99 lt north gt lt south gt 26 92 lt south gt lt west gt 37 32 lt west gt lt east gt 39 24 lt east gt lt label gt lt en gt Western Europe lt en gt lt fr gt Western Europe lt fr gt lt label gt lt region gt lt regions gt sources This is the container 6 7 General services 105 GeoNetwork Developer Manual Release 2 9 2 source 0
68. ator The user has edit rights over the metadata The user is a Reviewer and or UserAdmin and the metadata groupOwner is one of his groups 98 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 6 6 System configuration 6 6 1 Introduction The GeoNetwork s configuration is made up of a set of parameters that can be changed to accommodate any installation need These parameters are subdivided into 2 groups e parameters that can be easily changed through a web interface e parameters not accessible from a web interface and that must be changed when the system is not ruming The first group of parameters can be queried or changed through 2 services xml config get and xml config set The second group of parameters can be changed using the GAST tool 6 6 2 xml config get This service returns the system configuration s parameters Request No parameters are needed Response The response is an XML tree similar to the system hierarchy into the settings structure The response has the following elements e site A container for site information name Site s name organisation Site s organisation name e server A container for server information host Name of the host from which the site is reached port Port number of the previous host Intranet Information about the Intranet of the organisation network IP address that specifies the network netmask netmask of th
69. aultProfile string Default GeoNetwork s profile to use when the profile user attribute does not exist login userDN string password string distinguishedNames x base string users string userAttribs A container for user attributes present into the LDAP directory that must be retrieved and used to create the user in GeoNetwork name string password string profile string 142 Chapter 7 Settings hierarchy GeoNetwork Developer Manual Release 2 9 2 7 3 Harvesting nodes The second top level hierarchy is harvesting All nodes added using the web interface are stored here Each child has node in its key and its value can be GeoNetwork WebDAV CSW or another depending on the node type All harvesting nodes share a common setting structure which is used by the harvesting engine to retrieve these common parameters This imply that any new harvesting type must honour this structure which is the following e site A container for site information name string Node name as shown in the harvesting list UUID string A unique identifier assigned by the system when the harvesting node is created useAccount boolean Indicates if the harvester has to authenticate to access the data username string password string e options every integer Timeout in minutes between 2 consecutive harvesting oneRunOnly boolean If true the harvester will harve
70. ce you can use this service to get some system s information without fancy styles and graphics In GeoNetwork XML services have usually the xml prefix in their address Request Each service accepts a set of parameters which must be embedded into the request A service can be called using different HTTP methods depending on the structure of its request GET The parameters are sent using the URL address On the server side these parameters are grouped into a flat XML document with one root and several simple children A service can be called this way only if the parameters it accepts are not structured xml_request shows an example of such request and the parameters encoded in XML POST There are 3 variants of this method ENCODED The request has one of the following content types application x www form urlencoded or multipart form data The first case is very common when sending web forms while the second one is used to send binary data usually files to the server In these cases the parameters are not structured so the rules of the GET method applies Even if the second case could be used to send XML documents this possibility is not considered on the server side XML The content type is application xml This is the common case when the client is not a browser but a specialised client The request is a pure XML document in string form encoded using the encoding specified into the prologue of the XML document Using this form any type
71. ch branch git add lt new or modified files gt Add all files to be committed git add u will add all modified but not untracked git commit Commit often it is VERY fast to commit NOTE doing a commit is a local operation It does not push the change to Github more work another commit git push origin myfeature this pushed your new branch to Github now you are ready to make a Pull Request to get the new feature added to Geonetwork 1 4 Build GeoNetwork Once you checked out the code from Github repository go inside the GeoNetwork s root folder and execute the maven build command S mvn clean install If the build is succesful you ll get an output like INFO INFO INFO Reactor Summary INFO INFO GeoNetwork opensource 2 eee eee eee eee eee eee eee eee ee UCCESS 1 825s INFOJ Caching ESTE MOGULS aar zamen aaa e eek dili a ele aw lats UCCESS 1 579s INFO Jeeves modules 4 atsu seams aes SRE EE EWE A Be UCCESS 1 140s INFO Oaipmk modules sus sem wanen end ease AHS a ee He ees UCCESS 0 4778 INFO ArcSDE module dummy api asana ensen nen ee ed UCCESS 0 503s INFO GeoNetwork Web module ooooooooococococncocnnnnnnooooo ooo UCCESS 31 758s INFO GeoServer module wassen vane eee binet Ce ba VEER db ees UCCESS 16 510s INFOJ Gast module ii o Re dea A A EL ee UCCESS 24 961s INFO INFO INFO BUILD SUCCESSFUL INFO INFO
72. chema xsd schema 4 3 4 Creating the localized strings in the loc directory The loc directory contains localized strings specific to this schema arranged by language abbreviation in sub directories You should provide localized strings in whatever languages you expect your schema to be used in Localized strings for this schema can be used in the presentation xslts and schematron error messages For the presentation xslts e codelists for controlled vocabulary fields should be in loc lt language_abbreviation gt codelists xml eg loc en codelists xml e label strings that replace XML element names with more intelligible alternative phrases and rollover help strings should be in loc lt language_abbreviation gt labels xml eg loc en labels xml e all other localized strings should be in loc lt language_abbreviation gt strings xml eg loc en strings xml Note that because the MCP is a profile of ISO19115 19139 and we have followed the GeoNetwork naming convention for profiles we need only include the labels and codelists that are specific to the MCP or that we want to override Other labels and codelists will be retrieved from the base schema 15019139 More on codelists xml Typically codelists are generated from enumerated lists in the metadata schema XSDs such as the fol lowing from http www isotc2 1 l org 2005 gmd identification xsd for gmd MD_TopicCategoryCode in the iso19139 schema lt xs ele
73. children Each key is limited to 32 characters while each value is limited to 250 The 2 top level hierarchies are system and harvesting In the following sections the indentation is used to show hierarchies Names in bold represent keys with the value s datatype in parenthesis An italic font is used to indicate basic types string integer boolean while normal font with a is used to represent a set of allowed values Regarding the boolean type value can be only true or false A missing datatype means that the value of the node is not used Square brackets indicate cardinality If they are missing a cardinality of 1 1 should be considered 7 2 The system hierarchy site Contains information about the site name string Name used to present this site to other sites Used to fill comboboxes or lists organisation string Name of the organization company institute that is running GeoNet work siteld string A UUID that uniquely identifies the site It is generated by the installer platform Contains information about the current version version string GeoNetwork s version in the X Y Z format subVersion string A small description about the version like alpha 1 beta etc server Used when it is necessary to build absolute URLs to the GeoNetwork server This is the case for example when creating links inside a metadata or when providing CSW capabilities host string Main HTT
74. ct S schema gt lt xsl with param name edit select Sedit gt If a template for a profile is intended to override a template in the base schema then the template can be defined in the presentation XSLT for the profile with a priority attribute set to a high number and an XPath condition that ensures the template is processed for the profile only For example in the MCP we can override the handling of gmd EX_GeographicBoundingBox in metadata iso19139 xsl by defining a template in metadata iso19139 mcp xsl as follows lt xsl template mode iso19139 match gmd EX GeographicBoundingBox starts with geonet i Finally a profile may also extend some of the existing codelists in the base schema These extended codelists should be held in a localized codelists xml As an example in iso19139 these codelists are often attached to elements like the following lt gmd role gt lt gmd CI_RoleCode codeList http www isotc211 org 2005 resources Codelist gmxCodelist lt gmd role gt Templates for handling these elements are in the isol9139 presentation XSLT INSTALL_DIR web geonetwork xml schemas iso19139 present metadata iso19139 xsl These templates use the name of the element eg gmd CI_RoleCode and the codelist XPath eg root gui schemas iso19139 codelists to build select list drop down menus when editing and to display a full description when viewing See templates near the template named isol19139Codelist These temp
75. cuted just once or periodically This operation requires user authentification to be invoked Synchronous one run Harvest example POST request Uris http localhost 8080 geonetwork srv en csw publication Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw Harvest xmlns csw http www opengis net cat csw 2 0 2 xmlns gmd http www i lt csw Source gt http URL to the target CSW server request GetCapabilities amp amp se lt csw ResourceType gt http www isotc211 org schemas 2005 gmd lt csw ResourceType gt lt csw Harvest gt GET request Url http localhost 8080 geonetwork srv en csw publication request Harvest amp service CSW ve Response lt xml version 1 0 encoding UTF 8 gt lt csw HarvestResponse xmlns csw http www opengis net cat csw 2 0 2 gt lt csw TransactionResponse gt lt csw TransactionSummary gt lt esw totalInserted gt 22 lt csw totalInserted gt lt csw totalUpdated gt 0 lt csw totalUpdated gt lt csw totalDeleted gt 0 lt csw totalDeleted gt lt csw TransactionSummary gt lt csw TransactionResponse gt lt csw HarvestResponse gt 130 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Aynchronous one run Harvest example POST request Urls http localhost 8080 geonetwork srv en csw publication Content type application xml Post data lt xml version 1 0 encodi
76. d 500 HTTP code 6 5 Metadata services 6 5 1 Retrieve metadata services Search metadata xml search The xml search service can be used to retrieve the metadata stored in GeoNetwork Requires authentication Optional Request Search configuration parameters all values are optional e remote Search in local catalog or in a remote catalog Values off default on e extended Values on off default e timeout Timeout for request in seconds default 20 e hitsPerPage Results per page default 10 e similarity Lucene accuracy for searches default 0 8 6 5 Metadata services 75 GeoNetwork Developer Manual Release 2 9 2 e sortBy Sorting criteria Values relevance default rating popularity changeDate title Search parameters all values are optional e eastBL southBL northBL westBL Bounding box to restrict the search relation Bounding box criteria Values equal overlaps default encloses fullyOutsideOf intersection crosses touches within any Text to search in a free text search title Metadata title abstract Metadata abstract themeKey Metadata keywords To search for several use a value like Global or watersheds template Indicates 1f search for templates or not Values n default y dynamic Map type Values off default on download Map type Values off default on digital Map type Values off default on paper Map type Values off default on
77. d the website using the Hudson deployment system 2 1 13 Announce the release Mailing lists Send an email to both the developers list and users list announcing the release TODO Template mail 2 1 Create a stable release for GeoNetwork 15 scp geonetwork war username frs sourceforge net home frs project g ge geonetwork Geol scp geonetwork VERSION jar username frs sourceforge net home frs project g ge geone scp geonetwork VERSION exe username frs sourceforge net home frs project g ge geone scp does readme txt username frs sourceforge net home frs project g ge geonetwork Gec GeoNetwork Developer Manual Release 2 9 2 SourceForge TODO Do we create SourceForge notifications 2 1 14 Close the tag Warning This script must be configured in SVN server After a version is released we must close the tag to prevent commits using a pre commit script in SVN like bin sh REPOS 1 TXN 2 SVNLOOK usr bin svnlook Committing to tags is not allowed SSVNLOOK changed t STXN SREPOS grep U Wetags amp amp bin echo Cannot commit to te All checks passed so allow the commit exit 0 TODO Check the regular expression to identify the tags After creating a tag we commit the new versions in tag so we need to close the tag when the release it s finished 2 1 15 Upgrade branch pom versions Warning This steps must be performed using branch code After a release has being created t
78. e GeoNetwork source 4 3 Example ISO19115 19139 Marine Community Profile MCP 41 GeoNetwork Developer Manual Release 2 9 2 Once again because the MCP is a profile of ISO19115 19139 it is probably best to modify index fields xsl from the schema iso19139 to handle the namespaces and additional elements of the MCP At this stage our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl index fields xsl loc present schema ident xml schema xsd schema 4 3 7 Creating the sample data directory This is a simple directory Put MEF files with sample metadata in this directory Make sure they have a mef suffix A MEF file is a zip archive with the metadata thumbnails file based online resources and an info file describing the contents The contents of a MEF file are discussed in more detail in the next section of this manual Sample data in this directory can be added to the catalog using the Administration menu At this stage our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl index fields xsl loc present sample data schema ident xml schema xsd schema 4 3 8 Creating schematrons to describe MCP conditions Schematrons are rules that are used to check conditions and content in the metadata record as part of the two stage validation process used by GeoNetwork Schematron rules are created in the schematrons direct
79. e Mon 01 Feb 2010 09 29 43 GMT Expires Thu 01 Jan 1970 00 00 00 GMT Set Cookie JSESSIONID 1xh3kpownhmjh Path geonetwork Content Type application xml charset UTF 8 Pragma no cache Cache Control no cache Expires 1 Transfer Encoding chunked Server Jetty 6 1 14 58 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 The authentication process sets JSESSIONID cookie with the authentication token that should be send in the services that need authentication to be invoqued Otherwise a Service not allowed exception will be returned by these services Errors e Missing parameter error id missing parameter when mandatory parameters are not send Returned 400 HTTP code e bad parameter XXXX when an empty username or password is provided Returned 400 HTTP code e User login failed error id user login when login information is not valid Returned 400 HTTP code Example returning User login failed exception lt xml version 1 0 encoding UTF 8 gt lt error id user login gt lt message gt User login failed lt message gt lt class gt UserLoginEx lt class gt lt stack gt lt at class org fao geonet services login Login file Login java line 90 method lt at class jeeves server dispatchers Servicelnfo file ServiceInfo java line 238 lt at class jeeves server dispatchers Serv
80. e service not allowed Error message Service not allowed 6 14 3 Create a new user sending credentials This example show a request to create a new user that requires authentication to complete succesfully In this example httpClient it s used first to send a login request to GeoNetwork getting with JSES SIONID cookie Nexts requests send to GeoNetwork using httpClient send the JSESSIONID cookie and are managed as authenticated requests Source package org geonetwor import import import import import import import import import public k xmlservices client org apache commons httpclient Credentials org apache commons httpclient HttpClient org apache commons httpclient HttpStatus org apache commons httpclient UsernamePasswordCredentials org apache commons httpclient auth AuthScope org apache commons httpclient methods PostMethod org apache commons httpclient methods StringRequestEntity org jdom Document org jdom Element class CreateUserClientAuth private HttpClient httpclient CreateUserClientAuth httpclient new HttpClient ax x Authenticates the user in GeoNetwork and send a request that needs authentication to create a new user Xx xx public void sendRequest x Authenticate user 6 14 Java development with XML services 137 GeoNetwork Developer Manual Release 2 9 2 if login System exit 1 xx
81. e 2 9 2 lt xs documentation gt lt xs annotation gt lt xs complexContent gt lt xs extension base gmd MD_Constraints_Type gt lt xs sequence minOccurs 0 gt lt xs element name jurisdictionLink type gmd URL_PropertyType minOccurs 1 gt lt xs element name licenseLink type gmd URL_PropertyType minOccurs 1 gt lt xs element name imageLink type gmd URL_PropertyType minOccurs 1 gt lt xs element name licenseName type gco CharacterString_PropertyType minOccurs lt xs element name attributionConstraints type gco CharacterString_ PropertyType lt xs element name derivativeConstraints type gco CharacterString_PropertyType lt xs element name commercialUseConstraints type gco CharacterString_PropertyTy lt xs element name collectiveWorksConstraints type gco CharacterString_Property lt xs element name otherConstraints type gco CharacterString_PropertyType min lt xs sequence gt lt xs attribute ref mcp commonsType use required gt lt xs attribute ref gco isoType use required fixed gmd MD_Constraints gt lt xs extension gt lt xs complexContent gt lt xs complexType gt lt xs element name MD_Commons substitutionGroup gmd MD_Constraints type mcp MD_Commor For MCP records the GeoNetwork editor will show a choice of elements from the substitution group for gmd MD_Constraints when adding Resource Constraints to the metadata document Th
82. e 2 9 2 More on autodetect The autodetect section of schema ident xml is used when GeoNetwork needs to identify which metadata schema a record belongs to The five rules that can be used in this section in order of evaluation are 1 Attributes Find one or more attributes and or namespaces in the document An example use case is a profile of ISO19115 19139 that adds optional elements under a new namespace to gmd identificationInfo gmd MD_Dataldentification To detect records that belong to this profile the autodetect section in the schema ident xml file could look something like the following lt autodetect xmlns cmar http www marine csiro au schemas cmar xsd gt lt l catch all cmar records that have the cmar vocab element gt lt attributes cmar vocab http www marine csiro au vocabs projectCodes xml gt lt autodetect gt Some other points about attributes autodetect e multiple attributes can be specified all must be match for the record to be recognized as belonging to this schema e if the attributes have a namespace then the namespace should be specified on the autodetect ele ment or somewhere in the schema ident xml document 2 Elements Find one or more elements in the document An example use case is the one shown in the example schema ident xml file earlier lt autodetect xmlns mcp http bluenet3 antcrc utas edu au mcp xmlns gmd http www isotc211 org 2005 gmd xmlns gco http www isotc2
83. e network e 23950 Configuration about Z39 50 protocol enable true means that the server component is running port Port number to use to listen for incoming Z39 50 requests e proxy Proxy configuration use true means that the proxy is used when connecting to external nodes host Proxy s server host 6 6 System configuration 99 GeoNetwork Developer Manual Release 2 9 2 port Proxy s server port username Proxy s credentials password Proxy s credentials e feedback A container for feedback information email Administrator s email address mailServer Email server to use to send feedback x host Email s host address port Email s port to use in host address e removed Metadata A container for removed metadata information dir Folder used to store removed metadata in MEF format e Idap A container for LDAP parameters use host port defaultProfile login userDN password distinguishedNames base users userAttribs Name password x profile Example of xml config get response lt config gt lt site gt lt name gt dummy lt name gt lt organisation gt dummy lt organization gt lt site gt lt server gt lt host gt localhost lt host gt lt port gt 8080 lt port gt lt server gt lt Intranet gt lt network gt 127 0 0 1 lt network gt lt netmask gt 255 255 255 0 lt netmask gt lt intran
84. e three regions China Mongolia and CIS_BS countries DCW boundaries were introduced There are no DCW boundaries between Russian Federation and the rest of the new countries of the CIS_BS The original physiographic map of China inc EURASIA GEOSCIENTIFICINFORMATION PHYSIOGRAPHY SOIL SESEIISE Hydrological Basins in Africa Sample record please remove Acciones yu abstract update fsdafasdfasdfdsafsa AQUASTAT AWRD AFRICA HYDROLOGY INLANDWATERS RIVER BASINS WATER RESOURCES WATERSHEDS DUS e gt I 1 6 result s 6 Powered by GEONEs Work renderTo cloud tag onSuccess app loadResults On this example we just have to set up four properties on the constructor the catalogue variable which makes all the query which will be sent to the server to provide the items to show the renderTo id of the div where the tag cloud will be drawn and the onSuccess function which will decorate and give style to the results of the tag cloud search You can find the whole API of widgets here Create a new widget You can create new widgets to add to your customized user interface Using the same example as before you can see that you can easily create new widgets You just have to take care of two things e Visualization define an html div where your widget will display information e Manipulation of information add some functionality like a search connector so the visualization has data to show Using
85. ecord have a downloadable resource attached 0 or 1 digital Is the metadata record distributed available in a digital format 0 or 1 eastBL East bounding box longitude keyword Metadata keywords metadataStandardName Metadata standard name northBL North bounding box latitude operatesOn Uuid of metadata record describing dataset that is operated on by a service orgName Name of organisation listed in point of contact information parentUuid Uuid of parent metadata record paper Is the metadata record distributed available in a paper format 0 or 1 protocol On line resource access protocol publicationDate Date resource was published southBL South bounding box latitude spatialRepresentationType vector raster etc tempExtentBegin Beginning of temporal extent range tempExtentEnd End of temporal extent range title Metadata title topicCat Metadata topic category type Metadata hierarchy level should be dataset if unknown westBL West bounding box longitude For example here is the mapping created between the metadata element mcp revisionDate and the lucene index field changeDate lt xsl for each select mcp revisionDate x gt lt Field name changeDate string string store true index true gt lt xsl for each gt Notice that we are creating a new XML document The Field elements in this document are read by GeoNetwork to create a Lucene document object for indexing see the SearchManager class in th
86. ed in the appHandler configuration of the INSTALL_DIR web geonetwork WEB INF config xml config file or it could be a default specified by the operation calling autodetect eg a value parsed from a user bulk loading some metadata records For flexibility and accuracy reasons it is preferable that records be detected using the autodetect information of an installed schema The default schema is just a catch all method of assigning records to a spe cific schema The config element in INSTALL DIR web geonetwork WEB INF config xml looks like the following lt appHandler class org fao geonet Geonetwork gt lt param name preferredSchema value isol9139 gt lt appHandler gt More on autodetect evaluation The rules for autodetect are evaluated as follows for each autodetect rule type in attributes namespaces elements namespaces root element for each schema if schema has autodetect rule type then check rule for a match 26 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 if match add to list of previous matches end if end for each if more than one match throw SCHEMA RULE CONFLICT EXCEPTION if one match then set matched first match and break loop end for each if no match then if namespaces of record and default schema overlap then set match default schema else throw NO SCHEMA MATCHES EXCEPTION end if return matched schema
87. element It must contain a schema and a name attribute The first one must be one of the sup ported schemas see the section above The second must be the qualified name of the element which information must be retrieved The namespace must be declared into this element or into the root element of the request e codelist Works like the previous one but returns information about codelists lt request xmlns gmd http www isotc211 org 2005 gmd gt lt element schema iso19139 name gmd constraintLanguage gt lt codelist schema iso19115 name DateTypCd gt lt request gt Note The returned text is localised depending on the language specified during the service call A call to geonetwork srv en xml schema info will return text in the English language Response The response s root element will be populated with information of the elements codelists specified into the request The structure is the following e element A container for information about an element It has a name attribute which contains the qualified name of the element label The human readable name of the element localised into the request s language description A generic description of the element condition 0 1 This element is optional and indicates if the element must satisfy a condi tion like the element is always mandatory or is mandatory if another one is missing e codelist A container for information about a codelis
88. ematrons directory set thumbnail xsl Optional Set the browse graphic thumbnail in the metadata record set uuid xsl Optional Set the UUID of the metadata record suggest xsl Optional XSLT run by metadata suggestions service The XSLT contains processes that can be registered and run on different elements of a metadata record eg expand keyword field with comma separated content into multiple keyword fields See http trac osgeo org geonetwork wiki proposals MetadataEditorSuggestion for more info unset thumbnail xsl Optional Remove the browse graphic thumbnail from the metadata record update child from parent info xsl Optional XSLT to specify which elements in a child record are updated from a parent record Used to manage hierarchical relationships between metadata records update fixed info xsl Optional XSLT to update fixed content in metadata records The following configuration files can be present oasis catalog xml Optional An oasis catalog describing any mappings that should be used for this schema eg mapping URLs to local copies such as schemaLocations eg http www isotc211 org 2005 gmd gmd xsd is mapped to schema gmd gmd xsd Path names used in the oasis catalog are relative to the location of this file which is the schema di rectory schema xsd Optional XML schema directory file that includes the XSDs used by this metadata schema If the schema uses a DTD then this file should not be present
89. entication session cookiexx In Login response status code result System out println Authentication session cookie httpclient getStat return result catch Exception ex ex printStackTrace return false finally getCookies 0 HttpStatus SC_OK Release current connection to the connection pool once you are done post releaseConnection public static void main String args CreateUserClientAuth request new CreateUserClientAuth request sendRequest Output Login response status code 200 Authentication session cookie JS Create user respons status code ESSIONID 0zj8iyvalagv 200 Trying to run again the program as the user it s just created we get an exception 6 14 Java development with XML services 139 GeoNetwork Developer Manual Release 2 9 2 Login response status code Authentication session cookie Creat Error response lt xml lt error id error gt lt message gt ERROR duplicate key violates unique cons lt class gt PSOLException lt class gt user respons status code ves resources dbms Dbms 200 JSESSIONID 1q09kwg0r6fqe 500 version 1 0 encoding UTF 8 gt core v3 QueryExecutorImpl core v3 QueryExecutorImpl core v3 QueryExecutorImpl jdbc2 Abstractd jdbc2 Abstractd gt jdbc2 Abstractd class org fao geonet servic
90. er 7 Settings hierarchy GeoNetwork Developer Manual Release 2 9 2 e Site Contains the URL to connect to and account information URL string URL to connect to Must be well formed starting with http file or a supported protocol Icon string This is the icon that will be used as the metadata source s logo The image is taken from the images harvesting folder and copied to the images logos folder e options Recurse boolean Indicates if the remote folder must be recursively scanned for metadata Validate boolean If set the harvester will validate the metadata against its schema and the metadata will be harvested only if it is valid 7 3 4 Nodes of type CSW This type of harvesting is capable of querying a Catalogue Services for the Web CSW server and retrieving all found metadata e site capabUrl string URL of the capabilities file that will be used to retrieve the operations address icon string This is the icon that will be used as the metadata source s logo The image is taken from the images harvesting folder and copied to the images logos folder e search 0 n Contains search parameters If this element is missing an unconstrained search will be performed freeText string title string abstract string subject string 7 3 Harvesting nodes 145 GeoNetwork Developer Manual Release 2 9 2 146 Chapter 7 Settings hierarchy CHAPTER
91. er M2_REPO e In Path field enter the path to your m2 repository_directory e Example C Documents and Settingsm coudert m2repository An alternative to set up this variable directly using maven could to run the following command into your workspace directory mvn Declipse workspace eclipse add maven repo e Generate Eclipse project files To generate all the classpath and project files execute the following command at the project root direc tory mvn eclipse eclips 1 6 2 Import source code In order to import the source code follow instructions below e Press File gt Import Menu item e In new dialog Select General gt Existing Projects into Workspace e Press Next e In Select root directory field enter where your code is 1 6 Eclipse setup 7 GeoNetwork Developer Manual Release 2 9 2 import Ox Select 7 Create new projects from an archive file or directory Select an import source Y gt General E Archive File 3 File System E Preferences b cvs b gt EB b 5 Java EE gt E Maven gt E oXygen b gt Plug in Development gt 5 Run Debug Y SVN E 100 o 8 Chapter 1 Software development GeoNetwork Developer Manual Release 2 9 2 e example C devgeonetworktrunk e Select All projects and Press Finish button 1 6 3 Setting m2eclipse plugin To install m2eclipse please refer to the following documentation Then click on File gt I
92. ere is a file on web client src main resources apps html5ui css colors css which contains all the colors of the app Page design The html is loaded from web src main webapp xsl search xsl This xsl is interpreted by jeeves and trans formed to show the basic page The page scheme is basically the same on all links so if you change the position of some html elements they will be changed on all views Don t forget that some of the elements are also placed with css Specific css for this UI not shared with other UIs like search or tabsearch is placed on web client src main resources apps html5ui css main css 8 4 HTML5UI 155 GeoNetwork Developer Manual Release 2 9 2 Results view templates They are on web src main resources apps html5ui js Templates js Add more tabs To add more tabs just look on search xsl around line 240 id main navigation and add a new element like this lt li gt lt a id new tab href TODO gt lt xsl value of select root gui strings new tab gt lt a gt lt li gt The value of the string will be taken from the strings xml file that corresponds to the language used Add a footer link Look for the div element with id footer and just add it lt li gt lt a href http geonetwork opensource org gt GeoNetwork OpenSource lt a gt lt li gt Maps and other elements change display behaviour Maps are always loaded even if they are not displayed You c
93. ery which will be sent to the server to provide the items to show the renderTo id of the div where the tag cloud will be drawn and the onSuccess function which will decorate and give style to the results of the tag cloud search You can find the whole API of widgets here Create a new widget You can create new widgets to add to your customized user interface Using the same example as before you can see that you can easily create new widgets You just have to take care of two things e Visualization define an html div where your widget will display information e Manipulation of information add some functionality like a search connector so the visualization has data to show Using outside GeoNetwork Although it is a testing functionality in fact you can use this same widgets on your own webpage You just have to make sure that all dependencies are fulfilled and the settings are properly set up As development will go on this functionality will be made easier and documentation will be filled up TODO some simple examples It contains two maps preview map and big map You can access the big map clicking on the preview map Both maps have synchronized layers so if you add or remove or change style on one map layer you will see that the other map also changes Tested in Chrome Firefox and IE gt 8 also works but with some penalties on IE7 Changing Style Basic changing styling is pretty easy with this UI Colors Th
94. es service updates the operations allowed for a selected meta data with the list of operations allowed send in the parameters deleting all the operations allowed assigned previously This service requires a previous call to metadata select service to select the metadata records to update Requires authentication Yes Request to metadata select service Parameters e id Identifier of metadata to select e selected Selection state Values add add all remove remove all Select all metadata allowed example Url http localhost 8080 geonetwork srv en metadata select ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt 86 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt selected gt add all lt selected gt lt request gt Select a metadata record example Url http localhost 8080 geonetwork srv en metadata select ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 2 lt id gt lt selected gt add lt selected gt lt request gt Clear metadata selection example Url http localhost 8080 geonetwork srv en metadata select Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt selected gt remove all lt selected gt lt request gt Response to metadata select service The response contains t
95. es user U lt stack gt lt at class org postgresql lt at class org postgresql lt at class org postgresql lt at class org postgresql lt at class org postgresql method executeWithFlags lt at class org postgresql method executeUpdate gt lt at class j lt at lt at class j lt at class j lt stack gt lt request gt lt language gt en lt language gt lt service gt user update lt service gt lt request gt lt error gt Error code users_username_key error Error message ves server dispatchers Servicelnfo ves server dispatchers Servicelnfo ERROR fil Ei fil dbc2Statement dbc2Statement dbc2Statement file Dbms java pdate duplicate key violates e QueryExecu e QueryExecu e QueryExecu traint users username key lt message torImpl java torImpl java torImpl java file AbstractJdbc2Statement file AbstractJdbc2Statement file AbstractJdbc2Statement line 261 method execute file Update java line 134 methoc file ServiceInfo java line 238 file ServicelInfo java line 141 unique constraint 140 Chapter 6 XML Services CHAPTER 7 Settings hierarchy 7 1 Introduction GeoNetwork stores many options and information inside the Settings table Information is grouped into hierarchies where each node has a key value pair and can have many
96. et groups An authenticated user can see only himself A guest cannot see any user Request example lt request gt lt type gt site lt type gt lt type gt groups lt type gt lt request gt Response Each type element produces an XML subtree so the response to the previous request is like this lt info gt lt site gt lt site gt lt categories gt lt categories gt lt groups gt lt groups gt lt info gt Here follows the structure of each subtree site This is the container name Human readable site name siteld Universal unique identifier of the site platform This is just a container to hold the site s back end x name Platform name For GeoNetwork installations it must be GeoNetwork 6 7 General services 103 GeoNetwork Developer Manual Release 2 9 2 version Platform version given in the X Y Z format x subVersion Additional version notes like alpha 1 or beta 2 Example site information lt site gt lt name gt My site lt name gt lt organisation gt FAO lt organization gt lt siteld gt 0619cc50 708b 11da 8202 000d9335906e lt siteld gt lt platform gt lt name gt geonetwork lt name gt lt version gt 2 2 0 lt version gt lt platform gt lt site gt e categories This is the container for categories category On A single GeoNetwork s category This element has an id attribute which represents the local identifier f
97. et gt 100 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt z3950 gt lt enable gt true lt enable gt lt port gt 2100 lt port gt lt z3950 gt lt proxy gt lt use gt false lt use gt lt host gt lt port gt lt username gt proxyuser lt username gt lt password gt proxypass lt password gt lt proxy gt lt feedback gt lt email gt lt mailServer gt lt host gt lt port gt 25 lt port gt lt mailServer gt lt feedback gt lt removedMetadata gt lt dir gt WEB INF removed lt dir gt lt removedMet adata gt lt ldap gt lt use gt false lt use gt lt host gt lt port gt lt defaultProfile gt RegisteredUser lt defaultProfile gt lt login gt lt userDN gt cn Manager lt userDN gt lt password gt lt login gt lt distinguishedNames gt lt base gt dc fao dc org lt base gt lt users gt ou people lt users gt lt distinguishedNames gt lt userAttribs gt lt name gt cn lt name gt lt password gt userPassword lt password gt lt profile gt profile lt profile gt lt userAttribs gt lt 1dap gt lt config gt 6 6 3 xml config set This service is used to update the system s information and so it is restricted to administrators Request The request format must have the same structure returned by the xml config get service and can contain only elements that the caller wants to be updated If an element is not included
98. f an existing group Only users with Administrator profile can create update groups Requires authentication Yes Request Parameters e id Group identifier to update If not provided a new group it s created with name description and email parameters provided e name mandatory Name of the group e description Group description e email Mail address for the group Group update request example Url http localhost 8080 geonetwork srv en group update Mime type application xml Post request lt request gt lt id gt 2 lt id gt lt name gt sample lt name gt lt description gt Demo group lt description gt lt email gt group mail net lt email gt lt request gt 62 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code Missing parameter error id missing parameter when mandatory parameters are not pro vided Returned 400 HTTP code bad parameter name when name it s empty Returned 400 HTTP code ERROR duplicate key violates unique constraint groups name key when trying to create a new grou
99. for branch next version for example 2 6 2 2 1 1 Release committee To create new releases a committee of 3 4 persons should be choosen The members of the committee are responsible of creating the releases following the steps described in this document to guarantee the quality of releases A rotation policy can be use to select the person of the committee responsible of creating a release 2 1 2 Notify developer lists It is good practice to notify the GeoNetwork developer list of the intention to make the release a few days in advance On the day the release is being made a warning mail must be send to the list asking that developers refrain from committing until the release tag has been created 2 1 3 Prerequisites The following are necessary to perform a GeoNetwork release 1 Commit access to GeoNetwork svn 2 Administration rights to SourceForge server to publish the release 11 GeoNetwork Developer Manual Release 2 9 2 2 1 4 Update source code from SVN Warning This steps must be performed in branch code 1 Update or check out the branch to be released from 2 Ensure that svn status yields no local modifications Test issues solved for new release 1 Create an installer mvn clean install cd installer S ant 2 Install the installer located in geonetwork VERSION folder 3 Test the issues included for the release checking in GeoNetwork trac If tests are passed proceed with the relea
100. getAttribute id getValue System out println Error message response getChildText message catch Exception ex ex printStackTrace finally xx Release current connection to the connection pool once you are donexx post releaseConnection ax x Logins a user in GeoNetwork x After login httpClientx x gets with JSSESIONID cookie Using it for nexts requests these are managed as authenticated requests 138 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 x return True if login it s ok false otherwise Ax xx private boolean login xx Create request XML Element request new Element request addContent new Element username setText admin addContent new Element password se Text admin xx Create PostMethod specifying login service urlx x String loginUrl http localhos PostMethod post try String postDat xx Set post data post setReques application xml UTF8 x Send logi int result h xx Display s System out print a n 8080 geonetwork srv en xml user login new PostMethod loginUrl Xml getString new Document request ttpclient requestxx mime type and encodingx x tEntity new StringRequestEntity postData r xecuteMethod post tatus code and auth
101. gh the last two can be handled under special circumstances In the case of the Marine Commuity Profile we are basically defining a number of extensions to the base standard ISO19115 19139 These extensions are defined using the XSD extension mechanism on the types defined in ISO19139 The following snippet shows how the Marine Community Profile extends the gmd MD_Metadata element to add a new element called revisionDate lt xs schema targetNamespace http bluenet3 antcrc utas edu au mcp xmlns mcp http bluenet3 antcrc utas edu au mcp gt lt xs element name MD_Metadata substitutionGroup gmd MD_Metadata type mcp MD_Metadata_Type gt lt xs complexType name MD_Metadata_Type gt lt xs annotation gt lt xs documentation gt Extends the metadata element to include revisionDate lt xs documentation gt lt xs annotation gt lt xs complexContent gt lt xs extension base gmd MD_Metadata_Type gt lt xs sequence gt lt xs element name revisionDate type gco Date_PropertyType minOccurs 0 gt lt xs sequence gt lt xs attribute ref gco isoType use required fixed gmd MD_Metadata gt lt xs extension gt lt xs complexContent gt lt xs complexType gt lt xs schema gt 28 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 In short we have defined a new element mcp MD_Metadata with type mcp MD_Metadata_Type which is an extension of gmd MD_Metadata_Type B
102. gt lt options gt lt privileges gt lt group id 0 gt lt operation name view gt lt group gt lt group id 14 gt lt operation name download gt lt group gt lt privileges gt lt categories gt lt category id 2 gt lt categories gt lt info gt lt lastRun gt lt running gt false lt running gt lt info gt lt node gt The node s structure has a common XML format plus some additional information provided by the harvesting types In the following structure each element has a cardinality specified using the x y notation where x and y denote the minimum and the maximum values The cardinality 1 1 is omitted for clarity e node The root element It has a mandatory id attribute that represents the internal identifier and a mandatory type attribute which indicates the harvesting type site A container for site information name string The node s name used to describe the harvesting UUID string This is a system generated unique identifier associated to the harvesting node This is used as the source field into the Metadata table to group all metadata from the remote node account A container for account information 112 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 use boolean true means that the harvester will use the provided username and password to authenticate itself The authentication mechanism depends on the har ves
103. gt application xml lt ows OutputFormat gt lt ows AcceptFormats gt lt esw GetCapabilities gt SOAP request 126 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Url http localhost 8080 geonetwork srv en csw Content type application soap xml Post data lt xml version 1 0 encoding UTF 8 gt lt env Envelope xmlns env http www w3 org 2003 05 soap envelope gt lt env Body gt lt csw GetCapabilities xmlns csw http www opengis net cat csw 2 0 2 service CSW gt lt ows AcceptVersions xmlns ows http www opengis net ows gt lt ows Version gt 2 0 2 lt ows Version gt lt ows AcceptVersions gt lt ows AcceptFormats xmlns ows http www opengis net ows gt lt ows OutputFormat gt application xml lt ows OutputFormat gt lt ows AcceptFormats gt lt csw GetCapabilities gt lt env Body gt lt env Envelope gt DescribeRecord DescribeRecord operation allows a client to discover elements of the information model supported by the target catalogue service The operation allows some or all of the information model to be described Request examples GET request http localhost 8080 geonetwork srv en csw request DescribeRecord amp service CSW version 2 POST request Urls http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw DescribeRecord xmlns csw
104. he branch version number must be increased to next release version On a NIX Linux OSX etc operating system you can use the following batch script 1 From the root of the branch source tree execute the script updateBranchVersions sh To update from version 2 6 1 SNAPSHOT to 2 6 2 SNAPSHOT for example updateBranchVersions sh 2 6 1 2 6 2 2 Commit the updated files svn commit m Updated files version to VERSION SNAPSHOT 16 Chapter 2 Create GeoNetwork releases CHAPTER 3 Harvesting 3 1 Structure The harvesting capability is built around 3 areas JavaScript code Java code and XSL stylesheets on both the server and client side 3 1 1 JavaScript code This refers to the web interface The code is located in the web geonetwork scripts harvesting folder Here there is a subfolder for each harvesting type plus some classes for the main page These are 1 harvester js This is an abstract class that must be implemented by harvesting types It defines some information retrieval methods getType getLabel etc used to handle the harvesting type plus one getUpdateRequest method used to build the XML request to insert or update entries 2 harvester model js Another abstract class that must be implemented by harvesting types When creating the XML request the only method substituteCommon takes care of adding common information like privileges and categories taken from the user interface 3 harvester
105. he group that own metadata can be multiple editor elements id surname name Metadata user owner information Retrieve ownership groups response example lt xml version 1 0 encoding UTF 8 gt lt response gt lt targetGroup gt lt id gt 2 lt id gt lt name gt sample lt name gt lt description gt Demo group lt description gt lt email gt group mail net lt email gt lt referrer gt lt label gt lt en gt Sample group lt en gt lt fr gt Sample group lt fr gt lt es gt Sample group lt es gt lt de gt Beispielgruppe lt de gt lt nl gt Voorbeeldgroep lt nl gt lt label gt lt editor gt lt id gt 12 lt id gt lt surname gt lt name gt lt editor gt lt editor gt lt id gt 13 lt id gt lt surname gt lt name gt Samantha lt name gt lt editor gt lt targetGroup gt lt targetGroup gt 6 5 Metadata services 93 GeoNetwork Developer Manual Release 2 9 2 lt id gt 6 lt id gt lt name gt RWS lt name gt lt description gt lt email gt lt referrer gt lt label gt lt de gt RWS lt de gt lt fr gt RWS lt fr gt lt en gt RWS lt en gt lt es gt RWS lt es gt lt nl gt RWS lt nl gt lt label gt lt editor gt lt id gt 7 lt id gt lt surname gt lt name gt Samantha lt name gt lt editor gt lt targetGroup gt lt response gt Errors Service not allowed error id service not allowed when the user is not authenticated or h
106. he number of metadata selected Response select metadata example lt xml version 1 0 encoding UTF 8 gt lt request gt lt Selected gt 10 lt Selected gt lt request gt Request to metadata massive update privileges Parameters e _G_O can be multiple elements G Group identifier O Operation identifier Operation identifiers e 0 view e 1 download e 2 editing 6 5 Metadata services 87 GeoNetwork Developer Manual Release 2 9 2 e 3 notify e 4 dynamic e 5 featured Request metadata massive update privilegies example POST Url http localhost 8080 geonetwork srv en metadata massive update privileges ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt _1_2 gt lt _1 1 gt lt request gt GET Url http localhost 8080 geonetwork srv en metadata massive update privileges _1_2 amp _1_1 Response to metadata massive update privileges If request is executed succesfully HTTP 200 status code is returned If request fails an HTTP status code error is returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Metadata not found error id metadata not found if not exists a metadata record with the identifier provided ERROR
107. he record will be able to use this service To obtain these rights your application will need to use xml user login Request Called with a metadata id or uuid one or more file names if more than one file is attached to the metadata record as data for download and access which is almost always private Example lt request gt lt uuid gt d8c8ca11 ecc8 45dc b424 171a9e212220 lt uuid gt lt fname gt roam rsf aus bathy topo contours sff lt fname gt lt fname gt mse09_M8 nc lt fname gt lt access gt private lt access gt lt request gt Response The service returns a copy of the request parameters a copy of the metadata record xml and an HTML version of the license annex generated from the metadata record by the XSL metadata license annex xsl see web geonetwork xsl directory 108 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Example of an xml file disclaimer response for a GeoNetwork node Note the lt metadata gt and lt li cense gt elements are not shown in full as they are too big lt response gt lt id gt 22 lt id gt lt uuid gt d8c8ca11 ecc8 45dc b424 171a9e212220 lt uuid gt lt fname gt roam rsf aus bathy topo contours sff lt fname gt lt fname gt mse09_M8 nc lt fname gt lt access gt private lt access gt lt metadata gt lt gmd MD_Metadata xmlns gmd http www isotc211 org 2005 gmd xmlns xsi http lt gmd MD_Metadata gt lt metadata gt
108. hould contain everything related to the authentication of the user like control buttons to log in and log out and handles the cookie app mapApp Should control everything related to maps For example if you want to add a new layer to the maps you should look here Also initializes the maps preview and big app searchApp Closely related to Catalogue js it launches searches and initializes the results view To change the advanced search you have to look here too More info History The ExtJS History plugin is also used on this UI It is not quite stable not at all on IE but it can be modified to allow back button from browser to work What is the div id only_for_spiders As the name says this is for spiders or crawlers When you access with the direct link to a metadata that div will be used to load plain xml data so browsers can process it Don t worry if you are human you will not see it at all 8 4 2 Widgets The GeoNetwork widget framework provides a list of independent pieces of code that let you build a geonetwork user interface Add widget Widgets are usually pieces of html that will be shown on your user interface You should place them in some html structure so they are visually arranged 158 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 _ Nationaal Georegister Ge gt G Q D natien NGR er A Metals resultaat Online kaarten Downloadbare data C Data o
109. icelnfo file ServiceInfo java line 141 lt at class jeeves server dispatchers ServiceManager file ServiceManager java line lt at class jeeves server JeevesEngine file JeevesEngine java line 621 method c lt at class jeeves server sources http JeevesServlet file JeevesServlet java lines lt at class jeeves server sources http JeevesServlet file JeevesServlet java lines lt at class javax servlet http HttpServlet file HttpServlet java line 727 methoc lt at class javax servlet http HttpServlet file HttpServlet java line 820 methoc lt at class org mortbay jetty servlet ServletHolder file ServletHolder java line lt stack gt lt object gt admin2 lt object gt lt request gt lt language gt en lt language gt lt service gt user login lt service gt lt request gt lt error gt Shibboleth login shib user login The shib user login service process the creadentials of a Shibboleth login To use this service the user previously should be authenticated to Shibboleth If the authentication is succesful the HTTP headers will contain the user credentials When calling shib user login service in GeoNetwork the Shibboleth credentials are then used to find or create if don t exists the user account in GeoNetwork GeoNetwork processes the next HTTP header parameters filled by Shibboleth authentication e system shib attrib username e system shib attrib surname e system shib attrib firstname
110. ices status and so on For example it is used by the harvesting web interface to retrieve information about a remote node Request The XML request should contain at least one type element to indicates the kind of information to retrieve More type elements can be specified to obtain more information at once The set of allowed values are 102 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 5 6 Site Returns general information about the site like its name id etc categories Returns all site s categories groups Returns all site s groups visible to the requesting user If the user does not authenticate himself only the Intranet and the all groups are visible operations Returns all possible operations on metadata regions Returns all geographical regions usable for queries sources Returns all GeoNetwork sources that the remote site knows The result will contain The remote node s name and siteld All source UUIDs and names that have been discovered through harvesting All source UUIDs and names of metadata that have been imported into the remote node through the MEF format Administrators can see all users into the system normal other administrators etc User administrators can see all users they can administrate and all other user administrators in the same group set The group set is defined by all groups visible to the user administration beside the All and the Intran
111. icular to the profile and if this is not successful ie no template matches and thus no HTML elements are returned process the element in the mode of the base schema The advantage of this design is that overriding a template for an element in the base schema does not need the priority attribute or an XPath condition check on the schema name Here is an example for the MCP iso19139 mcp with base schema iso19139 e the main template which must be called metadata iso19139 mcp xsl lt main templat the way into processing iso19139 mcp gt lt xsl template name metadata iso19139 mcp gt lt xsl param name schema gt lt xsl param name edit select false gt lt xsl param name embedded gt lt process in profile mode first gt lt xsl variable name mcpElements gt lt xsl apply templates mode iso19139 mcp select gt lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl with param name embedded select Sembedded gt lt xsl apply templates gt lt xsl variable gt lt xsl choose gt lt if we got a match in profile mode then show it gt lt xsl when test count mcpElements x gt 0 gt lt xsl copy of select SmcpElements gt lt xsl when gt lt otherwise process in base iso19139 mode gt lt xsl otherwise gt lt xsl apply templates mode iso19139 select g
112. ion item Metadata RSS item one item for each metadata retrieved title Metadata title x link Link to show metadata page Additional link elements with rel alternate to OGC WXS services shapefile images files Google KML etc can be returned depend ing on metadata description Metadata description x pubDate Metadata publication date media Metadata thumbnails georrs point Bounding box in georss simplepoint format RSS latest response example Mimetype application rss xml Response lt xml version 1 0 encoding UTF 8 gt lt rss xmlns media http search yahoo com mrss xmlns georss http www georss org gec lt channel gt lt title gt GeoNetwork opensource portal to spatial data and information lt title gt lt link gt http localhost 8080 geonetwork lt link gt lt description gt GeoNetwork opensource provides Internet access to interactive maps sat lt language gt en lt language gt lt copyright gt All rights reserved Your generic copyright statement lt copyright gt lt category gt Geographic metadata catalog lt category gt lt generator gt GeoNetwork opensource lt generator gt lt tt1 gt 30 lt tt1 gt lt item gt lt title gt Hydrological Basins in Africa Sample record please remove lt title gt lt link gt http localhost 8080 geonetwork uuid 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt lt link href http geonetwork3 fao org ows 296 SERVICE wmsSamp VERSION 1 1 1 amp REQUE
113. ion 1 0 encoding UTF 8 gt lt response from 1 to 7 gt lt summary count 7 type local gt lt keywords gt lt keyword count 2 name Global gt lt keyword count 2 name World gt lt keyword count 2 name watersheds gt lt keyword count 1 name Biology gt lt keyword count 1 name water resources gt lt keyword count 1 name endangered plant species gt lt keyword count 1 name Africa gt lt keyword count 1 name Eurasia gt lt keyword count 1 name endangered animal species gt lt keyword count 1 name Antarctic ecosystem gt lt keywords gt lt summary gt lt metadata xmlns gmx http www isotc211 org 2005 gmx gt lt geonet info xmlns geonet http www fao org geonetwork gt lt id gt 12 lt id gt lt uuid gt bc179f91 11c1 4878 b9b4 2270abde98eb lt uuid gt lt schema gt isol9139 lt schema gt lt createDate gt 2007 07 25T12 05 45 lt createDate gt lt changeDate gt 2007 11 06T12 10 47 lt changeDate gt lt source gt 881a1630 d4e7 4c9c aa01 7a9 bbbbc47b2 lt source gt lt category gt maps lt category gt lt category gt interactiveResources lt category gt lt score gt 1 0 lt score gt lt geonet info gt lt metadata gt lt metadata xmlns gmx http www isotc211 org 2005 gmx gt lt geonet info xmlns geonet http www fao org geonetwork gt lt id gt 11 lt id gt lt uuid gt 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt uuid gt
114. is profile has no rights to execute the service Returned 401 HTTP code 6 5 4 Metadata editing This services allow to maintaining the metadata in the catalog Insert metadata metadata insert The metadata insert service allows to create a new metadata record in the catalog Requires authentication Yes Request Parameters data mandatory Contains the metadata record group mandatory Owner group identifier for metadata 66 9 isTemplate indicates if the metadata content is a new template or not Default value n 66 99 title Metadata title Only required if isTemplate y gt category mandatory Metadata category Use _none_ value to don t assign any category styleSheet mandatory Stylesheet name to transform the metadata before inserting in the catalog Use _none_ value to don t apply any stylesheet 94 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 e validate Indicates if the metadata should be validated before inserting in the catalog Values on off default Insert metadata request example Url http localhost 8080 geonetwork srv en metadata insert ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt group gt 2 lt group gt lt category gt _none_ lt category gt lt styleSheet gt _none_ lt styleSheet gt lt data gt lt CDATA lt gmd MD_Metadata xmlns gmd http www is
115. is responsible for changing the node s parameters A typical request has a node root element and must include the id attribute lt node id 24 gt lt node gt The body of the node element depends on the node s type The update policy is this e If an element is specified the associated parameter is updated e If an element is not specified the associated parameter will not be changed So you need to specify only the elements you want to change However there are some exceptions 118 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 1 privileges If this element is omitted privileges will not be changed If specified new privileges will replace the old ones 2 categories Like the previous one 3 searches Some harvesting types support multiple searches on the same remote note When supported the updated behaviour should be like the previous ones Note that you cannot change the type of an node once it has been created Request The request is the same as that used to add an entry Only the id attribute is mandatory Response The response is the same as the xml harvesting get called on the updated entry 6 9 5 xml harvesting remove start stop run These services are put together because they share a common request interface Their purpose is obvi ously to remove start stop or run a harvesting node In detail 1 remove Remove a node Completely deletes the harvesting instance 2
116. is to ensure that only templates intended to process metadata elements from this schema or the base schema are applied The reason for this 1s that almost all profiles change or add a small number of elements to those in the base schema So most of the metadata elements in a profile can be processed in the mode of the base schema We ll see later in this section how to override processing of an element in the base schema e acompleteTab template which must be called lt schema name gt CompleteTab This template will display all tabs apart from the default or simple mode and the XML View tabs in the left hand frame of the editor viewer screen Here is an example for the MCP lt xsl template name is019139 mcpCompleteTab gt lt xsl param name tabLink gt lt xsl call template name displayTab gt lt non existent tab by profile gt lt xsl with param name tab select gt lt xsl with param name text select root gui strings byGroup gt lt xsl with param name tabLink select gt lt xsl call template gt lt xsl call template name displayTab gt lt xsl with param name tab select mcpMinimum gt lt xsl with param name text select root gui strings isol9139 mep mepMinimum gt lt xsl with param name indent select amp xA0 amp xA0 HxA0 gt lt xsl with param name tabLink select StabLink gt lt xsl call template gt
117. is will now include mcp MD_Commons Descriptive keywords a8 m Resource specific usage Resource constraints Constraints gmd MD_Constraints Constraints gmd MD_Constraints Legal constraints gmd MD_LegalConstraints Security constraints gmd MD_SecurityConstraints EE Commons License mcp MD_Commons Creative Commons License deprecated mcp MD_Creati R ommons Data Commons License deprecated mcp MD_DataCommons Aggregation Information Spatial representation type Er RX x Spatial resolution Resolution PE scale Note that by similar process two other elements now deprecated in favour of MD_Commons were also added as substitutes for MD_Constraints If it was necessary to constrain the choices shown in this menu say to remove the deprecated elements and limit the choices to just legal security and commons then this can be done by the following piece of XML in the schema substitutes xml file lt field name gmd MD_Constraints gt lt substitute name gmd MD_LegalConstraints gt lt substitute name gmd MD_SecurityConstraints gt lt substitute name mcp MD_Commons gt lt field gt The result of this change is shown below Once again a good place to start when building a schema substitutes xml file for the MCP is the schema substitutes xml file for the iso19139 schema 4 3 Example ISO19115 19139 Marine
118. it will not be updated However when included some elements require mandatory information i e the value cannot be empty Please refer to table_config_parameters Mandatory and optional parameters for the xml config set service 6 6 System configuration 101 GeoNetwork Developer Manual Release 2 9 2 Parameter Type Mandatory site name string yes site organization string no server host string yes server port integer no intranet network string yes intranet netmask string yes z3950 enable boolean yes z3950 port integer no proxy use boolean yes proxy host string no proxy port integer no proxy username string no proxy password string no feedback email string no feedback mailServer host string no feedback mailServer port integer no removedMetadata dir string yes Idap use boolean yes Idap host string no Idap port integer no Idap defaultProfile string yes Idap login userDN string yes Idap login password string no Idap distinguishedNames base string yes Idap distinguishedNames users string yes Idap userAttribs name string yes Idap userAttribs password string yes Idap userAttribs profile string no Response On success the service returns a response element with the OK text Example lt response gt ok lt response gt Otherwise a proper error element is returned 6 7 General services 6 7 1 xml info The xml info service can be used to query the site about its configuration serv
119. itor lt profile gt lt address gt lt city gt Amsterdam lt city gt lt state gt lt zip gt lt country gt nl lt country gt lt email gt john smith mail com lt email gt lt organisation gt lt kind gt gov lt kind gt lt record gt lt response gt Exceptions e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service User groups list xml usergroups list The xml usergroups list service can be used to retrieve the groups assigned to a user 66 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 Requires authentication Yes Request Parameters e id User identifier multiple id elements can be espeficied User groups list request example Uris http localhost 8080 geonetwork srv en xml usergroups list ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 3 lt id gt lt request gt Response Here follows the structure of the response e group This is the container for each user group element returned e id Group identifier e name Group name e description Group description User groups list response example lt xml version 1 0 encoding UTF 8 gt lt groups gt lt group gt lt id gt 3 lt id gt lt name gt RWS lt name gt lt description gt lt group gt lt groups gt Exceptions e Service no
120. ix gt 2 Edit build xml 3 Add a clean schema dir target for your plugin schema directory This target will remove the schematron rules from plugin schema directory basically removes all files with pattern schematron rules xsl 4 Add a compile schematron target for your rules value attribute is the suffix used in the rules name eg for schematron rules iso mcp sch the value attribute should be iso mcp This target will turn the sch schematron rules into an XSLT using the saxon XSLT engine and re sources iso_svrl_for_xslt2 xsl 5 Add a publish schematron target This target copies the compiled rules in XSLT form into the plugin schema directory 6 Run ant to create the schematron XSLTs At this stage our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl index fields xsl loc present sample data schema ident xml schema xsd schema schematron rules iso mcp xsl 4 3 9 Adding the components necessary to create and edit MCP metadata So far we have added all the components necessary for GeoNetwork to identify view and validate MCP metadata records Now we will add the remaining components necessary to create and edit MCP metadata records We ll start with the XSLTs that set the content of various elements in the MCP metadata records Creating set uuid xsl e set uuid xsl this XSLT takes as a parameter the UUID of
121. k starts up Schemas can also added to GeoNetwork dynamically if a zip archive of the schema directory is created and then uploaded to GeoNetwork in one of following ways using functions in the Administration menu 1 Server file path specified using file chooser 2 HTTP URL eg http somehost somedirectory iso19139 mcp zip 3 As an online resource attached to an iso19139 metadata record When schemas are added to GeoNetwork dynamically they are stored in the directory specified in INSTALL_DIR web geonetwork WEB INF config xml By default this is ZN STALL_DIR web geonetwork schemaPlugins 4 1 Contents of a GeoNetwork schema When installed a GeoNetwork schema is a directory The following subdirectories can be present convert Mandatory Directory of XSLTs to convert metadata from or to this schema This could be to convert metadata to other schemas or to convert metadata from other schemas and formats to this schema Eg convert oai_de xsl loc Optional Directory of localized information labels codelists or schema specific strings Eg loc en codelists xml present Mandatory contains XSLTs for presenting metadata in the viewer editor and in re sponse to CSW requests for brief summary and full records process Optional contains XSLTs for processing metadata elements by metadata suggestions mechanism see suggest xsl below sample data Mandatory Sample metadata for this schema The metadata samples are in MEF
122. keyword gt lt keyword gt endangered animal species lt keyword gt lt keyword gt endangered plant species lt keyword gt lt link type url gt http www mysite org lt link gt lt geoBox gt lt westBL gt 180 0 lt westBL gt lt eastBL gt 180 0 lt eastBL gt lt southBL gt 90 0 lt southBL gt lt northBL gt 90 0 lt northBL gt lt geoBox gt lt geonet info gt lt id gt 11 lt id gt 6 11 Relations 123 GeoNetwork Developer Manual Release 2 9 2 lt schema gt fgdc std lt schema gt lt createDate gt 2005 03 31T19 13 31 lt createDate gt lt changeDate gt 2007 03 12T14 52 46 lt changeDate gt lt isTemplate gt n lt isTemplate gt lt title gt lt source gt 38b75c1b 634b 443e 9c36 al2e89 b4c866 lt source gt lt UUID gt 84b4190b de43 4bd7 b25f 6ed47eb239ac lt uuid gt lt isHarvested gt n lt isHarvested gt lt view gt true lt view gt lt admin gt false lt admin gt lt edit gt false lt edit gt lt notify gt false lt notify gt lt download gt true lt download gt lt dynamic gt false lt dynamic gt lt featured gt false lt featured gt lt geonet info gt lt metadata gt 6 12 MEF services 6 12 1 Introduction This chapter describes the services related to the Metadata Exchange Format These services allow to import export metadata using the MEF format 6 12 2 mef export As the name suggests this service exports a GeoNetwork s metadata using the MEF file form
123. l be known in GeoNetwork If the schema is a pro file of a base schema already added to GeoNetwork then the convention is to call the schema lt base_schema_name gt lt namespace_of_profile gt id a unique identifier for the schema version the version number of the schema Multiple versions of the schema can be present in GeoNetwork schemaLocation a set of pairs where the first member of the pair is a namespace URI and the second member is the official URL of the XSD The contents of this element will be added to the root element of any metadata record displayed by GeoNetwork as a schemaLoca tion noNamespaceSchemaLocation attribute if such as attribute does not already exist It will also be used whenever an official schemaLocation noNamespaceSchemaLocation is required eg in response to a ListMetadataFormats OAI request autodetect contains elements or attributes with content that must be present in any metadata record that belongs to this schema This is used during schema detection whenever GeoNetwork receives a metadata record of unknown schema After creating this file you can validate it manually using the XML schema definition XSD in INSTALL_DIR web geonetwork xml validation schemaPlugins schema ident xsd This XSD is also used to validate this file when the schema is loaded If schema ident xml failes validation the schema will not be loaded 24 Chapter 4 Schema Plugins GeoNetwork Developer Manual Releas
124. lates can handle the extended codelists for any profile because they e match on any element that has a child element with attribute codeList e use the schema name in the codelists XPath e fall back to the base 15019139 schema if the profile codelist doesn t have the required codelist However if you don t need localized codelists it is often easier and more direct to extract codelists directly from the gmxCodelists xml file This is in fact the solution that has been adopted for the MCP The gmxCodelists xml file is included in the presentation xslt for the MCP using a statement like lt xsl variable name codelistsmcp select document schema resources Codelist gmxCodelists xml gt Check the codelists handling templates in metadata iso19139 mep xsl to see how this works An alternative XSLT design for profiles In all powerful languages there will be more than one way to achieve a particular goal This alterna tive XSLT design is for processing profiles The idea behind the alternative is based on the following observations about the GeoNetwork XSLTs 38 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 1 All elements are initially processed by apply templates in mode elementEP 2 The template elementEP see INSTALL DIR web geonetwork xsl metadata xsl eventually calls the main template of the schema profile 3 The main template can initially process the element in a mode part
125. lements of the metadata record that de scribe a particular thumbnail The remaining elements of the metadata record are retained Because the MCP is a profile of ISO19115 19139 the easiest path to creating these XSLTs is to copy them from the iso19139 schema and modify them for the changes in namespace required by the MCP Creating the update XSLTs e update child from parent info xsl this XSLT is run when a child record needs to have content copied into it from a parent record It is an XSLT that changes the content of a few elements and leaves the remaining elements untouched The behaviour of this XSLT would depend on which elements of the parent record will be used to update elements of the child record e update fixed info xsl this XSLT is run after editing to fix certain elements and content in the metadata record For the MCP there are a number of actions we would like to take to hard wire certain elements and content To do this the XSLT the following processing logic if the element is one that we want to process then add a template with a match condition for that element and process it else copy the element to output Because the MCP is a profile of ISO19115 19139 the easiest path to creating this XSLT is to copy update fixed info xsl from the 15019139 schema and modify it for the changes in namespace required by the MCP and then to include the processing we want A simple example of MCP processing is to make sure that
126. les 36 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 2 The profile includes links to equivalent elements that can be used by the base schema to process common elements eg for ISO19139 elements in the profile have gco isoType at tributes that give the name of the base element and can be used in XPath matches such as gmd MD_Dataldentification gco isoType gmd MD _Dataldentification e templates that match on elements specific to the schema Here is an example from the eml gbif schema lt keywords are processed to add thesaurus name in brackets afterwards in view mode gt lt xsl template mode eml gbif match keywordSet gt lt xsl param name schema gt lt xsl param name edit gt lt xsl choose gt lt xsl when test Sedit false gt lt xsl variable name keyword gt lt xsl for each select keyword gt lt xsl if test position amp gt 1 gt lt xsl if gt lt xsl value of select gt lt xsl for each gt lt xsl if test keywordThesaurus gt lt xsl text gt lt xsl text gt lt xsl value of select keywordThesaurus gt lt xsl text gt lt xsl text gt lt xsl if gt lt xsl variable gt lt xsl apply templates mode simpleElement select gt lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl with param name text select Skeyword
127. ll be used to indicate any actor that can import metadata from a MEF file 3 the term writer will be used to indicate any actor that can generate a MEF file 5 2 MEF v1 file format A MEF file is simply a ZIP file which contains the following files Root metadata xml info xml public all public documents and thumbnails private all private documents and thumbnails 1 metadata xml this file contains the metadata itself in XML format The text encoding of the metadata is that one specified into the XML declaration 49 GeoNetwork Developer Manual Release 2 9 2 2 info xml this is a special XML file which contains information related to the metadata but that cannot be stored into it Examples of such information are the creation date the last change date privileges on the metadata and so on Now this information is related to the GeoNetwork s architecture 3 public this is a directory used to store the metadata thumbnails and other public files There are no restrictions on the images format but it is strongly recommended to use the portable network graphics PNG the JPEG or the GIF formats 4 private this is a directory used to store all data maps shape files etc associated to the metadata Files in this directory are private in the sense that an authorisation is required to access them There are no restrictions on the file types that can be stored in
128. ment name MD_TopicCategoryCode type gmd MD_TopicCategoryCode_Type gt lt xs simpleType name MD_TopicCategoryCode_Type gt lt xs restriction base xs string gt lt xs enumeration value farming gt lt xs enumeration value biota gt lt xs enumeration value boundaries gt lt xs enumeration value climatologyMeteorologyAtmosphere gt lt xs enumeration value economy gt lt xs enumeration value elevation gt lt xs enumeration value environment gt lt xs enumeration value geoscientificInformation gt lt xs enumeration value health gt lt xs enumeration value imageryBaseMapsEarthCover gt lt xs enumeration value intelligenceMilitary gt lt xs enumeration value inlandWaters gt lt xs enumeration value location gt lt xs enumeration value oceans gt 4 3 Example ISO19115 19139 Marine Community Profile MCP 31 GeoNetwork Developer Manual Release 2 9 2 lt xs enumeration value planningCadastre gt lt xs enumeration value society gt lt xs enumeration value structure gt lt xs enumeration value transportation gt lt xs enumeration value utilitiesCommunication gt lt xs restriction gt lt xs simpleType gt The following is part of the codelists xml entry manually created for this element lt codelist name gmd MD_TopicCategoryCode gt lt entry gt lt code gt farming lt code gt lt label gt Farming lt label gt lt descripti
129. mport gt Maven gt Check out Maven Projects From SCM Choose svn and enter your Github fork as SCM URL options git github com geonetwork core geonetwork git If you have not made a fork you can use Select E 7 Checkout Maven Project from SCM Select an import source gt General b amp cvs b gt EJB gt E Java EE Y 2 Maven Sa Check out Maven Projects from SCM Existing Maven Projects 0 Install or deploy an artifact to a Maven repository kl Materialize Maven Projects b oXygen gt gt Plug in Development gt E Run Debug b SVN gt 5 Tasks gt E Team y lt Bach Next gt Cancel Note It is also possible to import existing Maven projects using Maven m2eclipse import facilities choosing the Existing Maven projects option 1 6 Eclipse setup GeoNetwork Developer Manual Release 2 9 2 1 6 4 Debugging into eclipse e Tomcat Server TODO e Remote debuging e How do I configure Tomcat to support remote debugging e How do I remotely debug Tomcat using Eclipse 10 Chapter 1 Software development CHAPTER 2 Create GeoNetwork releases 2 1 Create a stable release for GeoNetwork This guide details the process of performing a GeoNetwork release Note e BRANCH Branches are created for major stables releases and end with x for example 2 6 x e VERSION for tag version to release for example 2 6 1 e NEW VERSION
130. n English Resource ype Find Interactive Maps GIS datasets Satellite Imagery and Related Applications GeoNetwork s purpose is a a a 9 To improve access to and integrated use of spatial data and information To support decision making To promote multidisciplinary approaches to sustainable development To enhance understanding of the benefits of geographic information Access this catalogue using the following services Catalogue Service for the web CSW de l 0GC Open Archive Initiative OAI PMH 239 50 OpenSearch 105 46875 96 32813 GeoNetwork opensource allows to easily share geographically referenced v Options thematic information between different organizations For more information please contact Advanced Search Options Latestnews Hydrological Basins in Geoscience Australia s Physiographic Map of North X Buscar dh Africa Sample record Open Day Photographs and Central Eurasia SL please remove 26th August 2007 Sample record please remove EE Hydrological basins in Globally threatened Natural polar ecosystems Europe species of the world Powered by GeoNetwork newqui geocat net geonetwork apps search 8 2 1 Widgets The GeoNetwork widget framework provides a list of independent pieces of code that let you build a geonetwork user interface Add widget Widgets are usually pieces of html that will be shown on your user interface You should place them in some html structure so they
131. n xml search ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt title gt africa lt title gt lt themekey gt Global or World lt themekey gt lt dateFrom gt 2000 02 03T12 47 00 lt dateFrom gt lt dateTo gt 2010 02 03T12 49 00 lt dateTo gt lt request gt Response The response is the metadata record with additional geonet info section The main fields for geonet info are e response Response container summary Attribute count indicates the number of metadata records retrieved keywords List of keywords that are part of the metadata resultset Each keyword contains the value and the number of occurences in the retrieved metadata metadata Container for metadata records found Each record contains an geonet info element with the following information title RSS channel title description RSS channel description x item Metadata RSS item one item for each metadata retrieved 6 5 Metadata services 77 GeoNetwork Developer Manual Release 2 9 2 id Metadata internal identifier uuid Metadata Universally Unique Identifier UUID schema Metadata schema createDate Metadata creation date changeDate Metadata last modification date source Source catalogue the metadata category Metadata category Can be multiple elements score Value indicating the accuracy of search Metadata search response example lt xml vers
132. name mandatory User login name password mandatory User new password profile mandatory User profile 6 4 User services 71 GeoNetwork Developer Manual Release 2 9 2 Reset user password request example Url http localhost 8080 geonetwork srv en user update Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt operation gt x resetpwx x lt operation gt lt id gt 2 lt id gt lt username gt editor lt username gt lt password gt newpassword lt password gt lt profile gt Editor lt profile gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when the mandatory parameters are not provided Returned 400 HTTP code e bad parameter when a mandatory field is empty Returned 400 HTTP code e Unknow profile XXXX error id error when the profile is not valid Returned 500 HTTP code e ERROR you don t have rights to do this when the authenticated user has a profile that it s not Administrator or UserAdmin Returned 500 HTTP code Update cu
133. name schema gt lt xsl param name edit gt lt xsl template gt e templates that override elements in the base schema are processed in the profile mode 1s019139 mcp lt xsl template mode iso1l9139 mcp match gmd keyword gt lt xsl param name schema gt lt xsl param name edit gt lt xsl template gt Notice that the template header of the profile has a simpler design than that used for the original design Neither the priority attribute or the schema XPath condition is required because we are using a different mode to the base schema e To support processing in two modes we need to add a null template to the profile mode 15019139 mcp as follows lt xsl template mode is019139 mcp match gt This template will match all elements that we don t have a specific template for in the profile mode 1s019139 mcp These elements will be processed in the base schema mode iso19139 instead because the null template returns nothing see the main template discussion above The remainder of the discussion in the original design relating to tabs etc applies to the alternative design and is not repeated here CSW Presentation XSLTs The CSW server can be asked to provide records in a number of output schemas The two supported by GeoNetwork are e ogc http www opengis net cat csw 2 0 2 a dublin core derivative e iso http www isotc2 11 org 2005 gmd ISO19115 19139 From each of these output
134. nd must be one of the supported harvesting types site 0 1 x name string x account 0 1 use boolean false username string password string options 0 1 x every integer 90 x oneRunOnly boolean false privileges 0 1 Can be omitted but doing so the harvested metadata will not be visible Please note that privileges are taken into account only if the harvesting type supports them x group 0 n It must have the id attribute which value should be the identifier of a GeoNetwork group If the id is not a valid group id all contained operations will be discarded operation 0 n It must have a name attribute which value must be one of the supported operation names categories 0 1 Please note that categories will be assigned to metadata only if the har vesting type supports them category integer 0 n The mandatory id attribute is the category s local identifier Please note that even if clients can store empty values for many parameters before starting the harvesting entry those parameters should be properly set in order to avoid errors In the following sections the XML structures described inherit from this one here so the common elements have been removed for clarity reasons unless they are containers and contain new children Standard GeoNetwork harvesting To create a node capable of harvesting from another GeoNetwork node the f
135. ng UTF 8 gt lt csw Harvest xmlns csw http www opengis net cat csw 2 0 2 xmlns gmd http www i lt csw Source gt http URL to the target CSW server request GetCapabilities amp amp se lt csw ResourceType gt http www isotc211 org schemas 2005 gmd lt csw ResourceType gt lt csw ResponseHandler gt URI or email address of response handler lt csw ResponseHar lt csw Harvest gt GET request Url http localhost 8080 geonetwork srv en csw publication request Harvest amp service CSW amp ve Response lt xml version 1 0 encoding UTF 8 gt lt csw HarvestResponse xmlns csw http www opengis net cat csw 2 0 2 gt lt csw Acknowledgement timeStamp 2011 12 05T15 13 59 gt lt csw EchoedRequest gt lt csw Harvest xmlns csw http www opengis net cat csw 2 0 2 xmlns gmd http lt csw Source gt http URL to the target CSW server request GetCapabilitiess lt csw ResourceType gt http www isotc211 org schemas 2005 gmd lt csw ResourceTyf lt csw ResponseHandler gt URI or email address of response handler lt csw Respc lt csw Harvest gt lt csw EchoedRequest gt lt csw Request Id gt e7684bec 1fa9 4053 814f 7ae970d7alal lt csw Requestld gt lt csw Acknowledgement gt lt csw HarvestResponse gt Transaction The Transaction operation defines an interface for creating modifying and deleting catalogue records This operation requires user authe
136. ng UTF 8 gt lt env Envelope xmlns env http www w3 org 2003 05 soap envelope gt lt env Body gt lt csw GetRecordByld xmlns csw http www opengis net cat csw 2 0 2 service CSW ve lt csw 1d gt 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt csw Id gt lt csw ElementSetName gt full lt csw ElementSetName gt lt esw GetRecordById gt lt env Body gt lt env Envelope gt 128 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 GetRecords GetRecords request allows to query the catalogue metadata records specifying a query in OCG Filter or CQL languages To retrieve non public metadata a previous xml user login service invocation is required See login service Request examples GET request using CQL language Url http localhost 8080 geonetwork srv en csw request Get Records service CSW version 2 0 2 POST request Url http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw GetRecords xmlns csw http www opengis net cat csw 2 0 2 service CSW version lt csw Query typeNames csw Record gt lt csw Constraint version 1 1 0 gt lt Filter xmlns http www opengis net ogc xmlns gml http www opengis net gml gt lt PropertyIsLike wildCard singleChar _ escape gt lt PropertyName gt AnyText lt PropertyName gt lt Literal gt africa lt Literal gt lt Proper
137. not allowed error id service not allowed when the user is not authenticated Re turned 401 HTTP code Change current authenticated user password user pwupdate The user pwupdate service can be used to change the password of the current user authenticated Requires authentication Yes 6 4 User services 73 GeoNetwork Developer Manual Release 2 9 2 Request Parameters e password Actual user password e newPassword New password to set for the user Example lt request gt lt password gt admin lt password gt lt newPassword gt admin2 lt newPassword gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated Re turned 401 HTTP code e Old password is not correct Returned 500 HTTP code e Bad parameter newPassword when an empty password is provided Returned 400 HTTP code Remove a user user remove The user remove service can be used to remove an existing user Only users with profiles Administrator or UserAdmin can delete users Users with profile Administrator can delete any user except himself while users with profile User Admin can delete users only in the groups where they belong except himself Requires authentification Ye
138. nstructiefilm geodata nationaalgeoregister nl kadastralekaart ows L 8 2 Search 149 GeoNetwork Developer Manual Release 2 9 2 div where the tag cloud will be drawn and the onSuccess function which will decorate and give style to the results of the tag cloud search You can find the whole API of widgets here Create a new widget You can create new widgets to add to your customized user interface Using the same example as before you can see that you can easily create new widgets You just have to take care of two things e Visualization define an html div where your widget will display information e Manipulation of information add some functionality like a search connector so the visualization has data to show Using outside GeoNetwork Although it is a testing functionality in fact you can use this same widgets on your own webpage You just have to make sure that all dependencies are fulfilled and the settings are properly set up As development will go on this functionality will be made easier and documentation will be filled up TODO some simple examples 8 3 TabSearch To use this UI you have to compile the web project with widgets tab profile activated like mvn clean package Pwidgets tab 8 3 1 Widgets The GeoNetwork widget framework provides a list of independent pieces of code that let you build a geonetwork user interface Add widget Widgets are usually pieces of html that will be shown
139. nt with XML services 135 GeoNetwork Developer Manual Release 2 9 2 addContent new Element country setText Netherlands addContent new Element email setText Samantha mail net xx Create PostMethod specifying service urlx x String serviceUrl http localhost 8080 geonetwork srv en user update PostMethod post new PostMethod serviceUrl try String postData Xml getString new Document request xx Set post data mime type and encodingx post setRequestEntity new StringRequestEntity postData application xml UTF8 xx Send requestx x HttpClient httpclient new HttpClient int result httpclient executeMethod post x x Display status codexx System out println Response status code result xx Display responsexx System out println Response body String responseBody post getResponseBodyAsString System out printin responseBody if result HttpStatus SC_OK xx Process exception Element response Xml loadString responseBody false System out println Error code response getAttribute id getValue System out println Error message response getChildText message catch Exception ex ex printStackTrace finally Release current connection to the connection pool once you are done post releaseConnection Output Response status code 401 Res
140. ntent is a new template or not Default value n e showValidationErrors Indicates if the metadata should be validated before updating in the cat alog e title Metadata title for templates e data mandatory Contains the metadata record Update metadata request example Urls http localhost 8080 geonetwork srv en metadata update ime type application xml Post request lt xml version 1 0 encoding UTEF 8 gt lt request gt lt id gt 11 lt id gt lt version gt 1 lt version gt x x lt data gt lt CDATA lt gmd MD Metadata xmlns gmd http www isotc211 org 2005 gmd xmlns xsi http www w3 org 2001 XMLSchema instance lt gmd DQ_DataQuality gt lt gmd dataQualityInfo gt lt gmd MD_Metadata gt gt lt data gt lt request gt Response If request is executed succesfully HTTP 200 status code is returned If request fails an HTTP status code error is returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when mandatory parameters are not pro vided Returned 400 HTTP code bad parameter XXXX when a mandatory parameter is empty Returned 400 HTTP code 6 5 Metadata services 97 GeoNetwork Developer Manual Release 2 9 2 e Concurrent u
141. ntification to be invoqued Insert operation example POST request Url http localhost 8080 geonetwork srv en csw publication Content type application xml Post data 6 13 CSW service 131 GeoNetwork Developer Manual Release 2 9 2 lt xml version 1 0 encoding UTF 8 gt gt lt csw Transaction xmlns csw http www opengis net cat csw 2 0 2 version 2 0 2 servic lt csw Insert gt lt gmd MD_Metadata xmlns gmd http www isotc211 org 2005 gmd xmlns xsi http www lt gmd MD_Metadata gt lt csw Insert gt lt csw Transaction gt Response lt xml version 1 0 encoding UTF 8 gt lt csw TransactionResponse xmlns csw http www opengis net cat csw 2 0 2 gt lt csw TransactionSummary gt lt csw totalInserted gt 1 lt csw totallnserted gt lt csw totalUpdated gt 0 lt csw totalUpdated gt lt csw totalDeleted gt 0 lt csw totalDeleted gt lt csw TransactionSummary gt lt csw TransactionResponse gt Update operation example POST request Url http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw Transaction xmlns csw http www opengis net cat csw 2 0 2 version 2 0 2 servic lt csw Update gt lt gmd MD_Metadata xmlns gmd http www isotc211 org 2005 gmd xmlns xsi http www lt gmd MD_Metadata gt lt csw Constraint version 1 1 0 gt lt ogc Filter gt lt ogc Prope
142. nts gt lt autodetect gt Some other points about root element autodetect e multiple elements can be specified any element in the set that matches the root element of the record will trigger a match e if the elements have a namespace then the namespace s should be specified on the autodetect element or somewhere in the schema ident xml document before the element that uses them eg as in the above there is a namespace declaration on the autodetect element for clarity 4 Namespaces Find one or more namespaces in the document An example use case is the one used for the csw Record schema Records belonging to the csw Record schema can have three possible root elements csw Record csw SummaryRecord and csw BriefRecord but instead of using a multiple element root autodetect we could use the common csw namespace for autodetect as follows lt autodetect gt lt namespaces xmlns csw http www opengis net cat csw 2 0 2 gt lt autodetect gt Some other points about namespaces autodetect e multiple namespaces can be specified all must be present for the record to be recognized as belonging to this schema e the prefix is ignored A namespace match occurs if the namespace URI found in the record matches the namespace URI specified in the namespaces autodetect element 5 Default schema This is the fail safe provision for records that don t match any of the in stalled schemas The value for the default schema is specifi
143. nvocation of the operations from a Java client is analogous as described in the chapter for XML services 6 13 2 CSW operations The CSW operations are divided in 2 types Discovery and Publication The Discovery operations are used to query the server about its capacities and to search and retrieve metadata from it The Publication opertions Harvest and Transaction are used to insert metadata into the catalog The CSW operations can be accesed using POST GET methods and SOAP encoding The GeoNetwork opensource catalog CSW Discovery service operations are accessible through the url http localhost 8080 geonetwork srv en csw GetCapabilities GetCapabilities operation allows CSW clients to retrieve service metadata from a server The response to a GetCapabilities request is an XML document containing service metadata about the server Request examples GET request http localhost 8080 geonetwork srv en csw request GetCapabilities amp service CSW accept Ve POST request Url http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt lt csw GetCapabilities xmlns csw http www opengis net cat csw 2 0 2 service CSW gt lt ows AcceptVersions xmlns ows http www opengis net ows gt lt ows Version gt 2 0 2 lt ows Version gt lt ows AcceptVersions gt lt ows AcceptFormats xmlns ows http www opengis net ows gt lt ows OutputFormat
144. of request can be made structured or not so any service can be called SOAP The content type is application soap xml SOAP is a simple protocol used to access objects and services using XML Clients that use this protocol can embed XML requests into a SOAP structure On the server side GeoNetwork will remove the SOAP structure and feed the content to the service Its response will be embedded again into a SOAP structure and sent back to the caller It makes sense to use this protocol if it is the only protocol understood by the client A GET request to a XML service and its request encoding 55 GeoNetwork Developer Manual Release 2 9 2 lt request gt lt hitsPerPage gt 10 lt hitsPerPage gt lt any gt lt request gt Response The response of an XML service always has a content type of application xml the only exception are those services which return binary data The document encoding is the one specified into the document s prologue Anyway all GeoNetwork services return documents in the UTF 8 encoding On a GET request the client can force a SOAP response adding the application soap xml content type to the Accept header parameter 6 1 2 Exception handling A response document having an error root element means that the XML service raised an exception This can happen under several conditions bad parameters internal errors et cetera In this cases the returned XML document has the following structure e erro
145. ollowing XML information should be provided e node The type attribute is mandatory and must be GeoNetwork 114 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 site x host string The GeoNetwork node s host name or IP address x port string 80 The port to connect to x servlet string geonetwork The servlet name chosen in the remote site searches 0 1 A container for search parameters x search 0 n A container for a single search on a siteID You can specify 0 or more searches If no search element is provided an unconstrained search is performed freeText string Free text to search This and the following parameters are the same used during normal search using the web interface title string Search the title field abstract string Search the abstract field keywords string Search the keywords fields digital boolean false Search for metadata in digital form hardcopy boolean false Search for metadata in printed form source string One of the sources present on the remote node groupsCopyPolicy 0 1 Container for copy policies of remote groups This mechanism is used to retain remote metadata privileges group There is one copy policy for each remote group This element must have 2 mandatory attributes name and policy The name attribute is the remote group s name If the
146. on gt Rearing of animals and or cultivation of plants Examples agriculture irrigation aquaculture plantations herding pests and diseases affecting crops livestock lt description gt lt entry gt lt gt lt entry gt lt code gt biota lt code gt lt label gt Biota lt label gt lt description gt Flora and or fauna in natural environment Examples wildlife vegetati biological sciences ecology wilderness sealife wetlands habitat lt description gt lt entry gt lt i gt lt entry gt lt code gt boundaries lt code gt lt label gt Boundaries lt label gt lt description gt Legal land descriptions Examples political and administrative boundaries lt description gt lt entry gt lt codelist gt The codelists xml file maps the enumerated values from the XSD to a localized label and a description via the code element A localized copy of codelists xml is made available on an XPath to the presentation XSLTs eg root gui schemas iso19139 codelist for the iso19139 schema The XSLT metadata xsl which contains templates used by all metadata schema presentation XSLTs handles the creation of a select list drop down menu in the editor and display of the code and description in the metadata viewer The isol9139 schema has additional codelists that are managed external to the XSDs in cata log vocabulary files such as http www isotc211 org 2005 resources
147. on over this record 6 9 Harvesting services 6 9 1 Introduction This chapter provides a detailed explanation of the GeoNetwork s harvesting services These services allow a complete control over the harvesting behaviour They are used by the web interface and can be used by any other client 6 9 2 xml harvesting get Retrieves information about one or all configured harvesting nodes Request Called with no parameters returns all nodes Example lt request gt Otherwise an id parameter can be specified 110 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt request gt lt id gt 123 lt id gt lt request gt Response When called with no parameters the service provide its output inside a nodes container You get as many node elements as are configured Example of an xml harvesting get response for a GeoNetwork node lt nodes gt lt node id 125 type geonetwork gt lt site gt lt name gt test 1 lt name gt lt UUID gt 0619cc50 708b 11da 8202 000d9335aaae lt uuid gt lt host gt localhost lt host gt lt port gt 8080 lt port gt lt servlet gt geonetwork lt servlet gt lt account gt lt use gt false lt use gt lt username gt lt password gt lt account gt lt site gt lt searches gt lt search gt lt freeText gt lt title gt lt abstract gt lt keywords gt lt digital gt false lt digital gt lt hardcopy gt false lt hardcopy gt
148. or the category It can be useful to a client to link back to this category Name Category s name x label The localised labels used to show the category on screen See xml_response_categories Example response for categories lt categories gt lt category id 1 gt lt name gt datasets lt name gt lt label gt lt en gt Datasets lt en gt lt fr gt Jeux de donn es lt fr gt lt label gt lt category gt lt categories gt e groups This is the container for groups group 2 n This is a GeoNetwork group There are at least the Internet and Intranet groups This element has an id attribute which represents the local identifier for the group Name Group s name description Group s description x referrer The user responsible for this group email The email address to notify when a map is downloaded label The localised labels used to show the group on screen See xml_response_groups Example response for groups lt groups gt lt group id 1 gt lt name gt editors lt name gt lt label gt lt en gt Editors lt en gt lt fr gt Editeurs lt fr gt 104 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt label gt lt group gt lt groups gt e operations This is the container for the operations operation 0 n This is a possible operation on metadata This element has an id attribute which represents the local identifier for the oper
149. ormatioM Lara enten aaa a wR a a amp 120 GIT Relations cir A A ats a ea a a 122 6 12 MEF SERVICES A arr aen var aen da we grey tee de ee a ot dg wea a a 124 6 13 CSW SEVICE te ned eed Wie Sai wh ar a eS A a 125 6 14 Java development with XML services eee 134 Settings hierarchy 141 del Introduction ei ss bass 580 ada ka be ba da a at Ah welds J 141 T2 _Thesystem Merarehy us en on onver arte wieren a ca ce aes we eg ad a we de 141 T gt Harvesting Nodes ye ic mes aan vake de vertand Be eo EEA 143 User Interface 147 EII 147 8 2 CACM 2 naga Sa haa aa le a Gale bal da aa ok aa a 147 Bet MADSCAEN er aar eect ty Sindee E we Bec ae 150 St HTMESUL os saa A JAR Sree 153 GeoNetwork Developer Manual Release 2 9 2 Welcome to the GeoNetwork Developer Manual v2 9 2 The manual is for those who want to help with the development process including source code software releasing and other administrative work Other documents GeoNetwork User Manual GeoNetwork Developer Manual PDF Contents 4 GeoNetwork Developer Manual Release 2 9 2 2 Contents CHAPTER 1 Software development 1 1 System Requirements GeoNetwork is a Java application that runs as a servlet so the Java Runtime Environment JRE must be installed in order to run it You can get the JRE from the following address http java sun com and you have to download the Java 5 Standard Edition SE GeoNetwork won t run with Java 1 4 and Java 6 h
150. ory that you checked out earlier see Preparation above An example rule is lt anzlic trunk gm1 3 2 0 gmd spatialRepresentation xsd gt lt l TEST 12 gt lt sch pattern gt lt sch title gt loc strings M30 lt sch title gt lt sch rule context gmd MD_Georectified gt lt sch let name cpd value gmd checkPointAvailability gco Boolean 1 or gmd checkt not gmd checkPointDescription or count gmd checkPointDescription gco nilReason lt sch assert test Scpd false gt loc strings alert M30 lt sch assert gt lt sch report test cpd false gt Sloc strings report M30 lt sch report gt lt sch rule gt lt sch pattern gt As for most of GeoNetwork the output of this rule can be localized to different languages The corre sponding localized strings are lt strings gt 42 Chapter 4 Schema Plugins GeoNetwork Developer Manual Release 2 9 2 lt M30 gt IS0OFTDS19139 2005 TableAl Row15 Check point description required if available lt alert M30 gt lt div gt checkPointDescription is mandatory if checkPointAvailability lt strings gt Procedure for adding schematron rules working within the schematrons directory 1 Place your schematron rules in rules Naming convetion is schematron rules lt suffix gt sch eg schematron rules iso mcp sch Place localized strings for the rule assertions into rules loc lt language_pref
151. otc211 org 2005 gmd xmlns xsi http www w3 org 2001 XMLSchema instance lt gmd DQ_DataQuality gt lt gmd dataQualityInfo gt lt gmd MD_Metadata gt gt lt data gt lt request gt Response If request is executed succesfully HTTP 200 status code is returned If request fails an HTTP status code error is returned and the response contains the XML document with the exception If validate parameter is set to on and the provided metadata is not valid confirming the xsd schema an exception report is returned Validation metadata report lt xml version 1 0 e lt error id xsd validation error gt lt message gt XSD Validation error s lt message gt lt class gt XSDValidationErrorEx lt class gt lt stack gt lt at class org fao geonet s file ImportFromDir java lt at class org fao geonet s ncoding UTF 8 gt rvices metadata ImportFromDir line 297 method validatelt rvices metadata ImportFromDir file ImportFromDir java line 281 method validatelt lt at class org fao geonet services metadata Insert file Insert java line 102 method exec gt i gt gt lt at class 3 fil lt at class 3 ves s le Servicelnfo rver dispatchers java line 238 fil lt at class 3 ves s le Servicelnfo rver dispatchers Java line 141 ves s rver dispatchers Servicelnfo method execService Servicelnfo method
152. oved just after being added to the result list In this case the metadata should be skipped and no exception raised The only settable privileges are view dynamic featured It does not make sense to use the others If anode raises an exception during harvesting that node will be deactivated If a metadata already exists its UUID exists but belong to another node it must not be updated even if it has been changed This way the harvesting will not conflict with the other one As a side effect this prevent locally created metadata from being changed The harvesting engine does not store results on disk so they will get lost when the server will be restarted 3 2 Data storage 19 GeoNetwork Developer Manual Release 2 9 2 10 When some harvesting parameters are changed the new harvesting type must use them during the next harvesting without requiring to reboot the server 20 Chapter 3 Harvesting CHAPTER 4 Schema Plugins A schema in GeoNetwork is a directory with stylesheets XML schema descriptions XSDs and other information necessary for GeoNetwork to index view and possibly edit content from XML metadata records To be used in GeoNetwork a schema directory can be placed in ZN STALL DIR web geonetwork xml schemas Schemas in this directory are built in schemas The contents of these schemas are parsed during GeoNetwork initialization If valid they will be available for use when GeoNetwor
153. p aanvraag Toon uitgebreide zoekcriteria Welkom op het Nationaal georegister d vindplaats van geo informatie van Nederland Door een zoekterm in te voeren krijgt u een overzicht van beschikbare datasets en services Deze datasets kunt u in veel gevallen direct downloaden en de services kuntu bekijken of in uw eigen toepassing gebruiken Wilt u meer weten over hetzoeken in het Nationaal georegister Bekijk dan de instructiefilm geodata nationaalgeoregister nl kadastralekaart ows L 8 4 HTML5UI 159 GeoNetwork Developer Manual Release 2 9 2 The widgets are prepared with some configuration options so you can select some of the visual aspects For example on the picture above you an select the number of tags on the cloud or the number of items shown on the latest section To add a widget you should wait for the page to be loaded This may be approached with the onReady function of ExtJS Ext onReady function new GeoNetwork TagCloudView catalogue catalogue query fast true amp summaryOnly true amp from 1 amp to 4 renderTo cloud tag onSuccess app loadResults DY y On this example we just have to set up four properties on the constructor the catalogue variable which makes all the query which will be sent to the server to provide the items to show the renderTo id of the div where the tag cloud will be drawn and the onSuccess function which will decorate and gi
154. p orgName Department 200f 20Sustainability 20and Y 4 a Google Reader G Redmine G Submit an Article Otros marcadores English we GeoNetwo ork Aine pensource BROWSE gt gt SEARCH RESULTS El Online data 7 Data for download 3 No direct download show advanced options El Department of Sustainability and Environment DSE FILTER e SO relevance v E B Other actions Keywords ye lo Localities in Victoria VMADMIN LOCALITY_POLYGON LAND Ownership 1 Comprehensive Elements BOUNDAPIES Administrative 1 This dataset is the definitive set of locality boundaries for the state of Victoria as defined by Local Government and registered by the Registrar of Types Geographic Names The boundaries are aligned to Vicmap Property This dataset is part of the Vicmap Admin dataset series boundaries 1 Dataset 1 BOUNDARIES Administrative LAND Ownership Deparment of Sustainability and Boundaries Environment DSE Last update 2007 11 06 62 Web link javascript void 0 8 4 1 HTML 5 UI This is an html5 based UI which uses the wigets from geonetwork and the library ExtJS Widgets The GeoNetwork widget framework provides a list of independent pieces of code that let you build a geonetwork user interface 8 4 HTML5UI 153 GeoNetwork Developer Manual Release 2 9 2 Add widget Widgets are usually pieces of html that will be shown on your user interface You should place them in some html structu
155. p using an existing group name Returned 500 HTTP code Update label translations xml group update The xml group update service can be used to update translations of a group name Only users with Administrator profile can update groups translations Requires authentication Yes Request Parameters e group Container for group information e id mandatory Group identifier to update e label mandatory This is just a container to hold the group names translated in the languages supported by GeoNetwork Each translated label it s enclosed in a tag that identifies the language code Group label update request example Url http localhost 8080 geonetwork srv en xml group update Mime type application xml Post request lt request gt lt group id 2 gt lt label gt lt es gt Grupo de ejemplo lt es gt lt label gt lt group gt lt request gt 6 3 Group services 63 GeoNetwork Developer Manual Release 2 9 2 Response Group label update response example lt xml version 1 0 encoding UTF 8 gt lt ok gt Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when mandatory parameters are not pro vided Returned 400 HTTP code Remove a group group remove The group remove service can be used to remove an existing g
156. pdate Mime type application xml Post request lt request gt lt operation gt newuser x lt operation gt lt username gt samantha lt username gt 68 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt password gt editor2 lt password gt lt profile gt Editor lt profile gt lt name gt Samantha lt name gt lt city gt Amsterdam lt city gt lt country gt Netherlands lt country gt lt email gt samantha mail net lt email gt lt groups gt 2 lt groups gt lt groups gt 4 lt groups gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when mandatory parameters are not pro vided e bad parameter when a mandatory fields is empty e Unknow profile XX XX error id error when the profile is not valid e ERROR duplicate key violates unique constraint users_username_key when trying to create a new user using an existing username ERROR insert or update on table usergroups violates foreign key constraint user groups_groupid_fkey when group identifier is not an e
157. pdate error id client when the version number provided is different from actual version number for metatada Returned 400 HTTP code Delete metadata metadata delete The metadata delete service allows to remove a metadata record from the catalog The metadata con tent is backup in MEF format by default in data removed folder This folder can be configured in geonetwork WEB INF config xml Requires authentication Yes Request Parameters e id mandatory Identifier of the metadata to delete Delete metadata request example Url http localhost 8080 geonetwork srv en metadata delete ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt id gt 10 lt id gt lt request gt Response If request is executed succesfully HTTP 200 status code is returned If request fails an HTTP status code error is returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Metadata not found error id error if the identifier provided don t correspond to an existing metadata Returned 500 HTTP code e Operation not allowed error id operation not allowed when the user is not authorized to edit the metadata To edit a metadata The user is the metadata owner The user is an Administr
158. ponse body lt xml version 1 0 encoding UTF 8 gt lt error id service not allowed gt lt message gt Service not allowed lt message gt lt class gt ServiceNotAllowedEx lt class gt lt stack gt lt at class jeeves server dispatchers ServiceManager file ServiceManager java line 136 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt at class jeeves server JeevesEngine file JeevesEngine java line 621 method c lt at class jeeves server sources http JeevesServlet file JeevesServlet java lines lt at class jeeves server sources http JeevesServlet file JeevesServlet java lines lt at class javax servlet http HttpServlet file HttpServlet java line 727 methoc lt at class javax servlet http HttpServlet file HttpServlet java line 820 methoc lt at class org mortbay jetty servlet ServletHolder file ServletHolder java line lt at class org mortbay jetty servlet ServletHandler file ServletHandler java line lt at class org mortbay jetty security SecurityHandler file SecurityHandler java lt at class org mortbay jetty servlet SessionHandler file SessionHandler java line lt stack gt lt object gt user update lt object gt lt request gt lt language gt en lt language gt lt service gt user update lt service gt lt request gt lt error gt Error cod
159. pter 2 Create GeoNetwork releases GeoNetwork Developer Manual Release 2 9 2 WWW U 4 b The same can be accomplished in Windows using WinSCP Or a desktop client like Cyberduck on Windows and Mac OS X 5 Once the upload of the files has been completed use the web interface to set the default download files The i button allows to set the default operating systems for each installer exe for Windows and jar for all other systems Looking for the latest version Download geonetwork install 2 6 4 0 jar 196 5 MB Add File Add Folder Home GeoNetwork_opensource v2 6 4 A Name Modified Size 4 Parent folder readme txt lt 30 mins ago 75 8 KB a geonetwork install 2 6 4 0 exe lt 2 hours ago 196 6 MB a a SHA1 e7923c34526e109295dc6dc7d052c09ad442949f Downloads 0 MD5 e5065a25f90caf dec0fd4c807alc20a Mirror Status 21 mirrors Download URL http sourceforge net projects geonetwork files GeoNetwork_o Default Download For Download Button M ay O i O A O e Exclude Stats O O Others Select all Save Cancel 6 The default downloads are ready now 2 1 12 Update geonetwork opensource website The website requires updates to reflect the new release Update the version number and add a new news entry in the following files website docsrc conf py website docsrc docs rst website docsrc downloads rst web site docsrc index rst website docsrc news rst website checkup_docs sh Commit the changes and buil
160. r This is the root element of the document It has a mandatory id attribute that represents an identifier of the error from a common set See error2_ids for a list of all id values message A message related to the error It can be a short description about the error type or it can contain some other information that completes the id code class The Java class of the raised error name without package information stack The server s stacktrace up to the point that generated the exception It contains several at children one for each nested level Useful for debugging purposes at Information about a nested level of called code It has the following mandatory attributes class Java class of the called method method Java called method line Line inside the called method s source code where there the method call of the next nested level file Source file where the class is defined object An optional container for parameters or other values that caused the exception In case a parameter is an XML object this container will contain that object in XML form request A container for some useful information that can be needed to debug the service x language Language used when the service was called service Name of the called service Summary of error ids 56 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 id Meaning of message Meaning of object element element error General message h
161. re so they are visually arranged Nationaal Georegister x NG Net oneal de ag or A Met als resultaat Online kaarten Downloadbare data Data op aanvraag Toon uitgebreide zoekcriteria Welkom op het Nationaal georegister d vindplaats van geo informatie van Nederland Door een zoekterm in te voeren krijgt u een overzicht van beschikbare datasets en services Deze datasets kunt u in veel gevallen direct downloaden en de services kuntu bekijken of in uw eigen toepassing gebruiken Wilt u meer weten over hetzoeken in het Nationaal georegister Bekijk dan de instructiefilm geodata nationaalgeoregister nl kadastralekaart ows L The widgets are prepared with some configuration options so you can select some of the visual aspects For example on the picture above you an select the number of tags on the cloud or the number of items shown on the latest section To add a widget you should wait for the page to be loaded This may be approached with the onReady function of ExtJS Ext onReady function new GeoNetwork TagCloudView catalogue catalogue query fast true amp summaryOnly true amp from 1 to 4 renderTo cloud tag onSuccess app loadResults y p On this example we just have to set up four properties on the constructor the catalogue variable which 154 Chapter 8 User Interface GeoNetwork Developer Manual Release 2 9 2 makes all the qu
162. redit BR University of Tasmania Suggestions UTAS xl Status UTAS Point of contact EH K UQ Individual name ma rfCantarct Tnfarmatian V More on strings xml A localized copy of strings xml is made available on an XPath to the presentation XSLTs eg root gui schemas iso19139 strings for the 15019139 schema After adding the localized strings our new GeoNetwork plugin schema for MCP contains extract date modified xsl extract gml xsd extract uuid xsl loc present schema ident xml schema xsd schema 4 3 5 Creating the presentations XSLTs in the present directory Each metadata schema should contain XSLTs that display and possibly edit metadata records that belong to the schema These XSLTs are held in the present directory To be be used in the XSLT include import hierarchy these XSLTs must follow a naming conven tion metadata lt schema name gt xsl So for example the presentation xslt for the iso19139 schema is metadata iso19139 xsl For the MCP since our schema name is iso19139 mcp the presentation XSLT would be called metadata iso19193 mcp xsl Any XSLTs included by the presentation XSLT should also be in the present directory this is a conven tion for clarity it is not mandatory as include import URLs can be mapped in the oasis catalog xml for the schema to other locations There are certain XSLT templates that the presentation XSLT must have 4 3 Example ISO19115 19139 Marine Community Profile MCP 33
163. remote group is renamed it is not found anymore and the copy policy is skipped The policy attribute represents the policy itself and can be copy createAndCopy copyToIntranet copy means that remote privileges are copied locally if there is locally a group with the same name as the name attribute createAndCopy works like copy but the group is created locally if it does not exist copyToIntranet works only for the remote group named all which represents the public group This policy copies privileges of the remote group named all to the local Intranet group This is useful to restrict metadata access Example of an xml harvesting add request for a GeoNetwork node lt node type geonetwork gt lt site gt lt name gt South Africa lt name gt lt host gt south africa org lt host gt lt port gt 8080 lt port gt lt servlet gt geonetwork lt servlet gt lt account gt lt use gt true lt use gt lt username gt admin lt username gt lt password gt admin lt password gt lt account gt lt site gt lt searches gt lt search gt lt freeText gt lt title gt lt abstract gt 6 9 Harvesting services 115 GeoNetwork Developer Manual Release 2 9 2 lt keywords gt lt digital gt true lt digital gt lt hardcopy gt false lt hardcopy gt lt source gt 0619cc50 708b 11da 8202 000d9335906e lt source gt lt search gt lt searches gt lt options gt lt every gt 90 lt every gt lt oneRunOnly
164. request gt Response to metadata select service The response contains the number of metadata selected Select metadata response example lt xml version 1 0 encoding UTF 8 gt lt request gt lt Selected gt 10 lt Selected gt lt request gt Request to metadata massive newowner Once the metadata records have been selected can be metadata massive newowner invoked with the next parameters e user mandatory New owner user identifier e group mandatory New owner group user identifier Transfer ownership request example Uris http localhost 8080 geonetwork srv en metadata massive newowner Mime type 6 5 Metadata services 89 GeoNetwork Developer Manual Release 2 9 2 application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt user gt 2 lt user gt lt group gt 2 lt group gt lt request gt Response to metadata massive newowner If request is executed succesfully HTTP 200 status code is returned If request fails an HTTP status code error is returned and the response contains the XML document with the exception Transfer ownership xml ownership transfer The xml ownership transfer service can be used to transfer ownership and privileges of metadata owned by a user in a group to another user in a group This service should be used with data retrieved from previous invocations to the services xml ownership editors and xml ownership groups described below
165. roup Only users with Administrator profile can delete groups Requires authentification Yes Request Parameters e id mandatory Group identifier to delete Group remove request example Urls http localhost 8080 geonetwork srv en group remove ime type application xml Post request lt request gt lt id gt 2 lt id gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code 64 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 e Missing parameter error id missing parameter when mandatory parameters are not pro vided Returned 400 HTTP code bad parameter id when id parameter it s empty Returned 400 HTTP code 6 4 User services 6 4 1 Users retrieving Users list xml user list The xml user list service can be used to retrieve the users defined in GeoNetwork Requires authentication Yes Request Parameters e None User list request example Url http localhost 8080 geonetwork srv en xml user list ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt Response
166. rovided credentials will be used to authenticate to the remote site 5 para ms This is just a container for the request that must be executed remotely Request for info from a remote server lt request gt lt site gt lt url gt http mynode org 8080 geonetwork srv en xml info lt url gt lt site gt 6 7 General services 107 GeoNetwork Developer Manual Release 2 9 2 lt params gt lt request gt lt type gt site lt type gt lt request gt lt params gt lt request gt Please note that this service uses the GeoNetwork s proxy configuration Response The response is just the response from the remote service 6 8 File download services 6 8 1 Introduction This chapter provides a detailed explanation of GeoNetwork file download services These are the ser vices you would use if you want to download a file attached to a metadata record as Data for Download usually in onlineResources section of an ISO record or perhaps as a gmx FileName where allowed The two services used together can be used to create a simple click through licensing scheme for file resources attached to metadata records in GeoNetwork 6 8 2 xml file disclaimer Retrieves information from the metadata about constraints or restrictions on the resources attached to the metadata record The information is xml and an xhtml presentation of the constraints and restrictions Note only users that have download rights over t
167. rrent authenticated user information user infoupdate The user infoupdate service can be used to update the information related to the current authenticated user Requires authentication Yes Request Parameters e surname mandatory User surname e name mandatory User name 72 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 e address User physical address e city User address city e state User address state e zip User address zip e country User address country e email User email e org User organisation departament e kind Kind of organisation Remarks If an optional parameter is not provided the value is updated in the database with an empty string Current user info update request example Dielis http localhost 8080 geonetwork srv en user infoupdate ime type application xml Post request lt request gt lt name gt admin lt name gt lt surname gt admin lt surname gt lt address gt address lt address gt lt city gt Amsterdam lt city gt lt zip gt 55555 lt zip gt lt country gt Netherlands lt country gt lt email gt user mail net lt email gt lt org gt GeoCat lt org gt lt kind gt gov lt kind gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors e Service
168. rs ServiceInfo file Servicelnfo java line 226 method execService gt lt at class jeeves server dispatchers ServiceInfo file Servicelnfo java line 129 method execServices gt lt at class jeeves server dispatchers ServiceManager file ServiceManager java line 370 method dispatch gt lt stack gt lt object gt lt request gt lt asd gt ee lt asd gt lt request gt lt object gt lt request gt 6 1 Calling specifications 57 GeoNetwork Developer Manual Release 2 9 2 lt language gt en lt language gt lt service gt mef export lt service gt lt request gt lt error gt 6 2 Login and logout services 6 2 1 Login services GeoNetwork standard login xml user login The xml user login service is used to authenticate the user in GeoNetwork allowing using the Xml services that require authentication For example the services to maintain group or user information Request Parameters e username mandatory Login for the user to authenticate e password mandatory Password for the user to authenticate Login request example Url http localhost 8080 geonetwork srv en xml user login Mime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt username gt admin lt username gt lt password gt admin lt password gt lt request gt Response When user authentication is succesful the next response is received OK Dat
169. rss simple format simplepoint Bounding box in georss simplepoint format default Bounding box in georss GML format RSS latest request example Url http localhost 8080 geonetwork srv en rss latest ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt georss gt default lt georss gt lt maxItems gt 1 lt maxItems gt lt request gt Response Here follows the principal fields of the response e channel This is the container for the RSS response title RSS channel title description RSS channel description item Metadata RSS item one item for each metadata retrieved title Metadata title x link Link to show metadata page Additional link elements with rel alternate to OGC WXS services shapefile images files Google KML etc can be returned depend ing on metadata description Metadata description pubDate Metadata publication date 6 5 Metadata services 83 GeoNetwork Developer Manual Release 2 9 2 media Metadata thumbnails georrs where Bounding box with the metadata extent RSS latest response example Mimetype application rss xml Response lt xml version 1 0 encoding UTF 8 gt lt rss xmlns media http search yahoo com mrss xmlns georss http www georss org ged lt channel gt lt lt xmlns gml http www opengis net gml version 2 0 gt lt title gt GeoNetwork open
170. rtylsEqualTo gt lt ogc PropertyName gt title lt ogc PropertyName gt lt ogc Literal gt Eurasia lt ogc Literal gt lt oge PropertyIsEqualTo gt lt ogc Filter gt lt csw Constraint gt lt csw Update gt lt csw Transaction gt Response lt xml version 1 0 encoding UTF 8 gt lt csw TransactionResponse xmlns csw http www opengis net cat csw 2 0 2 gt lt csw TransactionSummary gt lt csw totalInserted gt 0 lt csw totallnserted gt lt csw totalUpdated gt 1 lt csw totalUpdated gt lt csw totalDeleted gt 0 lt csw totalDeleted gt 132 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt csw TransactionSummary gt lt csw TransactionResponse gt Delete operation example POST request Url http localhost 8080 geonetwork srv en csw Content type application xml Post data lt xml version 1 0 encoding UTF 8 gt gt lt csw Transaction xmlns csw http www opengis net cat csw 2 0 2 xmlns ogc http www lt csw Delete gt lt csw Constraint version 1 1 0 gt lt ogc Filter gt lt ogc PropertylsEqualTo gt lt ogc PropertyName gt title lt ogc PropertyName gt lt ogc Literal gt africa lt ogc Literal gt lt oge PropertyIsEqualTo gt lt ogc Filter gt lt csw Constraint gt lt csw Delete gt lt csw Transaction gt Response lt xml version 1 0 encoding UTF 8 gt lt csw TransactionResponse xmlns csw http
171. s Request Parameters e id mandatory User identifier to delete User remove request example Uri http localhost 8080 geonetwork srv en user remov Mime type application xml Post request 74 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt request gt lt id gt 2 lt id gt lt request gt Response If request it s executed succesfully HTTP 200 status code it s returned If request fails an HTTP status code error it s returned and the response contains the XML document with the exception Errors Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code Missing parameter error id missing parameter when the id parameter is not provided Re turned 400 HTTP code You cannot delete yourself from the user database error id error when trying to delete the authenticated user himself Returned 500 HTTP code You don t have rights to delete this user error id error when trying to delete using an authenticated user that don t belongs to Administrator or User administrator profiles Returned 500 HTTP code You don t have rights to delete this user because the user is not part of your group error id error when trying to delete a user that is not in the same group of the authenticated user belonging the authenticated user to profile User administrator Returne
172. se Otherwise 1 If any critical bug detected fix before continue with the release 2 If no critical bug detected move the bug to next release and continue with release Note to discuss and get feedback This approach implicates a code freeze in branch until the release is done if all test are ok no bugs found in tests or non critical bugs 1 day or less is ok If a critical bug is detected the code freeze can take some time if a bug is complicated to fix To avoid this code freeze some alternatives can be considered 1 If there is a commit on the branch before the critical fix is commited it will be part of the release properly tested in a new release cycle 2 Create a tag anyway and commit the critical fix to that tag branch trunk so there is no freeze on the branch at all No other commits should happen on a tag except critical bug fixes This allows people to commit on the branch while the critical bug is been solved 2 1 5 Update changes txt file 1 Add an entry to docs changes txt describing the changes in this new release using the following template Comments from the SVN commits are used to extract the most important changes e g use svn log r 7219 HEAD gt changes264 txt to obtain these Some cleanup is required before adding them in the changes txt document GeoNetwork VERSION List of changes 12 Chapter 2 Create GeoNetwork releases GeoNetwork Developer Manual Relea
173. se 2 9 2 Bug fixes Fix fo issu NUMB Fix fo issu NUMB R Description of fix R Description of fix E El Changes Description of change Description of change 2 Commit docs changes txt file S svn commit m Updating CHANGES for VERSION docs changes txt 2 1 6 Update version numbers for a release A NIX Linux OSX etc operating system can use the following batch script 1 Execute in root of the branch source tree updat eReleaseVersions sh Example to create version 2 6 1 from 2 6 1 SNAPSHOT S updateReleaseVersions sh 2 6 1 2 Commit updated files svn commit m Updated files version to VERSION 2 1 7 Create release tag 1 Create a tag for the release svn copy m Create tag for release VERSION https geonetwork svn sourceforge net svnroot geonetwork branches BRANCH https geonetwork svn sourceforge net svnroot geonetwork tags VERSION 2 Checkout the release tag svn co https geonetwork svn sourceforge net svnroot geonetwork tags VERSION 2 1 8 Build release artifacts Warning All operations for the remainder of this guide must be performed from the release tag not the branch Unless otherwise stated 1 Uncomment doc sections in web pom xml lt webResources gt lt resource gt lt directory gt docs eng users build html lt directory gt lt targetPath gt docs eng users lt targetPath gt
174. siteld This is an UUID that identifies the actor that created the metadata and must be a valid UUID When the UUID element is missing this element should be missing too If present it will be ignored e siteName This is a human readable name for the actor that created the metadata It must be present only if the siteld is present f schema Indicates the metadata s schema The value can be assigned as will but if the schema is one of those describe below that value must be used i dublin core A metadata in the Dublin Core format as described in http dublincore org ii fgdc std A metadata in the Federal Geographic Data Committee iii iso19115 A metadata in the ISO 19115 format iv isol9139 A metadata in the ISO 19115 2003 format for which the ISO19139 is the XML encoding g format Indicates the MEF export format The element s value must belong to the following set simple partial full h localld This is an optional element If present indicates the id used locally by the sourceld actor to store the metadata Its purpose is just to allow the reuse of the same local id when reimporting a metadata 5 4 The info xml file 51 GeoNetwork Developer Manual Release 2 9 2 1 isTemplate A boolean field that indicates if this metadata is a template used to create new ones There is no real distinction between a real metadata and a template but some actors use it to allow fast metadata creation The value mu
175. source portal to spatial data and information lt title gt lt link gt http localhost 8080 geonetwork lt link gt lt description gt GeoNetwork opensource provides Internet access to interactive maps satellite imagery and related spatial databases lt description gt lt language gt en lt language gt lt copyright gt All rights reserved Your generic copyright statement lt copyright gt lt category gt Geographic metadata catalog lt category gt lt generator gt GeoNetwork opensource lt generator gt lt tt1 gt 30 lt tt1 gt lt item gt lt title gt Hydrological Basins in Africa Sample record please remove lt title gt lt link gt http localhost 8080 geonetwork uuid 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt 11 lt link href http geonetwork3 fao org ows 296PSERVICE wms amp VERSION 1 1 1 amp REQUES amp BBOX 17 3 34 6 51 1 38 2 amp LAYERS hydrological basins amp SRS EPSG 4326 amp WIDTH 200 amp HEIGHT 213 amp FORMAT image png amp TRANSPARENT TRUE amp STYLES default type image png rel alternate title Hydrological basins in Africa gt lt link href http localhost 8080 geonetwork srv en google kml uuid 5df54bf0 3a7d 44bf 9Yabf 84d772da8dfl layers hydrological_basins type application vnd google earth kml xml rel alternate title Hydrological basins in Africa gt lt category gt Geographic metada
176. ss All others are small utility classes used by harvesting types 3 1 3 XSL stylesheets Stylesheets are spread in some folders and are used by both the JavaScript code and the server The main folder is located at web src webapp xsl harvesting Here there are some general stylesheets plus one subfolder for each harvesting type The general stylesheets are 1 buttons xsl Defines all button present in the main page activate deactivate run remove back add refresh buttons present in the add new harvesting page back and add and at the bottom of the edit page back and save 2 client error tip xsl This stylesheet is used by the browser to build tooltips when an harvesting error occurred It will show the error class the message and the stacktrace 3 client node row xsl This is also used by the browser to add one row to the list of harvesting nodes in the main page 4 harvesting xsl This is the main stylesheet It generates the HTML page of the main page and includes all panels from all the harvesting nodes In each subfolder there are usually 4 files 1 xxx xsl This is the server stylesheets who builds all panels for editing the parameters XXX is the harvesting type Usually it has the following panels site information search criteria options privileges and categories 2 client privil row xsl This is used by the JavaScript code to add rows in the group s privileges panel 3 client result tip xsl
177. st be true false j rating This is an optional element If present indicates the users rating of the metadata ranging from 1 a bad rating to 5 an excellent rating The special value O means that the metadata has not been rated yet Can be used to sort search results k popularity Another optional value If present indicates the popularity of the metadata The value must be positive and high values mean high popularity The criteria used to set the popularity is left to the writer Its main purpose is to provide a metadata ordering during a search 2 categories a container for categories associated to this metadata A category is just a name like audio video that classifies the metadata to allow an easy search Each category is specified by a category element which must have a name attribute This attribute is used to store the category s name If there are no categories the categories element will be empty 3 privileges a container for privileges associated to this metadata Privileges are operations that a group which represents a set of users can do on a metadata and are specified by a set of group elements Each one of these has a mandatory name attribute to store the group s name and a set of operation elements used to store the operations allowed on the metadata Each operation element must have a name attribute which value must belong to the following set view download notify dynamic featured
178. st one time from this node and then it will set the status to inactive status activelinactive Indicates if the harvesting from this node is stopped inactive or if the harvester is waiting until the timeout comes e privileges 0 1 This is a container for privileges to assign to each imported metadata group integer 0 n Indicate a local group The node s value is its local identifier There can be several group nodes each with its set of privileges x operation integer On Privilege to assign to the group The node s value is the numeric id of the operation like O view 1 download 2 edit etc e categories 0 1 This is a container for categories to assign to each imported metadata category integer 0 n Indicate a local category and the node s value is its local identifier e info Just a container for some information about harvesting from this node lastRun string If not empty tells when the harvester harvested from this node The value is the current time in milliseconds since 1 January 1970 Privileges and categories nodes can or cannot be present depending on the harvesting type In the fol lowing structures this common structure is not shown Only extra information specific to the harvesting type is described 7 3 1 Nodes of type GeoNetwork This is the native harvesting supported by GeoNetwork 2 1 and above e site Contains host and account information host string
179. standard If the following XML was added to the schema suggestions xml file lt field name gmd CI_OnlineResource gt lt suggest name gmd protocol gt lt suggest name gmd name gt lt suggest name gmd description gt lt field gt The effect of this would be that when an online resource element was expanded then input fields for the protocol a drop down select list name and description would automatically appear in the editor Once again a good place to start when building a schema suggestions xml file for the MCP is the schema suggestions xml file for the iso19139 schema e schema substitutes xml Recall from the Schema and schema xsd section above that the method we used to extend the base ISO19115 19139 schemas is to extend the base type de fine a new element with the extended base type and allow the new element to substitute for the base element So for example in the MCP we want to add a new resource constraint element that holds Creative Commons and other commons type licensing information This requires that the MD_Constraints type be extended and a new mcp MD_Commons element be defined which can substitute for gmd MD_Constraints This is shown in the following snippet of XSD lt xs complexType name MD_CommonsConstraints_Type gt lt xs annotation gt lt xs documentation gt Add MD_Commons as an extension of gmd MD_Constraints_Type 46 Chapter 4 Schema Plugins GeoNetwork Developer Manual Releas
180. sted 122 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 e relation string normal This optional parameter identifies the kind of relation that the client wants to be returned It can be one of these values normal The service performs a query into the id field and returns all relatedId records reverse The service performs a query into the relatedId field and returns all id records full Includes both normal and reverse queries duplicated ids are removed Here is an example of POST XML request lt request gt lt id gt 10 lt id gt lt relation gt full lt relation gt lt request gt Response The response has a response root element with several metadata children depending on the relations found Example lt response gt lt metadata gt lt metadata gt lt metadata gt lt metadata gt lt response gt Each metadata element has the following structure e title Metadata title e abstract A brief explanation of the metadata e keyword Keywords found inside the metadata e image Information about thumbnails e link A link to the source site e geoBox coordinates of the bounding box e geonet info A container for GeoNetwork related information Example of a metadata record lt metadata gt lt title gt Globally threatened species of the world lt title gt lt abstract gt Contains information on animals lt abstract gt lt keyword gt biodiversity lt
181. t Errors e Service not allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service Returned 401 HTTP code e Missing parameter error id missing parameter when mandatory parameters are not pro vided e bad parameter XXXX when a mandatory parameter is empty Retrieve metadata owners xml ownership editors The xml ownership editors service can be used to retrieve the users that own metadata records Requires authentication Yes Request Parameters e None Retrieve metadata owners request example grl http localhost 8080 geonetwork srv en xml ownership editors ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt 6 5 Metadata services 91 GeoNetwork Developer Manual Release 2 9 2 Response Here follows the structure of the response e root This is the container for the response editor Container for each editor user information x id User identifier username User login name User name surname User surname profile User profile Retrieve metadata editors response example lt xml version 1 0 encoding UTF 8 gt lt root gt lt editor gt lt id gt 1 lt id gt lt username gt admin lt username gt lt name gt admin lt name gt lt surname gt admin lt surname gt lt profile gt Administrator lt profile gt lt editor gt lt editor gt lt
182. t lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl with param name embedded select Sembedded gt lt xsl apply templates gt lt xsl otherwise gt lt xsl choose gt lt xsl template gt Analyzing this template 1 The name metadata iso19139 mcp is used by the main element processing template in meta data xsl elementEP The main metadata services show and edit end up calling metadata show xsl and metadata edit xsl respectively with the metadata record passed from the Java service Both these XSLTs process the metadata record by applying the elementEP template from metadata xsl to the root element elementEP calls the appropriate main schema template using the schema name 2 The job of this main template is set to process all the elements of the metadata profile The 4 3 Example 1S019115 19139 Marine Community Profile MCP 39 GeoNetwork Developer Manual Release 2 9 2 processing takes place in one of two modes Firstly the element is processed in the profile mode iso19139 mcp If a match is found then HTML elements will be returned and copied to the output document If no HTML elements are returned then the element is processed in the base schema mode iso19139 e templates that match on elements specific to the profile have mode iso19139 mcp lt xsl template mode iso19139 mep match mcp taxonomicElement gt lt xsl param
183. t It has a name attribute which contains the qualified name of the codelist entry 1 n A container for a codelist entry There can be many entries x code The entry s code This is the value that will be present inside the metadata label This is a human readable name used to show the entry into the user interface It is localised x description A generic localised description of the codelist lt response gt lt element name gmd constraintLanguage gt lt label gt Constraint language lt label gt lt description gt language used in Application Schema lt description gt lt condition gt mandatory lt condition gt lt element gt lt codelist name DateTypCd gt lt entry gt lt code gt creation lt code gt lt label gt Creation lt label gt lt description gt date when the resource was brought into existence lt description gt lt entry gt lt entry gt lt code gt publication lt code gt lt label gt Publication lt label gt lt description gt date when the resource was issued lt description gt 6 10 Schema information 121 GeoNetwork Developer Manual Release 2 9 2 lt entry gt lt entry gt lt code gt revision lt code gt lt label gt Revision lt label gt lt description gt date identifies when the resource was examined or re examined and improved or amended lt description gt lt entry gt lt codelist gt lt response gt Error management Beside
184. t to display when a particular tab is active should be contained in the root element processing tab e a root element processing tab This tab should match on the root element of the metadata record For example for the iso19139 schema lt xsl template mode iso19139 match gmd MD_Metadata gt lt xsl param name schema gt lt xsl param name edit gt lt xsl param name embedded gt lt xsl choose gt lt metadata tab gt lt xsl when test ScurrTab metadata gt lt xsl call template name iso19139Metadata gt lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl call template gt lt xsl when gt lt identification tab gt lt xsl when test currTab identification gt lt xsl apply templates mode elementEP select gmd identificationInfolgeonet child st lt xsl with param name schema select Sschema gt lt xsl with param name edit select Sedit gt lt xsl apply templates gt lt xsl when gt lt xsl template gt This template is basically a very long choose statement with when clauses that test the value of the currently defined tab in global variable currTab Each when clause will display the set of metadata elements that correspond to the tab definition using elementEP directly as in the when 4 3 Example ISO19115 19139 Marine Community Profile MCP
185. t 90 lt every gt lt oneRunOnly gt false lt oneRunOnly gt 116 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 lt recurse gt false lt recurse gt lt validate gt true lt validate gt lt options gt lt privileges gt lt group id 0 gt lt operation name view gt lt group gt lt group id 14 gt lt operation name features gt lt group gt lt privileges gt lt categories gt lt category id 4 gt lt categories gt lt node gt CSW harvesting To create a node to harvest from a CSW capable server the following XML information should be provided e node The type attribute is mandatory and must be csw site x capabilitiesUrl string URL of the capabilities file that will be used to retrieve the operations address x icon string default gif Icon file used to represent this node in the search results The icon must be present into the images harvesting folder searches 0 1 x search 0 n Contains search parameters If this element is missing an unconstrained search will be performed freeText string Search the entire metadata title string Search the dc title queryable abstract string Search the dc abstract queryable subject string Search the dc subject queryable This type supports both privileges and categories assignment xml_request_harvesting_add_csw shows an example of an XML request
186. t allowed error id service not allowed when the user is not authenticated or his profile has no rights to execute the service e User XXXX doesn t exist if no exists a user with provided id value User information user get Retrieves user information Non XML response 6 4 User services 67 GeoNetwork Developer Manual Release 2 9 2 6 4 2 Users maintenance Create a user user update The user update service can be used to create new users update user information and reset user pass word depending on the value of the operation parameter Only users with profiles Administrator or UserAdmin can create new users Users with profile Administrator can create users in any group while users with profile UserAdmin can create users only in the groups where they belong Requires authentication Yes Request Parameters e operation mandatory newuser e username mandatory User login name e password mandatory User password e profile mandatory User profile e surname User surname e name User name e address User physical address e city User address city e state User address state e zip User address zip e country User address country e email User email e org User organisation departament e kind Kind of organisation e groups Group identifier to set for the user can be multiple groups elements e groupid Group identifier User create request example Url http localhost 8080 geonetwork srv en user u
187. t featured gt true lt featured gt lt edit gt true lt edit gt lt owner gt true lt owner gt lt ownername gt admin lt ownername gt lt subtemplates gt lt geonet info gt lt Metadata gt Errors e Request must contain a UUID or an ID when no uuid or id parameter is provided e Operation not allowed error id operation not allowed when the user is not allowed to show the metadata record Returned 403 HTTP code RSS Search Search metadata and retrieve in RSS format rss search The rss search service can be used to retrieve metadata records in RSS format using regular search parameters This service can be configured in WEB INF config xml file setting the next parameters maxSummaryKeys Maximum number of RSS records to retrieve default 10 Requires authentication Optional If not provided only public metadata records are retrieved Request Parameters 80 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 georss valid values are simple simplepoint and default See also http georss org simple Bounding box in georss simple format simplepoint Bounding box in georss simplepoint format default Bounding box in georss GML format eastBL southBL northBL westBL Bounding box to restrict the search relation Bounding box criteria Values equal overlaps default encloses fullyOutsideOf intersection crosses touches within any Te
188. ta catalog lt category gt lt description gt lt CDATA gt lt description gt lt pubDate gt 06 Nov 2007 12 13 00 EST lt pubDate gt lt guid gt http localhost 8080 geonetwork uuid 5df54bf0 3a7d 44bf 9abf 84d772da8df1 lt g1 lt media content url geonetwork srv en resources get id 118fname thumbnail_s gif amp access public type image gif width 100 gt lt media text gt Major hydrological basins and their sub basins lt media text gt lt Bounding box in georss GML format http georss org gt lt georss where gt lt gml Envelope gt lt gml lowerCorner gt 34 6 17 3 lt gml lowerCorner gt lt gml upperCorner gt 38 2 51 1 lt gml upperCorner gt lt gml Envelope gt lt georss where gt lt item gt channel gt rss gt 84 Chapter 6 XML Services GeoNetwork Developer Manual Release 2 9 2 6 5 2 Metadata administration services Update operations allowed for a metadata metadata admin The metadata admin service updates the operations allowed for a metadata with the list of operations allowed send in the parameters deleting all the operations allowed assigned previously Requires authentication Yes Request to metadata admin service Parameters e id Identifier of metadata to update e _G_O can be multiple elements G Group identifier O Operation identifier Operation identifiers e 0 view e 1 download e 2 editing e 3 notify e 4 dynamic e 5
189. tadata records that belong to the schema The schema ident xml file for the MCP is as follows 4 2 Preparation 23 GeoNetwork Developer Manual Release 2 9 2 lt xml version 1 0 encoding UTF 8 gt lt schema xmlns http geonetwork opensource org schemas schema ident xmlns xsi http www w3 org 2001 XMLSchema instance lt name gt iso19139 mcp lt name gt lt id gt 19c9a2b2 dddb 11df 9df4 001c2346de4c lt id gt lt version gt 1 5 lt version gt lt schemaLocation gt http bluenet3 antere utas edu au mep http bluenet3 antcrc utas edu au mcp 1 5 experimental schema xsd http www isotc211 org 2005 gmd http www isotc211 org 2005 gmd gmd xsd http www isotc211 org 2005 srv http schemas opengis net iso 19139 20060504 srv srv xsd lt schemaLocation gt lt autodetect xmlns mcp http bluenet3 antcrc utas edu au mcp xmlns gmd http www isotc211 org 2005 gmd xmlns gco http www isotc211 org 2005 gco gt lt elements gt lt gmd metadataStandardName gt lt gco CharacterString gt Australian Marine Community Profile of ISO 19115 2005 19139 lt gco CharacterString gt lt gmd metadataStandardName gt lt gmd metadataStandardVersion gt lt gco CharacterString gt MCP BlueNet V1 5 lt gco CharacterString gt lt gmd metadataStandardVersion gt lt elements gt lt autodetect gt lt schema gt Each of the elements is as follows name the name by which the schema wil
190. the gmd metadataStandardName and gmd metadataStandardVersion elements have the content needed to ensure that the record is recognized as MCP To do this we can add two templates as follows lt xsl template match gmd metadataStandardName priority 10 gt lt xsl copy gt lt gco CharacterString gt Australian Marine Community Profile of ISO 19115 2005 19139 lt gc lt xsl copy gt lt xsl template gt lt xsl template match gmd metadataStandardVersion priority 10 gt lt xsl copy gt lt gco CharacterString gt MCP BlueNet V1 5 lt gco CharacterString gt lt xsl copy gt lt xsl template gt Processing by update fixed info xsl can be enabled disabled using the Automatic Fixes check box in the System Configuration menu By default it is enabled Some important tasks handled in upgrade fixed info xsl e creating URLs for metadata with attached files eg onlineResources with File for download in 1so19139 e setting date stamp revision date e setting codelist URLs to point to online ISO codelist catalogs e adding default spatial reference system attributes to spatial extents 4 3 Example ISO19115 19139 Marine Community Profile MCP 45 GeoNetwork Developer Manual Release 2 9 2 A specific task required for the MCP update fixed info xsl was to automatically create an online resource with a URL pointing to the metadata show service with parameter set to the metadata uuid This required some changes to the update
191. the metadata record and writes it into the appropriate element of the metadata record For the MCP this element is the same as the base 4 3 Example ISO19115 19139 Marine Community Profile MCP 43 1 C GeoNetwork Developer Manual Release 2 9 2 ISO schema called iso19139 in GeoNetwork namely gmd fileldentifier However because the MCP uses a different namespace on the root element this XSLT needs to be modified Creating the extract set and unset thumbnail XSLTs If your metadata record can have a thumbnail or browse graphic link then you will want to add XSLTs that extract set and unset this information so that you can use the GeoNetwork thumbnail editing inter face The three XSLTs that support this interface are e extract thumbnails xsl this XSLT extracts the thumbnails browse graphics from the metadata record turning it into generic XML that is the same for all metadata schemas The elements need to have content that GeoNetwork understands The following is an example of what the thumbnail interface for iso19139 expects we ll duplicate this requirement for MCP lt gmd graphicOverview gt lt gmd MD_BrowseGraphic gt lt gmd fileName gt lt gco CharacterString gt bluenet_s png lt gco CharacterString gt lt gmd fileName gt lt gmd fileDescription gt lt gco CharacterString gt thumbnail lt gco CharacterString gt lt gmd fileDescription gt lt gmd fileType gt lt gco CharacterString gt png lt
192. ting maybe copying an al ready existing one Edit the harvesting js file to include the new type edit both constructor and init methods Add the proper folder in web src webapp xsl harvesting again it is easy to copy from an already existing one Edit the stylesheet web src webapp xsl harvesting harvesting xs1 and add the new type Add the transformation stylesheet in web src webapp xsl xml harvesting Its name must match the string used for the harvesting type Add the Java code in a package inside org fao geonet kernel harvest harvester Add proper strings in web src webapp loc XX xml harvesting xml Here is a list of steps to follow when adding a new harvesting type 1 Every harvesting node not type must generate its UUID This UUID is used to remove metadata when the harvesting node is removed and to check if a metadata which has another UUID has been already harvested by another node If a harvesting type supports multiple searches on a remote site these must be done sequentially and results merged Every harvesting type must save in the folder images logos a GIF image whose name is the node s UUID This image must be deleted when the harvesting node is removed This is necessary to propagate harvesting information to other GeoNetwork nodes When a harvesting node is removed all collected metadata must be removed too During harvesting take in mind that a metadata could have been rem
193. ting type username string Username on the remote node password string Password on the remote node options A container for generic options every integer Harvesting interval in minutes oneRunOnly boolean After the first run the entry s status will be set to inactive status string Indicates if the harvesting from this node is stopped inactive or if the harvester is waiting for the timeout active privileges 0 1 A container for privileges that must be associated to the harvested meta data This optional element is present only if the harvesting type supports it x group 0 n A container for allowed operations associated to this group It has the id attribute which value is the identifier of a GeoNetwork group operation 0 n Specifies an operation to associate to the containing group It has a name attribute which value is one of the supported operation names The only supported operations are view dynamic featured categories 0 1 This is a container for categories to assign to each imported metadata This optional element is present if the harvesting type supports it x category integer 0 n Represents a local category and the id attribute is its local identifier info A container for general information x lastRun string The lastRun element will be filled as soon as the harvester starts harvesting from this entry The value is the running boolean Tr
194. tle Metadata title e source Source catalogue the metadata e uuid Metadata Universally Unique Identifier UUID isHarvested Indicates if the metadata is harvested popularity Indicates how often the record is retrieved e rating Average rating provided by users State of operation on metadata for the user view notify download dynamic featured edit 6 5 Metadata services 79 GeoNetwork Developer Manual Release 2 9 2 owner Indicates if the user that executed the service is the owner of metadata e ownername Metadata owner name Get metadata response example lt xml version 1 0 encoding UTF 8 gt lt Metadata xmlns geonet http www fao org geonetwork xmlns csw http www opengis net cat csw 2 0 2 gt lt mdFileID gt aa9bc613 8eef 4859 a9eb 4df35d8b21e4 lt mdFileID gt lt geonet info gt lt id gt 10 lt id gt lt schema gt isol9115 lt schema gt lt createDate gt 2005 08 23T17 58 18 lt createDate gt lt changeDate gt 2007 03 12T17 49 50 lt changeDate gt lt isTemplate gt n lt isTemplate gt lt title gt lt source gt 881a1630 d4e7 4c9c aa01 7a9 bbbbc47b2 lt source gt lt uuid gt aa9 bc 13 B8eef 4859 ad eb 4df35d8b21e4 lt uuid gt lt isHarvested gt n lt isHarvested gt lt popularity gt 0 lt popularity gt lt rating gt 0 lt rating gt lt view gt true lt view gt lt notify gt true lt notify gt lt download gt true lt download gt lt dynamic gt true lt dynamic gt l
195. to create a CSW entry Example of an xml harvesting add request for a CSW node lt node type csw gt lt site gt lt name gt Minos CSW server lt name gt lt capabilitiesUrl gt http www minos org csw request GetCapabilities amp amp amp service CSW amp amp amp acceptVersions 2 0 1 lt capabilitiesUrl gt lt icon gt default gif lt icon gt lt account gt lt use gt true lt use gt lt username gt admin lt username gt 6 9 Harvesting services 117 GeoNetwork Developer Manual Release 2 9 2 lt password gt admin lt password gt lt account gt lt site gt lt options gt lt every gt 90 lt every gt lt oneRunOnly gt false lt oneRunOnly gt lt recurse gt false lt recurse gt lt validate gt true lt validate gt lt options gt lt privileges gt lt group id 0 gt lt operation name view gt lt group gt lt group id 14 gt lt operation name features gt lt group gt lt privileges gt lt categories gt lt category id 4 gt lt categories gt lt node gt Response The service s response is the output of the xml harvesting get service of the newly created node Summary The following table Summary of features of the supported harvesting types Harvesting type Authentication Privileges Categories GeoNetwork native through policies yes WebDAV HTTP digest yes yes CSW HTTP Basic yes yes 6 9 4 xml harvesting update This service
196. to this directory Any other file or directory present into the MEF file should be ignored by readers that don t recognise them This allows actors to add custom extensions to the MEF file A MEF file can have empty public and private folders depending on the export format which can be 1 simple both public and private are omitted 2 partial only public files are provided 3 full both public and private files are provided It is recommended to use the mef extension when naming MEF files 5 3 MEF v2 file format MEF version 2 support the following multi metadata support be able to have more than one metadata record in a single MEF file multi metadata format support be able to store in a single MEF n formats eg for ISO profil also store 18019139 record related metadata export export related metadata in the MEF file Related metadata record could be child metadata Using parentUuid search field service metadata Using operatesOn search field related metadata Using xml relation get service MEF v2 format structure is the following Root 0 n metadata metadata metadata xml ISO19139 optional metadata profil xml ISO19139profil info xml applischema optional schema xml ISO19110 public de all public documents and thumbnails 50 Chapter 5 Metadata Exchange Format GeoNetwork Developer Manual Release 2 9 2 private all
197. ts in the convert directory of a GeoNetwork schema then records that belong to this schema will be transformed and included in OAIPMH requests for the oai_dc prefix To add oai_dc support for the MCP the easiest method is to copy oai_dc xsl from the convert directory of the iso19139 schema and modify it to cope with the different namespaces and additional elements of the MCP 48 Chapter 4 Schema Plugins CHAPTER 5 Metadata Exchange Format 5 1 Introduction The metadata exchange format MEF in short is a special designed file format whose purpose is to allow metadata exchange between different platforms A metadata exported into this format can be imported by any platform which is able to understand it This format has been developed with GeoNet work in mind so the information it contains is mainly related to it Nevertheless it can be used as an interoperability format between any platform This format has been designed with these needs in mind 1 Export a metadata record for backup purposes 2 Import a metadata record from a previous backup 3 Import a metadata record from a different GeoNetwork version to allow a smooth migration from one version to another All these operations regard the metadata and its related data as well In the paragraphs below some terms should be intended as follows 1 the term actor is used to indicate any system application service etc that operates on metadata 2 the term reader wi
198. tyIsLike gt lt Filter gt lt csw Constraint gt lt csw Query gt lt csw GetRecords gt SOAP request Url http localhost 8080 geonetwork srv en csw Content type application soap xml Post data lt xml version 1 0 encoding UTF 8 gt lt env Envelope xmlns env http www w3 org 2003 05 soap envelope gt lt env Body gt lt csw GetRecords xmlns csw http www opengis net cat csw 2 0 2 service CSW vers lt csw Query typeNames csw Record gt lt csw Constraint version 1 1 0 gt lt Filter xmlns http www opengis net ogc xmlns gml http www opengis net c lt PropertyIsLike wildCard singleChar _ escape gt lt PropertyName gt AnyText lt Propert yName gt lt Literal gt africa lt Literal gt 6 13 CSW service 129 GeoNetwork Developer Manual Release 2 9 2 lt PropertylsLike gt lt Filter gt lt csw Constraint gt lt csw Query gt lt csw GetRecords gt lt env Body gt lt env Envelope gt The GeoNetwork opensource catalog CSW Publication service operations are accessible through the url http localhost 8080 geonetwork srv en csw publication Harvest The Harvest operation defines an interface for indirectly creating modifying and deleting catalogue records by invoking a CSW client harvesting run from the server to a specified target It can be run in ei ther synchronous or asynchronous mode and the harvesting run can be exe
199. ue if the harvester is currently running error This element will be present if the harvester encounters an error during harvesting code string The error code in string form message string The description of the error x object string The object that caused the error if any This element can be present or not depending on the case Errors e ObjectNotFoundEx If the id parameter is provided but the node cannot be found 6 9 3 xml harvesting add Create a new harvesting node The node can be of any type supported by GeoNetwork GeoNet work node web folder etc When a new node is created its status is set to inactive A call to the xml harvesting start service is required to start harvesting 6 9 Harvesting services 113 GeoNetwork Developer Manual Release 2 9 2 Request The service requires an XML tree with all information the client wants to add In the following sections default values are given in parenthesis after the parameter s type and are used when the parameter is omitted If no default is provided the parameter is mandatory If the type is boolean only the true and false strings are allowed All harvesting nodes share acommon XML structure that must be honoured Please refer to the previous section for elements explanation Each node type can add extra information to that structure The common structure is here described e node The root container The type attribute is mandatory a
200. uman x readable bad format Reason x bad parameter Name of the parameter Parameter s bad value file not found x File s name file upload too x X big missing Name of the parameter XML container where the parameter should parameter have been present object not found x Object s name operation Reason of abort If present the object that caused the abort aborted operation not x x allowed resource not x Resource s name found service not x Service s name allowed service not x Service s name found user login User login failed message User s name user not found x User s id or name metadata not The requested metadata was Metadata s id found not found mef_export_exception shows an example of exception generated by the mef export service The service complains about a missing parameter as you can see from the content of the id attribute The object element contains the xml request with an unknown test parameter while the mandatory UUID parameter as specified by the message element is missing An example of generated exception lt error gt lt message gt UUID lt message gt lt class gt MissingParameterEx lt class gt lt stack gt lt at class jeeves utils Util file Util java line 66 method getParam gt lt at class org fao geonet services mef Export file Export java line 60 method exec gt lt at class jeeves server dispatche
201. up mail net lt email gt lt referrer gt lt label gt lt en gt Sample group lt en gt lt fr gt Sample group lt fr gt lt es gt Sample group lt es gt lt de gt Beispielgruppe lt de gt lt nl gt Voorbeeldgroep lt nl gt lt label gt lt record gt lt response gt 6 14 2 Create a new user exception management This example show a request to create a new user that requires authentication to complete succesfully The request is executed without authentication to capture the exception returned by GeoNetwork Source package org geonetwork xmlservices client import org apache commons httpclient HttpClient import org apache commons httpclient HttpStatus import org apache commons httpclient methods PostMethod import org apache commons httpclient methods StringRequestEntity import org jdom Document import org jdom Element public class CreateUserClient public static void main String args xx Create requestx x xml Element request new Element request addContent new Element operation setText newuser addContent new Element username setText Samantha addContent new Element password setText editor2 addContent new Element profile setText Editor addContent new Element name setText Samantha addContent new Element city setText Amsterdam 6 14 Java developme
202. use spatial extents apart from the bounding box are encoded as gml in the metadata record 4 3 Example ISO19115 19139 Marine Community Profile MCP 29 GeoNetwork Developer Manual Release 2 9 2 Again the easiest way to create this for the MCP is to copy extract gml xsd from the iso19139 schema ad modify it to suit the MCP namespace An example bounding box fragment from an MCP metadata record is lt gmd extent gt lt gmd EX Extent gt lt gmd geographicElement gt lt gmd EX_GeographicBoundingBox gt lt gmd westBoundLongitude gt lt gco Decimal gt 112 9 lt gco Decimal gt lt gmd westBoundLongitude gt lt gmd eastBoundLongitude gt lt gco Decimal gt 153 64 lt gco Decimal gt u u a o u lt gmd eastBoundLongitude gt lt gmd southBoundLatitude gt lt gco Decimal gt 43 8 lt gc0 Decimal gt lt gmd southBoundLatitude gt lt gmd northBoundLatitude gt lt gco Decimal gt 9 0 lt gco Decimal gt lt gmd northBoundLatitude gt lt gmd EX_GeographicBoundingBox gt lt gmd geographicElement gt lt gmd EX_Extent gt lt gmd extent gt Running extract gml xsl on the metadata record that contains this XML will produce lt gml GeometryCollection xmlns gml http www opengis net gml gt lt gml Polygon gt lt gml exterior gt lt gml LinearRing gt lt gml coordinates gt 112 9 9 0 153 64 9 0 153 64 43 8
203. ve style to the results of the tag cloud search You can find the whole API of widgets here Create a new widget You can create new widgets to add to your customized user interface Using the same example as before you can see that you can easily create new widgets You just have to take care of two things e Visualization define an html div where your widget will display information e Manipulation of information add some functionality like a search connector so the visualization has data to show Using outside GeoNetwork Although it is a testing functionality in fact you can use this same widgets on your own webpage You just have to make sure that all dependencies are fulfilled and the settings are properly set up As development will go on this functionality will be made easier and documentation will be filled up TODO some simple examples 160 Chapter 8 User Interface
204. view js This is an important abstract class that must be implemented by harvesting types It takes care of many common aspects of the user interface It provides methods to add group s privileges to select categories to check data for validity and to set and get common data from the user interface 4 harvesting js This is the main JavaScript file that takes care of everything It starts all the sub modules loads XML strings from the server and displays the main page that lists all harvesting nodes 5 model js Performs all XML requests to the server handles errors and decode responses 6 view js Handles all updates and changes on the main page 7 util js just a couple of utility methods 3 1 2 Java code The harvesting package is located in web src main java org fao geonet kernel harvest Here too there is one subfolder for each harvesting type The most important classes for the implemen tor are 17 GeoNetwork Developer Manual Release 2 9 2 1 AbstractHarvester This is the main class that a new harvesting type must extends It takes care of all aspects like adding updating removing starting stopping of harvesting nodes Some abstract methods must be implemented to properly tune the behaviour of a particular harvesting type 2 AbstractParams All harvesting parameters must be enclosed in a class that extends this abstract one Doing so all common parameters can be transparently handled by this abstract cla
205. xisting group identifier e ERROR tried to add group id XX to user XXXX not allowed because you are not a mem ber of that group when the authenticated user has profile UserAdmin and tries to add the user to a group in which the UserAdmin user is not allowed to manage e ERROR you don t have rights to do this when the authenticated user has a profile that is not Administrator or UserAdmin Update user information user update The user update service can be used to create new users update user information and reset user pass word depending on the value of the operation parameter Only users with profiles Administrator or UserAdmin can update users information Users with profile Administrator can update any user while users with profile UserAdmin can update users only in the groups where they belong Requires authentication Yes 6 4 User services 69 GeoNetwork Developer Manual Release 2 9 2 Request Parameters e operation mandatory editinfo e id mandatory Identifier of the user to update e username mandatory User login name e password mandatory User password e profile mandatory User profile e surname User surname e name User name e address User physical address e city User address city e state User address state e zip User address zip e country User address country e email User email e org User organisation departament e kind Kind of organisation e groups Group identifier to set
206. xt to search in a free text search title Metadata title abstract Metadata abstract themeKey Metadata keywords To search for several use a value like Global or watersheds dynamic Map type Values off default on download Map type Values off default on digital Map type Values off default on paper Map type Values off default on group Filter metadata by group if missing search in all groups attrset dateFrom Filter metadata created after specified date dateTo Filter metadata created before specified date category Metadata category If not specified search all categories RSS search request example UEL http localhost 8080 geonetwork srv en rss search ime type application xml Post request lt xml version 1 0 encoding UTF 8 gt lt request gt lt georss gt simplepoint lt georss gt lt any gt africa lt any gt lt eastBL gt 74 91574 lt eastBL gt lt southBL gt 29 40611 lt southBL gt lt northBL gt 38 47198 lt northBL gt lt westBL gt 60 50417 lt westBL gt lt relation gt overlaps lt relation gt lt sortBy gt relevance lt sortBy gt lt attrset gt geo lt attrset gt lt request gt 6 5 Metadata services 81 GeoNetwork Developer Manual Release 2 9 2 Response Here follows the principal fields of the response e channel This is the container for the RSS response title RSS channel title description RSS channel descript
207. y extension we mean that the new type includes all of the elements of the old type plus one new element mcp revisionDate A mandatory attribute gco isoType is also attached to mcp MD_Metadata with a fixed value set to the name of the element that we extended gmd MD_Metadata By defining the profile in this way it is not necessary to modify the underlying ISO19139 schemas So the schema directory for the MCP essentially consists of the extensions plus the base ISO19139 schemas One possible directory structure is as follows extensions gco gmd gml gmx gsr gss gts resources srv xlink The extensions directory contains a single file mcpExtensions xsd which imports the gmd namespace The remaining directories are the ISO19139 base schemas The schema xsd file which is the file GeoNetwork looks for will import the mcpExtensions xsd file and any other namespaces not imported as part of the base ISO19139 schema It is shown as follows lt xs schema targetNamespace http bluenet3 antcrc utas edu au mcp elementFormDefault qualified xmlns xs http www w3 org 2001 XMLSchema xmlns mcp http bluenet3 antcrc utas edu au mcp xmlns gmd http www isotc211 org 2005 gmd xmlns gmx http www isotc211 org 2005 gmx xmlns srv http www isotc211 org 2005 srv gt lt xs include schemaLocation schema extensions mcpExtensions xsd gt lt this is a logical place to include any additional schemas that are related to ISO19139 including
208. y users that have download rights over the record will be able to use this service To obtain these rights your application will need to use xml user login 6 8 File download services 109 GeoNetwork Developer Manual Release 2 9 2 Request Called with a metadata id or uuid one or more file names if more than one file is attached to the metadata record as data for download access which is almost always private and details of the user who has accepted the license and wants to download the files Example lt request gt lt uuid gt d8c8cal1 ecc8 45dc b424 171a9e212220 lt uuid gt lt fname gt roam rsf aus bathy topo contours sff lt fname gt lt fname gt mse09_M8 nc lt fname gt lt access gt private lt access gt lt name gt Aloyisus Wankania lt name gt lt org gt Allens Butter Factory lt org gt lt email gt A Wankania allens org lt email gt lt comments gt Gimme the data buddy lt comments gt lt request gt Response The service returns a zip archive containing the file resources requested a copy of the metadata record as a mef and a copy of the html license generated and provided by the xml file disclaimer service Note this service is protected against users and or applications that do not go through the xml file disclaimer service first Errors e IllegalArgumentException Request must contain a UUID or an ID parameter e OperationNowAllowedException you don t have download permissi

Download Pdf Manuals

image

Related Search

Related Contents

Lindy 21603 rack console  Promate Amos N3    531534-1_A - PMAX 220 Manual.qxp  Actionneur radio télérupteur Relais FSR61-230V Afin d  General Specifications  取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file