diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..c9bc76806f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,41 @@ +name: Documentation + +on: + push: + branches: + - 4.2.x + paths: + - "docs/manual/**" + pull_request: + branches: + - 4.2.x + paths: + - "docs/manual/**" + workflow_dispatch: + +jobs: + deploy-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout GeoNetwork + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: mkdocs install + run: pip install --upgrade pip && pip install -r docs/manual/requirements.txt + - name: git configuration + run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com' + - name: build docs without publishing them + if: ${{ github.event_name == 'pull_request' }} + working-directory: docs/manual + run: | + mike deploy --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable + - name: deploy 4.2 docs to gh-pages branch + if: ${{ github.event_name != 'pull_request' }} + working-directory: docs/manual + run: | + mike deploy --push --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable diff --git a/.gitignore b/.gitignore index bf4605d3b4..23cf0b3eb7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ git*.properties */target/ **/.idea **/.settings +.*/ +!.github #GeoNetwork* /geonetwork* camel-harvesters/wfsfeature-harvester/logs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 698871368c..ab418f3efe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,13 +11,19 @@ Thank you for contributing to GeoNetwork: * Pull requests must be applied to `main`, before being backported. +* Before merging a pull request, should be defined the following properties: + + - Milestone to include the change. + - Add the label `changelog` when the change is relevant to be added to the release changelog file . + - Add the label(s) to the backport to previous branch(es), when the change is a bug fix or if it is a small improvement that may be relevant to the backport. + * Good housekeeping: Anytime you commit, try and clean the code around it to latest style guide. If you improve a function without comments: add comments. If you modify functionality that does not have tests: write a test. If you fix functionality without documentation: add documentation. -* History: Clean commit messages and history: avoid big commits with hundreds of files, break commits commits up into understandable chunks, longer verbose commit messages are encouraged. Beware of reformatting and needless whitespace changes. +* History: Clean commit messages and history: avoid big commits with hundreds of files, break commits up into understandable chunks, longer verbose commit messages are encouraged. Beware of reformatting and needless whitespace changes. * Draft: Use pull request *Draft** (or even the text "WIP") to identify work in progress. -* Rebase: No merge commits with current branch: use rebase! +* Rebase / Squash and merge: No merge commits with current branch, use Rebase or Squash and merge! * API Change: Please identify any API change or behavior changes in commit messages. diff --git a/cachingxslt/pom.xml b/cachingxslt/pom.xml index edd994abea..145fd678a2 100644 --- a/cachingxslt/pom.xml +++ b/cachingxslt/pom.xml @@ -31,7 +31,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/code_quality/README.md b/code_quality/README.md index fcea5269fb..5c708c35ae 100644 --- a/code_quality/README.md +++ b/code_quality/README.md @@ -1,3 +1,3 @@ The files in this directory are used for configuring IDEs or are used by the build tool to make certain code quality checks. -For example findbugs-ecludes is used by both the build tool's findbugs implementation as well as IDES for running findbugs. \ No newline at end of file +For example, findbugs-excludes is used by both the build tool's findbugs implementation as well as IDES for running findbugs. diff --git a/common/pom.xml b/common/pom.xml index 36f05e439c..c54acce505 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -31,7 +31,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/core/README.md b/core/README.md index f9d23d22e6..cc99498e81 100644 --- a/core/README.md +++ b/core/README.md @@ -1,9 +1,9 @@ -The core module contains the core Geonetwork classes. For example SearchManager for searching the metadata index, DataManager for saving +The core module contains the core Geonetwork classes. For example, EsSearchManager for searching the metadata index, DataManager for saving and loading Metadata. -Services, Harvesters, etc... that are are plugins will usually depend on core and will make use of these core classes to implement their +Services, Harvesters, etc... that are plugins will usually depend on core and will make use of these core classes to implement their services. -Geonetwork is wired together via Spring-Dependency-Injection. The critical classes (DataManager, SchemaManager, SearchManager, etc...) are +Geonetwork is wired together via Spring-Dependency-Injection. The critical classes (DataManager, SchemaManager, EsSearchManager, etc...) are all singleton beans in the application context and can be either injected into other beans or obtained via the ServiceContext.getBean -method (or ServiceContext.getApplicationContext()). \ No newline at end of file +method (or ServiceContext.getApplicationContext()). diff --git a/core/pom.xml b/core/pom.xml index 737a015171..c961a0fb62 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -27,13 +27,13 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-core GeoNetwork core - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/core/src/main/java/org/fao/geonet/kernel/AbstractSchematronValidator.java b/core/src/main/java/org/fao/geonet/kernel/AbstractSchematronValidator.java index 324895f4f4..d8ad4b2df5 100644 --- a/core/src/main/java/org/fao/geonet/kernel/AbstractSchematronValidator.java +++ b/core/src/main/java/org/fao/geonet/kernel/AbstractSchematronValidator.java @@ -47,7 +47,7 @@ public class AbstractSchematronValidator { protected void runSchematron(String lang, Path schemaDir, List validations, Element schemaTronXmlOut, - int metadataId, Element md, ApplicableSchematron applicable) { + int metadataId, Element md, ApplicableSchematron applicable) { final ConfigurableApplicationContext applicationContext = ApplicationContextHolder.get(); ThesaurusManager thesaurusManager = applicationContext.getBean(ThesaurusManager.class); @@ -61,6 +61,9 @@ protected void runSchematron(String lang, Path schemaDir, List params = new HashMap(); params.put("lang", lang); @@ -74,28 +77,33 @@ protected void runSchematron(String lang, Path schemaDir, List i = xmlReport.getDescendants(new ElementFilter("fired-rule", Geonet.Namespaces.SVRL)); - int firedRules = Iterators.size(i); + firedRules = Iterators.size(i); i = xmlReport.getDescendants(new ElementFilter("failed-assert", Geonet.Namespaces.SVRL)); - int invalidRules = Iterators.size(i); + invalidRules = Iterators.size(i); - if (validations != null) { - validations.add(new MetadataValidation(). - setId(new MetadataValidationId(metadataId, ruleId)). - setStatus(invalidRules != 0 ? MetadataValidationStatus.INVALID : MetadataValidationStatus.VALID). - setRequired(requirement == SchematronRequirement.REQUIRED). - setNumTests(firedRules). - setNumFailures(invalidRules)); - - } + metadataValidationStatus = invalidRules != 0 ? MetadataValidationStatus.INVALID : MetadataValidationStatus.VALID; } } catch (Exception e) { Log.error(Geonet.DATA_MANAGER, "WARNING: schematron xslt " + ruleId + " failed", e); // If an error occurs that prevents to verify schematron rules, add to show in report Element errorReport = new Element("schematronVerificationError", Edit.NAMESPACE); - errorReport.addContent("Schematron error ocurred, rules could not be verified: " + e.getMessage()); + errorReport.addContent("Schematron error occurred, rules could not be verified: " + e.getMessage()); report.addContent(errorReport); + + // As the validation failed due to an exception lets identify the metadata as never validated. + metadataValidationStatus = MetadataValidationStatus.NEVER_CALCULATED; + } finally { + if (metadataValidationStatus != null && validations != null) { + validations.add(new MetadataValidation(). + setId(new MetadataValidationId(metadataId, ruleId)). + setStatus(metadataValidationStatus). + setRequired(requirement == SchematronRequirement.REQUIRED). + setNumTests(firedRules). + setNumFailures(invalidRules)); + + } } // -- append report to main XML report. diff --git a/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java b/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java index 35e346bb34..09b5c4faa4 100644 --- a/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java +++ b/core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java @@ -527,7 +527,11 @@ public void indexMetadata(final String metadataId, // TODO: Check if ignore INSPIRE validation? if (!type.equalsIgnoreCase("inspire")) { - if (status == MetadataValidationStatus.INVALID && vi.isRequired()) { + // If never validated and required then set status to never validated. + if (status == MetadataValidationStatus.NEVER_CALCULATED && vi.isRequired()) { + isValid = "-1"; + } + if (status == MetadataValidationStatus.INVALID && vi.isRequired() && isValid != "-1") { isValid = "0"; } } else { diff --git a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java index 746b9d8cc1..e07c3dfb48 100644 --- a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java +++ b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java @@ -153,7 +153,7 @@ public class EsSearchManager implements ISearchManager { .build(); FIELDLIST_RELATED_SCRIPTED = ImmutableMap.builder() - // ElasticSearch scripted field to get the first overview url. Scripted fields must return single values. + // Elasticsearch scripted field to get the first overview url. Scripted fields must return single values. .put("overview", "return params['_source'].overview == null ? [] : params['_source'].overview.stream().map(f -> f.url).findFirst().orElse('');") .build(); } diff --git a/core/src/main/java/org/fao/geonet/kernel/url/UrlChecker.java b/core/src/main/java/org/fao/geonet/kernel/url/UrlChecker.java index 71b0e12d6a..a9b65a6180 100644 --- a/core/src/main/java/org/fao/geonet/kernel/url/UrlChecker.java +++ b/core/src/main/java/org/fao/geonet/kernel/url/UrlChecker.java @@ -1,5 +1,5 @@ //============================================================================= -//=== Copyright (C) 2001-2019 Food and Agriculture Organization of the +//=== 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) //=== @@ -31,6 +31,7 @@ import org.fao.geonet.constants.Geonet; import org.fao.geonet.domain.LinkStatus; import org.fao.geonet.kernel.setting.SettingManager; +import org.fao.geonet.lib.Lib; import org.fao.geonet.lib.NetLib; import org.fao.geonet.utils.GeonetHttpRequestFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -149,8 +150,7 @@ public Void apply(@Nullable HttpClientBuilder originalConfig) { Log.info(Geonet.GEONETWORK,"UrlChecker: cannot determine hostname from url: "+url); } //now we have hostname, we can configure proxy - NetLib netLib = new NetLib(); - netLib.setupProxy(settingManager, originalConfig, hostname); + Lib.net.setupProxy(settingManager, originalConfig, hostname); return null; } }; diff --git a/core/src/main/java/org/fao/geonet/lib/NetLib.java b/core/src/main/java/org/fao/geonet/lib/NetLib.java index 353d49d596..6f1939a9ca 100644 --- a/core/src/main/java/org/fao/geonet/lib/NetLib.java +++ b/core/src/main/java/org/fao/geonet/lib/NetLib.java @@ -1,5 +1,5 @@ //============================================================================= -//=== Copyright (C) 2001-2022 Food and Agriculture Organization of the +//=== 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) //=== @@ -34,7 +34,6 @@ import org.fao.geonet.GeonetContext; import org.fao.geonet.constants.Geonet; import org.fao.geonet.kernel.setting.SettingManager; -import org.fao.geonet.kernel.setting.Settings; import org.fao.geonet.utils.Log; import org.fao.geonet.utils.XmlRequest; @@ -51,6 +50,18 @@ import jeeves.server.context.ServiceContext; public class NetLib { + private ProxyConfiguration proxyConfiguration; + + public ProxyConfiguration getProxyConfiguration() { + return proxyConfiguration; + } + + public NetLib() { + boolean isProxyConfiguredInSystemProperties = StringUtils.isNotBlank(System.getProperty(ProxyConfiguration.HTTP_PROXY_HOST)) || + StringUtils.isNotBlank(System.getProperty(ProxyConfiguration.HTTPS_PROXY_HOST)); + + proxyConfiguration = new ProxyConfiguration(isProxyConfiguredInSystemProperties); + } public void setupProxy(ServiceContext context, XmlRequest req) { GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); @@ -66,12 +77,14 @@ public void setupProxy(ServiceContext context, XmlRequest req) { */ public void setupProxy(SettingManager sm, XmlRequest req) { - boolean enabled = sm.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); - String host = sm.getValue(Settings.SYSTEM_PROXY_HOST); - String port = sm.getValue(Settings.SYSTEM_PROXY_PORT); - String username = sm.getValue(Settings.SYSTEM_PROXY_USERNAME); - String password = sm.getValue(Settings.SYSTEM_PROXY_PASSWORD); - String ignoreHostList = sm.getValue(Settings.SYSTEM_PROXY_IGNOREHOSTLIST); + proxyConfiguration.refresh(sm); + + boolean enabled = proxyConfiguration.isEnabled(); + String host = proxyConfiguration.getHost(); + String port = proxyConfiguration.getPort(); + String username = proxyConfiguration.getUsername(); + String password = proxyConfiguration.getPassword(); + String ignoreHostList = proxyConfiguration.getIgnoreHostList(); if (!enabled) { req.setUseProxy(false); @@ -108,12 +121,14 @@ public CredentialsProvider setupProxy(ServiceContext context, HttpClientBuilder * Setup proxy for http client */ public CredentialsProvider setupProxy(SettingManager sm, HttpClientBuilder client, String requestHost) { - boolean enabled = sm.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); - String host = sm.getValue(Settings.SYSTEM_PROXY_HOST); - String port = sm.getValue(Settings.SYSTEM_PROXY_PORT); - String username = sm.getValue(Settings.SYSTEM_PROXY_USERNAME); - String password = sm.getValue(Settings.SYSTEM_PROXY_PASSWORD); - String ignoreHostList = sm.getValue(Settings.SYSTEM_PROXY_IGNOREHOSTLIST); + proxyConfiguration.refresh(sm); + + boolean enabled = proxyConfiguration.isEnabled(); + String host = proxyConfiguration.getHost(); + String port = proxyConfiguration.getPort(); + String username = proxyConfiguration.getUsername(); + String password = proxyConfiguration.getPassword(); + String ignoreHostList = proxyConfiguration.getIgnoreHostList(); CredentialsProvider provider = new BasicCredentialsProvider(); if (enabled) { @@ -153,30 +168,34 @@ public void setupProxy(ServiceContext context) { * Setup proxy for http client */ public void setupProxy(SettingManager sm) { - boolean useProxy = sm.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); + proxyConfiguration.refresh(sm); - if (useProxy) { - String host = sm.getValue(Settings.SYSTEM_PROXY_HOST); - String port = sm.getValue(Settings.SYSTEM_PROXY_PORT); - String username = sm.getValue(Settings.SYSTEM_PROXY_USERNAME); - String ignoreHostList = sm.getValue(Settings.SYSTEM_PROXY_IGNOREHOSTLIST); + // If the proxy is configured in the system properties, + // ignore the proxy configuration in the system settings. + if (proxyConfiguration.isProxyConfiguredInSystemProperties()) return; + + if (proxyConfiguration.isEnabled()) { + String host = proxyConfiguration.getHost(); + String port = proxyConfiguration.getPort(); + String username = proxyConfiguration.getUsername(); + String ignoreHostList = proxyConfiguration.getIgnoreHostList(); Properties props = System.getProperties(); - props.put("http.proxyHost", host); - props.put("http.proxyPort", port); - props.put("https.proxyHost", host); - props.put("https.proxyPort", port); - props.put("http.nonProxyHosts", ignoreHostList); + props.put(ProxyConfiguration.HTTP_PROXY_HOST, host); + props.put(ProxyConfiguration.HTTP_PROXY_PORT, port); + props.put(ProxyConfiguration.HTTPS_PROXY_HOST, host); + props.put(ProxyConfiguration.HTTPS_PROXY_PORT, port); + props.put(ProxyConfiguration.HTTP_NON_PROXY_HOSTS, ignoreHostList); if (username.trim().length() > 0) { Log.error(Geonet.GEONETWORK, "Proxy credentials cannot be used"); } } else { - System.clearProperty("http.proxyHost"); - System.clearProperty("http.proxyPort"); - System.clearProperty("https.proxyHost"); - System.clearProperty("https.proxyPort"); - System.clearProperty("http.nonProxyHosts"); + System.clearProperty(ProxyConfiguration.HTTP_PROXY_HOST); + System.clearProperty(ProxyConfiguration.HTTP_PROXY_PORT); + System.clearProperty(ProxyConfiguration.HTTPS_PROXY_HOST); + System.clearProperty(ProxyConfiguration.HTTPS_PROXY_PORT); + System.clearProperty(ProxyConfiguration.HTTP_NON_PROXY_HOSTS); } } @@ -189,12 +208,14 @@ public URLConnection setupProxy(ServiceContext context, URL url) throws IOExcept GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME); SettingManager sm = gc.getBean(SettingManager.class); - boolean enabled = sm.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); - String host = sm.getValue(Settings.SYSTEM_PROXY_HOST); - String port = sm.getValue(Settings.SYSTEM_PROXY_PORT); - String username = sm.getValue(Settings.SYSTEM_PROXY_USERNAME); - String password = sm.getValue(Settings.SYSTEM_PROXY_PASSWORD); - String ignoreHostList = sm.getValue(Settings.SYSTEM_PROXY_IGNOREHOSTLIST); + proxyConfiguration.refresh(sm); + + boolean enabled = proxyConfiguration.isEnabled(); + String host = proxyConfiguration.getHost(); + String port = proxyConfiguration.getPort(); + String username = proxyConfiguration.getUsername(); + String password = proxyConfiguration.getPassword(); + String ignoreHostList = proxyConfiguration.getIgnoreHostList(); URLConnection conn = null; if (enabled) { diff --git a/core/src/main/java/org/fao/geonet/lib/ProxyConfiguration.java b/core/src/main/java/org/fao/geonet/lib/ProxyConfiguration.java new file mode 100644 index 0000000000..8454a8caab --- /dev/null +++ b/core/src/main/java/org/fao/geonet/lib/ProxyConfiguration.java @@ -0,0 +1,138 @@ +//============================================================================= +//=== 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: geonetwork@osgeo.org +//============================================================================== + +package org.fao.geonet.lib; + +import org.apache.commons.lang.StringUtils; +import org.fao.geonet.kernel.setting.SettingManager; +import org.fao.geonet.kernel.setting.Settings; + +/** + * Class to abstract the http proxy configuration from Java system properties or GeoNetwork configuration. + */ +public class ProxyConfiguration { + // HTTP Proxy host + public static final String HTTP_PROXY_HOST = "http.proxyHost"; + + // HTTP Proxy port + public static final String HTTP_PROXY_PORT = "http.proxyPort"; + + // HTTP Proxy username + public static final String HTTP_PROXY_USERNAME = "http.proxyUser"; + + // HTTP Proxy password + public static final String HTTP_PROXY_PASSWORD = "http.proxyPassword"; + + // HTTPS Proxy host + public static final String HTTPS_PROXY_HOST = "https.proxyHost"; + + // HTTPS Proxy port + public static final String HTTPS_PROXY_PORT = "https.proxyPort"; + + // HTTPS Proxy username + public static final String HTTPS_PROXY_USERNAME = "https.proxyUser"; + + // HTTPS Proxy password + public static final String HTTPS_PROXY_PASSWORD = "https.proxyPassword"; + + // HTTP Non-Proxy Hosts + public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts"; + + private boolean enabled = false; + + private boolean isProxyConfiguredInSystemProperties = false; + private String host; + private String port; + private String username; + private String password; + private String ignoreHostList; + + public boolean isEnabled() { + return enabled; + } + + public boolean isProxyConfiguredInSystemProperties() { + return isProxyConfiguredInSystemProperties; + } + + public String getHost() { + return host; + } + + public String getPort() { + return port; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + public String getIgnoreHostList() { + return ignoreHostList; + } + + public ProxyConfiguration(boolean isProxyConfiguredInSystemProperties) { + this.isProxyConfiguredInSystemProperties = isProxyConfiguredInSystemProperties; + if (this.isProxyConfiguredInSystemProperties) { + this.enabled = true; + } + } + + public void refresh(SettingManager settingManager) { + this.enabled = this.isProxyConfiguredInSystemProperties || + settingManager.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); + + if (this.enabled) { + if (this.isProxyConfiguredInSystemProperties) { + if (StringUtils.isNotBlank(System.getProperty(ProxyConfiguration.HTTPS_PROXY_HOST))) { + this.host = System.getProperty(ProxyConfiguration.HTTPS_PROXY_HOST); + this.port = System.getProperty(ProxyConfiguration.HTTPS_PROXY_PORT); + this.username = System.getProperty(ProxyConfiguration.HTTPS_PROXY_USERNAME, ""); + this.password = System.getProperty(ProxyConfiguration.HTTPS_PROXY_PASSWORD, ""); + } else { + this.host = System.getProperty(ProxyConfiguration.HTTP_PROXY_HOST); + this.port = System.getProperty(ProxyConfiguration.HTTP_PROXY_PORT); + this.username = System.getProperty(ProxyConfiguration.HTTP_PROXY_USERNAME, ""); + this.password = System.getProperty(ProxyConfiguration.HTTP_PROXY_PASSWORD, ""); + } + + // Escape characters for regular expression matching + this.ignoreHostList = System.getProperty(ProxyConfiguration.HTTP_NON_PROXY_HOSTS, "") + .replace("\\.", "\\\\.") + .replace("\\*", "\\.\\*"); + + } else { + this.host = settingManager.getValue(Settings.SYSTEM_PROXY_HOST); + this.port = settingManager.getValue(Settings.SYSTEM_PROXY_PORT); + this.username = settingManager.getValue(Settings.SYSTEM_PROXY_USERNAME); + this.password = settingManager.getValue(Settings.SYSTEM_PROXY_PASSWORD); + this.ignoreHostList = settingManager.getValue(Settings.SYSTEM_PROXY_IGNOREHOSTLIST); + + } + } + } +} diff --git a/core/src/main/java/org/fao/geonet/util/UserUtil.java b/core/src/main/java/org/fao/geonet/util/UserUtil.java index 0a9e2f8e79..a0c790c08b 100644 --- a/core/src/main/java/org/fao/geonet/util/UserUtil.java +++ b/core/src/main/java/org/fao/geonet/util/UserUtil.java @@ -22,6 +22,11 @@ */ package org.fao.geonet.util; +import jeeves.server.UserSession; +import org.apache.commons.lang.StringUtils; +import org.fao.geonet.api.exception.NotAllowedException; +import org.fao.geonet.domain.Profile; +import org.fao.geonet.kernel.setting.SettingManager; import org.springframework.security.access.hierarchicalroles.RoleHierarchy; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; @@ -55,4 +60,27 @@ public static boolean hasHierarchyRole(String role, RoleHierarchy roleHierarchy) return false; } + /** + * Checks if the user session's profile is allowed to do the transaction + * + * @param userSession current user session + * @param settingManager setting manager bean + * @param roleHierarchy role hierarchy bean + * @param settingConfigPath setting config path check org.fao.geonet.kernel.setting.Settings + * @param defaultProfile default configuration profile is no configuration found + * @param errorText error text to the exception + */ + public static void checkUserProfileLevel(UserSession userSession, SettingManager settingManager, RoleHierarchy roleHierarchy, String settingConfigPath, Profile defaultProfile, String errorText) { + if (userSession.getProfile() != Profile.Administrator) { + String allowedUserProfileFromConfiguration = + StringUtils.defaultIfBlank(settingManager.getValue(settingConfigPath), defaultProfile.toString()); + + // Is the user profile higher than the configuration profile allowed to do the transaction? + if (!UserUtil.hasHierarchyRole(allowedUserProfileFromConfiguration, roleHierarchy)) { + throw new NotAllowedException("The user has no permissions to " + errorText); + } + } + + } + } diff --git a/core/src/main/java/org/geonetwork/http/SessionTimeoutCookieFilter.java b/core/src/main/java/org/geonetwork/http/SessionTimeoutCookieFilter.java index 21a2227667..09cba97a0a 100644 --- a/core/src/main/java/org/geonetwork/http/SessionTimeoutCookieFilter.java +++ b/core/src/main/java/org/geonetwork/http/SessionTimeoutCookieFilter.java @@ -24,8 +24,6 @@ package org.geonetwork.http; import java.io.IOException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; @@ -40,7 +38,6 @@ import org.apache.commons.lang.StringUtils; import jeeves.server.UserSession; -import jeeves.server.dispatchers.ServiceManager; import jeeves.server.sources.http.JeevesServlet; /** @@ -64,18 +61,20 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filte if (session != null) { long currTime = System.currentTimeMillis(); + String cookiePath = StringUtils.isBlank(httpReq.getContextPath()) ? "/" : httpReq.getContextPath(); + Cookie cookie = new Cookie("serverTime", "" + currTime); - cookie.setPath(httpReq.getContextPath()); + cookie.setPath(cookiePath); cookie.setSecure(req.getServletContext().getSessionCookieConfig().isSecure()); httpResp.addCookie(cookie); UserSession userSession = null; - if (session != null) { - Object tmp = session.getAttribute(JeevesServlet.USER_SESSION_ATTRIBUTE_KEY); - if (tmp instanceof UserSession) { - userSession = (UserSession) tmp; - } + + Object tmp = session.getAttribute(JeevesServlet.USER_SESSION_ATTRIBUTE_KEY); + if (tmp instanceof UserSession) { + userSession = (UserSession) tmp; } + // If user is authenticated, then set expiration time if (userSession != null && StringUtils.isNotEmpty(userSession.getName())) { long expiryTime = currTime + session.getMaxInactiveInterval() * 1000; @@ -83,7 +82,7 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filte } else { cookie = new Cookie("sessionExpiry", "" + currTime); } - cookie.setPath(httpReq.getContextPath()); + cookie.setPath(cookiePath); cookie.setSecure(req.getServletContext().getSessionCookieConfig().isSecure()); httpResp.addCookie(cookie); } diff --git a/core/src/test/java/org/fao/geonet/kernel/ElasticSearchIndexingTest.java b/core/src/test/java/org/fao/geonet/kernel/ElasticsearchIndexingTest.java similarity index 97% rename from core/src/test/java/org/fao/geonet/kernel/ElasticSearchIndexingTest.java rename to core/src/test/java/org/fao/geonet/kernel/ElasticsearchIndexingTest.java index 085ac3922d..6170271f79 100644 --- a/core/src/test/java/org/fao/geonet/kernel/ElasticSearchIndexingTest.java +++ b/core/src/test/java/org/fao/geonet/kernel/ElasticsearchIndexingTest.java @@ -17,7 +17,7 @@ import java.util.Objects; import static org.junit.Assert.*; -public class ElasticSearchIndexingTest extends AbstractIntegrationTestWithMockedSingletons { +public class ElasticsearchIndexingTest extends AbstractIntegrationTestWithMockedSingletons { @Autowired private EsSearchManager searchManager; diff --git a/csw-server/pom.xml b/csw-server/pom.xml index ae4c6bd4ab..da85389728 100644 --- a/csw-server/pom.xml +++ b/csw-server/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java index 08e2e24d97..e373081227 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java @@ -99,7 +99,7 @@ public class CswFilter2Es extends AbstractFilterVisitor { private boolean useFilter = true; - // Stack to build the ElasticSearch Query + // Stack to build the Elasticsearch Query Deque stack = new ArrayDeque(); private final String templateNot = " {\"bool\": {\n" + diff --git a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2EsTest.java b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2EsTest.java index fc0eee3c64..7170f4b437 100644 --- a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2EsTest.java +++ b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2EsTest.java @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; /** - * CswFilter2Es converts (XML-based) CSW queries into ElasticSearch queries. + * CswFilter2Es converts (XML-based) CSW queries into Elasticsearch queries. * These ES-queries are in JSON-notation. We do not want to test the resulting * JSON-String char-by-char as this is error-prone.
*

@@ -292,10 +292,10 @@ void assertFilterEquals(JsonNode expected, String actual) throws IOException { /** * Converts xml-string into OGC Filter expression using a specific filter - * version. This Filter is then finally converted to an ElasticSearch expression + * version. This Filter is then finally converted to an Elasticsearch expression * and checked against the expected output. * - * @param expected JsonNode representing the expected ElasticSearch + * @param expected JsonNode representing the expected Elasticsearch * query. * @param actual XML text of the OGC Filter. * @param filterSpecVersion see {@link FilterCapabilities} diff --git a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswSortBy2EsTest.java b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswSortBy2EsTest.java index 7036125f75..e233ed945a 100644 --- a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswSortBy2EsTest.java +++ b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswSortBy2EsTest.java @@ -43,7 +43,7 @@ import java.util.List; /** - * CswFilter2Es converts (XML-based) CSW queries into ElasticSearch queries. + * CswFilter2Es converts (XML-based) CSW queries into Elasticsearch queries. * These ES-queries are in JSON-notation. We do not want to test the resulting * JSON-String char-by-char as this is error-prone.
*

diff --git a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/EsJsonHelper.java b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/EsJsonHelper.java index 08b345f0ef..629247c882 100644 --- a/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/EsJsonHelper.java +++ b/csw-server/src/test/java/org/fao/geonet/kernel/csw/services/getrecords/es/EsJsonHelper.java @@ -31,7 +31,7 @@ import java.util.List; /** - * Tools to build up ElasticSearch JSON structures via Jackson. + * Tools to build up Elasticsearch JSON structures via Jackson. * * @author bhoefling * diff --git a/docs/changes4.2.7-0.txt b/docs/changes4.2.7-0.txt new file mode 100644 index 0000000000..2dc3e58b37 --- /dev/null +++ b/docs/changes4.2.7-0.txt @@ -0,0 +1,44 @@ +================================================================================ +=== +=== GeoNetwork 4.2.7: List of changes +=== +================================================================================ +- [BP] i18n / Transifex update. (#7505) +- [BP] Security / Jolokia update. (#7501) +- [BP] Don't override proxy configuration when saving the settings, if the http proxy is configured in Java system properties (#7325) +- [BP] Check http links in documentation (#7496) +- [BP] Add more db information to the site information page. (#7403) +- [BP] Update manual links to use https://docs.geonetwork-opensource.org/ (#7487) +- [BP] Change the structure of the MkDocs assets. Stylesheets and logos are moved to the `overrides` directory (#7429) +- [BP] Fix url link in full view. bracket ") " could be included in link (#7483) +- [BP] Batch edit access level for editor role (#7464) +- [BP] Fixed broken links and formatting in BUILDING.md (#7471) +- [BP] Editor / Remove extra space on mandatory add action (#7438) +- [BP] change label to "Access to the catalogue" (#7467) +- [BP] Remove exception class name from the error message (#6977) +- [BP] List styling for related records (#7442) +- [BP] Fix cookies path when deployed on root "/" context (#7446) +- [BP] Standard / Feature catalogues / Do not index empty codelist value (#7440) +- Update the links to documentation in the sofware development pages (4.2.x) (#7409) +- [BP] Fixed typos, formatting and numbering (#7430) +- [BP]Fix issue with canViewRecord when calling related api (#7373) +- [BP] Transifex updates (#7432) +- [BP] Fix exception handling from schematron validation so that it flags the metadata as invalid if there is an exception (#6978) +- [BP] Rename ElasticSearch to Elasticsearch (#7404) +- [BP] Sort the portals by label, not by name (identifier) (#7424) +- [BP] Metadata editor / ISO19115-3.2008 / Filter out metadata templates in the online resources dialog +- [BP] Fix system info when ES throw errors (#7413) +- [BP] Remove old password field for admins (#7417) +- [backport 4.2.x] Add documentation to GitHub workflows (#7415) +- [BP] Change the url the icon in the homepage is linking to (#7422) +- [BP] Fixed typos and updated SearchManager to EsSearchManager in core readme (#7418) +- [BP] Update the CONTRIBUTING guide to detail the steps, before merging the pull requests (#7419) +- [BP] Transifex updates +- [BP] Record view / fix double approved parameter in the metadata working copy page, for the buttons in the online resources panel. Related to #7248 (#7402) +- [BP] Doc / Fix list (#7401) +- [BP] Fixed typos in code_quality readme (#7407) +- Remove changelog for latest +- Use default mike settings to fix interaction between language chooser and versions +- Correct canical_version to stable +- Add 3.12.11 changelog and fix the display of the changelogs in the navigation bar (#7397) +- Doc / 4.4.0 / Add note about datastore changes (#7398) diff --git a/docs/manual/README.md b/docs/manual/README.md index 70e77432ce..67b9ce2ffc 100644 --- a/docs/manual/README.md +++ b/docs/manual/README.md @@ -100,38 +100,40 @@ If you are not familiar with python the mkdocs-material website has instructions We use ``mike`` for publishing to https://geonetwork.github.io using `.` version: -1. To deploy SNAPSHOT development docs from the `main` branch to website `gh-pages` branch: +1. To deploy docs from the `main` branch to website `gh-pages` branch: ```bash - mike deploy --push --update-aliases 4.4 devel + mike deploy --push --no-redirect --update-aliases 4.4 latest ``` 2. To deploy documentation for a new release: ```bash - mike deploy --push --update-aliases 4.2 stable + mike deploy --push --no-redirect --update-aliases 4.2 stable ``` - When starting a new branch you can make it the default: +3. When starting a new branch you can make it the default: ```bash mike set-default --push 4.2 ``` + + Hint: When starting a new branch update `overview/changelog/` navigation tree also. -3. To publish documentation for a maintenance release: +4. To publish documentation for a maintenance release: ```bash - mike deploy --push --update-aliases 3.12 maintenance + mike deploy --push --no-redirect --update-aliases 3.12 maintenance ``` -4. To show published versions: +5. To show published versions: ```bash mike list ``` -5. To preview things locally (uses your local ``gh-pages`` branch): +6. To preview things locally (uses your local ``gh-pages`` branch): ```bash mike serve diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/inspire-configuration.md b/docs/manual/docs/administrator-guide/configuring-the-catalog/inspire-configuration.md index ccc01ccf37..0dea7a3ce9 100644 --- a/docs/manual/docs/administrator-guide/configuring-the-catalog/inspire-configuration.md +++ b/docs/manual/docs/administrator-guide/configuring-the-catalog/inspire-configuration.md @@ -14,7 +14,7 @@ To configure the discovery service, a dedicated service metadata record MUST be ## Loading INSPIRE codelists -To describe INSPIRE datasets and series, it is recommended to load relevant codelists from the [INSPIRE Registry](http://inspire.ec.europa.eu/registry/), the following codelists are relevant in the scope of metadata guidelines v2.0: +To describe INSPIRE datasets and series, it is recommended to load relevant codelists from the [INSPIRE Registry](https://inspire.ec.europa.eu/registry/), the following codelists are relevant in the scope of metadata guidelines v2.0: - [INSPIRE Theme](https://inspire.ec.europa.eu/theme) - [Application schema](https://inspire.ec.europa.eu/applicationschema) @@ -54,7 +54,7 @@ Via the schema plugin form configuration it is an option to configure a thesauru ## INSPIRE validation -INSPIRE validation of metadata records is available at [the INSPIRE Validator](https://inspire.ec.europa.eu/validator/about/). It is using [ETF which is an open source testing framework for spatial data and services](https://github.com/etf-validator/etf-webapp). GeoNetwork is able to `te` any record using a service provided by an instance of ETF. To configure remote validation, go to `Admin console` --> `Settings` and set the URL of the validator. The url of the main INSPIRE validator is `http://inspire.ec.europa.eu/validator/`. +INSPIRE validation of metadata records is available at [the INSPIRE Validator](https://inspire.ec.europa.eu/validator/about/). It is using [ETF which is an open source testing framework for spatial data and services](https://github.com/etf-validator/etf-webapp). GeoNetwork is able to `te` any record using a service provided by an instance of ETF. To configure remote validation, go to `Admin console` --> `Settings` and set the URL of the validator. The url of the main INSPIRE validator is `https://inspire.ec.europa.eu/validator/`. ![image](img/inspire-configuration.png) diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/map-server-configuration.md b/docs/manual/docs/administrator-guide/configuring-the-catalog/map-server-configuration.md index 661f091431..07924ce61f 100644 --- a/docs/manual/docs/administrator-guide/configuring-the-catalog/map-server-configuration.md +++ b/docs/manual/docs/administrator-guide/configuring-the-catalog/map-server-configuration.md @@ -2,8 +2,8 @@ To publish information from the catalog as OGC services (WMS, WFS, WCS), catalog administrator need to register one or more map servers to publish on. Map servers MUST support the GeoServer REST API in order to work with the catalog. The 2 following implementations have been tested: -- [GeoServer](http://geoserver.org) -- [Mapserver](http://mapserver.org) and [Mapserver REST API](https://github.com/neogeo-technologies/mra) +- [GeoServer](https://geoserver.org) +- [Mapserver](https://mapserver.org) and [Mapserver REST API](https://github.com/neogeo-technologies/mra) Setup you map server and then register it from the administration interface: diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/system-configuration.md b/docs/manual/docs/administrator-guide/configuring-the-catalog/system-configuration.md index 07ed71a556..37a665a169 100644 --- a/docs/manual/docs/administrator-guide/configuring-the-catalog/system-configuration.md +++ b/docs/manual/docs/administrator-guide/configuring-the-catalog/system-configuration.md @@ -151,7 +151,7 @@ See [Configuring for the INSPIRE Directive](inspire-configuration.md). ## INSPIRE Atom Feed -Allows to define the configuration of Atom Feeds referenced by the metadata to provide services related to the [INSPIRE technical guidance for download services](http://inspire.ec.europa.eu/documents/Network_Services/Technical_Guidance_Download_Services_3.0.pdf): +Allows to define the configuration of Atom Feeds referenced by the metadata to provide services related to the [INSPIRE technical guidance for download services](https://inspire.ec.europa.eu/documents/Network_Services/Technical_Guidance_Download_Services_3.0.pdf): - Select the type of atom feed: diff --git a/docs/manual/docs/administrator-guide/managing-classification-systems/managing-categories.md b/docs/manual/docs/administrator-guide/managing-classification-systems/managing-categories.md index bd2e32d439..6afc42ce6f 100644 --- a/docs/manual/docs/administrator-guide/managing-classification-systems/managing-categories.md +++ b/docs/manual/docs/administrator-guide/managing-classification-systems/managing-categories.md @@ -6,4 +6,4 @@ To assign a category to a metadata document. Go to the metadata modification for To modify the available categories in the catalog, from the admin page, open the "classification systems" and then the "category" tab. -Note: If you add or modify categories, they may not obtain an appropriate icon. These icon are managed in `/catalog/style/gn_icons.less`. In this file category-classes are mapped to font-awesome variables that map to a certain [font-awesome icon](http://fontawesome.io). +Note: If you add or modify categories, they may not obtain an appropriate icon. These icon are managed in `/catalog/style/gn_icons.less`. In this file category-classes are mapped to font-awesome variables that map to a certain [font-awesome icon](https://fontawesome.io). diff --git a/docs/manual/docs/administrator-guide/managing-users-and-groups/authentication-mode.md b/docs/manual/docs/administrator-guide/managing-users-and-groups/authentication-mode.md index 3f0bd72b37..61b53c68e4 100644 --- a/docs/manual/docs/administrator-guide/managing-users-and-groups/authentication-mode.md +++ b/docs/manual/docs/administrator-guide/managing-users-and-groups/authentication-mode.md @@ -96,7 +96,7 @@ In order to define which groups the user is member of and which profile is the u ``` text ldapUserContextMapper.mapping[privilege]=groups,sample # If not set, the default profile is RegisteredUser -# Valid profiles are http://geonetwork-opensource.org/manuals/trunk/eng/developer/apidocs/geonetwork/org/fao/geonet/constants/Geonet.Profile.html +# Valid profiles are ADMINISTRATOR, USER_ADMIN, REVIEWER, EDITOR, REGISTERED_USER, GUEST ldapUserContextMapper.mapping[profile]=privileges,RegisteredUser ``` diff --git a/docs/manual/docs/annexes/standards/iso19115-3.2018.md b/docs/manual/docs/annexes/standards/iso19115-3.2018.md index ff46740884..baaabc077f 100644 --- a/docs/manual/docs/annexes/standards/iso19115-3.2018.md +++ b/docs/manual/docs/annexes/standards/iso19115-3.2018.md @@ -12,13 +12,13 @@ This schema also includes: More information: -- [Using the latest ISO Standard for Geographic Information (ISO19115-1) for an INSPIRE Discovery Service](http://cnig.gouv.fr/wp-content/uploads/2015/06/titellus_fx_prunayre_iso19115-3_inspire2015.pdf) +- [Using the latest ISO Standard for Geographic Information (ISO19115-1) for an INSPIRE Discovery Service](https://www.iso.org/standard/53798.html) -This standard is maintained on and is available by default in GeoNetwork 3.8+. The TC211 is maintaining the XSD for this standard on . +This standard is maintained on and is available by default in GeoNetwork. The TC211 is maintaining the XSD for this standard on . Example of catalogues using this standard: -- [Metawal - Catalogue pour l'information géographique de Wallonie](http://metawal.wallonie.be/) is using ISO19115-3 as the default standard for all records. Main advantages are: categorizations of related documents (eg. online sources, DQ reports, GIS styles, Data models), better description of organization / parties and roles, remain compliant to the INSPIRE directive by converting to ISO19139 through CSW. +- [Metawal - Catalogue pour l'information géographique de Wallonie](https://metawal.wallonie.be/) is using ISO19115-3 as the default standard for all records. Main advantages are: categorizations of related documents (eg. online sources, DQ reports, GIS styles, Data models), better description of organization / parties and roles, remain compliant to the INSPIRE directive by converting to ISO19139 through CSW. ![](img/metawal-tramedesaxes.png) diff --git a/docs/manual/docs/help/index.md b/docs/manual/docs/help/index.md index 4311e71766..70324d5ce0 100644 --- a/docs/manual/docs/help/index.md +++ b/docs/manual/docs/help/index.md @@ -12,4 +12,4 @@ GeoNetwork is a catalog application to manage spatially referenced resources. It [GeoNetwork Manual](https://docs.geonetwork-opensource.org/4.2) - [GeoNetwork opensource](http://geonetwork-opensource.org) + [GeoNetwork opensource](https://geonetwork-opensource.org) diff --git a/docs/manual/docs/index.fr.md b/docs/manual/docs/index.fr.md index 5b83b12bb3..214738778a 100644 --- a/docs/manual/docs/index.fr.md +++ b/docs/manual/docs/index.fr.md @@ -3,7 +3,7 @@ hide: - navigation --- -# GeoNetwork {#toc} +# GeoNetwork 4.2 {#toc} Bienvenue à GeoNetwork. Cette documentation est organisée en guides spécifiques destinés à différents publics. diff --git a/docs/manual/docs/index.md b/docs/manual/docs/index.md index 53566091e5..cb1595f866 100644 --- a/docs/manual/docs/index.md +++ b/docs/manual/docs/index.md @@ -3,7 +3,7 @@ hide: - navigation --- -# GeoNetwork {#toc} +# GeoNetwork 4.2 {#toc} Welcome to GeoNetwork. This documentation is organized into specific guides targeting different audience. diff --git a/docs/manual/docs/install-guide/configuring-database.md b/docs/manual/docs/install-guide/configuring-database.md index acc4ba9122..213aedc937 100644 --- a/docs/manual/docs/install-guide/configuring-database.md +++ b/docs/manual/docs/install-guide/configuring-database.md @@ -6,7 +6,7 @@ GeoNetwork uses a database to persist aspects such as metadata records, privileg ## H2 database -By default, a [H2](http://www.h2database.com/html/main.html) database is configured and created when the application first starts. The H2 database named `gn.h2.db` is created: +By default, a [H2](https://www.h2database.com/html/main.html) database is configured and created when the application first starts. The H2 database named `gn.h2.db` is created: - In the **`jetty`** folder of the GeoNetwork application folder when using the [ZIP distribution](installing-from-zip.md). - In the **`bin`** folder of Tomcat when deploying the [WAR](installing-from-war-file.md) on Tomcat (started using `startup.sh`). diff --git a/docs/manual/docs/install-guide/installing-from-source-code.md b/docs/manual/docs/install-guide/installing-from-source-code.md index f73c43c0e4..7e10862520 100644 --- a/docs/manual/docs/install-guide/installing-from-source-code.md +++ b/docs/manual/docs/install-guide/installing-from-source-code.md @@ -4,7 +4,7 @@ ### Java 8 -GeoNetwork is a Java 8 application that runs as a servlet, which means that a Java Development Kit (JDK) must be installed in order to build and run it. You can get a Java 8 JDK from your Linux distribution, [Oracle OpenJDK](http://openjdk.java.net/) or [AdoptOpenJDK](https://adoptopenjdk.net). Please note that the Java 8 [Oracle JDK](http://www.oracle.com/technetwork/java/javase/downloads) is currently only being distributed for testing purposes. +GeoNetwork is a Java 8 application that runs as a servlet, which means that a Java Development Kit (JDK) must be installed in order to build and run it. You can get a Java 8 JDK from your Linux distribution, [OpenJDK](https://openjdk.java.net/) or [AdoptOpenJDK](https://adoptopenjdk.net). Please note that the Java 8 [Oracle JDK](https://www.oracle.com/es/java/technologies/javase/javase8-archive-downloads.html) is currently only being distributed for testing purposes. Because GeoNetwork is developed with Java 8 (LTS), this has the following implications: @@ -21,12 +21,14 @@ Because GeoNetwork is developed with Java 8 (LTS), this has the following implic Next, you need a servlet container. GeoNetwork ships with an embedded container, [Eclipse Jetty](https://www.eclipse.org/jetty/), which is fast and well-suited for most applications. -If you need a more powerful container, we recommend [Apache Tomcat](http://tomcat.apache.org). Tomcat provides load balancing, fault tolerance and other production features. Apache Tomcat is widely used with many organizations standardizing on Tomcat for all their Java Web Applications. +We highly recommend [Apache Tomcat](https://tomcat.apache.org). Apache Tomcat provides load balancing, fault tolerance and other production features. Apache Tomcat is widely used with many organizations as a standardized environment for all their Java Web Applications. We recommend the following stable releases of Tomcat: -- Apache Tomcat 8.5 - Apache Tomcat 9.0 +- Apache Tomcat 8.5 + +GeoNetwork cannot use the newer versions of Apache Tomcat 10 which are based on the Jakarata Enterprise Edition web application standard. ### Database @@ -50,10 +52,10 @@ The software runs in different ways depending on the servlet container you are u The following tools are required to be installed to setup a development environment for GeoNetwork: - **Java 8** - Developing with GeoNetwork requires Java Development Kit (JDK) 1.8. -- **Maven** 3.1.0+ - GeoNetwork uses [Maven](http://maven.apache.org/) 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](https://github.com/geonetwork/core-geonetwork). Depending on your operating system a variety of Git clients are available. Please check the Git website for some [alternatives](http://git-scm.com/downloads/guis) and good [documentation](http://git-scm.com/documentation). More documentation can be found on the [Github website](https://help.github.com/). -- **Ant** - GeoNetwork uses [Ant](http://ant.apache.org/) 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 build the GeoNetwork documentation in a nice format, [Sphinx](https://www.sphinx-doc.org/) is used. Please note that if you don't have a Python interpreter on your system, Sphinx will not work, so you need to install [Python](https://www.python.org/downloads/). +- **Maven** 3.1.0+ - GeoNetwork uses [Maven](https://maven.apache.org/) 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](https://github.com/geonetwork/core-geonetwork). Depending on your operating system a variety of Git clients are available. Please check the Git website for some [alternatives](https://git-scm.com/downloads/guis) and good [documentation](https://git-scm.com/documentation). More documentation can be found on the [Github website](https://help.github.com/). +- **Ant** - GeoNetwork uses [Ant](https://ant.apache.org/) 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). +- **mkdocs** - To build the GeoNetwork documentation in a nice format, [mkdocs](https://www.mkdocs.org) is used. Please note that if you don't have a Python interpreter on your system, Sphinx will not work, so you need to install [Python](https://www.python.org/downloads/). ## Building & Running @@ -160,11 +162,11 @@ $ mvn install -o $ mvn install -o -DskipTests -T 2C ``` -Please refer to the [Maven documentation](http://www.sonatype.com/books/mvnref-book/reference/public-book.html) for any other options. +Please refer to the [Maven documentation](https://www.sonatype.com/books/mvnref-book/reference/public-book.html) for any other options. ### Run embedded Jetty server -Maven comes with built-in support for Jetty via a [plug-in](http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin). +Maven comes with built-in support for Jetty via a [plug-in](https://eclipse.dev/jetty/documentation/jetty-9/index.html#maven-and-jetty). To run GeoNetwork with the embedded Jetty server you have to change directory to the root of the **web** module, and then execute the following Maven command: @@ -172,10 +174,10 @@ To run GeoNetwork with the embedded Jetty server you have to change directory to mvn jetty:run -Penv-dev ``` -After a while, GeoNetwork should be accessible at: +After some moments of startup and initialization, GeoNetwork is available at: For changes related to the user interface in the ``web-ui`` module or the metadata schemas in the `as` module, these can be deployed in Jetty executing the following Maven command in the **web** module: ``` shell -mvn process-resources +mvn process-resources -DschemasCopy=true ``` diff --git a/docs/manual/docs/install-guide/installing-from-war-file.md b/docs/manual/docs/install-guide/installing-from-war-file.md index 5d598bc6cf..5d6b83e542 100644 --- a/docs/manual/docs/install-guide/installing-from-war-file.md +++ b/docs/manual/docs/install-guide/installing-from-war-file.md @@ -6,11 +6,16 @@ At the end of the installation process you will end up with the web applications Host ports requirements: -- Java web server [Apache Tomcat](http://tomcat.apache.org/) or [Jetty](https://www.eclipse.org/jetty/): 8080 -- [ElasticSearch](https://www.elastic.co/elasticsearch/): 9200 +- Java web server [Apache Tomcat](https://tomcat.apache.org/) or [Jetty](https://www.eclipse.org/jetty/): 8080 +- [Elasticsearch](https://www.elastic.co/elasticsearch/): 9200 - [Kibana](https://www.elastic.co/kibana/): 5601 - Database eg. 5432 for a default [PostgreSQL](https://www.postgresql.org/) installation + +For [Apache Tomcat](https://tomcat.apache.org/) we recommend the following versions: 8.5.x and 9.0.x. The latest Apache Tomcat 10.x cannot be used at this time. + +For [Jetty](https://www.eclipse.org/jetty/) we the following versions: 9.4.x. Newer versions to Jetty cannot be used at this time. + 1. Download the WAR file GeoNetwork releases are available in diff --git a/docs/manual/docs/maintainer-guide/statistics/index.md b/docs/manual/docs/maintainer-guide/statistics/index.md index 0784a301bd..fa8a507097 100644 --- a/docs/manual/docs/maintainer-guide/statistics/index.md +++ b/docs/manual/docs/maintainer-guide/statistics/index.md @@ -1,16 +1,16 @@ # Setting up search/content statistics {#statistics} -Since GeoNetwork 3.4 search and content statistics are stored in [ElasticSearch](https://www.elastic.co/products/elasticsearch/) using [Kibana](https://www.elastic.co/products/kibana) dashboards to visualize them in the GeoNetwork administration application. +Since GeoNetwork 3.4 search and content statistics are stored in [Elasticsearch](https://www.elastic.co/products/elasticsearch/) using [Kibana](https://www.elastic.co/products/kibana) dashboards to visualize them in the GeoNetwork administration application. -This guide describes the configuration required to integrate ElasticSearch/Kibana in GeoNetwork to store and visualize the search and content statistics. +This guide describes the configuration required to integrate Elasticsearch/Kibana in GeoNetwork to store and visualize the search and content statistics. -GeoNetwork 3.8.x supports ElasticSearch/Kibana 7.2, other versions may not work properly. +GeoNetwork 3.8.x supports Elasticsearch/Kibana 7.2, other versions may not work properly. !!! note - This guide doesn't provide a production level setup for ElasticSearch/Kibana. Please refer to the ElasticSearch/Kibana documentation to do a proper setup/configuration for a production environment. + This guide doesn't provide a production level setup for Elasticsearch/Kibana. Please refer to the Elasticsearch/Kibana documentation to do a proper setup/configuration for a production environment. -- [Setup ElasticSearch](setup-elasticsearch.md) +- [Setup Elasticsearch](setup-elasticsearch.md) - [Setup Kibana](setup-kibana.md) - [Setup GeoNetwork](setup-geonetwork.md) diff --git a/docs/manual/docs/maintainer-guide/statistics/setup-elasticsearch.md b/docs/manual/docs/maintainer-guide/statistics/setup-elasticsearch.md index 819983cfd8..cdc8074bb9 100644 --- a/docs/manual/docs/maintainer-guide/statistics/setup-elasticsearch.md +++ b/docs/manual/docs/maintainer-guide/statistics/setup-elasticsearch.md @@ -1,19 +1,19 @@ -# Setup ElasticSearch {#statistics_es} +# Setup Elasticsearch {#statistics_es} -This section describes how to setup ElasticSearch to be used in GeoNetwork to store the search/content statistics. Note that Geonetwork must have been built with the `es` profile for ElasticSearch to be used. See for details. +This section describes how to setup Elasticsearch to be used in GeoNetwork to store the search/content statistics. Note that Geonetwork must have been built with the `es` profile for Elasticsearch to be used. See for details. ## Installation -ElasticSearch can be installed manually, or for some operating systems packages are available. +Elasticsearch can be installed manually, or for some operating systems packages are available. !!! note - If installed manually, ElasticSearch must be configured as a service to ensure it starts automatically when the server is started. This is beyond the scope of this guide. + If installed manually, Elasticsearch must be configured as a service to ensure it starts automatically when the server is started. This is beyond the scope of this guide. To install manually: -- Download ElasticSearch from . For Geonetwork 3.8.x version 7.2.x is recommended. +- Download Elasticsearch from . For Geonetwork 3.8.x version 7.2.x is recommended. - Unzip the file and copy it, for example, to ``/opt/elasticsearch`` @@ -24,7 +24,7 @@ To install manually: $ ./elasticsearch & ``` -- Verify in a browser that ElasticSearch is running: +- Verify in a browser that Elasticsearch is running: ## Load indexes diff --git a/docs/manual/docs/maintainer-guide/statistics/setup-geonetwork.md b/docs/manual/docs/maintainer-guide/statistics/setup-geonetwork.md index 0469681173..c23f21c8a3 100644 --- a/docs/manual/docs/maintainer-guide/statistics/setup-geonetwork.md +++ b/docs/manual/docs/maintainer-guide/statistics/setup-geonetwork.md @@ -2,7 +2,7 @@ !!! note - GeoNetwork package should be build using the Maven `es` profile in order to be able to configure the search/content statistics to use ElasticSearch/Kibana: + GeoNetwork package should be build using the Maven `es` profile in order to be able to configure the search/content statistics to use Elasticsearch/Kibana: ``` shell $ cd GN_SOURCES/ @@ -47,9 +47,9 @@ To setup the search/content statistics in GeoNetwork, do the following steps: ## Content statistics/validation -Content and validation status statistics are available also from to `us` in , but require to index manually the content in ElasticSearch. This will be improved in future versions. +Content and validation status statistics are available also from to `us` in , but require to index manually the content in Elasticsearch. This will be improved in future versions. -- To index the content and validation status in ElasticSearch, go to and select the following option: +- To index the content and validation status in Elasticsearch, go to and select the following option: ![](img/content-indexing.png) diff --git a/docs/manual/docs/overview/change-log/archive.md b/docs/manual/docs/overview/change-log/archive.md deleted file mode 100644 index 8b3e4106d9..0000000000 --- a/docs/manual/docs/overview/change-log/archive.md +++ /dev/null @@ -1,90 +0,0 @@ -# Archived - -The following series of GeoNetwork are no longer in active use and you are encouraged to migrate to a newer version. - -The GeoNetwork community is not large enough to maintain many active branches of GeoNetwork at one time. Older installations of GeoNetwork may be subject to disclosed security vulnerabilities resulting in our recommendation to update to the supported [stable](stable.md) or [maintenance](maintenance.md) series. - -Volunteers wishing to backport security fixes to older versions of GeoNetwork are welcome to do so. Commercial support providers are welcome to do so on behalf of their customers. - -## 4.0.x - -- [Version 4.0.6](version-4.0.6.md) -- [Version 4.0.5](version-4.0.5.md) -- [Version 4.0.4](version-4.0.4.md) -- [Version 4.0.3](version-4.0.3.md) -- [Version 4.0.2](version-4.0.2.md) -- [Version 4.0.1](version-4.0.1.md) -- [Version 4.0.0](version-4.0.0.md) -- [Version 4.0.0 Alpha.2](version-4.0.0-alpha.2.md) -- [Version 4.0.0 Alpha.1](version-4.0.0-alpha.1.md) - -## 3.10.x - -- [Version 3.10.10](version-3.10.10.md) -- [Version 3.10.9](version-3.10.9.md) -- [Version 3.10.8](version-3.10.8.md) -- [Version 3.10.7](version-3.10.7.md) -- [Version 3.10.6](version-3.10.6.md) -- [Version 3.10.5](version-3.10.5.md) -- [Version 3.10.4](version-3.10.4.md) -- [Version 3.10.3](version-3.10.3.md) -- [Version 3.10.2](version-3.10.2.md) -- [Version 3.10.1](version-3.10.1.md) -- [Version 3.10.0](version-3.10.0.md) -- [Version 3.8.3](version-3.8.3.md) -- [Version 3.8.2](version-3.8.2.md) -- [Version 3.8.1](version-3.8.1.md) -- [Version 3.8.0](version-3.8.0.md) -- [Version 3.6.0](version-3.6.0.md) -- [Version 3.4.4](version-3.4.4.md) -- [Version 3.4.3](version-3.4.3.md) -- [Version 3.4.2](version-3.4.2.md) -- [Version 3.4.1](version-3.4.1.md) -- [Version 3.4.0](version-3.4.0.md) -- [Version 3.2.2](version-3.2.2.md) -- [Version 3.2.1](version-3.2.1.md) -- [Version 3.2.0](version-3.2.0.md) -- [Version 3.0.4](version-3.0.4.md) -- [Version 3.0.3](version-3.0.3.md) -- [Version 3.0.2](version-3.0.2.md) -- [Version 3.0.1](version-3.0.1.md) -- [Version 3.0.0](version-3.0.0.md) - -## 3.8.x - -- [Version 3.8.3](version-3.8.3.md) -- [Version 3.8.2](version-3.8.2.md) -- [Version 3.8.1](version-3.8.1.md) -- [Version 3.8.0](version-3.8.0.md) - -## 3.6.x - -- [Version 3.6.0](version-3.6.0.md) - -## 3.4.x - -- [Version 3.4.4](version-3.4.4.md) -- [Version 3.4.3](version-3.4.3.md) -- [Version 3.4.2](version-3.4.2.md) -- [Version 3.4.1](version-3.4.1.md) -- [Version 3.4.0](version-3.4.0.md) - -## 3.2.x - -- [Version 3.2.2](version-3.2.2.md) -- [Version 3.2.1](version-3.2.1.md) -- [Version 3.2.0](version-3.2.0.md) - -## 3.0.x - -- [Version 3.0.4](version-3.0.4.md) -- [Version 3.0.3](version-3.0.3.md) -- [Version 3.0.2](version-3.0.2.md) -- [Version 3.0.1](version-3.0.1.md) -- [Version 3.0.0](version-3.0.0.md) - -## 2.10.x - -All development has ceased: - -* [User Manual v2.10.4-0](https://geonetwork-opensource.org/manuals/2.10.4/eng/users/index.html) diff --git a/docs/manual/docs/overview/change-log/archive/index.md b/docs/manual/docs/overview/change-log/archive/index.md new file mode 100644 index 0000000000..3c9dd91e5f --- /dev/null +++ b/docs/manual/docs/overview/change-log/archive/index.md @@ -0,0 +1,90 @@ +# Archived + +The following series of GeoNetwork are no longer in active use and you are encouraged to migrate to a newer version. + +The GeoNetwork community is not large enough to maintain many active branches of GeoNetwork at one time. Older installations of GeoNetwork may be subject to disclosed security vulnerabilities resulting in our recommendation to update to the supported [stable](../stable/index.md) or [maintenance](../maintenance/index.md) series. + +Volunteers wishing to backport security fixes to older versions of GeoNetwork are welcome to do so. Commercial support providers are welcome to do so on behalf of their customers. + +## 4.0.x + +- [Version 4.0.6](../version-4.0.6.md) +- [Version 4.0.5](../version-4.0.5.md) +- [Version 4.0.4](../version-4.0.4.md) +- [Version 4.0.3](../version-4.0.3.md) +- [Version 4.0.2](../version-4.0.2.md) +- [Version 4.0.1](../version-4.0.1.md) +- [Version 4.0.0](../version-4.0.0.md) +- [Version 4.0.0 Alpha.2](../version-4.0.0-alpha.2.md) +- [Version 4.0.0 Alpha.1](../version-4.0.0-alpha.1.md) + +## 3.10.x + +- [Version 3.10.10](../version-3.10.10.md) +- [Version 3.10.9](../version-3.10.9.md) +- [Version 3.10.8](../version-3.10.8.md) +- [Version 3.10.7](../version-3.10.7.md) +- [Version 3.10.6](../version-3.10.6.md) +- [Version 3.10.5](../version-3.10.5.md) +- [Version 3.10.4](../version-3.10.4.md) +- [Version 3.10.3](../version-3.10.3.md) +- [Version 3.10.2](../version-3.10.2.md) +- [Version 3.10.1](../version-3.10.1.md) +- [Version 3.10.0](../version-3.10.0.md) +- [Version 3.8.3](../version-3.8.3.md) +- [Version 3.8.2](../version-3.8.2.md) +- [Version 3.8.1](../version-3.8.1.md) +- [Version 3.8.0](../version-3.8.0.md) +- [Version 3.6.0](../version-3.6.0.md) +- [Version 3.4.4](../version-3.4.4.md) +- [Version 3.4.3](../version-3.4.3.md) +- [Version 3.4.2](../version-3.4.2.md) +- [Version 3.4.1](../version-3.4.1.md) +- [Version 3.4.0](../version-3.4.0.md) +- [Version 3.2.2](../version-3.2.2.md) +- [Version 3.2.1](../version-3.2.1.md) +- [Version 3.2.0](../version-3.2.0.md) +- [Version 3.0.4](../version-3.0.4.md) +- [Version 3.0.3](../version-3.0.3.md) +- [Version 3.0.2](../version-3.0.2.md) +- [Version 3.0.1](../version-3.0.1.md) +- [Version 3.0.0](../version-3.0.0.md) + +## 3.8.x + +- [Version 3.8.3](../version-3.8.3.md) +- [Version 3.8.2](../version-3.8.2.md) +- [Version 3.8.1](../version-3.8.1.md) +- [Version 3.8.0](../version-3.8.0.md) + +## 3.6.x + +- [Version 3.6.0](../version-3.6.0.md) + +## 3.4.x + +- [Version 3.4.4](../version-3.4.4.md) +- [Version 3.4.3](../version-3.4.3.md) +- [Version 3.4.2](../version-3.4.2.md) +- [Version 3.4.1](../version-3.4.1.md) +- [Version 3.4.0](../version-3.4.0.md) + +## 3.2.x + +- [Version 3.2.2](../version-3.2.2.md) +- [Version 3.2.1](../version-3.2.1.md) +- [Version 3.2.0](../version-3.2.0.md) + +## 3.0.x + +- [Version 3.0.4](../version-3.0.4.md) +- [Version 3.0.3](../version-3.0.3.md) +- [Version 3.0.2](../version-3.0.2.md) +- [Version 3.0.1](../version-3.0.1.md) +- [Version 3.0.0](../version-3.0.0.md) + +## 2.10.x + +All development has ceased: + +* [User Manual v2.10.4-0](https://geonetwork-opensource.org/manuals/2.10.4/eng/users/index.html) diff --git a/docs/manual/docs/overview/change-log/index.md b/docs/manual/docs/overview/change-log/index.md index dccd206249..cf1072c0de 100644 --- a/docs/manual/docs/overview/change-log/index.md +++ b/docs/manual/docs/overview/change-log/index.md @@ -2,6 +2,6 @@ Notable changes made to a GeoNetwork-open source including new features, migration instructions, and bug fixes. -- [Stable](stable.md) -- [Maintenance](maintenance.md) -- [Archive](archive.md) +- [Stable](stable/index.md) +- [Maintenance](maintenance/index.md) +- [Archive](archive/index.md) diff --git a/docs/manual/docs/overview/change-log/maintenance.md b/docs/manual/docs/overview/change-log/maintenance.md deleted file mode 100644 index 7f28099786..0000000000 --- a/docs/manual/docs/overview/change-log/maintenance.md +++ /dev/null @@ -1,21 +0,0 @@ -# Maintenance - -The GeoNetwork 4.2.x series is stable and recommended for production use and new installations of GeoNetwork. -This series is under active use by our community, with regular improvements, documentation updates, bug reports, fixes, and releases. - -## Latest - -* [Version 3.12.10](version-3.12.10.md) - -## History - -* [Version 3.12.9](version-3.12.9.md) -* [Version 3.12.8](version-3.12.8.md) -* [Version 3.12.7](version-3.12.7.md) -* [Version 3.12.6](version-3.12.6.md) -* [Version 3.12.5](version-3.12.5.md) -* [Version 3.12.4](version-3.12.4.md) -* [Version 3.12.3](version-3.12.3.md) -* [Version 3.12.3](version-3.12.2.md) -* [Version 3.12.1](version-3.12.1.md) -* [Version 3.12.0](version-3.12.0.md) diff --git a/docs/manual/docs/overview/change-log/maintenance/index.md b/docs/manual/docs/overview/change-log/maintenance/index.md new file mode 100644 index 0000000000..a7939f7842 --- /dev/null +++ b/docs/manual/docs/overview/change-log/maintenance/index.md @@ -0,0 +1,22 @@ +# Maintenance + +The GeoNetwork 4.2.x series is stable and recommended for production use and new installations of GeoNetwork. +This series is under active use by our community, with regular improvements, documentation updates, bug reports, fixes, and releases. + +## Latest + +* [Version 3.12.11](../version-3.12.11.md) + +## History + +* [Version 3.12.10](../version-3.12.10.md) +* [Version 3.12.9](../version-3.12.9.md) +* [Version 3.12.8](../version-3.12.8.md) +* [Version 3.12.7](../version-3.12.7.md) +* [Version 3.12.6](../version-3.12.6.md) +* [Version 3.12.5](../version-3.12.5.md) +* [Version 3.12.4](../version-3.12.4.md) +* [Version 3.12.3](../version-3.12.3.md) +* [Version 3.12.3](../version-3.12.2.md) +* [Version 3.12.1](../version-3.12.1.md) +* [Version 3.12.0](../version-3.12.0.md) diff --git a/docs/manual/docs/overview/change-log/stable.md b/docs/manual/docs/overview/change-log/stable.md deleted file mode 100644 index bf06c17fde..0000000000 --- a/docs/manual/docs/overview/change-log/stable.md +++ /dev/null @@ -1,17 +0,0 @@ -# Stable - -The GeoNetwork 4.2.x series is stable and recommended for production use and new installations of GeoNetwork. -This series is under active use by our community, with regular improvements, documentation updates, bug reports, fixes, and releases. - -## Latest - -- [Version 4.2.6](version-4.2.6.md) -- [Version 4.2.5](version-4.2.5.md) - -## History - -- [Version 4.2.4](version-4.2.4.md) -- [Version 4.2.3](version-4.2.3.md) -- [Version 4.2.2](version-4.2.2.md) -- [Version 4.2.1](version-4.2.1.md) -- [Version 4.2.0](version-4.2.0.md) diff --git a/docs/manual/docs/overview/change-log/stable/index.md b/docs/manual/docs/overview/change-log/stable/index.md new file mode 100644 index 0000000000..7dd249e713 --- /dev/null +++ b/docs/manual/docs/overview/change-log/stable/index.md @@ -0,0 +1,19 @@ +# Stable + +The GeoNetwork 4.2.x series is stable and recommended for production use and new installations of GeoNetwork. +This series is under active use by our community, with regular improvements, documentation updates, bug reports, fixes, and releases. + +## Latest + +- [Version 4.2.7](../version-4.2.7.md) + + +## History + +- [Version 4.2.6](../version-4.2.6.md) +- [Version 4.2.5](../version-4.2.5.md) +- [Version 4.2.4](../version-4.2.4.md) +- [Version 4.2.3](../version-4.2.3.md) +- [Version 4.2.2](../version-4.2.2.md) +- [Version 4.2.1](../version-4.2.1.md) +- [Version 4.2.0](../version-4.2.0.md) diff --git a/docs/manual/docs/overview/change-log/version-3.0.1.md b/docs/manual/docs/overview/change-log/version-3.0.1.md index 2727fc04ca..0b14e2b17e 100644 --- a/docs/manual/docs/overview/change-log/version-3.0.1.md +++ b/docs/manual/docs/overview/change-log/version-3.0.1.md @@ -2,7 +2,7 @@ ## New features -- [Map viewer provides now 3D mode](https://github.com/geonetwork/core-geonetwork/pull/1012) using [Cesiumjs](http://cesiumjs.org/) +- [Map viewer provides now 3D mode](https://github.com/geonetwork/core-geonetwork/pull/1012) using [Cesiumjs](https://cesiumjs.org/) - Make your map in the visualization tools and [save your maps in the catalog](https://github.com/geonetwork/core-geonetwork/issues/1036) - [Spatial filter is now available on the minimap](https://github.com/geonetwork/core-geonetwork/issues/1051) - [Browse catalog by INSPIRE themes](https://github.com/geonetwork/core-geonetwork/issues/1054) and use the new [INSPIRE icon set](https://github.com/titellus/INSPIRE-themes-icons) diff --git a/docs/manual/docs/overview/change-log/version-3.12.11.md b/docs/manual/docs/overview/change-log/version-3.12.11.md new file mode 100644 index 0000000000..703c22d001 --- /dev/null +++ b/docs/manual/docs/overview/change-log/version-3.12.11.md @@ -0,0 +1,16 @@ +# Version 3.12.11 {#version-31211} + +## New features/fixes + +- Metadata + - [BP] [Fix working copy display so that links go to working copy](https://github.com/geonetwork/core-geonetwork/pull/7279) + - [BP] [Record view / Add support for emails with subdomains](https://github.com/geonetwork/core-geonetwork/pull/7314) + - [BP] [Batch Editing access level in general system settings](https://github.com/geonetwork/core-geonetwork/pull/7238) + +- Other + - [BP] [Fix `robots.txt` and sitemap 500 errors if no right content type is provided](https://github.com/geonetwork/core-geonetwork/pull/7327) + + +and more \... see [3.12.11 issues](https://github.com/geonetwork/core-geonetwork/issues?q=is%3Aissue+milestone%3A3.12.11+is%3Aclosed) and [pull requests](https://github.com/geonetwork/core-geonetwork/pulls?q=milestone%3A3.12.11+is%3Aclosed+is%3Apr) for full details. + +**Full Changelog**: [here](https://github.com/geonetwork/core-geonetwork/compare/3.12.10...3.12.11) diff --git a/docs/manual/docs/overview/change-log/version-3.2.0.md b/docs/manual/docs/overview/change-log/version-3.2.0.md index 3a826f4eff..177322705f 100644 --- a/docs/manual/docs/overview/change-log/version-3.2.0.md +++ b/docs/manual/docs/overview/change-log/version-3.2.0.md @@ -14,7 +14,7 @@ - Editor / XML view provides code editing with syntax highlighting and more, \... - Directories can be populated from catalog content - Metadata import improved (import by URL, import multiple files at once, better error reports) -- GeoServer updated to [version 2.9.0](http://geoserver.org/) +- GeoServer updated to [version 2.9.0](https://geoserver.org/) - Added schema.org tags for better indexing by search engine ## Removed features diff --git a/docs/manual/docs/overview/change-log/version-4.2.0.md b/docs/manual/docs/overview/change-log/version-4.2.0.md index 5b7112e494..28801a5925 100644 --- a/docs/manual/docs/overview/change-log/version-4.2.0.md +++ b/docs/manual/docs/overview/change-log/version-4.2.0.md @@ -9,7 +9,7 @@ Due to H2 database major update, when migrating from a previous version drop the - JS/CSS cache database in \$DATA_DIR/wro4j-cache.mv.db - Formatter cache database in \$DATA_DIR/data/resources/htmlcache/formatter-cache/info-store.mv.db -If using H2 as the main database consider migrating to an external database (see [Configuring the database](../../install-guide/configuring-database.md)) or read [H2 migration guide](http://www.h2database.com/html/migration-to-v2.html) and migrate the database to version 2 format. +If using H2 as the main database consider migrating to an external database (see [Configuring the database](../../install-guide/configuring-database.md)) or read [H2 migration guide](https://www.h2database.com/html/migration-to-v2.html) and migrate the database to version 2 format. Then start the application. diff --git a/docs/manual/docs/overview/change-log/version-4.2.6.md b/docs/manual/docs/overview/change-log/version-4.2.6.md index 827d5d095e..a6bbd57191 100644 --- a/docs/manual/docs/overview/change-log/version-4.2.6.md +++ b/docs/manual/docs/overview/change-log/version-4.2.6.md @@ -11,6 +11,7 @@ After update, don't forget to go to admin console --> tools --> Delete index and ## List of changes Major changes: + - [API / CSV export / Add support for custom export](https://github.com/geonetwork/core-geonetwork/pull/7132) - [Map / WFS Features / Improvements](https://github.com/geonetwork/core-geonetwork/pull/7000) diff --git a/docs/manual/docs/overview/change-log/version-4.2.7.md b/docs/manual/docs/overview/change-log/version-4.2.7.md new file mode 100644 index 0000000000..251365aeb4 --- /dev/null +++ b/docs/manual/docs/overview/change-log/version-4.2.7.md @@ -0,0 +1,14 @@ +# Version 4.2.7 {#version-427} + +GeoNetwork 4.2.7 release is a minor release. + +## List of changes + +Release highlights: + +- [Add more db information to the site information page](https://github.com/geonetwork/core-geonetwork/pull/7403) +- [Fix cookies path when deployed on root "/" context](https://github.com/geonetwork/core-geonetwork/pull/7446) +- [Security / Jolokia update](https://github.com/geonetwork/core-geonetwork/pull/7501) + + +and more \... see [4.2.7 issues](https://github.com/geonetwork/core-geonetwork/issues?q=is%3Aissue+milestone%3A4.2.6+is%3Aclosed) and [pull requests](https://github.com/geonetwork/core-geonetwork/pulls?page=3&q=is%3Apr+milestone%3A4.2.7+is%3Aclosed) for full details. diff --git a/docs/manual/docs/overview/index.md b/docs/manual/docs/overview/index.md index 1923ff9dda..cd91b9f0ac 100644 --- a/docs/manual/docs/overview/index.md +++ b/docs/manual/docs/overview/index.md @@ -1,6 +1,6 @@ # Overview -The GeoNetwork project started out in year 2001 as a Spatial Data Catalogue System for the Food and Agriculture organisation of the United Nations ([FAO](http://www.fao.org)), the United Nations World Food Programme ([WFP](http://www.wfp.org)) and the United Nations Environmental Programme ([UNEP](http://www.unep.org)). +The GeoNetwork project started out in year 2001 as a Spatial Data Catalogue System for the Food and Agriculture organisation of the United Nations ([FAO](https://www.fao.org)), the United Nations World Food Programme ([WFP](https://www.wfp.org)) and the United Nations Environmental Programme ([UNEP](https://www.unep.org)). The project is widely used as the foundation of Spatial Data Infrastructures world wide (See [gallery](../annexes/gallery/index.md)). diff --git a/docs/manual/docs/tutorials/inspire/download-atom.md b/docs/manual/docs/tutorials/inspire/download-atom.md index 5510c04eb9..41eeaa735f 100644 --- a/docs/manual/docs/tutorials/inspire/download-atom.md +++ b/docs/manual/docs/tutorials/inspire/download-atom.md @@ -1,8 +1,8 @@ # Setting up an Atom/OpenSearch based INSPIRE download service {#tuto-download-atom} -This tutorial shows how one can set up GeoNetwork to provide download services following [technical guidelines for download services](http://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). +This tutorial shows how one can set up GeoNetwork to provide download services following [technical guidelines for download services](https://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). -Note that the technical guidelines allow both Atom/OpenSearch as well as [WFS](http://www.opengeospatial.org/standards/wfs). This tutorial describes how to set up a download service using Atom/Opensearch. +Note that the technical guidelines allow both Atom/OpenSearch as well as [WFS](https://www.opengeospatial.org/standards/wfs). This tutorial describes how to set up a download service using Atom/Opensearch. The basics of Atom/OpenSearch is that for each dataset a number of file-downloads in various flavours (language/projection/format) is available. These flavours are advertised in a "Dataset Atom Feed" document. A set of "Dataset Atom Feed" documents is grouped into a "Service Atom Feed" document. For each "Service Atom Feed" document an OpenSearchDescription document is available. A website can refer to this OpenSearchDescription document, which enables searching through the download service using the browser search bar (OpenSearch). @@ -40,7 +40,7 @@ Currently only the external mode is fully supported. Atom files can be generated ``` -When deploying Geonetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire configuration](http://geonetwork-opensource.org/manuals/trunk/eng/users/administrator-guide/configuring-the-catalog/inspire-configuration.html). In this file "schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml " (and the same file in other languages in use in the catalogue) in the gmd:protocol helper (around line 2000) add the "INSPIRE-ATOM" protocol which is used to indicate links that link to an Atom file (only links having that protocol value will be ingested). +When deploying Geonetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire configuration](../../administrator-guide/configuring-the-catalog/inspire-configuration.md). In this file "schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml " (and the same file in other languages in use in the catalogue) in the gmd:protocol helper (around line 2000) add the "INSPIRE-ATOM" protocol which is used to indicate links that link to an Atom file (only links having that protocol value will be ingested). In Admin --> Settings activate the INSPIRE extension and activate Atom harvesting (at certain interval). The settings page facilitates to set a protocol which is used in metadata to indicate an Atom link. @@ -58,7 +58,7 @@ Before you validate the implementation, run the Atom harvester in admin --> sett ## Validate the implementation -If you are running the above setup online, you can use the [INSPIRE validator](http://inspire.ec.europa.eu/validator/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. +If you are running the above setup online, you can use the [INSPIRE validator](https://inspire.ec.europa.eu/validator/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. ![image](img/image_6.png) diff --git a/docs/manual/docs/tutorials/inspire/download-geoserver.md b/docs/manual/docs/tutorials/inspire/download-geoserver.md index c8af51b19c..a90a5ec13c 100644 --- a/docs/manual/docs/tutorials/inspire/download-geoserver.md +++ b/docs/manual/docs/tutorials/inspire/download-geoserver.md @@ -1,20 +1,20 @@ # Setting up a WFS based INSPIRE download service with GeoServer {#tuto-download-geoserver} -This tutorial shows how one can set up a combination of GeoNetwork and GeoServer to provide download services following [technical guidelines for download services](http://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). +This tutorial shows how one can set up a combination of GeoNetwork and GeoServer to provide download services following [technical guidelines for download services](https://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). -Note that the technical guidelines allow both Atom/OpenSearch as well as [WFS](http://www.opengeospatial.org/standards/wfs). This tutorial describes how to set up a download service using WFS. +Note that the technical guidelines allow both Atom/OpenSearch as well as [WFS](https://www.opengeospatial.org/standards/wfs). This tutorial describes how to set up a download service using WFS. ## GeoServer -To support the INSPIRE data models the geoserver ["appschema" plugin](http://docs.geoserver.org/stable/en/user/data/app-schema/) needs to be installed. Configuring appschema support in GeoServer is not the goal of this tutorial. Appschema support for INSPIRE is nicely documented by [Marcus Sen](https://data.gov.uk/sites/default/files/library/INSPIREWFSCookbook_v1.0.pdf). Another valuable resource is available at [geosolutions](http://www.geo-solutions.it/blog/inspire-support-in-geoserver-made-easy-with-hale/). In this tutorial we'll focus on metadata aspects of a WFS download service. +To support the INSPIRE data models the geoserver ["appschema" plugin](https://docs.geoserver.org/stable/en/user/data/app-schema/) needs to be installed. Configuring appschema support in GeoServer is not the goal of this tutorial. Appschema support for INSPIRE is nicely documented by [Marcus Sen](https://data.gov.uk/sites/default/files/library/INSPIREWFSCookbook_v1.0.pdf). Another valuable resource is available at [geosolutions](https://www.geo-solutions.it/blog/inspire-support-in-geoserver-made-easy-with-hale/). In this tutorial we'll focus on metadata aspects of a WFS download service. -Download and install GeoServer INSPIRE extension as documented in [installing inspire extension](http://docs.geoserver.org/latest/en/user/extensions/inspire/installing.html) +Download and install GeoServer INSPIRE extension as documented in [installing inspire extension](https://docs.geoserver.org/latest/en/user/extensions/inspire/using.html) Create at least one workspace per data model. On workspace properties activate "Settings" and set the selected service type (WFS). ![image](img/image_0.png) -On WFS settings, select the new workspace and fill out the form (keep service metadata url empty for now) as described in [using inspire extension](http://docs.geoserver.org/latest/en/user/extensions/inspire/using.html#inspire-using). If the new workspace is not in the pull down, return to previous step and make sure "Settings" is activated for the workspace. If the INSPIRE fields are not visible, make sure the INSPIRE extension is correctly installed. +On WFS settings, select the new workspace and fill out the form (keep service metadata url empty for now) as described in [using inspire extension](https://docs.geoserver.org/latest/en/user/extensions/inspire/using.html). If the new workspace is not in the pull down, return to previous step and make sure "Settings" is activated for the workspace. If the INSPIRE fields are not visible, make sure the INSPIRE extension is correctly installed. ![image](img/image_8.png) @@ -22,7 +22,7 @@ Create featuretypes according to the appschema documentation. ## GeoNetwork -When deploying GeoNetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire documentation](http://geonetwork-opensource.org/manuals/trunk/eng/users/administrator-guide/configuring-the-catalog/inspire-configuration.html). +When deploying GeoNetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire documentation](../../administrator-guide/configuring-the-catalog/inspire-configuration.md). In Admin --> Settings activate the INSPIRE extension. @@ -42,7 +42,7 @@ On the WFS-settings --> INSPIRE workspace add the link to the service metadata. ## Validate the implementation -If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](http://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. +If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](https://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. ![image](img/image_6.png) diff --git a/docs/manual/docs/tutorials/inspire/index.md b/docs/manual/docs/tutorials/inspire/index.md index 6c18ebd101..ba501e95d2 100644 --- a/docs/manual/docs/tutorials/inspire/index.md +++ b/docs/manual/docs/tutorials/inspire/index.md @@ -1,6 +1,6 @@ # Tutorials {#tutorials_inspire} -The tutorials in this section target specific GeoNetwork implementation scenarios related to the [European INSPIRE Directive](http://inspire.ec.europa.eu/). INSPIRE mandates European organisations to set up view- and download services and to describe them using metadata in discovery services. To respond to all aspects of the technical guidelines requires to compose an infrastructure of various components. For now we provide tutorials for view services in [mapserver](view-mapserver.md) and [geoserver](view-geoserver.md) and download services using [Atom](download-atom.md) and [Tutorial setting up a WFS based INSPIRE download service with GeoServer](download-geoserver.md). +The tutorials in this section target specific GeoNetwork implementation scenarios related to the [European INSPIRE Directive](https://inspire.ec.europa.eu/). INSPIRE mandates European organisations to set up view- and download services and to describe them using metadata in discovery services. To respond to all aspects of the technical guidelines requires to compose an infrastructure of various components. For now we provide tutorials for view services in [mapserver](view-mapserver.md) and [geoserver](view-geoserver.md) and download services using [Atom](download-atom.md) and [Tutorial setting up a WFS based INSPIRE download service with GeoServer](download-geoserver.md). - [Setting up INSPIRE view service with GeoNetwork and GeoServer](view-geoserver.md) - [Setting up INSPIRE view service with GeoNetwork and Mapserver](view-mapserver.md) diff --git a/docs/manual/docs/tutorials/inspire/view-geoserver.md b/docs/manual/docs/tutorials/inspire/view-geoserver.md index 7e6380bb13..49b560fc55 100644 --- a/docs/manual/docs/tutorials/inspire/view-geoserver.md +++ b/docs/manual/docs/tutorials/inspire/view-geoserver.md @@ -1,28 +1,28 @@ # Setting up INSPIRE view service with GeoNetwork and GeoServer {#tuto-view-geoserver} -This tutorial shows how one can set up a combination of GeoServer and GeoNetwork to provide view services following [technical guidelines for view services](http://inspire.ec.europa.eu/documents/Network_Services/TechnicalGuidance_ViewServices_v3.1.pdf). +This tutorial shows how one can set up a combination of GeoServer and GeoNetwork to provide view services following [technical guidelines for view services](https://inspire.ec.europa.eu/documents/Network_Services/TechnicalGuidance_ViewServices_v3.1.pdf). -Note that the technical guidelines allow both [WMS](http://www.opengeospatial.org/standards/wms) as well as [WMTS](http://www.opengeospatial.org/standards/wmts). Select the service type which matches your use case or both. WMTS is generally the preferred choice for bigger datasets (facilitates to meet the quality of service requirements). WMS is generally the better choice for datasets with a high update frequency. GeoServer has improved its WMTS support in recent versions (2.10+). Older versions can not be used for providing WMTS according to INSPIRE technical guidelines. +Note that the technical guidelines allow both [WMS](https://www.opengeospatial.org/standards/wms) as well as [WMTS](https://www.opengeospatial.org/standards/wmts). Select the service type which matches your use case or both. WMTS is generally the preferred choice for bigger datasets (facilitates to meet the quality of service requirements). WMS is generally the better choice for datasets with a high update frequency. GeoServer has improved its WMTS support in recent versions (2.10+). Older versions can not be used for providing WMTS according to INSPIRE technical guidelines. ## GeoServer -Download and install GeoServer INSPIRE extension as documented in [installing inspire extension](http://docs.geoserver.org/latest/en/user/extensions/inspire/installing.html) +Download and install GeoServer INSPIRE extension as documented in [installing inspire extension](https://docs.geoserver.org/latest/en/user/extensions/inspire/installing.html) Create a workspace from which the INSPIRE layers will be hosted. On workspace properties activate "Settings" and set the selected services (WMS/WMTS). Limit the number of projections to the required INSPIRE projections. Keeping all default geoserver projections will cause serious performance issues. ![image](img/image_0.png) -On WMS/WMTS settings, select the INSPIRE workspace and fill out the form (keep service metadata url empty for now) as described in [using inspire extension](http://docs.geoserver.org/latest/en/user/extensions/inspire/using.html#inspire-using). If the INSPIRE workspace is not in the pull down, return to previous step and make sure "Settings" is activated for the workspace. If the INSPIRE fields are not visible, make sure the INSPIRE extension is correctly installed. +On WMS/WMTS settings, select the INSPIRE workspace and fill out the form (keep service metadata url empty for now) as described in [using inspire extension](https://docs.geoserver.org/latest/en/user/extensions/inspire/using.html#inspire-using). If the INSPIRE workspace is not in the pull down, return to previous step and make sure "Settings" is activated for the workspace. If the INSPIRE fields are not visible, make sure the INSPIRE extension is correctly installed. ![image](img/image_1.png) -Create layers as described in [layer management](http://docs.geoserver.org/latest/en/user/data/webadmin/layers.html) +Create layers as described in [layer management](https://docs.geoserver.org/latest/en/user/data/webadmin/layers.html) ![image](img/image_2.png) ## GeoNetwork -When deploying Geonetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire documentation](http://geonetwork-opensource.org/manuals/trunk/eng/users/administrator-guide/configuring-the-catalog/inspire-configuration.html). +When deploying Geonetwork, make sure the GEMET thesauri are loaded and activate the INSPIRE editor as described in [inspire documentation](../../administrator-guide/configuring-the-catalog/inspire-configuration.md). In Admin --> Settings activate the INSPIRE extension. @@ -44,7 +44,7 @@ On the WM(T)S-settings --> INSPIRE workspace add a link to the service metadata ## Validate the implementation -If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](http://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. +If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](https://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. ![image](img/image_6.png) diff --git a/docs/manual/docs/tutorials/inspire/view-mapserver.md b/docs/manual/docs/tutorials/inspire/view-mapserver.md index 27922bc59e..30ac0fee8e 100644 --- a/docs/manual/docs/tutorials/inspire/view-mapserver.md +++ b/docs/manual/docs/tutorials/inspire/view-mapserver.md @@ -1,10 +1,10 @@ # Setting up INSPIRE view service with GeoNetwork and Mapserver {#tuto-view-mapserver} -This tutorial shows how one can set up a combination of [MapServer](http://mapserver.org) and GeoNetwork to provide view services following [technical guidelines for view services](http://inspire.ec.europa.eu/documents/Network_Services/TechnicalGuidance_ViewServices_v3.1.pdf). +This tutorial shows how one can set up a combination of [MapServer](https://mapserver.org) and GeoNetwork to provide view services following [technical guidelines for view services](https://inspire.ec.europa.eu/documents/Network_Services/TechnicalGuidance_ViewServices_v3.1.pdf). ## MapServer -How to set up an INSPIRE view service in Mapserver is documented in [mapserver documentation](http://www.mapserver.org/ogc/inspire.html). In this tutorial we use the reference service metadata approach: +How to set up an INSPIRE view service in Mapserver is documented in [mapserver documentation](https://www.mapserver.org/ogc/inspire.html). In this tutorial we use the reference service metadata approach: ``` text WEB @@ -64,7 +64,7 @@ END ## Validate the implementation -If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](http://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. +If you are running the above setup online, you can use the [pilot JRC INSPIRE validator](https://inspire-geoportal.ec.europa.eu/validator2/). If the above setup is running locally, you can use [Esdin Test Framework](https://github.com/Geonovum/etf-test-projects-inspire) to validate the INSPIRE setup. ![image](img/image_6.png) diff --git a/docs/manual/docs/user-guide/associating-resources/linking-online-resources.md b/docs/manual/docs/user-guide/associating-resources/linking-online-resources.md index 326b6c7bb8..09cf9ccbd4 100644 --- a/docs/manual/docs/user-guide/associating-resources/linking-online-resources.md +++ b/docs/manual/docs/user-guide/associating-resources/linking-online-resources.md @@ -166,4 +166,4 @@ Examples: Reference documents: -- [INSPIRE technical guidelines for download services](http://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). +- [INSPIRE technical guidelines for download services](https://inspire.ec.europa.eu/documents/technical-guidance-implementation-inspire-download-services). diff --git a/docs/manual/docs/user-guide/describing-information/index.md b/docs/manual/docs/user-guide/describing-information/index.md index dfa677e39d..42a2d6a620 100644 --- a/docs/manual/docs/user-guide/describing-information/index.md +++ b/docs/manual/docs/user-guide/describing-information/index.md @@ -2,9 +2,9 @@ This section describes how to catalog resources. First, user needs to choose a standard to use. In general, the following rules apply: -- [Dublin core](http://dublincore.org/) usually used for opendata portal, referencing publication, report, \... -- [ISO 19115/119/139](http://www.iso.org/iso/en/home/store/catalogue_tc/catalogue_detail.htm?csnumber=32557) used for spatial resources (eg. datasets, services, maps) -- [ISO 19110](http://www.iso.org/iso/en/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39965) used for feature attribute table +- [Dublin core](https://dublincore.org/) usually used for opendata portal, referencing publication, report, \... +- [ISO 19115/119/139](https://www.iso.org/iso/en/home/store/catalogue_tc/catalogue_detail.htm?csnumber=32557) used for spatial resources (eg. datasets, services, maps) +- [ISO 19110](https://www.iso.org/iso/en/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39965) used for feature attribute table The editor form provides uploading of data, graphics, documents, pdf files and any other content type. It supports among other: diff --git a/docs/manual/docs/user-guide/describing-information/inspire-editing.md b/docs/manual/docs/user-guide/describing-information/inspire-editing.md index f8471e8863..7b3a9e1a35 100644 --- a/docs/manual/docs/user-guide/describing-information/inspire-editing.md +++ b/docs/manual/docs/user-guide/describing-information/inspire-editing.md @@ -10,7 +10,7 @@ File identifier is automatically set by the catalogue. The metadata last update ## Languages -The metadata language is mandatory. This information usually does not change in records part of the same catalogue. So it is recommended to properly set the value in the template used. The language code is a 3 letter code from the list of [official languages of the European Union](http://ec.europa.eu/languages/policy/linguistic-diversity/official-languages-eu_en.htm). A record can be multilingual (see [Multilingual editing](multilingual-editing.md)). +The metadata language is mandatory. This information usually does not change in records part of the same catalogue. So it is recommended to properly set the value in the template used. The language code is a 3 letter code from the list of [official languages of the European Union](https://ec.europa.eu/languages/policy/linguistic-diversity/official-languages-eu_en.htm). A record can be multilingual (see [Multilingual editing](multilingual-editing.md)). The resource language is also mandatory and follow the same rule. The catalogue provides a list of languages to easily choose the language code. @@ -133,7 +133,7 @@ and can also be a more detailed description of the temporal coverage of the data ## Resource constraints -Resource constraints should be set from the [Limitation on public access](http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess) codelist: +Resource constraints should be set from the [Limitation on public access](https://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess) codelist: ![image](img/inspire-resource-constraint.png) @@ -265,7 +265,7 @@ Editors must set: ## Validating -During editing, user can trigger validation using the [commonly agreed validator](http://inspire.ec.europa.eu/validator/). The catalogue will send the record the validator and display a link to the report once done: +During editing, user can trigger validation using the [commonly agreed validator](https://inspire.ec.europa.eu/validator/). The catalogue will send the record the validator and display a link to the report once done: ![image](img/inspire-validation-pass.png) diff --git a/docs/manual/docs/user-guide/harvesting/index.md b/docs/manual/docs/user-guide/harvesting/index.md index 48ff2d3e09..46f52f782c 100644 --- a/docs/manual/docs/user-guide/harvesting/index.md +++ b/docs/manual/docs/user-guide/harvesting/index.md @@ -105,7 +105,7 @@ Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target ``` -The server certificate for the GeoNetwork server being harvested needs to be added to the JVM keystore with [keytool](http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html) in order to be trusted. +The server certificate for the GeoNetwork server being harvested needs to be added to the JVM keystore with [keytool](https://docs.oracle.com/en/java/javase/11/tools/keytool.html) in order to be trusted. An alternative way to add the certificate is to use a script like: @@ -128,7 +128,7 @@ sudo cp jssecacerts $JAVA_HOME/jre/lib/security/jssecacerts #sudo cp jssecacerts /Library/Java/Home/lib/security/ ``` -To use the script, the Java compiler must be installed and the file [InstallCert.java](http://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java), must be downloaded and placed in the same directory as the script. +To use the script, the Java compiler must be installed and the file [InstallCert.java](https://github.com/escline/InstallCert), must be downloaded and placed in the same directory as the script. The script will add the certificate to the JVM keystore, if you run it as follows:: diff --git a/docs/manual/docs/user-guide/workflow/batchupdate-from-admin.md b/docs/manual/docs/user-guide/workflow/batchupdate-from-admin.md index 4fb9a2931d..9e065bb8df 100644 --- a/docs/manual/docs/user-guide/workflow/batchupdate-from-admin.md +++ b/docs/manual/docs/user-guide/workflow/batchupdate-from-admin.md @@ -64,7 +64,7 @@ Sample configuration: In the configuration, the `element` define the target element in the metadata record. It starts with the schema identifier and then define a path to the element. This is a regular expression and could use `.*` for matching all elements wherever in the document. To match a more specific element, user can defined complete path like `iso19139\\.contact\\.individualName` to match only the metadata contact individual name. -The `searchval` is also a [regular expression](http://www.regular-expressions.info/tutorial.html). It could be simple text or more advanced expression. For example with catching groups, searching for `(.*)` and replacing by `Mr $1` will replace `John` by `Mr John`. +The `searchval` is also a [regular expression](https://www.regular-expressions.info/tutorial.html). It could be simple text or more advanced expression. For example with catching groups, searching for `(.*)` and replacing by `Mr $1` will replace `John` by `Mr John`. The last parameter is the vacuum mode defining what to do with empty elements: diff --git a/docs/manual/help.yml b/docs/manual/help.yml index 3ffdedb68f..f0d5ed4642 100644 --- a/docs/manual/help.yml +++ b/docs/manual/help.yml @@ -1,32 +1,34 @@ +# Project information site_name: Catalogue Help site_dir: target/help docs_dir: docs/help + +# Copyright +copyright: Copyright © 2001 - 2023 FAO-UN and others + extra_css: - - stylesheets/extra.css + - assets/stylesheets/extra.css + theme: name: material language: en custom_dir: overrides - logo: assets/geonetwork-logo.svg - favicon: assets/geonetwork-logo.png + logo: assets/images/geonetwork-logo.svg + favicon: assets/images/geonetwork-logo.png palette: - # Palette toggle for light mode - media: "(prefers-color-scheme: light)" scheme: default - primary: blue grey - + primary: blue toggle: icon: material/weather-night name: Switch to dark mode - # Palette toggle for dark mode - media: "(prefers-color-scheme: dark)" scheme: slate toggle: icon: material/weather-sunny name: Switch to light mode - features: - content.code.annotate - content.tabs.link @@ -87,8 +89,13 @@ markdown_extensions: - tables extra: + homepage: https://geonetwork-opensource.org/ social: - - icon: fontawesome/solid/arrow-up-right-from-square + - icon: fontawesome/brands/github + link: https://github.com/geonetwork + - icon: fontawesome/brands/docker + link: https://hub.docker.com/_/geonetwork + - icon: geonetwork/logo_bw link: https://geonetwork-opensource.org/ name: GeoNetwork Website diff --git a/docs/manual/mkdocs.yml b/docs/manual/mkdocs.yml index 3303110b2a..6f8ee8b6de 100644 --- a/docs/manual/mkdocs.yml +++ b/docs/manual/mkdocs.yml @@ -12,17 +12,16 @@ edit_uri: edit/main/docs/manual/docs # Copyright copyright: Copyright © 2001 - 2023 FAO-UN and others - extra_css: - - stylesheets/extra.css + - assets/stylesheets/extra.css # Configuration theme: name: material language: en custom_dir: overrides - logo: assets/geonetwork-logo.svg - favicon: assets/geonetwork-logo.png + logo: assets/images/geonetwork-logo.svg + favicon: assets/images/geonetwork-logo.png icon: repo: fontawesome/brands/github palette: @@ -78,14 +77,13 @@ plugins: - exclude: glob: - annexes/gallery/bin/README.md - - mike: - canonical_version: latest # Customizations extra: version: provider: mike default: stable + homepage: https://geonetwork-opensource.org/ social: - icon: fontawesome/brands/github link: https://github.com/geonetwork @@ -128,7 +126,7 @@ markdown_extensions: # Page tree nav: - - index.md + - 'GeoNetwork': index.md - 'Overview': - overview/index.md - overview/about.md @@ -139,7 +137,9 @@ nav: - 'Changelog': - overview/change-log/index.md - 'Stable': - - overview/change-log/stable.md + - overview/change-log/stable/index.md + - overview/change-log/version-4.2.7.md + - overview/change-log/version-4.2.6.md - overview/change-log/version-4.2.5.md - overview/change-log/version-4.2.4.md - overview/change-log/version-4.2.3.md @@ -147,7 +147,8 @@ nav: - overview/change-log/version-4.2.1.md - overview/change-log/version-4.2.0.md - 'Maintenance': - - overview/change-log/maintenance.md + - overview/change-log/maintenance/index.md + - overview/change-log/version-3.12.11.md - overview/change-log/version-3.12.10.md - overview/change-log/version-3.12.9.md - overview/change-log/version-3.12.8.md @@ -160,7 +161,7 @@ nav: - overview/change-log/version-3.12.1.md - overview/change-log/version-3.12.0.md - 'Archive': - - overview/change-log/archive.md + - overview/change-log/archive/index.md - overview/change-log/version-4.0.6.md - overview/change-log/version-4.0.5.md - overview/change-log/version-4.0.4.md diff --git a/docs/manual/docs/assets/geonetwork-logo.png b/docs/manual/overrides/assets/images/geonetwork-logo.png similarity index 100% rename from docs/manual/docs/assets/geonetwork-logo.png rename to docs/manual/overrides/assets/images/geonetwork-logo.png diff --git a/docs/manual/docs/assets/geonetwork-logo.svg b/docs/manual/overrides/assets/images/geonetwork-logo.svg similarity index 100% rename from docs/manual/docs/assets/geonetwork-logo.svg rename to docs/manual/overrides/assets/images/geonetwork-logo.svg diff --git a/docs/manual/docs/stylesheets/extra.css b/docs/manual/overrides/assets/stylesheets/extra.css similarity index 100% rename from docs/manual/docs/stylesheets/extra.css rename to docs/manual/overrides/assets/stylesheets/extra.css diff --git a/docs/manual/pom.xml b/docs/manual/pom.xml index ddf7357a22..99f9d7dd95 100644 --- a/docs/manual/pom.xml +++ b/docs/manual/pom.xml @@ -27,7 +27,7 @@ gn-docs org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-guide diff --git a/docs/pom.xml b/docs/pom.xml index 2ad1acac5a..43a03c950f 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-docs diff --git a/doi/pom.xml b/doi/pom.xml index 1d198387e0..a5b383d7a7 100644 --- a/doi/pom.xml +++ b/doi/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/domain/README.md b/domain/README.md new file mode 100644 index 0000000000..c80270193f --- /dev/null +++ b/domain/README.md @@ -0,0 +1,61 @@ +# Domain Module + +The domain module contains the domain model object and the Spring-Data-JPA Repositories for accessing the database. In order to +compile correctly, you have to enable the JPA Metamodel generator. It is an annotation processor and the instructions for enabling +it in your IDE are available at: http://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit + +Maven already has it enabled, so if you don't want to work on this package, you only need to run the maven build and the +required files will be generated. + +## Structure and Conventions + +The package structure of this module is to put: + +* JPA Entity and related Embeddable classes in the org.fao.geonet.domain package or sub-packages +* JPA EntityListener objects in org.fao.geonet.entitylistener package or sub-packages +* Spring-data repository objects in org.fao.geonet.repository package or sub-packages +* Spring-data-jpa Specification Utility/Factory objects in org.fao.geonet.repository.specification package or sub-packages + +The file config-spring-geonetwork.xml in the src/main/resources directory configures spring and JPA to scan the +org.fao.geonet.domain package (and sub-packages) for Entities and the org.fao.geonet.repository package for spring-data-jpa +Repository objects. + +The exact list that is scanned by the spring configuration files needs to be checked. At the time of this writing the file +is config-spring-geonetwork.xml in this module. + +The side effect of this means that repositories and entities can be in other modules as well. At the time of this writing +that is not the case but should be considered in the future. + +## Writing Custom Queries + +IMPORTANT: Please do not add any Specifications or Queries to the system without at least one test for each query! + +Spring Data allows four different ways to write queries. (For more in-depth explanation see: http://projects.spring.io/spring-data-jpa/ + +1. Query methods + - You can create methods in the ...Repository interface and the method name will be parsed by Spring Data and a query will be created for you based on the name. There are many different options including in, and, or ways to write the methods. + - While the methods are easy to write, they are not very flexible. Using Specifications tends to be a more flexible solution and is therefore preferred. + - **Examples: (See tests for example usage)** + * [UserRepository](src/main/java/org/fao/geonet/repository/UserRepository.java) + * [OperationAllowedRepository](src/main/java/org/fao/geonet/repository/OperationAllowedRepository.java) +2. Specifications + - The Specification interface provides a composable API for writing queries. + - For example, you could write a hasMetadataId specification and a hasOwnerId specification. One could then compose them using not, and, or. + - Each specification should be in the appropriate Specs class. + - Each specification is to be created with a static method. + - Each specification must have a test. + - **Examples: (See tests for example usage)** + * [MetadataSpecs](src/main/java/org/fao/geonet/repository/specification/MetadataSpecs.java) + * [UserSpecs](src/main/java/org/fao/geonet/repository/specification/UserSpecs.java) +3. Custom Queries + - Spring JPA Repositories can have custom queries with very custom implementations. A Repository will extend an interface with the custom methods and the implementations would be in a subclass of the interface. + - The implementation will use the normal EntityManager (JPA) API for constructing the queries. + - **Examples: (See tests for example usage)** + * [MetadataRepositoryCustom](src/main/java/org/fao/geonet/repository/MetadataRepositoryCustom.java) + * [MetadataRepositoryCustomImpl](src/main/java/org/fao/geonet/repository/MetadataRepositoryCustomImpl.java) +4. Standard JPA querying + - One can obtain an EntityManager by using the @PersistentContext annotation on a field in a Spring bean. + - The EntityManager can be used to write queries. + - All Queries should be contained in the same module as the domain object that it is querying, unless the module is a plugin module. + - **Examples: (See tests for example usage)** + * [MetadataReportsQueries](src/main/java/org/fao/geonet/repository/reports/MetadataReportsQueries.java) diff --git a/domain/Readme.md b/domain/Readme.md deleted file mode 100644 index 081fd051cd..0000000000 --- a/domain/Readme.md +++ /dev/null @@ -1,64 +0,0 @@ -Domain Module -------------- - -The domain module contains the domain model object and the Spring-Data-JPA Repositories for accessing the database. In order to -compile correctly you have to enable the JPA Metamodel generator. It is an annotation processor and the instruction for enabling -it in your IDE are available at: http://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit - -Maven already has it enabled so if you don't want to work on this package only need to run the maven build and the -required files will be generated. - -Structure and Conventions -------------------------- - -The package structure of this module is to put: - -* JPA Entity and related Embeddable classes in the org.fao.geonet.domain package or sub-packages -* JPA EntityListener objects in org.fao.geonet.entitylistener package or sub-packages -* Spring-data repository objects in org.fao.geonet.repository package or sub-packages -* Spring-data-jpa Specification Utility/factory objects in org.fao.geonet.repository.specification package or sub-packages - -The file config-spring-geonetwork.xml in the src/main/resources directory configures spring and JPA to scan the -org.fao.geonet.domain package (and sub-packages) for Entities and the org.fao.geonet.repository package for spring-data-jpa -Repository objects. - -The exact list that are scanned the spring configuration files need to be checked. At the time of this writing the file -is config-spring-geonetwork.xml in this module. - -The side-effect of this means that repositories and entities can be in other modules as well. At the time of this writing -that is not the case but should be considered in the future. - -Writing Custom Queries ----------------------- - -IMPORTANT: Please do not add any Specifications or queries to the system without at least one test for each query! - -Spring Data allows four different ways to write queries. (For more in-depth explanation see: http://projects.spring.io/spring-data-jpa/ - -1. Query methods - * You can create methods in the ...Repository interface and the method name will be parsed by Spring Data and a query will be created you based on the name. There are many different options including in, and, or ways to write the methods. - * While the methods are easy to write they are not very flexible. Using Specifications tend to be a more flexible solution and is therefore preferred - * **Examples: (See tests for example usage)** - * [UserRepository](src/main/java/org/fao/geonet/repository/UserRepository.java) - * [OperationAllowedRepository](src/main/java/org/fao/geonet/repository/OperationAllowedRepository.java) -1. Specifications - * The Specification interface provides a composable API for writing queries. - * For example you could write a hasMetadataId specification and a hasOwnerId specification. One could then compose them in using not, and, or. - * Each specification should be in the appropriate Specs class. - * Each specification is be created with a static method. - * Each specification must have a test. - * **Examples: (See tests for example usage)** - * [MetadataSpecs](src/main/java/org/fao/geonet/repository/specification/MetadataSpecs.java) - * [UserSpecs](src/main/java/org/fao/geonet/repository/specification/UserSpecs.java) -1. Custom Queries - * Spring JPA Repositories can have custom queries with very custom implementations. A Repository will extend an interface with the custom methods and the implementations would be in a subclass of the interface. - * **Examples: (See tests for example usage)** - * [MetadataRepositoryCustom](src/main/java/org/fao/geonet/repository/MetadataRepositoryCustom.java) - * [MetadataRepositoryImpl](src/main/java/org/fao/geonet/repository/MetadataRepositoryImpl.java) - * The implementation will use the normal EntityManager (JPA) API for constructing the queries -1. Standard JPA querying - * One can obtain an EntityManager by using the @PersistentContext annotation on a field in a Spring bean. - * The EntityManager can be used to write queries. - * All Queries should be contained in the same module as the domain object that it is querying, unless the module is a plugin module. - * **Examples: (See tests for example usage)** - * [MetadataStatisticsQueries](src/main/java/org/fao/geonet/repository/statistic/MetadataStatisticsQueries.java) diff --git a/domain/pom.xml b/domain/pom.xml index 1f790cfa5a..0aeab572ca 100644 --- a/domain/pom.xml +++ b/domain/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/es/es-dashboards/pom.xml b/es/es-dashboards/pom.xml index 360ecfb0c1..2246939aec 100644 --- a/es/es-dashboards/pom.xml +++ b/es/es-dashboards/pom.xml @@ -28,7 +28,7 @@ gn-es org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/es/pom.xml b/es/pom.xml index debb01bb8f..82d0c9ab7e 100644 --- a/es/pom.xml +++ b/es/pom.xml @@ -5,7 +5,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-es diff --git a/estest/pom.xml b/estest/pom.xml index e1b6eb02f0..5ca34c62ee 100644 --- a/estest/pom.xml +++ b/estest/pom.xml @@ -5,7 +5,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/events/pom.xml b/events/pom.xml index 0679230674..c7538a9646 100644 --- a/events/pom.xml +++ b/events/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra GeoNetwork Events diff --git a/georchestra-integration/externalized-accounts/pom.xml b/georchestra-integration/externalized-accounts/pom.xml index 634f6f88d8..a543983ed4 100644 --- a/georchestra-integration/externalized-accounts/pom.xml +++ b/georchestra-integration/externalized-accounts/pom.xml @@ -4,7 +4,7 @@ org.geonetwork-opensource gn-georchestra-integration - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-externalized-accounts diff --git a/georchestra-integration/georchestra-authnz/pom.xml b/georchestra-integration/georchestra-authnz/pom.xml index 7fee60216f..abe48b2aa5 100644 --- a/georchestra-integration/georchestra-authnz/pom.xml +++ b/georchestra-integration/georchestra-authnz/pom.xml @@ -4,7 +4,7 @@ org.geonetwork-opensource gn-georchestra-integration - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-georchestra-authnz diff --git a/georchestra-integration/georchestra-utils/pom.xml b/georchestra-integration/georchestra-utils/pom.xml index 1a61d9a9ef..99ca9dee3e 100644 --- a/georchestra-integration/georchestra-utils/pom.xml +++ b/georchestra-integration/georchestra-utils/pom.xml @@ -4,7 +4,7 @@ org.geonetwork-opensource gn-georchestra-integration - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-georchestra-utils diff --git a/georchestra-integration/pom.xml b/georchestra-integration/pom.xml index 7040365d4e..5cb3013182 100644 --- a/georchestra-integration/pom.xml +++ b/georchestra-integration/pom.xml @@ -4,7 +4,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-georchestra-integration diff --git a/harvesters/pom.xml b/harvesters/pom.xml index 5cde120101..246c78d9a6 100644 --- a/harvesters/pom.xml +++ b/harvesters/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/healthmonitor/pom.xml b/healthmonitor/pom.xml index 70f731c104..a62ff6034f 100644 --- a/healthmonitor/pom.xml +++ b/healthmonitor/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/index/pom.xml b/index/pom.xml index 77f6f20c03..bbf5519844 100644 --- a/index/pom.xml +++ b/index/pom.xml @@ -5,7 +5,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-index diff --git a/index/src/main/java/org/fao/geonet/index/es/EsRestClient.java b/index/src/main/java/org/fao/geonet/index/es/EsRestClient.java index 23001f417d..9837d551f1 100644 --- a/index/src/main/java/org/fao/geonet/index/es/EsRestClient.java +++ b/index/src/main/java/org/fao/geonet/index/es/EsRestClient.java @@ -38,6 +38,7 @@ import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy; import org.apache.http.ssl.SSLContextBuilder; import org.apache.lucene.search.TotalHits; +import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -504,7 +505,7 @@ public String getServerStatus() throws IOException { // return getClient().ping(RequestOptions.DEFAULT); } - public String getServerVersion() throws IOException { + public String getServerVersion() throws IOException, ElasticsearchException { MainResponse.Version version = client.info(RequestOptions.DEFAULT).getVersion(); return version.getNumber(); diff --git a/inspire-atom/pom.xml b/inspire-atom/pom.xml index 86d71e449e..ba8aded533 100644 --- a/inspire-atom/pom.xml +++ b/inspire-atom/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/jmeter/pom.xml b/jmeter/pom.xml index daf013d3aa..84f38ca1fe 100644 --- a/jmeter/pom.xml +++ b/jmeter/pom.xml @@ -29,7 +29,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/listeners/pom.xml b/listeners/pom.xml index 35f0dd9619..6bc5d68016 100644 --- a/listeners/pom.xml +++ b/listeners/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra GeoNetwork Events diff --git a/messaging/pom.xml b/messaging/pom.xml index 43aa2cfc15..b03a7aea70 100644 --- a/messaging/pom.xml +++ b/messaging/pom.xml @@ -5,7 +5,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/oaipmh/pom.xml b/oaipmh/pom.xml index 22bc7d065c..811a338e2c 100644 --- a/oaipmh/pom.xml +++ b/oaipmh/pom.xml @@ -30,7 +30,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/pom.xml b/pom.xml index c5f3e66afc..d657199a43 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.geonetwork-opensource geonetwork pom - 4.2.6-georchestra + 4.2.7-georchestra GeoNetwork opensource GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced @@ -1617,7 +1617,7 @@ 2.17.2 1.8.0-beta2 4.22 - 1.6.0 + 1.7.2 4.5.14 1.9.3 5.9.1 diff --git a/release/build.properties b/release/build.properties index 7b48e4b1c2..399f1119ca 100644 --- a/release/build.properties +++ b/release/build.properties @@ -5,7 +5,7 @@ homepage=https://geonetwork-opensource.org supportEmail=geonetwork-users@lists.sourceforge.net # Application version properties -version=4.2.6 +version=4.2.7 subVersion=0 # Java runtime properties diff --git a/release/pom.xml b/release/pom.xml index 0aea6f748f..179b781a69 100644 --- a/release/pom.xml +++ b/release/pom.xml @@ -7,7 +7,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra gn-release diff --git a/schemas-test/pom.xml b/schemas-test/pom.xml index 260091a7c0..06d674384e 100644 --- a/schemas-test/pom.xml +++ b/schemas-test/pom.xml @@ -27,7 +27,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 jar diff --git a/schemas/csw-record/pom.xml b/schemas/csw-record/pom.xml index 33fab27553..428501f4e5 100644 --- a/schemas/csw-record/pom.xml +++ b/schemas/csw-record/pom.xml @@ -5,7 +5,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-schema-csw-record diff --git a/schemas/dublin-core/pom.xml b/schemas/dublin-core/pom.xml index 9ecd66368b..558350ff3e 100644 --- a/schemas/dublin-core/pom.xml +++ b/schemas/dublin-core/pom.xml @@ -5,7 +5,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/schemas/iso19110/pom.xml b/schemas/iso19110/pom.xml index f73336075e..17d2b36592 100644 --- a/schemas/iso19110/pom.xml +++ b/schemas/iso19110/pom.xml @@ -28,7 +28,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/schemas/iso19110/src/main/plugin/iso19110/index-fields/index.xsl b/schemas/iso19110/src/main/plugin/iso19110/index-fields/index.xsl index f765f417ba..8eef33934d 100644 --- a/schemas/iso19110/src/main/plugin/iso19110/index-fields/index.xsl +++ b/schemas/iso19110/src/main/plugin/iso19110/index-fields/index.xsl @@ -120,9 +120,11 @@ ,"cardinality": "" - + + ,"values": [ - { + { "label": "", "code": "", "definition": ""} diff --git a/schemas/iso19115-3.2018/pom.xml b/schemas/iso19115-3.2018/pom.xml index 0b69652922..692657f0e4 100644 --- a/schemas/iso19115-3.2018/pom.xml +++ b/schemas/iso19115-3.2018/pom.xml @@ -6,7 +6,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json index 8105289441..c15c53fc2b 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json @@ -30,7 +30,8 @@ "metadataStore": { "label": "searchAnApplication", "params": { - "resourceType": "application" + "resourceType": "application", + "isTemplate": "n" } } }, @@ -63,7 +64,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WMS", "WMS", "view"] + "serviceType": ["OGC:WMS", "WMS", "view"], + "isTemplate": "n" } } }, @@ -95,7 +97,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "view" + "serviceType": "view", + "isTemplate": "n" } } }, @@ -132,7 +135,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WMTS", "WMTS"] + "serviceType": ["OGC:WMTS", "WMTS"], + "isTemplate": "n" } } }, @@ -164,7 +168,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "ESRI:REST" + "serviceType": "ESRI:REST", + "isTemplate": "n" } } }, @@ -196,7 +201,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "ESRI:REST" + "serviceType": "ESRI:REST", + "isTemplate": "n" } } }, @@ -310,7 +316,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WFS", "WFS", "download"] + "serviceType": ["OGC:WFS", "WFS", "download"], + "isTemplate": "n" } } }, @@ -342,7 +349,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WCS", "WCS"] + "serviceType": ["OGC:WCS", "WCS"], + "isTemplate": "n" } } }, @@ -374,7 +382,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "download" + "serviceType": "download", + "isTemplate": "n" } } }, @@ -411,7 +420,8 @@ "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "download" + "serviceType": "download", + "isTemplate": "n" } } }, diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/index-fields/index.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/index-fields/index.xsl index 7fc65f15d7..42fb609862 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/index-fields/index.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/index-fields/index.xsl @@ -1026,9 +1026,11 @@ ,"cardinality": "" - + + ,"values": [ - { + { "label": "", "code": "", "definition": ""} diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/strings.xml b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/strings.xml index 153dbbe580..b3a0372af0 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/strings.xml +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/strings.xml @@ -59,7 +59,7 @@ Provided by Share on social sites Views - Access to the portal + Access to the catalogue Read here the full details and access to the data. Citation proposal This proposal was automatically generated, check if the metadata authors did not specified custom citation requirements. diff --git a/schemas/iso19139/pom.xml b/schemas/iso19139/pom.xml index 5eee3828e6..80d62c402b 100644 --- a/schemas/iso19139/pom.xml +++ b/schemas/iso19139/pom.xml @@ -5,7 +5,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/chi/strings.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/chi/strings.xml index 637bae9936..396f637ef9 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/chi/strings.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/chi/strings.xml @@ -63,7 +63,7 @@ Provided by Share on social sites Views - Access to the portal + Access to the catalogue Read here the full details and access to the data. Citation proposal This proposal was automatically generated, check if the metadata authors did not specified custom citation requirements. diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/eng/strings.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/eng/strings.xml index 262f745c47..67eb0e2376 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/eng/strings.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/eng/strings.xml @@ -63,7 +63,7 @@ Provided by Share on social sites Views - Access to the portal + Access to the catalogue Read here the full details and access to the data. Citation proposal This proposal was automatically generated, check if the metadata authors did not specified custom citation requirements. diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/strings.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/strings.xml index 028e3a9a15..e4202acbac 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/strings.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/strings.xml @@ -36,7 +36,7 @@ Fourni par Partager Mode d'affichage - Lien vers le portail + Lien vers le catalogue Consultez l'intégralité des métadonnées et accédez à la donnée. diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/swe/strings.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/swe/strings.xml index d7a8cf125a..f5f7814c7c 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/swe/strings.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/swe/strings.xml @@ -65,7 +65,7 @@ Provided by Share on social sites Views - Access to the portal + Access to the catalogue Read here the full details and access to the data. Citation proposal This proposal was automatically generated, check if the metadata authors did not specified custom citation requirements. diff --git a/schemas/pom.xml b/schemas/pom.xml index 02195dd35e..7730b337e1 100644 --- a/schemas/pom.xml +++ b/schemas/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/schemas/schema-core/pom.xml b/schemas/schema-core/pom.xml index d1ffd2c0a9..deb1dd2417 100644 --- a/schemas/schema-core/pom.xml +++ b/schemas/schema-core/pom.xml @@ -28,7 +28,7 @@ gn-schemas org.geonetwork-opensource.schemas - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 diff --git a/sde/pom.xml b/sde/pom.xml index 1a7c6d8dbe..a7b4d7d224 100644 --- a/sde/pom.xml +++ b/sde/pom.xml @@ -30,7 +30,7 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/services/pom.xml b/services/pom.xml index 0f2e77819f..93d7452d31 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -27,13 +27,13 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra 4.0.0 gn-services GeoNetwork services - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/services/src/main/java/org/fao/geonet/api/ApiError.java b/services/src/main/java/org/fao/geonet/api/ApiError.java index 3f7bac150e..de3a4dd0b3 100644 --- a/services/src/main/java/org/fao/geonet/api/ApiError.java +++ b/services/src/main/java/org/fao/geonet/api/ApiError.java @@ -58,8 +58,8 @@ public ApiError(String code, String message, String description) { public ApiError(String code, Exception exception) { this(code, - exception.getClass().getSimpleName(), - exception.getMessage() + exception.getMessage(), + null ); this.exception = exception; } diff --git a/services/src/main/java/org/fao/geonet/api/ApiUtils.java b/services/src/main/java/org/fao/geonet/api/ApiUtils.java index 2a3f94b214..1ee51045fa 100644 --- a/services/src/main/java/org/fao/geonet/api/ApiUtils.java +++ b/services/src/main/java/org/fao/geonet/api/ApiUtils.java @@ -23,8 +23,6 @@ package org.fao.geonet.api; -import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId; - import com.google.common.collect.Sets; import jeeves.constants.Jeeves; import jeeves.server.UserSession; @@ -115,7 +113,11 @@ public static String getInternalId(String uuidOrInternalId, Boolean approved) throws Exception { IMetadataUtils metadataUtils = ApplicationContextHolder.get().getBean(IMetadataUtils.class); - String id = String.valueOf(metadataUtils.findOneByUuid(uuidOrInternalId).getId()); + AbstractMetadata metadata = metadataUtils.findOneByUuid(uuidOrInternalId); + String id = null; + if (metadata != null) { + id = String.valueOf(metadata.getId()); + } if (StringUtils.isEmpty(id)) { //It wasn't a UUID @@ -295,7 +297,7 @@ public static AbstractMetadata canViewRecord(String metadataUuid, boolean approv String metadataId; if (!approved) { // If the record is not approved then we need to get the id of the record. - metadataId = String.valueOf(getAndCheckMetadataId(metadataUuid, approved)); + metadataId = getInternalId(metadataUuid, approved); } else { // Otherwise use the uuid or id that was supplied. metadataId = metadataUuid; diff --git a/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java b/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java index 8f17dcf27b..3683551b6f 100644 --- a/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java +++ b/services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java @@ -88,7 +88,7 @@ "/{portal}/api" }) @Tag(name = "search", - description = "Proxy for ElasticSearch catalog search operations") + description = "Proxy for Elasticsearch catalog search operations") @Controller public class EsHTTPProxy { public static final String[] _validContentTypes = { diff --git a/services/src/main/java/org/fao/geonet/api/processing/DatabaseProcessApi.java b/services/src/main/java/org/fao/geonet/api/processing/DatabaseProcessApi.java index 7732fff4d5..afd1f15d03 100644 --- a/services/src/main/java/org/fao/geonet/api/processing/DatabaseProcessApi.java +++ b/services/src/main/java/org/fao/geonet/api/processing/DatabaseProcessApi.java @@ -32,11 +32,9 @@ import jeeves.server.UserSession; import jeeves.server.context.ServiceContext; import jeeves.services.ReadWriteController; -import org.apache.commons.lang.StringUtils; import org.fao.geonet.ApplicationContextHolder; import org.fao.geonet.api.ApiParams; import org.fao.geonet.api.ApiUtils; -import org.fao.geonet.api.exception.NotAllowedException; import org.fao.geonet.api.processing.report.MetadataReplacementProcessingReport; import org.fao.geonet.api.processing.report.XsltMetadataProcessingReport; import org.fao.geonet.domain.AbstractMetadata; @@ -63,7 +61,11 @@ import org.springframework.security.access.hierarchicalroles.RoleHierarchy; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -184,7 +186,7 @@ public ResponseEntity previewProcessSearchAndReplace( try { ServiceContext serviceContext = ApiUtils.createServiceContext(request); - checkUserProfileToBatchEditMetadata(serviceContext.getUserSession()); + UserUtil.checkUserProfileLevel(serviceContext.getUserSession(), settingManager, roleHierarchy, Settings.METADATA_BATCH_EDITING_ACCESS_LEVEL, Profile.Editor, "batch edit metadata"); Set records = ApiUtils.getUuidsParameterOrSelection(uuids, bucket, session); @@ -319,7 +321,7 @@ public XsltMetadataProcessingReport processSearchAndReplace( try { ServiceContext serviceContext = ApiUtils.createServiceContext(request); - checkUserProfileToBatchEditMetadata(serviceContext.getUserSession()); + UserUtil.checkUserProfileLevel(serviceContext.getUserSession(), settingManager, roleHierarchy, Settings.METADATA_BATCH_EDITING_ACCESS_LEVEL, Profile.Editor, "batch edit metadata"); Set records = ApiUtils.getUuidsParameterOrSelection(uuids, bucket, session); UserSession userSession = ApiUtils.getUserSession(httpSession); @@ -416,21 +418,4 @@ public void process(String catalogueId) throws Exception { } } - /** - * Checks if the user profile is allowed to batch edit metadata. - * - * @param userSession - */ - private void checkUserProfileToBatchEditMetadata(UserSession userSession) { - if (userSession.getProfile() != Profile.Administrator) { - String allowedUserProfileToImportMetadata = - StringUtils.defaultIfBlank(settingManager.getValue(Settings.METADATA_BATCH_EDITING_ACCESS_LEVEL), Profile.Editor.toString()); - - // Is the user profile is higher than the profile allowed to import metadata? - if (!UserUtil.hasHierarchyRole(allowedUserProfileToImportMetadata, this.roleHierarchy)) { - throw new NotAllowedException("The user has no permissions to batch edit metadata."); - } - } - - } } diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataApi.java b/services/src/main/java/org/fao/geonet/api/records/MetadataApi.java index 4082f44100..2323f1439a 100644 --- a/services/src/main/java/org/fao/geonet/api/records/MetadataApi.java +++ b/services/src/main/java/org/fao/geonet/api/records/MetadataApi.java @@ -73,7 +73,7 @@ import java.util.stream.Stream; import static org.fao.geonet.api.ApiParams.*; -import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId; + import static org.fao.geonet.kernel.mef.MEFLib.Version.Constants.MEF_V1_ACCEPT_TYPE; import static org.fao.geonet.kernel.mef.MEFLib.Version.Constants.MEF_V2_ACCEPT_TYPE; diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataAssociatedApi.java b/services/src/main/java/org/fao/geonet/api/records/MetadataAssociatedApi.java index 1f355fd326..5859385b99 100644 --- a/services/src/main/java/org/fao/geonet/api/records/MetadataAssociatedApi.java +++ b/services/src/main/java/org/fao/geonet/api/records/MetadataAssociatedApi.java @@ -52,11 +52,8 @@ import javax.servlet.http.HttpServletRequest; import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static org.fao.geonet.api.ApiParams.*; -import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId; @RequestMapping(value = { "/{portal}/api/records" diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java b/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java index 0c7c8388d8..1c50daf45e 100644 --- a/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java +++ b/services/src/main/java/org/fao/geonet/api/records/MetadataInsertDeleteApi.java @@ -47,7 +47,17 @@ import org.fao.geonet.api.records.attachments.StoreUtils; import org.fao.geonet.api.tools.i18n.LanguageUtils; import org.fao.geonet.constants.Geonet; -import org.fao.geonet.domain.*; +import org.fao.geonet.domain.AbstractMetadata; +import org.fao.geonet.domain.ISODate; +import org.fao.geonet.domain.MetadataCategory; +import org.fao.geonet.domain.MetadataDraft; +import org.fao.geonet.domain.MetadataResourceVisibility; +import org.fao.geonet.domain.MetadataType; +import org.fao.geonet.domain.Pair; +import org.fao.geonet.domain.Profile; +import org.fao.geonet.domain.ReservedGroup; +import org.fao.geonet.domain.ReservedOperation; +import org.fao.geonet.domain.UserGroup; import org.fao.geonet.domain.utils.ObjectJSONUtils; import org.fao.geonet.events.history.RecordCreateEvent; import org.fao.geonet.events.history.RecordDeletedEvent; @@ -91,18 +101,39 @@ import org.springframework.security.access.hierarchicalroles.RoleHierarchy; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.nio.file.*; +import java.nio.file.DirectoryStream; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; -import java.util.*; - -import static org.fao.geonet.api.ApiParams.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.UUID; + +import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS; +import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG; +import static org.fao.geonet.api.ApiParams.API_PARAM_RECORD_UUID; +import static org.fao.geonet.api.ApiParams.API_PARAM_RECORD_UUIDS_OR_SELECTION; import static org.springframework.data.jpa.domain.Specification.where; @@ -203,7 +234,7 @@ public void deleteRecord( UserSession userSession = ApiUtils.getUserSession(request.getSession()); if (accessMan.isVisibleToAll(String.valueOf(metadata.getId())) ) { - checkUserProfileToDeletePublishedMetadata(userSession); + UserUtil.checkUserProfileLevel(userSession, settingManager, roleHierarchy, Settings.METADATA_PUBLISHED_DELETE_USERPROFILE, Profile.Editor, "delete published metadata"); } store.delResources(context, metadata.getUuid(), approved); @@ -250,7 +281,7 @@ public SimpleMetadataProcessingReport deleteRecords( if (accessMan.isVisibleToAll(String.valueOf(metadata.getId())) ) { try { - checkUserProfileToDeletePublishedMetadata(userSession); + UserUtil.checkUserProfileLevel(userSession, settingManager, roleHierarchy, Settings.METADATA_PUBLISHED_DELETE_USERPROFILE, Profile.Editor, "delete published metadata"); } catch (NotAllowedException ex) { report.addMetadataInfos(metadata, ex.getMessage()); continue; @@ -320,7 +351,7 @@ SimpleMetadataProcessingReport insert( SimpleMetadataProcessingReport report = new SimpleMetadataProcessingReport(); UserSession userSession = ApiUtils.getUserSession(request.getSession()); - checkUserProfileToImportMetadata(userSession); + UserUtil.checkUserProfileLevel(userSession, settingManager, roleHierarchy, Settings.METADATA_IMPORT_USERPROFILE, Profile.Editor, "import metadata"); boolean isMdWorkflowEnable = settingManager.getValueAsBool(Settings.METADATA_WORKFLOW_ENABLE); @@ -597,7 +628,7 @@ public SimpleMetadataProcessingReport insertFile( if (file != null) { ServiceContext context = ApiUtils.createServiceContext(request); - checkUserProfileToImportMetadata(context.getUserSession()); + UserUtil.checkUserProfileLevel(context.getUserSession(), settingManager, roleHierarchy, Settings.METADATA_IMPORT_USERPROFILE, Profile.Editor, "import metadata"); for (MultipartFile f : file) { if (MEFLib.isValidArchiveExtensionForMEF(f.getOriginalFilename())) { @@ -986,39 +1017,4 @@ private Pair loadRecord(MetadataType metadataType, Element xmlE return Pair.read(Integer.valueOf(id.get(0)), uuid); } - /** - * Checks if the user profile is allowed to import metadata. - * - * @param userSession - */ - private void checkUserProfileToImportMetadata(UserSession userSession) { - if (userSession.getProfile() != Profile.Administrator) { - String allowedUserProfileToImportMetadata = - StringUtils.defaultIfBlank(settingManager.getValue(Settings.METADATA_IMPORT_USERPROFILE), Profile.Editor.toString()); - - // Is the user profile is higher than the profile allowed to import metadata? - if (!UserUtil.hasHierarchyRole(allowedUserProfileToImportMetadata, this.roleHierarchy)) { - throw new NotAllowedException("The user has no permissions to import metadata."); - } - } - - } - - /** - * Checks if the user profile is allowed to import metadata. - * - * @param userSession - */ - private void checkUserProfileToDeletePublishedMetadata(UserSession userSession) { - if (userSession.getProfile() != Profile.Administrator) { - String allowedUserProfileToImportMetadata = - StringUtils.defaultIfBlank(settingManager.getValue(Settings.METADATA_PUBLISHED_DELETE_USERPROFILE), Profile.Editor.toString()); - - // Is the user profile is higher than the profile allowed to import metadata? - if (!UserUtil.hasHierarchyRole(allowedUserProfileToImportMetadata, this.roleHierarchy)) { - throw new NotAllowedException("The user has no permissions to delete published metadata."); - } - } - - } } diff --git a/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java b/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java index 5feb506f19..63efea7a15 100644 --- a/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java +++ b/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java @@ -191,7 +191,7 @@ private Pair applyBatchEdits( ServiceContext serviceContext = ApiUtils.createServiceContext(request); - checkUserProfileToBatchEditMetadata(serviceContext.getUserSession()); + UserUtil.checkUserProfileLevel(serviceContext.getUserSession(), settingManager, roleHierarchy, Settings.METADATA_BATCH_EDITING_ACCESS_LEVEL, Profile.Editor, "batch edit metadata"); final Set setOfUuidsToEdit; if (uuids == null) { SelectionManager selectionManager = diff --git a/services/src/main/java/org/fao/geonet/api/related/Related.java b/services/src/main/java/org/fao/geonet/api/related/Related.java index fd1de74d6c..ae800982a4 100644 --- a/services/src/main/java/org/fao/geonet/api/related/Related.java +++ b/services/src/main/java/org/fao/geonet/api/related/Related.java @@ -58,8 +58,6 @@ import java.util.Locale; import java.util.Map; -import static org.fao.geonet.api.records.attachments.AbstractStore.getAndCheckMetadataId; - @RequestMapping(value = { "/{portal}/api/related" }) diff --git a/services/src/main/java/org/fao/geonet/api/site/SiteApi.java b/services/src/main/java/org/fao/geonet/api/site/SiteApi.java index e00acdba5e..00f478966b 100644 --- a/services/src/main/java/org/fao/geonet/api/site/SiteApi.java +++ b/services/src/main/java/org/fao/geonet/api/site/SiteApi.java @@ -64,6 +64,7 @@ import org.fao.geonet.kernel.setting.SettingManager; import org.fao.geonet.kernel.setting.Settings; import org.fao.geonet.lib.Lib; +import org.fao.geonet.lib.ProxyConfiguration; import org.fao.geonet.repository.*; import org.fao.geonet.repository.specification.MetadataSpecs; import org.fao.geonet.resources.Resources; @@ -161,12 +162,12 @@ public static void reloadServices(ServiceContext context) throws Exception { try { // Load proxy information into Jeeves ProxyInfo pi = JeevesProxyInfo.getInstance(); - boolean useProxy = settingMan.getValueAsBool(Settings.SYSTEM_PROXY_USE, false); + boolean useProxy = Lib.net.getProxyConfiguration().isEnabled(); if (useProxy) { - String proxyHost = settingMan.getValue(Settings.SYSTEM_PROXY_HOST); - String proxyPort = settingMan.getValue(Settings.SYSTEM_PROXY_PORT); - String username = settingMan.getValue(Settings.SYSTEM_PROXY_USERNAME); - String password = settingMan.getValue(Settings.SYSTEM_PROXY_PASSWORD); + String proxyHost = Lib.net.getProxyConfiguration().getHost(); + String proxyPort = Lib.net.getProxyConfiguration().getPort(); + String username = Lib.net.getProxyConfiguration().getUsername(); + String password = Lib.net.getProxyConfiguration().getPassword(); pi.setProxyInfo(proxyHost, Integer.valueOf(proxyPort), username, password); } else { pi.setProxyInfo(null, -1, null, null); @@ -735,6 +736,24 @@ public StatusValueNotificationLevel[] getNotificationLevel() { return StatusValueNotificationLevel.values(); } + @io.swagger.v3.oas.annotations.Operation( + summary = "Get proxy configuration details", + description = "Get the proxy configuration.") + @RequestMapping( + path = "/info/proxy", + produces = MediaType.APPLICATION_JSON_VALUE, + method = RequestMethod.GET) + @ResponseStatus(HttpStatus.OK) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Proxy configuration.") + }) + @PreAuthorize("hasAuthority('Administrator')") + @ResponseBody + public ProxyConfiguration getProxyConfiguration( + ) { + return Lib.net.getProxyConfiguration(); + } + @io.swagger.v3.oas.annotations.Operation( summary = "Set catalog logo", description = "Logos are stored in the data directory " + diff --git a/services/src/main/java/org/fao/geonet/api/site/SiteInformation.java b/services/src/main/java/org/fao/geonet/api/site/SiteInformation.java index 3adae15438..727084264c 100644 --- a/services/src/main/java/org/fao/geonet/api/site/SiteInformation.java +++ b/services/src/main/java/org/fao/geonet/api/site/SiteInformation.java @@ -27,6 +27,7 @@ import jeeves.server.ServiceConfig; import jeeves.server.context.ServiceContext; import org.apache.commons.dbcp2.BasicDataSource; +import org.elasticsearch.ElasticsearchException; import org.fao.geonet.GeonetContext; import org.fao.geonet.constants.Geonet; import org.fao.geonet.kernel.search.EsSearchManager; @@ -65,7 +66,7 @@ public SiteInformation(final ServiceContext context, final GeonetContext gc) { } try { loadIndexInfo(context); - } catch (IOException e) { + } catch (IOException | ElasticsearchException e) { Log.error(Geonet.GEONETWORK, e.getMessage(), e); } loadVersionInfo(); @@ -180,6 +181,21 @@ private void loadDatabaseInfo(ServiceContext context) throws SQLException { connection = context.getBean(DataSource.class).getConnection(); dbURL = connection.getMetaData().getURL(); databaseProperties.put("db.openattempt", "Database Opened Successfully"); + try { + databaseProperties.put("db.type", connection.getMetaData().getDatabaseProductName()); + databaseProperties.put("db.version", connection.getMetaData().getDatabaseProductVersion()); + databaseProperties.put("db.driver", connection.getMetaData().getDriverName()); + databaseProperties.put("db.driverVersion", connection.getMetaData().getDriverVersion()); + databaseProperties.put("db.username", connection.getMetaData().getUserName()); + databaseProperties.put("db.name", connection.getCatalog()); + // Put "db.schema" field last as getSchema() has a known issues with the jetty jndi h2 drivers which is most likely related to a driver mismatch issue. + // Receiver class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper does not define or inherit an implementation of the resolved method 'abstract java.lang.String getSchema()' of interface java.sql.Connection. + databaseProperties.put("db.schema", connection.getSchema()); + } catch (AbstractMethodError e) { + // Most likely driver mismatch + // https://stackoverflow.com/questions/17969365/why-i-am-getting-java-lang-abstractmethoderror-errors + Log.warning(Geonet.GEONETWORK, "Failed to get db properties. " + e.getMessage()); + } if (connection instanceof BasicDataSource) { BasicDataSource basicDataSource = (BasicDataSource) connection; diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java index fcc69168dc..f41f7eec28 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java @@ -29,17 +29,20 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jeeves.server.context.ServiceContext; import org.apache.commons.lang.StringUtils; -import org.fao.geonet.api.API; import org.fao.geonet.api.ApiParams; import org.fao.geonet.api.ApiUtils; import org.fao.geonet.api.exception.ResourceNotFoundException; import org.fao.geonet.api.exception.WebApplicationException; import org.fao.geonet.api.tools.i18n.LanguageUtils; +import org.fao.geonet.domain.Profile; import org.fao.geonet.kernel.SchemaManager; import org.fao.geonet.kernel.schema.MetadataSchema; import org.fao.geonet.kernel.schema.editorconfig.BatchEditing; import org.fao.geonet.kernel.schema.editorconfig.Editor; import org.fao.geonet.kernel.schema.labels.Codelists; +import org.fao.geonet.kernel.setting.SettingManager; +import org.fao.geonet.kernel.setting.Settings; +import org.fao.geonet.util.UserUtil; import org.fao.geonet.utils.Xml; import org.jdom.Element; import org.json.JSONObject; @@ -48,13 +51,27 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +import org.springframework.security.access.hierarchicalroles.RoleHierarchy; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; import javax.servlet.http.HttpServletRequest; import java.nio.file.Files; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; /** * @@ -74,6 +91,12 @@ public class StandardsApi implements ApplicationContextAware { @Autowired LanguageUtils languageUtils; + @Autowired + SettingManager settingManager; + + @Autowired + RoleHierarchy roleHierarchy; + private ApplicationContext context; public synchronized void setApplicationContext(ApplicationContext context) { @@ -135,8 +158,13 @@ Map getConfigurations( required = false, example = "iso19139") @RequestParam(required = false) - String[] schema + String[] schema, + HttpServletRequest request ) throws Exception { + + ServiceContext serviceContext = ApiUtils.createServiceContext(request); + UserUtil.checkUserProfileLevel(serviceContext.getUserSession(), settingManager, roleHierarchy, Settings.METADATA_BATCH_EDITING_ACCESS_LEVEL, Profile.Editor, "batch edit metadata"); + List listOfRequestedSchema = schema == null ? new ArrayList() : Arrays.asList(schema); Set listOfSchemas = schemaManager.getSchemas(); Map schemasConfig = new HashMap<>(); @@ -394,4 +422,5 @@ public String getEditorAssociatedPanelConfiguration( name, schemasProcessed.toString())); } + } diff --git a/services/src/test/java/org/fao/geonet/api/groups/GroupsApiTest.java b/services/src/test/java/org/fao/geonet/api/groups/GroupsApiTest.java index 02f093d365..6c34f9848c 100644 --- a/services/src/test/java/org/fao/geonet/api/groups/GroupsApiTest.java +++ b/services/src/test/java/org/fao/geonet/api/groups/GroupsApiTest.java @@ -311,7 +311,7 @@ public void addExistingGroup() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("A group with name 'sample' already exist."))); + .andExpect(jsonPath("$.message", is("A group with name 'sample' already exist."))); } /** diff --git a/services/src/test/java/org/fao/geonet/api/identifiers/IdentifiersApiTest.java b/services/src/test/java/org/fao/geonet/api/identifiers/IdentifiersApiTest.java index cb178eb5d6..6930ea9633 100644 --- a/services/src/test/java/org/fao/geonet/api/identifiers/IdentifiersApiTest.java +++ b/services/src/test/java/org/fao/geonet/api/identifiers/IdentifiersApiTest.java @@ -155,7 +155,7 @@ public void addExistingIdentifier() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("A metadata identifier template with id '" + metadataIdentifierTemplateToAdd.getId() + "' already exist."))); + .andExpect(jsonPath("$.message", is("A metadata identifier template with id '" + metadataIdentifierTemplateToAdd.getId() + "' already exist."))); } diff --git a/services/src/test/java/org/fao/geonet/api/records/MetadataValidateApiTest.java b/services/src/test/java/org/fao/geonet/api/records/MetadataValidateApiTest.java index d862f51b6b..4f8afb5279 100644 --- a/services/src/test/java/org/fao/geonet/api/records/MetadataValidateApiTest.java +++ b/services/src/test/java/org/fao/geonet/api/records/MetadataValidateApiTest.java @@ -116,8 +116,7 @@ public void subTemplateValidIsNotSet() throws Exception { .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)) - .andExpect(jsonPath("$.message").value("BadParameterEx")) - .andExpect(jsonPath("$.description").value("Parameter isvalid MUST be set for subtemplate.")); + .andExpect(jsonPath("$.message").value("Parameter isvalid MUST be set for subtemplate.")); List validations = metadataValidationRepository.findAllById_MetadataId(subTemplate.getId()); assertEquals(0, validations.size()); @@ -158,8 +157,7 @@ public void subTemplateValidSetButTemplate() throws Exception { .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)) - .andExpect(jsonPath("$.message").value("BadParameterEx")) - .andExpect(jsonPath("$.description").value("Parameter isvalid can't be set if it is not a Subtemplate. You cannot force validation of a metadata or a template.")); + .andExpect(jsonPath("$.message").value("Parameter isvalid can't be set if it is not a Subtemplate. You cannot force validation of a metadata or a template.")); List validations = metadataValidationRepository.findAllById_MetadataId(subTemplate.getId()); assertEquals(0, validations.size()); diff --git a/services/src/test/java/org/fao/geonet/api/users/UsersApiTest.java b/services/src/test/java/org/fao/geonet/api/users/UsersApiTest.java index 60086e92fc..92e7bd4d98 100644 --- a/services/src/test/java/org/fao/geonet/api/users/UsersApiTest.java +++ b/services/src/test/java/org/fao/geonet/api/users/UsersApiTest.java @@ -184,7 +184,7 @@ public void deleteUserLogged() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("You cannot delete yourself from the user database"))) + .andExpect(jsonPath("$.message", is("You cannot delete yourself from the user database"))) .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)); } @@ -214,7 +214,7 @@ public void deleteUserNotAllowedToUserAdmin() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("You don't have rights to delete this user because the user is not part of your group"))) + .andExpect(jsonPath("$.message", is("You don't have rights to delete this user because the user is not part of your group"))) .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)); } @@ -271,7 +271,7 @@ public void createUserMissingUsername() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("username is a required parameter for newuser operation"))) + .andExpect(jsonPath("$.message", is("username is a required parameter for newuser operation"))) .andExpect(status().is(400)); } @@ -299,7 +299,7 @@ public void createDuplicatedUsername() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("Users with username " + user.getUsername() + .andExpect(jsonPath("$.message", is("Users with username " + user.getUsername() + " ignore case already exists"))) .andExpect(status().is(400)); @@ -329,7 +329,7 @@ public void createDuplicatedUsernameIgnoreCase() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("Users with username " + user.getUsername() + .andExpect(jsonPath("$.message", is("Users with username " + user.getUsername() + " ignore case already exists"))) .andExpect(status().is(400)); @@ -357,7 +357,7 @@ public void resetPassword() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("The old password is not valid."))); + .andExpect(jsonPath("$.message", is("The old password is not valid."))); passwordReset.setPasswordOld("testuser-editor-password"); @@ -397,7 +397,7 @@ public void resetPasswordToNotAllowedUser() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("You don't have rights to do this"))) + .andExpect(jsonPath("$.message", is("You don't have rights to do this"))) .andExpect(status().is(400)); } @@ -424,7 +424,7 @@ public void resetPasswordNotEqual() throws Exception { .content(json) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("Passwords should be equal"))) + .andExpect(jsonPath("$.message", is("Passwords should be equal"))) .andExpect(status().is(400)); } @@ -451,7 +451,7 @@ public void resetPasswordWrongOldPassword() throws Exception { .content(json) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("The old password is not valid."))) + .andExpect(jsonPath("$.message", is("The old password is not valid."))) .andExpect(status().is(400)); } @@ -477,7 +477,7 @@ public void resetPasswordNotExistingUser() throws Exception { .content(json) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("User not found"))) + .andExpect(jsonPath("$.message", is("User not found"))) .andExpect(status().is(404)); } @@ -564,7 +564,7 @@ public void updateUserByUserAdminNotAllowed() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("You don't have rights to do this"))) + .andExpect(jsonPath("$.message", is("You don't have rights to do this"))) .andExpect(status().is(400)); } @@ -598,7 +598,7 @@ public void updateUserDuplicatedUsername() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("Another user with username " + .andExpect(jsonPath("$.message", is("Another user with username " + "'testuser-editor' ignore case already exists"))) .andExpect(status().is(400)); } @@ -633,7 +633,7 @@ public void updateUserDuplicatedUsernameIgnoreCase() throws Exception { .contentType(API_JSON_EXPECTED_ENCODING) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("Another user with username 'testuser-editor' ignore case already exists"))) + .andExpect(jsonPath("$.message", is("Another user with username 'testuser-editor' ignore case already exists"))) .andExpect(status().is(400)); } @@ -701,7 +701,7 @@ public void updateUserAlreadyExistingUsernameCase() throws Exception { .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) .andExpect(status().is(400)) - .andExpect(jsonPath("$.description", is("Another user with username 'testuser-editor' ignore case already exists"))); + .andExpect(jsonPath("$.message", is("Another user with username 'testuser-editor' ignore case already exists"))); } /** diff --git a/services/src/test/java/org/fao/geonet/services/metadata/BatchEditsServiceTest.java b/services/src/test/java/org/fao/geonet/services/metadata/BatchEditsServiceTest.java index 7c6ce23d64..a3835e2f95 100644 --- a/services/src/test/java/org/fao/geonet/services/metadata/BatchEditsServiceTest.java +++ b/services/src/test/java/org/fao/geonet/services/metadata/BatchEditsServiceTest.java @@ -115,7 +115,7 @@ public void testParameterMustBeSet() throws Exception { .contentType(MediaType.APPLICATION_JSON) .session(this.mockHttpSession) .accept(MediaType.parseMediaType("application/json"))) - .andExpect(jsonPath("$.description", is("At least one edit must be defined."))) + .andExpect(jsonPath("$.message", is("At least one edit must be defined."))) .andExpect(status().is(400)); } diff --git a/slave/pom.xml b/slave/pom.xml index 9b6ba891ca..4156e20e7d 100644 --- a/slave/pom.xml +++ b/slave/pom.xml @@ -28,7 +28,7 @@ geonetwork org.geonetwork-opensource - 4.2.6-georchestra + 4.2.7-georchestra GeoNetwork Slave diff --git a/software_development/BUILDING.md b/software_development/BUILDING.md index b6cf044168..397a7074c6 100644 --- a/software_development/BUILDING.md +++ b/software_development/BUILDING.md @@ -1,17 +1,16 @@ # Building -See [Installing from source code](https://geonetwork-opensource.org/manuals/4.0.x/en/install-guide/installing-from-source-code.html) (Installation Guide) +See [Installing from source code](https://docs.geonetwork-opensource.org/4.2/install-guide/installing-from-source-code/) (Installation Guide) -Build GeoNetwork ----------------- +## Build GeoNetwork -Once you checked out the code from Github repository, go inside the GeoNetwork’s root folder and execute the maven build command: +Once you checked out the code from GitHub repository, go inside the GeoNetwork’s root folder and execute the maven build command: ``` mvn clean install ``` -If the build is successful you'll get an output like: +If the build is successful, you'll get an output like: ``` [INFO] [INFO] ------------------------------------------------------------------------ @@ -41,8 +40,7 @@ If the build is successful you'll get an output like: Your local maven repository now contain the GeoNetwork artifacts created (``$HOME/.m2/repository/org/geonetwork-opensource``). -Compilation options -------------------- +## Compilation options Many Maven build options are available, for instance, you might like to use following options : @@ -66,13 +64,11 @@ Many Maven build options are available, for instance, you might like to use foll Please refer to the maven documentation for additional options, [Maven: The Complete Reference](https://books.sonatype.com/mvnref-book/pdf/mvnref-pdf.pdf) -Maven Profiles --------------- +## Maven Profiles Maven profiles are used to enable additional build configuration. -Run Elasticsearch ------------------ +## Run Elasticsearch GeoNetwork requires an Elasticsearch instance as an index. @@ -90,9 +86,7 @@ GeoNetwork requires an Elasticsearch instance as an index. 3. For alternatives see [es/readme](../es/README.md). - -Run Kibana ----------- +## Run Kibana 1. To run, download using maven: @@ -107,12 +101,11 @@ Run Kibana mvn exec:exec -Dkb-start ``` -3. For alternatives see [es/es-dashboard/readme](../es/es-dashboard/README.md). +3. For alternatives see [es/es-dashboards/readme](../es/es-dashboards/README.md). -Run embedded Jetty server -------------------------- +## Run embedded Jetty server -Maven comes with built-in support for Jetty via a [jetty-maven-plugin](https://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html). +Maven comes with built-in support for Jetty via a [jetty-maven-plugin](https://eclipse.dev/jetty/documentation/jetty-12/programming-guide/index.html#jetty-maven-plugin). To run GeoNetwork with the embedded Jetty server: @@ -140,7 +133,7 @@ To run GeoNetwork with the embedded Jetty server: mvn clean:clean@reset ``` -5. For more information see [web/README.md](../web/README.md). +6. For more information see [web/README.md](../web/README.md). @@ -152,8 +145,7 @@ To start the application under the root context, use: ``` -Tool chain ----------- +## Tool chain GeoNetwork requires Java 8 at this time. If you have multiple JDK environments installed our build can make use of an optional `~/.m2/toolchains.xml` file. diff --git a/software_development/GITHUB.md b/software_development/GITHUB.md index 870aaf52de..8b99545886 100644 --- a/software_development/GITHUB.md +++ b/software_development/GITHUB.md @@ -33,4 +33,4 @@ To checkout a branch from upstream:: GeoNetwork uses feature branches for development, and a pull-request workflow for review: * [Contributing](../CONTRIBUTING.md). -* [Making a pull request](https://geonetwork-opensource.org/manuals/trunk/en/contributing/making-a-pull-request.html). +* [Making a pull request](https://docs.geonetwork-opensource.org/4.2/contributing/making-a-pull-request/). diff --git a/software_development/README.md b/software_development/README.md index 4d58433a27..053ff96ea2 100644 --- a/software_development/README.md +++ b/software_development/README.md @@ -13,15 +13,15 @@ This manual is for software developers customizing or developing GeoNetwork: * [Eclipse IDE](ECLIPSE.md) * [IntelliJ IDE](INTELLIJ.md). - See [Installing from source code](https://geonetwork-opensource.org/manuals/4.0.x/en/install-guide/installing-from-source-code.html) (Installation Guide) + See [Installing from source code](https://docs.geonetwork-opensource.org/4.2/install-guide/installing-from-source-code/) (Installation Guide) -* Writing documentation: see [Writing documentation](https://geonetwork-opensource.org/manuals/trunk/en/contributing/writing-documentation.html) (Contributing Guide). -* Release process: See [Doing a release](https://geonetwork-opensource.org/manuals/trunk/en/contributing/doing-a-release.html) (Contributing Guide). +* Writing documentation: see [Documentation Guide](https://docs.geonetwork-opensource.org/latest/devel/docs/) (Contributing Guide). +* Release process: See [Doing a release](https://docs.geonetwork-opensource.org/4.2/contributing/doing-a-release/) (Contributing Guide). If you just want to use the software and are looking for instructions on how to do that, there is a lot of documentation for users, administrators, metadata editors and application -maintainers at: [GeoNetwork Documentation](http://geonetwork-opensource.org/manuals/trunk/eng/users/index.html). +maintainers at: [GeoNetwork Documentation](https://docs.geonetwork-opensource.org/4.2/). # Quickstart diff --git a/web-ui/pom.xml b/web-ui/pom.xml index ed0da4f910..eeab24684a 100644 --- a/web-ui/pom.xml +++ b/web-ui/pom.xml @@ -30,14 +30,14 @@ org.geonetwork-opensource geonetwork - 4.2.6-georchestra + 4.2.7-georchestra org.geonetwork-opensource gn-web-ui jar GeoNetwork user interface module - 4.2.6-georchestra + 4.2.7-georchestra diff --git a/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js b/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js index 84896ced93..508d639231 100644 --- a/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js +++ b/web-ui/src/main/resources/catalog/components/common/needhelp/NeedHelpDirective.js @@ -69,7 +69,7 @@ var helpBaseUrl = gnGlobalSettings.docUrl || - "https://geonetwork-opensource.org/manuals/trunk/{lang}"; + "https://docs.geonetwork-opensource.org/latest/{lang}"; /** * load the JSON file with all the documentation links and put the links in the scope @@ -126,13 +126,20 @@ scope.showHelp = function () { var pageId = attrs.gnNeedHelp; var page = scope.documentationLinks[pageId]; - var baseUrl = helpBaseUrl.replace("{lang}", gnGlobalSettings.lang); + var baseUrl; + + if (gnGlobalSettings.lang !== "en") { + baseUrl = helpBaseUrl.replace("{lang}", gnGlobalSettings.lang); + } else { + baseUrl = helpBaseUrl.replace("/{lang}", ""); + } + var helpPageUrl = baseUrl + "/" + page; testAndOpen(helpPageUrl).then( function () {}, function () { - var baseUrl = helpBaseUrl.replace("{lang}", "en"); + var baseUrl = helpBaseUrl.replace("/{lang}", ""); var helpPageUrl = baseUrl + "/" + page; testAndOpen(helpPageUrl); diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js index 246247d3d9..9ef7f90ebe 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js @@ -320,13 +320,15 @@ "gnRelatedResources", "gnExternalViewer", "gnConfigService", + "gnUrlUtils", function ( gnRelatedService, gnGlobalSettings, gnSearchSettings, gnRelatedResources, gnExternalViewer, - gnConfigService + gnConfigService, + gnUrlUtils ) { return { restrict: "A", @@ -417,7 +419,15 @@ ".*/api/records/" + scope.md.uuid + "/attachments/.*" ) != null ) { - scope.relations[idx][i].url += "?approved=false"; + scope.relations[idx][i].url = gnUrlUtils.remove( + scope.relations[idx][i].url, + ["approved"], + true + ); + scope.relations[idx][i].url = gnUrlUtils.append( + scope.relations[idx][i].url, + "approved=false" + ); } } } diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/partials/related.html b/web-ui/src/main/resources/catalog/components/metadataactions/partials/related.html index 9301df49d8..0b936fb9c0 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/partials/related.html +++ b/web-ui/src/main/resources/catalog/components/metadataactions/partials/related.html @@ -176,8 +176,8 @@