Skip to content

Commit

Permalink
merge branch from upstrea/4.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed Jan 4, 2023
1 parent 91b1187 commit fa284b7
Show file tree
Hide file tree
Showing 1,232 changed files with 111,309 additions and 83,787 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=auto eol=lf

# Standard to msysgit
*.doc diff=astextplain
Expand Down Expand Up @@ -33,4 +33,3 @@
*.eot binary
*.woff binary

*.xsd text eol=lf
18 changes: 5 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,22 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Java JDK
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v3.5.1
with:
java-version: 8
# Java distribution. See the list of supported distributions in README file
distribution: temurin
# The package type (jdk, jre, jdk+fx, jre+fx)
java-package: jdk
cache: maven

- name: Maven repository caching
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-


# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -72,7 +64,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -86,7 +78,7 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

- name: Remove SNAPSHOT jars from repository
run: |
Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,21 @@ jobs:
- os: ubuntu-18.04
jdk: 8
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# 500 commits, set to 0 to get all
fetch-depth: 500
submodules: 'recursive'
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3.5.1
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.6.3
- name: Maven repository caching
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B -V install -DskipTests=true -Dmaven.javadoc.skip=true
- name: Remove SNAPSHOT jars from repository
Expand All @@ -47,26 +42,21 @@ jobs:
QA:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# 500 commits, set to 0 to get all
fetch-depth: 500
submodules: 'recursive'
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3.5.1
with:
distribution: 'temurin'
java-version: 8
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.6.3
- name: Maven repository caching
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Test with maven
run: mvn -B -V -fae install
- name: Remove SNAPSHOT jars from repository
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ git*.properties
# Directories and paths
*/*/.*
*/*/target/
*/.*
*/target/
.*/
GeoNetwork*
Expand All @@ -27,6 +26,7 @@ docs/schema-loc-*.rst
eclipse/
es/elasticsearch-*
es/es-dashboards/kibana-*
es/es-dashboards/data/nodes/
harvesters/harvester_*.log
idea/
jcs_caching/
Expand All @@ -39,6 +39,9 @@ schemas/*/doc/*/*.rst
schematrons/.build
target/
transifex/transifex-format/

# web-app, clear using: mvn -f web/pom.xml clean:clean@reset

web-itest/jcs_caching
web-ui/src/main/resources/catalog/lib/gn*.min.js
web-ui/src/main/resources/catalog/style/gn*.css
Expand All @@ -52,14 +55,15 @@ web/jcs_caching/
web/logs/
web/src/main/webapp/META-INF/MANIFEST.MF
web/src/main/webapp/WEB-INF/data/0*
web/src/main/webapp/WEB-INF/data/config/encryptor.properties
web/src/main/webapp/WEB-INF/data/config/index/records.json
web/src/main/webapp/WEB-INF/data/config/schema_plugins/*/schematron/schematron*.xsl
web/src/main/webapp/WEB-INF/data/config/schema_plugins/csw-record
web/src/main/webapp/WEB-INF/data/config/schema_plugins/dublin-core
web/src/main/webapp/WEB-INF/data/config/schema_plugins/iso19*
web/src/main/webapp/WEB-INF/data/config/schema_plugins/dcat2
web/src/main/webapp/WEB-INF/data/config/schema_plugins/schemaplugin-uri-catalog.xml
web/src/main/webapp/WEB-INF/data/config/schemaplugin-uri-catalog.xml
web/src/main/webapp/WEB-INF/data/config/encryptor.properties
web/src/main/webapp/WEB-INF/data/data/backup
web/src/main/webapp/WEB-INF/data/data/metadata_data
web/src/main/webapp/WEB-INF/data/data/metadata_subversion
Expand Down
5 changes: 3 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Each GeoNetwork release is supported with bug fixes for a limited period, with p

| Version | Supported | Comment |
| ----------- | ------------------ |------------------------ |
| 4.x | :white_check_mark: | Current version |
| 3.x | :white_check_mark: | Maintenance version |
| 4.2.x | :white_check_mark: | Current version |
| 4.0.x | :white_check_mark: | Maintenance version |
| 3.12.x | :white_check_mark: | Maintenance version |

If your organisation is making use of a GeoNetwork version that is no longer in use by the community all is not lost. You can volunteer on the developer list to make additional releases, or engage with one of our [Commercial Support](https://www.osgeo.org/service-providers/?p=geonetwork) providers.

Expand Down
6 changes: 3 additions & 3 deletions cachingxslt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.2.0-georchestra</version>
<version>4.2.2-georchestra</version>
</parent>


Expand All @@ -56,8 +56,8 @@

<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import net.sf.saxon.TransformerFactoryImpl;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.fao.geonet.utils.CachedTransformer;

import java.io.File;
Expand All @@ -28,7 +29,7 @@ public class CachingTransformerFactory extends TransformerFactoryImpl implements
* Factory logger.
*/
protected static final Logger logger =
Logger.getLogger(CachingTransformerFactory.class);
LogManager.getLogger(CachingTransformerFactory.class);
/**
* Active readers count.
*/
Expand Down
14 changes: 9 additions & 5 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.2.0-georchestra</version>
<version>4.2.2-georchestra</version>
</parent>


