Difference between revisions of "GeoNetwork library"

From Gcube Wiki
Jump to: navigation, search
(Using the library)
(Using the library)
Line 56: Line 56:
 
* ''public static GeoNetworkPublisher get(Configuration config)'' : uses the passed ''Configuration'' implementation.
 
* ''public static GeoNetworkPublisher get(Configuration config)'' : uses the passed ''Configuration'' implementation.
  
See [[[Configuration]] to get more information.
+
See [[#Configuration]] to get more information.
  
 
==Security==
 
==Security==
Line 80: Line 80:
 
* PRIVATE   
 
* PRIVATE   
  
see [[[Configuration]]] for details on how the related credentials are used.
+
see [[#Configuration]] for details on how the related credentials are used.
  
 
==Configuration==
 
==Configuration==

Revision as of 16:51, 23 May 2013

A library to interact with GeoNetwork's REST Interface to publish/modify/delete and search for Metadata.The library is designed on top of geoserver-manager library, developed by GeoSolutions. Metadata objects managed by the library are compliant to standard specification ISO 19115:2003/19139. Default configuration of the library interacts exploits Featherweight Stack functionalities to discover geonetwork available in the infrastructure.

Module overview

The library is distributed as the artifact

<dependency>
  <groupId>org.gcube.spatial.data</groupId>
  <artifactId>geonetwork</artifactId>
  <version>...</version>
</dependency>


ISO 19115:2003 metadata compliance

Metadata objects used by the libraries implement GeoAPI interfaces, which are fully compliant to ISO 19115:2003/19139. Current implementation is based on GeoToolkit Metadata module.

Dependecies

The library declares these dependecies to external third parties artifacts

<dependency>
        <groupId>it.geosolutions</groupId>
	<artifactId>geonetwork-manager</artifactId>
	<version>1.1</version>
</dependency>
<dependency>
	<groupId>org.geotoolkit</groupId>
	<artifactId>geotk-metadata</artifactId>
	<version>3.20-geoapi-3.0</version>
</dependency>
<dependency>
	<groupId>org.w3c</groupId>
	<artifactId>dom</artifactId>
	<version>2.3.0-jaxb-1.0.6</version>
</dependency>
<dependency>
	<groupId>org.geotoolkit</groupId>
	<artifactId>geotk-referencing</artifactId>
	<version>3.20-geoapi-3.0</version>
</dependency>

Using the library

The library acts as a wrapper to the functionalities exposed by the geonetwork-manager library. The methods offered by the library are splitted in two different interfaces :

  • org.gcube.spatial.data.geonetwork.GeoNetworkReader : declares methods to access metadata stored in geonetwork
  • org.gcube.spatial.data.geonetwork.GeoNetworkPublisher : extends GeoNetworkReader, and declares methods to publish/update/delete metadata in geonetwork

The class org.gcube.spatial.data.geonetwork.GeoNetwork offers two static members to obtain implementations of the above interfaces :

  • public static GeoNetworkPublisher get() throws Exception : uses the current settings of ConfigurationManager to get a Configuration implementation.
  • public static GeoNetworkPublisher get(Configuration config) : uses the passed Configuration implementation.

See #Configuration to get more information.

Security

From version 2.0.0 the library refers to the guidelines stated in GeoNetwork administration in particular :

  • applications should publish their metadata in the current scope group
  • applications should publish as <SCOPE_PUBLIC_USER> metadata with scope visibility
  • applications should publish as <SCOPE_PRIVATE_USER> metadata with private (per user) visibility

Login

Unless the client calls the method public void login(LoginLevel level)throws AuthorizationException declared by GeoNetworkReader interface, all calls to geonetwork are sent without login thus :

  • queries return only public metadata
  • access to metadata with no public access will fail
  • methods which change the current geonetwork state will fail

The following LoginLevels are defined :

  • DEFAULT
  • SCOPE
  • PRIVATE

see #Configuration for details on how the related credentials are used.

Configuration

The geonetwork library relies on instances of org.gcube.spatial.data.geonetwork.configuration.Configuration interface in order to retrieve needed information to interact with geonetwork REST interface.


Example Code