Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from geonetwork:main #105

Open
wants to merge 123 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
bb9c861
Metadata editor / validation report improvements (#8395)
josegar74 Oct 8, 2024
d4d2a31
Fix the width of the projection switcher (#8399)
MichelGabriel Oct 8, 2024
51c0b01
Metadata editor / Add required indicator support to the keyword selec…
josegar74 Oct 3, 2024
f65ae30
Fixed spurious whitespace for gn-comma-list (#8398)
joachimnielandt Oct 8, 2024
78f8bfc
Metadata indexing / ISO19139 / ISO19115-3.2018 / Escape graphic overv…
josegar74 Oct 9, 2024
a0465e3
Harvester / ISO19115-3 / Better support missing metadata date info
fxprunayre Jun 6, 2024
3252d14
Update external management url
ianwallen Sep 8, 2024
b3f5000
Javascript / HTML formatting fixes related to Prettier
josegar74 Oct 1, 2024
1cc4e42
CSW / Fix parsing date values for filters. Fixes #8034
josegar74 Jun 25, 2024
8471646
Standard / ISO19115-3 / Only search for associated record with UUID
fxprunayre Jun 4, 2024
2df2bb1
Thesaurus / Add inScheme property in concept of local thesaurus
fxprunayre Jun 4, 2024
9228e4a
Editor / Table mode / Fix field using directive (#8261)
fxprunayre Oct 10, 2024
8f9cfa9
Map / Save your map improvements (#8155)
fxprunayre Oct 10, 2024
50cbfd0
Record view / Does not display thesaurus block if no keywords.
fxprunayre Oct 8, 2024
ffe8282
Thesaurus / OWL format / Mobility theme hierarchy (#8393)
fxprunayre Oct 10, 2024
c1564c0
Remove spaces from the list of schema list of metadata import restric…
ianwallen Oct 10, 2024
c7c9e97
Formatter / Datacite / Default resource type (#8407)
fxprunayre Oct 10, 2024
721cd4c
Fixed description for getIdentifiers in IdentifierApi (#8422)
SuperOctocat Oct 11, 2024
6d6eef1
Editor / Associated resource / Remote document / Add content type
fxprunayre Sep 3, 2024
58a713c
WebDav harvester / Add support for XSLT filter process (#8243)
josegar74 Oct 11, 2024
c7f8e8b
Editor / Geopublication / Misc fix. (#8092)
fxprunayre Oct 11, 2024
87a8e3d
Harvester / Simple URL / ODS improvement
fxprunayre Sep 9, 2024
9afd1bf
Improve administrator guide UI configuration documentation
michikommader Oct 11, 2024
eb1a2e9
Elasticsearch / API / Allow ndjson for _msearch endpoint
fxprunayre Oct 10, 2024
8c1636f
Remove empty filename condition (#8436)
tylerjmchugh Oct 16, 2024
7b9361a
Elasticsearch / Update to 8.14.3. (#8337)
fxprunayre Oct 16, 2024
5ef4f51
Harvester / Simple URL / Fix multiple URL alignement
fxprunayre Oct 15, 2024
4f1dc68
Fix saving UI settings without changes
josegar74 Oct 16, 2024
f64425c
Record view / More like this / Add filter option.
fxprunayre Oct 15, 2024
66d3a58
Add better logging when resources are deleted to make it clear what m…
ianwallen Oct 16, 2024
e20820a
Add bootstrap datepicker language files for supported UI languages
josegar74 Oct 16, 2024
82fda12
Avoid duplicate validation message when trying to register a user wit…
josegar74 Oct 17, 2024
7d97656
Update home page "browse by" to display facet as label if there is on…
tylerjmchugh Oct 17, 2024
5b01f64
Standard / DCAT (and profiles) export (#7600)
fxprunayre Oct 17, 2024
6cd9085
Delete date not being copied causing duplicate (#8454)
ianwallen Oct 22, 2024
cd72f8e
update PSC details in user guide
jodygarnett Oct 22, 2024
1a0c70e
Release / 4.4.6 / Changelog. (#8462)
fxprunayre Oct 24, 2024
a36ba67
Update version to 4.4.6-0
fxprunayre Oct 24, 2024
573d4be
Update version to 4.4.7-SNAPSHOT
fxprunayre Oct 24, 2024
43a57af
XSL utility / Add function to retrieve thesaurus URI
fxprunayre Oct 22, 2024
d8a5b72
Metadata status changes notification mails improvements: (#8453)
josegar74 Oct 28, 2024
ea92905
Documentation / Update managing privileges page:
josegar74 Oct 29, 2024
7500803
option to force xsd schema check for required field (#8294)
wangf1122 Oct 29, 2024
0de6cd4
Documentation / Metadata workflow improvements (#8473)
josegar74 Oct 29, 2024
b62e6c2
Add option to mock a dropdown for keywordPickers (#8401)
tylerjmchugh Oct 29, 2024
c93b5b1
getResourceInternal implementation for cmis and jcloud (#8466)
wangf1122 Nov 1, 2024
cd50ded
Configuration to display an application banner (#8416)
josegar74 Nov 4, 2024
62ec516
Configuration to display an application banner - fix database migrati…
josegar74 Nov 6, 2024
052be18
GeoTools 32.0 update and JTS 1.20.0 update
jodygarnett Nov 5, 2024
bedfe3d
Enhance static page with group user accessibility (#7707)
wangf1122 Nov 7, 2024
56a4069
Change icon for the layer tools in the layer manager panel on the map…
MichelGabriel Nov 8, 2024
6dbaa47
Metadata editor / Fix display of multiple choice elements with custom…
josegar74 Oct 30, 2024
d672a4c
Lib / Spring / Minor version update (#8498)
fxprunayre Nov 14, 2024
4cd0930
Admin / DOI server / Clarify labels for record group (#8496)
fxprunayre Nov 14, 2024
4fa388c
Metadata publication notifications / allow to configure the mail form…
josegar74 Nov 15, 2024
af0c541
Sort groups alphabetically on the new account and report pages
josegar74 Oct 29, 2024
97bdd7b
Metadata editor / Regions picker display empty entry form the metadat…
josegar74 Nov 22, 2024
7ba4d47
removing jena non-compliant attribute during harvesting
joachimnielandt Oct 9, 2024
c84ff3b
Update file upload so that it has better error support. (#8427)
ianwallen Nov 25, 2024
60014cd
Directory entries / Fix parsing of sorting configuration (#8482)
josegar74 Nov 26, 2024
6f3d10c
Component to allow checking duplicated metadata values for title, alt…
josegar74 Nov 26, 2024
92c20ba
Remove usage of ECMASCRIPT6 const keyword. (#8518)
josegar74 Nov 26, 2024
b125070
Add better Jcloud versioning supports (#8512)
ianwallen Nov 28, 2024
e8a46b4
Automatic formatting
juanluisrp Nov 28, 2024
908338e
Change ESAPI logger to SLF4J using log4j2 (#8522)
josegar74 Nov 28, 2024
0fc0447
Batch selection is not in sync between search results and record view.
josegar74 Nov 8, 2024
8ca1e5c
Use case insensitive username for login and reset password (#8523)
josegar74 Nov 29, 2024
5e6f08f
update PSC details in user guide
fxprunayre Nov 29, 2024
c5b3fa6
Use the copyBlob to copy the resource with updated metadata (#8530)
ianwallen Dec 4, 2024
1b6d0fb
Update index to use a key with translations defined for map resource …
tylerjmchugh Dec 5, 2024
df52e1f
fixed login url for missing records
joachimnielandt Dec 4, 2024
2471bd3
Update CONTRIBUTING.md to describe the CLA automation
ticheler Dec 8, 2024
85eb829
Update README.md
ticheler Dec 8, 2024
82cc425
ISO19115.3-2008 / Fix typo in facsimile codelist value (#8539)
josegar74 Dec 9, 2024
e5bf00d
Fix wrong HTML self-closed elements. (#8542)
josegar74 Dec 9, 2024
794db36
ISO19110 / ISO19115-3.2008 / Fix indexing of multiple feature type al…
josegar74 Dec 9, 2024
c2b4558
Formatters / DCAT-AP / Allow PO URI to be used for constraints.
fxprunayre Nov 21, 2024
cd74d3b
Update db search and replace to support working copies (#8514)
tylerjmchugh Dec 10, 2024
18b00b3
Restrict setting privileges on groups (#8511)
tylerjmchugh Dec 10, 2024
a9c2e05
Attachments API use filename from Content-Disposition before url (#8470)
tylerjmchugh Dec 10, 2024
d5dc0d6
Editor / Add support for conditional default view
fxprunayre Dec 10, 2024
3389c9e
Standard / ISO19115-3 / Process / encode all keywords using anchor (#…
GeryNi Dec 11, 2024
96869d8
Editor / Improve support of schema having sibling elements for transl…
fxprunayre Dec 11, 2024
795b153
Editor / Add keywords even if thesaurus not available in record langu…
fxprunayre Dec 11, 2024
31c641d
Formatter / DCAT / Service (#8526)
fxprunayre Dec 11, 2024
36ce40b
Restyled `default` address block (#8289)
MichelGabriel Dec 11, 2024
4fbdefd
JWT Headers security module (#7899)
davidblasby Dec 11, 2024
b6114ea
Update CONTRIBUTING.md
geonetworkbuild Dec 11, 2024
c16869d
Update README.md
ticheler Dec 11, 2024
6545aa0
Attachments API / Set content-length and close input stream when retr…
josegar74 Dec 12, 2024
c0a6baf
Formatter / DCAT / Improvements
fxprunayre Dec 9, 2024
5ec47b5
DCAT / GeoDCAT-AP / Update shacl rules to version 3.
fxprunayre Dec 10, 2024
20d67b4
GeoDCAT-AP / Extends DCAT-AP-HVD.
fxprunayre Dec 10, 2024
180e409
DCAT-AP-HVD / Update vocabulary for HVD category including now sub ca…
fxprunayre Dec 10, 2024
9e035a6
Documentation / DCAT / Improvement.
fxprunayre Dec 10, 2024
657e195
Formatter / DCAT / Fix test after rebase of https://github.com/geonet…
fxprunayre Dec 10, 2024
8a531d0
Formatter / DCAT / Add element in Resource (mandatory in HVD for ser…
fxprunayre Dec 10, 2024
0856a80
Fix eu-applicable-legislation.rdf
fxprunayre Dec 11, 2024
541bd22
Update schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/format…
fxprunayre Dec 11, 2024
8e31a5f
Formatter / DCAT / Fix test after rebase.
fxprunayre Dec 11, 2024
80a0fee
Standard / ISO / Schematron for HVD
fxprunayre Dec 10, 2024
91b82fa
support section variable in manual url (#8494)
wangf1122 Dec 14, 2024
64f9efc
Doc / DCAT page / Fix formatting (#8563)
fxprunayre Dec 16, 2024
408dc79
Formatters / Properly detect URL ending in 1,2,3 or 5 (#8235)
fxprunayre Dec 16, 2024
2432dc9
Feature catalogue / Add table of content of feature types (#8041)
fxprunayre Dec 16, 2024
86242e8
Editor / Add unit attribute as main field (#8245)
fxprunayre Dec 16, 2024
d975d52
Admin / Schematron / Fix icon in rules (#8569)
fxprunayre Dec 17, 2024
b252795
API / Extents / Add option to generate square image
fxprunayre Dec 16, 2024
19d5b5c
Facet / Add meta property to customize label. (#8536)
fxprunayre Dec 19, 2024
39d9f66
remove outgoing headers for the proxy
david-blasby Dec 16, 2024
da294f7
ISO19115-3.2008 - Add URL check schematron (#8575)
josegar74 Dec 20, 2024
9d3e585
Return xml inside JSON status (#8579)
wangf1122 Dec 24, 2024
490e6b9
GN5 / Security configuration
fxprunayre Dec 12, 2024
eab5c1b
Url decode the resourceId supplied to store.getResourceInternal to fi…
ianwallen Jan 10, 2025
21f0dc8
Fix set site settings in swagger_ui so it function correctly. (#8582)
ianwallen Jan 10, 2025
2e31720
Move StatusValue.Events to an enum class (#8583)
ianwallen Jan 10, 2025
243ccb7
Record view / fix javascript error when a metadata has multiple linea…
josegar74 Jan 14, 2025
67e581e
Update creating-group.md (#8592)
PeterParslow Jan 14, 2025
d46fa20
Metadata indexing / parse process steps and measure dates to check th…
josegar74 Jan 14, 2025
8b2a00d
Enforce upload size limit on putResourceFromUrl api (#8562)
tylerjmchugh Jan 14, 2025
815191e
French translation for user registered message
josegar74 Jan 14, 2025
f4890d5
Audit user changes (#8137)
josegar74 Jan 16, 2025
987d5dd
delete all if the excludes list is empty (#8609)
tylerjmchugh Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

Thank you for contributing to GeoNetwork!

* Free-software: GeoNetwork is free-software, using the [GNU GENERAL PUBLIC LICENSE](LICENSE.md). Contributions provided by you, or your employer, are required to be compatible with this free-software license.
* Free-software: GeoNetwork is free-software, using the [GNU GENERAL PUBLIC LICENSE](LICENSE.md).
* Contributions provided by you, or your employer, are required to be compatible with this free-software license. You will therefor be asked to sign the [Contributor License Agreement](https://cla-assistant.io/geonetwork/) when you are contributing to the repositories. This process is automatically enabled when you create your first pull request via https://cla-assistant.io/.

[![CLA assistant](https://cla-assistant.io/readme/badge/geonetwork/geonetwork)](https://cla-assistant.io/geonetwork/geonetwork)

* Pull-request: GeoNetwork uses a pull-request workflow to review and accept changes. Pull-requests must be submitted against the *main* branch first, and may be back ported as required.

# Pull requests
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# GeoNetwork opensource

## Build Health

[![Build Status](https://github.com/geonetwork/core-geonetwork/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/geonetwork/core-geonetwork/actions/workflows/linux.yml?query=branch%3Amain)
[![Build Status](https://github.com/geonetwork/core-geonetwork/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/geonetwork/core-geonetwork/actions/workflows/linux.yml?query=branch%3Amain) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8626/badge)](https://www.bestpractices.dev/projects/8626) [![CLA assistant](https://cla-assistant.io/readme/badge/geonetwork/geonetwork)](https://cla-assistant.io/geonetwork/geonetwork)

## Features

Expand All @@ -29,7 +27,4 @@ Developer documentation located in ``README.md`` files in the code-base:

* General documentation for the project as a whole is in this [README.md](README.md)
* [Software Development Documentation](/software_development/) provides instructions for setting up a development environment, building GeoNetwork, compiling user documentation, and making a releases.
* Module specific documentation can be found in each module:

## Open Source Security Foundation (OpenSSF) best practices status
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8626/badge)](https://www.bestpractices.dev/projects/8626)
* Module specific documentation can be found in each module
14 changes: 14 additions & 0 deletions auditable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Auditable Module

The auditable module contains the classes that allow auditing changes in user information using [Hibernate Envers](https://hibernate.org/orm/envers/).

Support for new auditable entities can be added, for example to audit changes in group information. For users auditing:

- Entity with the information to audit: [UserAuditable](../domain/src/main/java/org/fao/geonet/domain/auditable/UserAuditable.java).
- Related JPA repository: [UserAuditableRepository](../domain/src/main/java/org/fao/geonet/repository/UserAuditableRepository.java).
- The auditable service: [UserAuditableService](src/main/java/org/fao/geonet/auditable/UserAuditableService.java).
- The users API updated to use the auditable service: [UserApi](../services/src/main/java/org/fao/geonet/api/users/UsersApi.java).




51 changes: 51 additions & 0 deletions auditable/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geonetwork-opensource</groupId>
<artifactId>geonetwork</artifactId>
<version>4.4.7-SNAPSHOT</version>
</parent>

<!-- =========================================================== -->
<!-- Module Description -->
<!-- =========================================================== -->
<artifactId>gn-auditable</artifactId>
<packaging>jar</packaging>
<name>GeoNetwork auditable objects</name>

<licenses>
<license>
<name>General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>


<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gn-domain</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gn-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
</dependencies>

<properties>
<rootProjectDir>${basedir}/..</rootProjectDir>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/*
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: [email protected]
*/
package org.fao.geonet.auditable;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.MapDifference;
import com.google.common.collect.Maps;
import org.fao.geonet.auditable.model.RevisionFieldChange;
import org.fao.geonet.auditable.model.RevisionInfo;
import org.fao.geonet.domain.auditable.AuditableEntity;
import org.fao.geonet.kernel.setting.SettingManager;
import org.fao.geonet.kernel.setting.Settings;
import org.fao.geonet.repository.BaseAuditableRepository;
import org.springframework.data.history.Revision;
import org.springframework.data.history.Revisions;
import org.springframework.util.StringUtils;

import java.util.*;

public abstract class BaseAuditableService<U> {
protected static final String LINE_SEPARATOR = System.lineSeparator();

protected BaseAuditableRepository<U> repository;
protected SettingManager settingManager;

public abstract String getEntityType();

public void auditSave(U auditableEntity) {
if (!isAuditableEnabled()) return;

repository.save(auditableEntity);
}

public void auditDelete(U auditableEntity) {
if (!isAuditableEnabled()) return;

repository.delete(auditableEntity);
}

public String getEntityHistoryAsString(Integer entityIdentifier, ResourceBundle messages) {
if (!isAuditableEnabled()) return "";

Revisions<Integer, U> revisions = repository.findRevisions(entityIdentifier);

return retrieveRevisionHistoryAsString(revisions, messages);
}

public List<RevisionInfo> getEntityHistory(Integer entityIdentifier) {
if (!isAuditableEnabled()) return new ArrayList<>();

Revisions<Integer, U> revisions = repository.findRevisions(entityIdentifier);

return retrieveRevisionHistory(revisions);
}


protected String retrieveRevisionHistoryAsString(Revisions<Integer, U> revisions, ResourceBundle messages) {
List<RevisionInfo> revisionInfoList = retrieveRevisionHistory(revisions);

List<String> diffs = new ArrayList<>();

revisionInfoList.stream().forEach(revision -> {
List<String> revisionChanges = new ArrayList<>();
revisionChanges.add(revision.getValue());

revision.getChanges().forEach(change -> {
boolean oldValueIsDefined = StringUtils.hasLength(change.getOldValue());
boolean newValueIsDefined = StringUtils.hasLength(change.getNewValue());

if (oldValueIsDefined && newValueIsDefined) {
revisionChanges.add(String.format(messages.getString("audit.revision.field.updated"),
change.getName(), change.getOldValue(), change.getNewValue()));
} else if (!oldValueIsDefined && newValueIsDefined) {
revisionChanges.add(String.format(messages.getString("audit.revision.field.set"),
change.getName(), change.getNewValue()));
} else if (oldValueIsDefined && !newValueIsDefined) {
revisionChanges.add(String.format(messages.getString("audit.revision.field.unset"), change.getName()));
}
});

String revisionInfo = String.format(messages.getString("audit.revision"),
revision.getUser(),
revision.getDate(),
String.join(LINE_SEPARATOR, revisionChanges));

diffs.add(revisionInfo);

});

return String.join(LINE_SEPARATOR, diffs);
}

protected List<RevisionInfo> retrieveRevisionHistory(Revisions<Integer, U> revisions) {
String idFieldName = "id";
List<Revision<Integer, U>> revisionList = revisions.toList();
int numRevisions = revisions.toList().size();

List<RevisionInfo> revisionInfoList = new ArrayList<>();

if (numRevisions > 0) {
Revision<Integer, U> initialRevision = revisionList.get(0);
AuditableEntity initialRevisionEntity = (AuditableEntity) initialRevision.getEntity();

// Initial revision
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> revisionMap = objectMapper.convertValue(initialRevision.getEntity(), Map.class);
// Remove empty values and id
revisionMap.values().removeAll(Arrays.asList("", null));
revisionMap.remove(idFieldName);

RevisionInfo initialRevisionInfo = new RevisionInfo(
initialRevision.getMetadata().getRequiredRevisionNumber(),
initialRevisionEntity.getCreatedBy(),
initialRevisionEntity.getCreatedDate(), revisionMap.toString());

revisionInfoList.add(initialRevisionInfo);

int i = 0;
while (i + 1 < numRevisions) {
Revision<Integer, U> revision1 = revisionList.get(i);
Revision<Integer, U> revision2 = revisionList.get(i + 1);

Map<String, Object> revision1Map = objectMapper.convertValue(revision1.getEntity(), Map.class);
revision1Map.remove(idFieldName);
Map<String, Object> revision2Map = objectMapper.convertValue(revision2.getEntity(), Map.class);
revision2Map.remove(idFieldName);

MapDifference<String, Object> diff = Maps.difference(revision1Map, revision2Map);

revision2Map.values().removeAll(Arrays.asList("", null));

final RevisionInfo revisionInfo = new RevisionInfo(
revision2.getMetadata().getRequiredRevisionNumber(),
((AuditableEntity) revision2.getEntity()).getLastModifiedBy(),
((AuditableEntity) revision2.getEntity()).getLastModifiedDate(),
revision2Map.toString());

diff.entriesDiffering().forEach((key, entry) -> {
String oldValueAsString = (entry.leftValue() != null) ? entry.leftValue().toString() : "";
String newValueAsString = (entry.rightValue() != null) ? entry.rightValue().toString() : "";

RevisionFieldChange revisionFieldChange = new RevisionFieldChange(key, oldValueAsString, newValueAsString);

revisionInfo.addChange(revisionFieldChange);
});


revisionInfoList.add(revisionInfo);
i++;
}
}

Collections.reverse(revisionInfoList);
return revisionInfoList;
}

protected boolean isAuditableEnabled() {
return settingManager.getValueAsBool(Settings.SYSTEM_AUDITABLE_ENABLE, false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: [email protected]
*/

package org.fao.geonet.auditable;

import org.fao.geonet.domain.auditable.UserAuditable;
import org.fao.geonet.kernel.setting.SettingManager;
import org.fao.geonet.repository.UserAuditableRepository;
import org.springframework.stereotype.Service;

@Service
public class UserAuditableService extends BaseAuditableService<UserAuditable> {

public static final String ENTITY_TYPE = "user";

public UserAuditableService(SettingManager settingManager, UserAuditableRepository repository) {
this.settingManager = settingManager;
this.repository = repository;
}

@Override
public String getEntityType() {
return ENTITY_TYPE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2001-2024 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: [email protected]
*/
package org.fao.geonet.auditable.model;

/**
* This class represents a change in an entity field. It stores the field name,
* the previous and the new value.
*/
public class RevisionFieldChange {
private final String name;
private final String oldValue;
private final String newValue;

public RevisionFieldChange(String name, String oldValue, String newValue) {
this.name = name;
this.oldValue = oldValue;
this.newValue = newValue;
}

public String getName() {
return name;
}

public String getOldValue() {
return oldValue;
}

public String getNewValue() {
return newValue;
}
}
Loading