Expand Down Expand Up @@ -74,9 +74,13 @@
<artifactId>jdbm</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jcs</groupId>
<artifactId>jcs</artifactId>
Expand Down Expand Up @@ -171,8 +175,8 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>diff_match_patch</groupId>
<artifactId>diff_match_patch</artifactId>
<groupId>org.bitbucket.cowwoc</groupId>
<artifactId>diff-match-patch</artifactId>
</dependency>
</dependencies>

Expand Down
77 changes: 72 additions & 5 deletions common/src/main/java/org/fao/geonet/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,99 @@

package org.fao.geonet;

import org.apache.log4j.FileAppender;

//=============================================================================

import org.apache.logging.log4j.core.appender.FileAppender;

/**
* GeoNetwork logger wrapper providing module based logging services.
*/
public interface Logger {
/**
* Quick check to see if debug logging is available, used to avoid creating
* expensive debug messages if they are not going to be used.
*
* @return check if debug logging is enabled
*/
public boolean isDebugEnabled();

/**
* Log debug message used indicate module troubleshoot module activity.
*
* @param message debug message used to provide in
*/
public void debug(String message);

/**
* Log information message indicating module progress.
*
* @param message information message indicating progress
*/
public void info(String message);

/** Log warning message indicating potentially harmful situation, module
* will continue to try and complete current activity.
*
* @param message Warning message indicating potentially harmful situation
*/
public void warning(String message);

/**
* Log error message indicating module cannot continue current activity.
*
* @param message Error message
*/
public void error(String message);

/**
* Log error message using provided throwable, indicating module cannot continue
* current activity.
*
* @param ex Cause of error condition.
*/
public void error(Throwable ex);

/**
* Log severe message, indicating application cannot continue to operate.
*
* @param message severe message
*/
public void fatal(String message);

/**
* Functional module used for logging messages (for example {@code jeeves.engine}).
*
* @return functional module used for logging messages.
*/
public String getModule();

public void setAppender(FileAppender fa);

/**
* Configure logger with log4j {@link FileAppender}, used for output.
*
* The file appender is also responsible for log file location provided by {@link #getFileAppender()}.
*
* @param fileAppender Log4j FileAppender
*/
public void setAppender(FileAppender fileAppender);

/**
* The log file name from the file appender for this module.
*
* Note both module and fallback module are provided allowing providing a better opportunity
* to learn the log file location. Harvesters use the log file name parent directory as a good
* location to create {@code /harvester_logs/} folder.
*
* Built-in configuration uses log file location {@code logs/geonetwork.log} relative to the current directory, or relative to system property {@code log_file}.
*
* @return logfile location of {@code logs/geonetwork.log} file
*/
public String getFileAppender();

public org.apache.log4j.Level getThreshold();
/**
* Access to omodule logging level, providing
* @return
*/
public org.apache.logging.log4j.Level getThreshold();

}

Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/org/fao/geonet/utils/DateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public class DateUtil {
private static final Pattern gsYearMonth = Pattern.compile("([0-9]{4})-([0-1][0-9])(-([0-2][0-9]):([0-5][0-9])([A-Z]{0,1}))?");

// Some catalogs are using 2012-09-12Z
private static final Pattern gsYearMonthDayZ = Pattern.compile("([0-9]{4})-([0-1][0-9])-([0-2][0-9])Z");
private static final Pattern gsDayMonthYear = Pattern.compile("([0-2][0-9])/([0-1][0-9])/([0-9]{4})");
private static final Pattern gsYearMonthDayZ = Pattern.compile("([0-9]{4})-([0-1][0-9])-([0-3][0-9])Z");
private static final Pattern gsDayMonthYear = Pattern.compile("([0-3][0-9])/([0-1][0-9])/([0-9]{4})");

// Fri Jan 01 2010 00:00:00 GMT+0100 (CET)
private static final Pattern htmlFormat = Pattern
Expand Down
Loading

0 comments on commit fa284b7

Please sign in to comment.