Skip to content

Commit ceeaebe

Browse files
committed
Merge remote-tracking branch 'upstream/main' into async_indexing
# Conflicts: # core/src/main/java/org/fao/geonet/kernel/datamanager/IMetadataIndexer.java # core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataManager.java # core/src/main/java/org/fao/geonet/kernel/search/index/BatchOpsMetadataReindexer.java # core/src/test/java/org/fao/geonet/AbstractCoreIntegrationTest.java
2 parents f0d7469 + f7b49c8 commit ceeaebe

File tree

266 files changed

+7232
-2676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+7232
-2676
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These are supported funding model platforms
22

33
github: [osgeo]
4-
cusotm: ['https://github.com/geonetwork/core-geonetwork/wiki#financial-support','https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LDTWEL3XKUVU8&source=url','https://www.osgeo.org/about/how-to-become-a-sponsor/']
4+
custom: ['https://github.com/geonetwork/core-geonetwork/wiki#financial-support','https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LDTWEL3XKUVU8&source=url','https://www.osgeo.org/about/how-to-become-a-sponsor/']

.github/workflows/linux.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ jobs:
6868
run: |
6969
mvn -B resources:resources@copy-index-schema-to-source -f web
7070
mvn -B -ntp -V -fae verify -Drelesae -Pit
71+
- name: Check for uncommitted changes such as formatting changes
72+
run: |
73+
if [[ -n "$(git status -s)" ]]; then
74+
echo "Uncommitted changes"
75+
git status -s
76+
exit 1
77+
fi
7178
- name: Remove SNAPSHOT jars from repository
7279
run: |
7380
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ web/logs/
6363
web/src/main/webapp/META-INF/MANIFEST.MF
6464
web/src/main/webapp/WEB-INF/data/0*
6565
web/src/main/webapp/WEB-INF/data/config/encryptor.properties
66+
web/src/main/webapp/WEB-INF/data/config/codelist/external/thesauri/theme/mobility-theme.rdf
6667
web/src/main/webapp/WEB-INF/data/config/index/records.json
6768
web/src/main/webapp/WEB-INF/data/config/schema_plugins/*
6869
web/src/main/webapp/WEB-INF/data/config/schemaplugin-uri-catalog.xml

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<artifactId>jaxen</artifactId>
111111
</dependency>
112112
<dependency>
113-
<groupId>jsch</groupId>
113+
<groupId>com.github.mwiede</groupId>
114114
<artifactId>jsch</artifactId>
115115
</dependency>
116116
<dependency>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//=============================================================================
2+
//=== Copyright (C) 2001-2025 Food and Agriculture Organization of the
3+
//=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
4+
//=== and United Nations Environment Programme (UNEP)
5+
//===
6+
//=== This program is free software; you can redistribute it and/or modify
7+
//=== it under the terms of the GNU General Public License as published by
8+
//=== the Free Software Foundation; either version 2 of the License, or (at
9+
//=== your option) any later version.
10+
//===
11+
//=== This program is distributed in the hope that it will be useful, but
12+
//=== WITHOUT ANY WARRANTY; without even the implied warranty of
13+
//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
//=== General Public License for more details.
15+
//===
16+
//=== You should have received a copy of the GNU General Public License
17+
//=== along with this program; if not, write to the Free Software
18+
//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19+
//===
20+
//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
21+
//=== Rome - Italy. email: geonetwork@osgeo.org
22+
//==============================================================================
23+
package org.fao.geonet.exceptions;
24+
25+
public class TooManyMDsForThisSubTemplateException extends RuntimeException {
26+
27+
public TooManyMDsForThisSubTemplateException(String msg) {
28+
super(msg);
29+
}
30+
31+
public TooManyMDsForThisSubTemplateException(String msg, Throwable cause) {
32+
super(msg, cause);
33+
}
34+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//=============================================================================
2+
//=== Copyright (C) 2001-2025 Food and Agriculture Organization of the
3+
//=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
4+
//=== and United Nations Environment Programme (UNEP)
5+
//===
6+
//=== This library is free software; you can redistribute it and/or
7+
//=== modify it under the terms of the GNU Lesser General Public
8+
//=== License as published by the Free Software Foundation; either
9+
//=== version 2.1 of the License, or (at your option) any later version.
10+
//===
11+
//=== This library is distributed in the hope that it will be useful,
12+
//=== but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
//=== Lesser General Public License for more details.
15+
//===
16+
//=== You should have received a copy of the GNU Lesser General Public
17+
//=== License along with this library; if not, write to the Free Software
18+
//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
//===
20+
//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
21+
//=== Rome - Italy. email: geonetwork@osgeo.org
22+
//==============================================================================
23+
24+
package org.fao.geonet.utils;
25+
26+
public class EmailUtil {
27+
private static final String OWASP_EMAIL_REGEX = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$";
28+
private static final java.util.regex.Pattern OWASP_EMAIL_PATTERN = java.util.regex.Pattern.compile(OWASP_EMAIL_REGEX);
29+
30+
private EmailUtil() {
31+
throw new UnsupportedOperationException();
32+
}
33+
34+
/**
35+
* Checks if a string contains a valid email address format.
36+
*
37+
* @param emailAddress Value to validate.
38+
* @return true if the value contains a valid email address format, otherwise false.
39+
*/
40+
public static boolean isValidEmailAddress(String emailAddress) {
41+
return OWASP_EMAIL_PATTERN.matcher(emailAddress).matches();
42+
}
43+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//=============================================================================
2+
//=== Copyright (C) 2001-2025 Food and Agriculture Organization of the
3+
//=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
4+
//=== and United Nations Environment Programme (UNEP)
5+
//===
6+
//=== This library is free software; you can redistribute it and/or
7+
//=== modify it under the terms of the GNU Lesser General Public
8+
//=== License as published by the Free Software Foundation; either
9+
//=== version 2.1 of the License, or (at your option) any later version.
10+
//===
11+
//=== This library is distributed in the hope that it will be useful,
12+
//=== but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
//=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
//=== Lesser General Public License for more details.
15+
//===
16+
//=== You should have received a copy of the GNU Lesser General Public
17+
//=== License along with this library; if not, write to the Free Software
18+
//=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
//===
20+
//=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
21+
//=== Rome - Italy. email: geonetwork@osgeo.org
22+
//==============================================================================
23+
24+
package org.fao.geonet.utils;
25+
26+
import org.junit.Test;
27+
28+
import static org.junit.Assert.assertEquals;
29+
30+
public class EmailUtilTest {
31+
@Test
32+
public void testEmailAddress() {
33+
assertEquals(true, EmailUtil.isValidEmailAddress("test@domain.com"));
34+
35+
assertEquals(true, EmailUtil.isValidEmailAddress("test@example.international"));
36+
37+
assertEquals(true, EmailUtil.isValidEmailAddress("test.user@domain.com"));
38+
39+
assertEquals(true, EmailUtil.isValidEmailAddress("test.user@domain.subdomain.com"));
40+
41+
assertEquals(false, EmailUtil.isValidEmailAddress("test.user"));
42+
43+
assertEquals(false, EmailUtil.isValidEmailAddress("test.user@domain"));
44+
}
45+
}

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
</dependency>
390390
<dependency>
391391
<groupId>org.mockito</groupId>
392-
<artifactId>mockito-all</artifactId>
392+
<artifactId>mockito-inline</artifactId>
393393
<scope>test</scope>
394394
</dependency>
395395

