Skip to content

Commit

Permalink
feat: implement georchestra needs
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 16, 2023
1 parent 0200c53 commit 2cc4da9
Show file tree
Hide file tree
Showing 73 changed files with 1,153 additions and 141 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ git*.properties
*/*/.*
*/*/target/
*/target/
.*/
**/.idea
**/.settings
#GeoNetwork*
/geonetwork*
camel-harvesters/wfsfeature-harvester/logs
Expand Down
2 changes: 1 addition & 1 deletion 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.6-0</version>
<version>4.2.6-georchestra</version>
</parent>


Expand Down
21 changes: 20 additions & 1 deletion 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.6-0</version>
<version>4.2.6-georchestra</version>
</parent>


Expand Down Expand Up @@ -207,6 +207,25 @@
</plugins>
</build>
</profile>
<profile>
<id>jdk11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<properties>
<rootProjectDir>${basedir}/..</rootProjectDir>
Expand Down
3 changes: 2 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>gn-core</artifactId>
<name>GeoNetwork core</name>
<version>4.2.6-georchestra</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,81 +124,6 @@ public void init(final String webappName, final Path webappDir, Path systemDataD
this.init(webappName, webappDir, handlerConfig, jeevesServlet);
}


/**
* This is the name of the RollingFileAppender in your log4j2.xml configuration file.
* <p>
* LogConfig uses this name to lookup RollingFileAppender to check configuration in
* case a custom log file location has been used.
*/
private static final String FILE_APPENDER_NAME = "File";

/**
* Logfile location as determined from appender, or system property, or default.
* <p>
* Note this code is duplicated with the deprecated {@code LogConfig}.
*
* @return logfile location, or {@code null} if unable to determine
*/
public static File getLogfile() {
// Appender is supplied by LogUtils based on parsing log4j2.xml file indicated
// by database settings

// First, try the fileappender from the logger named "geonetwork"
Appender appender = Logger.getLogger(Geonet.GEONETWORK).getAppender(FILE_APPENDER_NAME);
// If still not found, try the one from the logger named "jeeves"
if (appender == null) {
appender = Logger.getLogger(Log.JEEVES).getAppender(FILE_APPENDER_NAME);
}
if (appender != null) {
if (appender instanceof AppenderWrapper) {
AppenderWrapper wrapper = (AppenderWrapper) appender;
org.apache.logging.log4j.core.Appender appender2 = wrapper.getAppender();

if (appender2 instanceof FileAppender) {
FileAppender fileAppender = (FileAppender) appender2;
String logFileName = fileAppender.getFileName();
if (logFileName != null) {
File logFile = new File(logFileName);
if (logFile.exists()) {
return logFile;
}
}
}
if (appender2 instanceof RollingFileAppender) {
RollingFileAppender fileAppender = (RollingFileAppender) appender2;
String logFileName = fileAppender.getFileName();
if (logFileName != null) {
File logFile = new File(logFileName);
if (logFile.exists()) {
return logFile;
}
}
}
}
}
Log.warning(Geonet.GEONETWORK, "Error when getting logger file for the " + "appender named '" + FILE_APPENDER_NAME + "'. "
+ "Check your log configuration file. "
+ "A FileAppender or RollingFileAppender is required to return last activity to the user interface."
+ "Appender file not found.");

if (System.getProperties().containsKey("log_dir")) {
File logDir = new File(System.getProperty("log_dir"));
if (logDir.exists() && logDir.isDirectory()) {
File logFile = new File(logDir, "logs/geonetwork.log");
if (logFile.exists()) {
return logFile;
}
}
} else {
File logFile = new File("logs/geonetwork.log");
if (logFile.exists()) {
return logFile;
}
}
return null; // unavailable
}

/**
* Logfile location as determined from appender, or system property, or default.
* <p>
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/resources/config-spring-geonetwork.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">


<context:property-placeholder location="file:${georchestra.datadir}/geonetwork/geonetwork.properties"
ignore-resource-not-found="true" ignore-unresolvable="true" order="1"/>
<context:property-placeholder location="WEB-INF/config-geonetwork-georchestra.properties"
ignore-resource-not-found="true" ignore-unresolvable="true" order="2"/>
<context:property-placeholder location="${app.properties},file://#{systemEnvironment['geonetwork_dir']}/config/app.properties"
ignore-unresolvable="true"
ignore-resource-not-found="true"
order="3"
file-encoding="UTF-8"/>

<context:annotation-config/>
Expand Down
2 changes: 1 addition & 1 deletion csw-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>gn-docs</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-guide</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-docs</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion doi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion es/es-dashboards/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>gn-es</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<profiles>
<profile>
Expand Down
2 changes: 1 addition & 1 deletion es/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-es</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion estest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>

<name>GeoNetwork Events</name>
Expand Down
2 changes: 1 addition & 1 deletion georchestra-integration/externalized-accounts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>gn-georchestra-integration</artifactId>
<version>4.2.2-georchestra</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-externalized-accounts</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion georchestra-integration/georchestra-authnz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>gn-georchestra-integration</artifactId>
<version>4.2.2-georchestra</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-georchestra-authnz</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion georchestra-integration/georchestra-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>gn-georchestra-integration</artifactId>
<version>4.2.2-georchestra</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-georchestra-utils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion georchestra-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.2.2-georchestra</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-georchestra-integration</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion harvesters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion healthmonitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gn-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion inspire-atom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion jmeter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<!-- =========================================================== -->
<!-- Module Description -->
Expand Down
2 changes: 1 addition & 1 deletion listeners/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>

<name>GeoNetwork Events</name>
Expand Down
2 changes: 1 addition & 1 deletion messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>geonetwork</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion oaipmh/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.2.6-0</version>
<version>4.2.6-georchestra</version>
</parent>


Expand Down
Loading

0 comments on commit 2cc4da9

Please sign in to comment.