Skip to content

Commit

Permalink
Merge tag '4.2.6' into 4.2.x-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 15, 2023
2 parents 56f1e0c + d7b4ae6 commit a626eba
Show file tree
Hide file tree
Showing 84 changed files with 582 additions and 1,126 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Linux GitHub CI

on: [pull_request,push,workflow_dispatch]

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx512m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
TAKARI_SMART_BUILDER_VERSION: 0.6.1

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
jdk: 8
steps:
- uses: actions/checkout@v4
with:
# 500 commits, set to 0 to get all
fetch-depth: 500
submodules: 'recursive'
show-progress: 'false'
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Build with Maven
run: mvn -B -V install -DskipTests=true -Dmaven.javadoc.skip=true
- name: Remove SNAPSHOT jars from repository
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
- name: Remove Schema 3.8 jars from repository
run: |
find ~/.m2/repository -name "*3.8*" -type d | xargs rm -rf {}
QA:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
# 500 commits, set to 0 to get all
fetch-depth: 500
submodules: 'recursive'
show-progress: 'false'
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 8
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.6.3
- name: Test with maven
run: |
mvn resources:resources@copy-index-schema-to-source -f web
mvn -B -V -fae verify -Pit
- name: Remove SNAPSHOT jars from repository
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
- name: Remove Schema 3.8 jars from repository
run: |
find ~/.m2/repository -name "*3.8*" -type d | xargs rm -rf {}
21 changes: 0 additions & 21 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,6 @@
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<!-- bridge java util logging api based on logging.properties -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<!-- bridge slf4j api for testig wtih apacheds -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<!-- log4j 2 logging configured via log4j2.xml -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down Expand Up @@ -454,19 +442,10 @@
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
</dependency>
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
</dependency>
<dependency>
<groupId>org.mapfish.print</groupId>
<artifactId>print-lib</artifactId>
<exclusions>
<exclusion>
<!-- provided by openpdf -->
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
</exclusion>
<exclusion>
<!-- provided by openpdf -->
<groupId>com.itextpdf</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ protected String determineTargetUrl(HttpServletRequest request, HttpServletRespo

String siteHost = settingManager.getValue(Settings.SYSTEM_SERVER_HOST);
String siteProtocol = settingManager.getValue(Settings.SYSTEM_SERVER_PROTOCOL);

// some conditional logic to handle the case where there's no port in the settings
SettingInfo si = new SettingInfo();
int sitePort = si.getSitePort();
int sitePort = si.getSitePort();

if (!hostName.equalsIgnoreCase(siteHost) ||
!protocol.equalsIgnoreCase(siteProtocol) ||
port != sitePort) {
!protocol.equalsIgnoreCase(siteProtocol) ||
port != sitePort) {
urlPatternValue = getDefaultTargetUrl();
}
} catch (MalformedURLException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

package org.fao.geonet.kernel;

import static org.fao.geonet.kernel.setting.Settings.SYSTEM_METADATAPRIVS_PUBLICATIONBYGROUPOWNERONLY;
import jeeves.server.UserSession;
import jeeves.server.context.ServiceContext;
import org.apache.commons.lang.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ public static File getLogfile() {
return Log.getLogfile();
}

/**
* 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() {
return Log.getLogfile();
}

/**
* Determines the location of a property based on the
* following lookup mechanism:
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/org/fao/geonet/kernel/Thesaurus.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ public class Thesaurus {
private Cache<String, Object> THESAURUS_SEARCH_CACHE;


private Cache<String, Object> THESAURUS_SEARCH_CACHE;


/**
* Available for subclasses.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.fao.geonet.kernel.schema.SchemaPlugin;
import org.fao.geonet.kernel.search.EsSearchManager;
import org.fao.geonet.kernel.search.IndexingMode;
import org.fao.geonet.kernel.search.IndexingMode;
import org.fao.geonet.kernel.search.index.BatchOpsMetadataReindexer;
import org.fao.geonet.kernel.setting.SettingManager;
import org.fao.geonet.kernel.setting.Settings;
Expand Down Expand Up @@ -742,7 +741,8 @@ public synchronized AbstractMetadata updateMetadata(final ServiceContext context
session.removeProperty(Geonet.Session.VALIDATION_REPORT + metadataId);
}
String schema = metadataSchemaUtils.getMetadataSchema(metadataId);
final AbstractMetadata metadata = metadataUtils.findOne(metadataId);

final AbstractMetadata metadata = metadataUtils.findOne(metadataId);

if (updateDateStamp) {
if (StringUtils.isEmpty(changeDate)) {
Expand All @@ -752,6 +752,7 @@ public synchronized AbstractMetadata updateMetadata(final ServiceContext context
metadata.getDataInfo().setChangeDate(new ISODate(changeDate));
}
}

String uuidBeforeUfo = null;
if (ufo) {
String parentUuid = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private void addMDFields(Element doc, Path schemaDir,
IndexingMode indexingMode) {
final Path styleSheet = getXSLTForIndexing(schemaDir, metadataType);
try {
Map<String, Object> indexParams = new HashMap<String, Object>();
Map<String, Object> indexParams = new HashMap<>();
indexParams.put("fastIndexMode", indexingMode.equals(IndexingMode.core));

Element fields = Xml.transform(metadata, styleSheet, indexParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ public UserDetails getUserDetails(OidcIdToken idToken, Map attributes, boolean w
*/
//from keycloak
protected void updateGroups(Map<Profile, List<String>> profileGroups, User user) {
// First we remove all previous groups
userGroupRepository.deleteAll(UserGroupSpecs.hasUserId(user.getId()));

Set<UserGroup> userGroups = new HashSet<>();

// Now we add the groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ public void testResolveLocalXLink() throws Exception {
String id = _dataManager.insertMetadata(context, schema, metadata, uuid, owner, groupOwner, source, metadataType, null,
null, createDate, changeDate, false, IndexingMode.none);

SpringLocalServiceInvoker mockInvoker = resetAndGetMockInvoker();

String keyword1 = "World";
Element element1 = new SAXBuilder().build(new StringReader(String.format(responseTemplate, keyword1))).getRootElement();
when(springLocalServiceInvoker.invoke(any(String.class))).thenReturn(element1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

package org.fao.geonet.component.csw;

import org.fao.geonet.kernel.search.IndexingMode;
import org.locationtech.jts.util.Assert;
import jeeves.server.UserSession;
import jeeves.server.context.ServiceContext;
import org.fao.geonet.ApplicationContextHolder;
Expand Down Expand Up @@ -360,6 +358,7 @@ private int updateTransaction(Element request, Element xml, ServiceContext conte
}

beforeMetadata = metadataUtils.findOneByUuid(uuid).getXmlData(false);

String language = context.getLanguage();
dataMan.updateMetadata(context, id, xml,
applyValidation, applyUpdateFixedInfo,
Expand Down
Binary file added docs/manual/overrides/.icons/.DS_Store
Binary file not shown.
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
Empty file.
5 changes: 0 additions & 5 deletions doi/src/main/java/org/fao/geonet/doi/client/DoiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ private void checkPreConditions(AbstractMetadata metadata, String doi) throws Do
.withDescriptionKey("exception.doi.missingSavedquery.description",
new String[]{ metadata.getUuid(), schema.getName(),
SavedQuery.DOI_GET, e.getMessage(),
schema.getName() })
.withMessageKey("exception.doi.missingSavedquery")
.withDescriptionKey("exception.doi.missingSavedquery.description",
new String[]{ metadata.getUuid(), schema.getName(),
DOI_GET_SAVED_QUERY, e.getMessage(),
schema.getName() });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import jeeves.server.UserSession;
import jeeves.server.context.ServiceContext;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.ThreadContext;
import org.fao.geonet.Logger;
import org.fao.geonet.constants.Geonet;
import org.fao.geonet.csw.common.exceptions.InvalidParameterValueEx;
Expand Down Expand Up @@ -606,6 +605,7 @@ protected OperResult harvest() {
cancelMonitor.set(false);
try {
String logfile = LogUtil.initializeHarvesterLog(getType(), this.getParams().getName());

this.log.info("Starting harvesting of " + this.getParams().getName());
error = null;
errors.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.fao.geonet.kernel.harvest.harvester.*;
import org.fao.geonet.kernel.mef.*;
import org.fao.geonet.kernel.search.IndexingMode;
import org.fao.geonet.kernel.search.IndexingMode;
import org.fao.geonet.kernel.setting.SettingManager;
import org.fao.geonet.kernel.setting.Settings;
import org.fao.geonet.repository.GroupRepository;
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>

Expand Down
Loading

0 comments on commit a626eba

Please sign in to comment.