Skip to content

Commit

Permalink
Merge pull request #260 from georchestra/georchestra-gn4.2.x-rebase
Browse files Browse the repository at this point in the history
Geonetwork 4.2.7
  • Loading branch information
f-necas authored Jan 26, 2024
2 parents 5dc598b + 22a7d05 commit 8419cfa
Show file tree
Hide file tree
Showing 2,383 changed files with 120,654 additions and 80,817 deletions.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**Geochestra/geonetwork checklist**
<!--- In order to ease future geonetwork migration : -->

- [ ] PR only involves cherry picked commits from upstream.
- [ ] PR contains custom code which will be soon available in a release on upstream and can be overrided. Mention core-geonetwork version if possible.
- [ ] PR contains custom georchestra code, which need to be verified in future migration.
- [ ] I have properly filled [migration-helper-changelog.md](..%2Fgeorchestra-migration%2Fmigration-helper-changelog.md) file.

12 changes: 7 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [ 4.2.x ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [ 4.2.x ]
schedule:
- cron: '44 20 * * 5'

Expand All @@ -38,10 +38,12 @@ jobs:

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

uses: actions/checkout@v4
with:
show-progress: 'false'

- name: Setup Java JDK
uses: actions/setup-java@v3.5.1
uses: actions/setup-java@v3.12.0
with:
java-version: 8
# Java distribution. See the list of supported distributions in README file
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions .github/workflows/georchestra-gn4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ jobs:
- name: "run tests"
run: mvn verify -Pit

- name: "Building the docker image"
working-directory: web/
run: |
mvn clean package docker:build -Pdocker,log4j-logstash,sentry-log4j \
-DdockerImageName=georchestra/geonetwork:${DOCKER_TAG} -DskipTests
- name: "publish the webapp as artifact"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v1
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ git*.properties
*/*/.*
*/*/target/
*/target/
**/.idea
**/.settings
.*/
GeoNetwork*
!.github
#GeoNetwork*
/geonetwork*
camel-harvesters/wfsfeature-harvester/logs
changes-*
Expand Down Expand Up @@ -81,6 +84,7 @@ web/src/main/webapp/WEB-INF/data/wro4j-cache*
web/src/main/webapp/WEB-INF/data_*
web/src/main/webapp/WEB-INF/metadata_subversion/
web/src/main/webapp/WEB-INF/server.prop
web/src/main/webapp/WEB-INF/prebuilt
web/src/main/webapp/data/
web/src/main/webapp/doc/en
web/src/main/webapp/doc/fr
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@
[submodule "web-ui/src/main/resources/catalog/lib/bootstrap-table"]
path = web-ui/src/main/resources/catalog/lib/bootstrap-table
url = https://github.com/wenzhixin/bootstrap-table.git
[submodule "docs/manuals"]
path = docs/manuals
url = https://github.com/geonetwork/doc.git
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.2-georchestra</version>
<version>4.2.7-georchestra</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion code_quality/README.md
Original file line number Diff line number Diff line change
@@ -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.
For example, findbugs-excludes is used by both the build tool's findbugs implementation as well as IDES for running findbugs.
2 changes: 1 addition & 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.2-georchestra</version>
<version>4.2.7-georchestra</version>
</parent>


Expand Down
24 changes: 12 additions & 12 deletions common/src/main/java/org/fao/geonet/utils/AbstractHttpRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2016 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)
*
Expand Down Expand Up @@ -83,7 +83,7 @@ public class AbstractHttpRequest {
private boolean useProxy;
private String proxyHost;
private int proxyPort;
private ArrayList<NameValuePair> alSimpleParams = new ArrayList<NameValuePair>();
private ArrayList<NameValuePair> alSimpleParams = new ArrayList<>();
private String postData;
private boolean preemptiveBasicAuth;
private HttpClientContext httpClientContext;
Expand Down Expand Up @@ -303,9 +303,9 @@ protected HttpRequestBase setupHttpMethod() throws IOException {
}

if (host == null || protocol == null) {
throw new IllegalStateException(String.format(getClass().getSimpleName() + " is not ready to be executed: \n\tprotocol: '%s' " +
throw new IllegalStateException(String.format("%s is not ready to be executed: \n\tprotocol: '%s' " +
"\n\tuserinfo: '%s'\n\thost: '%s' \n\tport: '%s' \n\taddress: '%s'\n\tquery '%s'" +
"\n\tfragment: '%s'", protocol, userInfo, host, port, address, query, fragment));
"\n\tfragment: '%s'", getClass().getSimpleName(), protocol, userInfo, host, port, address, query, fragment));
}

HttpRequestBase httpMethod;
Expand Down Expand Up @@ -352,25 +352,25 @@ protected HttpRequestBase setupHttpMethod() throws IOException {

protected String getSentData(HttpRequestBase httpMethod) {
URI uri = httpMethod.getURI();
StringBuilder sentData = new StringBuilder(httpMethod.getMethod()).append(" ").append(uri.getPath());
StringBuilder sentDataValue = new StringBuilder(httpMethod.getMethod()).append(" ").append(uri.getPath());

if (uri.getQuery() != null) {
sentData.append("?" + uri.getQuery());
sentDataValue.append("?" + uri.getQuery());
}

sentData.append("\r\n");
sentDataValue.append("\r\n");

for (Header h : httpMethod.getAllHeaders()) {
sentData.append(h);
sentDataValue.append(h);
}

sentData.append("\r\n");
sentDataValue.append("\r\n");

if (httpMethod instanceof HttpPost) {
sentData.append(postData);
sentDataValue.append(postData);
}

return sentData.toString();
return sentDataValue.toString();
}

private Element soapEmbed(Element elem) {
Expand All @@ -393,7 +393,7 @@ protected Element soapUnembed(Element envelope) throws BadSoapResponseEx {

List<Element> list = body.getChildren();

if (list.size() == 0)
if (list.isEmpty())
throw new BadSoapResponseEx(envelope);

return list.get(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2016 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)
*
Expand Down Expand Up @@ -200,6 +200,7 @@ public HttpClientBuilder getDefaultHttpClientBuilder() {
final HttpClientBuilder builder = HttpClientBuilder.create();
builder.setRedirectStrategy(new LaxRedirectStrategy());
builder.disableContentCompression();
builder.useSystemProperties();

synchronized (this) {
if (connectionManager == null) {
Expand Down Expand Up @@ -249,40 +250,40 @@ public void closeIdleConnections(long idleTimeout, TimeUnit tunit) {

private static class AdaptingResponse extends AbstractClientHttpResponse {

private final CloseableHttpResponse _response;
private final CloseableHttpClient _client;
private final CloseableHttpResponse response;
private final CloseableHttpClient client;

public AdaptingResponse(CloseableHttpClient client, CloseableHttpResponse response) {
this._response = response;
this._client = client;
this.response = response;
this.client = client;
}

@Override
public int getRawStatusCode() throws IOException {
return _response.getStatusLine().getStatusCode();
return response.getStatusLine().getStatusCode();
}

@Override
public String getStatusText() throws IOException {
return _response.getStatusLine().getReasonPhrase();
return response.getStatusLine().getReasonPhrase();
}

@Override
public void close() {
IOUtils.closeQuietly(_response);
IOUtils.closeQuietly(_client);
IOUtils.closeQuietly(response);
IOUtils.closeQuietly(client);
}

@Override
public InputStream getBody() throws IOException {
return _response.getEntity().getContent();
return response.getEntity().getContent();
}

@Override
public HttpHeaders getHeaders() {
final HttpHeaders httpHeaders = new HttpHeaders();

final Header[] headers = _response.getAllHeaders();
final Header[] headers = response.getAllHeaders();

for (Header header : headers) {
final HeaderElement[] elements = header.getElements();
Expand Down
22 changes: 4 additions & 18 deletions common/src/main/java/org/fao/geonet/utils/IO.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//=============================================================================
//=== Copyright (C) 2001-2005 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)
//===
Expand Down Expand Up @@ -30,38 +30,24 @@
import org.fao.geonet.utils.debug.DebuggingInputStream;
import org.fao.geonet.utils.debug.DebuggingReader;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
import java.nio.file.FileSystemNotFoundException;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

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

/**
Expand Down
Loading

0 comments on commit 8419cfa

Please sign in to comment.