core/src/main/java/jeeves/server/JeevesEngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class JeevesEngine {
9191
private Vector<ApplicationHandler> _appHandlers = new Vector<ApplicationHandler>();
9292
private List<Element> _dbServices = new ArrayList<Element>();
9393
private Path _appPath;
94-
private int _maxUploadSize;
94+
private long _maxUploadSize;
9595

9696

9797
public static void handleStartupError(Throwable e) {
@@ -325,7 +325,7 @@ private void initGeneral(final Element general, final ServiceManager serviceMan)
325325
info("Initializing general configuration...");
326326

327327
try {
328-
_maxUploadSize = Integer.parseInt(Util.getParam(general, ConfigFile.General.Child.MAX_UPLOAD_SIZE));
328+
_maxUploadSize = Long.parseLong(Util.getParam(general, ConfigFile.General.Child.MAX_UPLOAD_SIZE));
329329
} catch (Exception e) {
330330
_maxUploadSize = DEFAULT_MAX_UPLOAD_SIZE_MD;
331331
error("Maximum upload size not properly configured in config.xml. Using default size of 50MB");
@@ -544,7 +544,7 @@ public Path getUploadDir() {
544544

545545
//---------------------------------------------------------------------------
546546

547-
public int getMaxUploadSize() {
547+
public long getMaxUploadSize() {
548548
return _maxUploadSize;
549549
}
550550

core/src/main/java/jeeves/server/context/ServiceContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class ServiceContext extends BasicContext {
6363
private String _language;
6464
private String _service;
6565
private String _ipAddress;
66-
private int _maxUploadSize;
66+
private long _maxUploadSize;
6767
private JeevesServlet _servlet;
6868
private boolean _startupError = false;
6969
private Map<String, String> _startupErrors;
@@ -156,11 +156,11 @@ public Path getUploadDir() {
156156
return getBean(GeonetworkDataDirectory.class).getUploadDir();
157157
}
158158

159-
public int getMaxUploadSize() {
159+
public long getMaxUploadSize() {
160160
return _maxUploadSize;
161161
}
162162

163-
public void setMaxUploadSize(final int size) {
163+
public void setMaxUploadSize(final long size) {
164164
_maxUploadSize = size;
165165
}
166166

0 commit comments

Comments
 (0)