GeoPortal Service

From Gcube Wiki
Revision as of 18:17, 2 February 2021 by Fabio.sinibaldi (Talk | contribs) (Handler Framework)

Jump to: navigation, search

GeoPortal Service is a new REST service designed to manage complex space-temporal Documents defined by metadata Profiles. It has been released as a component of the gCube framework, and SmartGears powers it. It has been designed to manage publication lifecycle of complex space-temporal Documents, supporting their materialization & Indexing in different platforms (Databases, Catalogues, OGC Services..) and maximising reusability.

Overview

Users can define their model as a Profile in the VRE and then manage their Documents publication lifecycle both via gateway’s GUIs and by interacting with the service’s API (both JAVA and/or REST). The service provides a set of Handlers which can be declared and configured in the Profile (defaults apply) in order to be invoked in the different phases of the publication lifecycle. The set of Event Handlers is dynamically loaded by the service allowing support for custom implementation of Event Handlers. The provided java client library allows for dynamic model Serialization / Deserialization of custom provided Java model classes, allowing for easy integration of different systems.


Its main features are :

Documents Publication Management
CRUD (Create, Read, Update, Delete) operations, publication lifecycle, Profiles-based validation;
Role-based access to resources and metadata sections;
Cooperative workflow;
Automatic Indexing & aggregation based on Profiles annotations
GIS indexes (both centroids & multi-polygon), with dynamic aggregation based on zoom level;
Text indexes;
Time indexes and aggregation;
Extensible Document model
Generic meta-model Profile;
Custom extensions of the model;
Extensible behaviour
Core engine based on a meta-model;
Publication management implemented by an extendable set of Event Handlers;
Behaviour configured in Profiles by declaring Event Handlers call in cascade;

Architecture

GeoPortal Service Architecture

API

REST Interface

Client Library

Java client library to interact with the service is distributed as maven artifact

<groupId>org.gcube.application</groupId>
<artifactId>geoportal-client</artifactId>


The library offers various wrappings of the REST interface, allowing for :

  • Both Custom & Generic management of Profiled Documents ;
  • Both Custom & Generic automatic parsing of JSON communications over REST interface;
  • Transparent authentication and service discovery, thanks to gCube Framework;

Generic Profiled Documents Managers

  • ProfiledDocumentsManagerI : JAVA interface for the management of Profiled Documents.

Custom Concessioni Managers

The library provides the following customized versions of the generic clients in order to manage Concessioni Documents :

MongoConcessioni

Interface for the stateless management of Concessioni Documents. It reflects the contract of the generic REST API. Following snippet shows typical usage :

import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;
...
 
Concessione c=...
 
//Register New Concessione
c=client.createNew(c);
 
// Upload files to Concessione Section by Path (e.g. Relazione)
String mongoId=c.getMongo_id();	
List<TempFile> files=...
AddSectionToConcessioneRequest request=	new AddSectionToConcessioneRequest(Paths.RELAZIONE, files);
 
client.registerFile(mongoId, request);
 
 
// Publish
 
client.publish(mongoId);
ConcessioniManagerI

Interface for the statefull creation of Concessioni Documents. Stateful logic helps client to manage the management of the last loaded/registered Concessione, offering dedicated methods for adding FileSets (e.g. RelazioneScavo) to the current Document.

Following snippet shows typical usage :

import org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
....
 
//Obtain the client
ConcessioniManagerI manager=statefulMongoConcessioni().build();
...
 
//Create a new Document from scratch
Concessione c = ...
...
manager.createNew(c);
 
//Adds an UploadedImage to the current document
 
UploadedImage toRegisterImg= ...
TempFile toUpload=....
 
manager.addImmagineRappresentativa(toRegisterImg, toUpload);
 
 
//Publishes current object
manager.publish();

Utility Classes

StorageUtils

In order to transfer FileSets to the REST service, an utility class is provided, allowing for the management of infrastructure's TempFiles. Following snippet is a typical usage :

StorageUtils storage=new StorageUtils();
 
InputStream myPayload=...
String payloadName=...
 
TempFile toUpload=storage.putOntoStorage(myPayload, payloadName);