Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datahubs per sub-portal #8644

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ web/src/main/webapp/data/
web/src/main/webapp/doc/en
web/src/main/webapp/doc/fr
web/src/main/webapp/WEB-INF/data/data/resources/schemapublication

# geonetwork-ui git project
plugins/datahub-integration/src/main/geonetwork-ui/
plugins/datahub-integration/node/
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class Settings {

public static final String MICROSERVICES_ENABLED = "microservices/enabled";


public static class GNSetting {
private String name;
private boolean nullable;
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/docs/administrator-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [Managing users and groups](managing-users-and-groups/index.md)
- [Managing classification system](managing-classification-systems/index.md)
- [Managing metadata & template](managing-metadata-standards/index.md)

- [plugins.md](plugins/plugins.md)
![](img/admin.png)

All Admin functions are available from the Admin Dashboard from the main menu. On the Admin Dashboard you will find shortcuts to any administration option your role can access.
7 changes: 7 additions & 0 deletions docs/manual/docs/administrator-guide/plugins/plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Datahub plugin

You can adapt your GeoNetwork UI by enabling Datahub. This plugin affect the UI of the application. By enabling that you should see the Geontwork UI, described in thisproject : https://github.com/geonetwork/geonetwork-ui

First, download the specific plugin release datahub-integration. Then, on the portal's setting page, enable Datahub for each portal you want.

For developers, you must build and execute the plugin by adding the profile datahub-integration.
27 changes: 27 additions & 0 deletions domain/src/main/java/org/fao/geonet/domain/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.fao.geonet.domain.converter.BooleanToYNConverter;
import org.fao.geonet.entitylistener.SourceEntityListenerManager;
import org.fao.geonet.repository.LanguageRepository;
import org.hibernate.annotations.Type;

import javax.annotation.Nonnull;
import javax.persistence.*;
Expand Down Expand Up @@ -64,6 +65,9 @@ public class Source extends Localized {
private Integer groupOwner;
private Boolean listableInHeaderSelector = true;

private Boolean datahubEnabled = false;
private String datahubConfiguration = ""; // will use the main conf if empty

/**
* Default constructor. Required by framework.
*/
Expand Down Expand Up @@ -224,6 +228,29 @@ public Source setUiConfig(String uiConfig) {
return this;
}

/**
* Only applies to subportal.
*
* @return
*/
public Boolean getDatahubEnabled() {
return datahubEnabled;
}
public Source setDatahubEnabled(Boolean datahubEnabled) {
this.datahubEnabled = datahubEnabled;
return this;
}

@Lob
@Type(type = "org.hibernate.type.TextType")
public String getDatahubConfiguration() {
return datahubConfiguration;
}
public Source setDatahubConfiguration(String datahubConfiguration) {
this.datahubConfiguration = datahubConfiguration;
return this;
}


/**
* Get the date that the source was created.
Expand Down
198 changes: 198 additions & 0 deletions plugins/datahub-integration/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2001-2023 Food and Agriculture Organization of the
~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
~ and United Nations Environment Programme (UNEP)
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or (at
~ your option) any later version.
~
~ This program is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
~
~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
~ Rome - Italy. email: [email protected]
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.4.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>


<groupId>org.geonetwork-opensource.plugins</groupId>
<artifactId>gn-datahub-integration</artifactId>
<name>GeoNetwork Datahub integration</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>gn-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>datahub-integration</id>
<activation>
<property>
<!-- include when making a release -->
<name>release</name>
</property>
</activation>
</profile>
</profiles>

<properties>
<geonetwork-ui.git.branch>main</geonetwork-ui.git.branch>
<rootProjectDir>../..</rootProjectDir>
</properties>

<build>
<plugins>
<!-- Git clone geonetwork-ui -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>delete-existing</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>rm</executable>
<arguments>
<argument>-rf</argument>
<argument>src/main/geonetwork-ui</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>checkout-geonetwork-ui</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>git</executable>
<arguments>
<argument>clone</argument>
<argument>--branch</argument>
<argument>${geonetwork-ui.git.branch}</argument>
<argument>https://github.com/geonetwork/geonetwork-ui.git</argument>
<argument>src/main/geonetwork-ui</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>

<!-- Install node & npm -> npm install -> npm run build -->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.0</version>
<executions>
<execution>
<!-- Installing node and npm -->
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v20.12.2</nodeVersion>
<npmVersion>10.7.0</npmVersion>
</configuration>
</execution>
<!-- Install geonetwork-ui dependencies -->
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci --loglevel error</arguments>
<workingDirectory>src/main/geonetwork-ui</workingDirectory>
<installDirectory>${basedir}</installDirectory>
</configuration>
</execution>
<!-- Build datahub app -->
<execution>
<id>npm-build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<environmentVariables>
<NX_DAEMON>false</NX_DAEMON>
</environmentVariables>
<arguments>
run nx -- build datahub --base-href=./
</arguments>
<workingDirectory>src/main/geonetwork-ui</workingDirectory>
<installDirectory>${basedir}</installDirectory>
</configuration>
</execution>
</executions>
</plugin>

<!-- Copy of datahub files -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<encoding>UTF-8</encoding>
<outputDirectory>src/main/resources/datahub</outputDirectory>
<resources>
<resource>
<directory>src/main/geonetwork-ui/dist/apps/datahub</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
Loading
Loading