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 #91

Merged
merged 16 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Ask in a comment if you have troubles with any of them. -->

# Checklist

- [ ] I have read the [contribution guidelines](https://github.com/geonetwork/core-geonetwork/blob/main/CONTRIBUTING.md
- [ ] I have read the [contribution guidelines](https://github.com/geonetwork/core-geonetwork/blob/main/CONTRIBUTING.md)
- [ ] *Pull request* provided for `main` branch, backports managed with label
- [ ] *Good housekeeping* of code, cleaning up comments, tests, and documentation
- [ ] *Clean commit history* broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Thank you for contributing to GeoNetwork:

* 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.
* API Change: Please identify any API change or behavior changes in commit messages. Also make sure that a [process for deprecation](PROCESS_FOR_DEPRECATION.md) of a feature is carefully dealt with.

* Review: Review is required by another person, or more than one! Don't be shy asking for help or reviewing.

Expand Down
6 changes: 6 additions & 0 deletions PROCESS_FOR_DEPRECATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* Proposal for a Process for Deprecation (draft)

# Feature deprecation process

This page describes considerations and steps to take when removing a product feature. This is the process of depreciation or 'deprecating a feature'.

1 change: 1 addition & 0 deletions core/src/main/java/org/fao/geonet/constants/Edit.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static final class Elem {
public static final String TITLE = "title";
public static final String IS_HARVESTED = "isHarvested";
public static final String HARVEST_INFO = "harvestInfo";
public static final String OWNERID = "ownerId";
public static final String OWNERNAME = "ownername";
public static final String GROUPOWNERNAME = "groupOwnerName";
public static final String POPULARITY = "popularity";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ private Element buildInfoElem(ServiceContext context, String id, String version)
// add owner name
java.util.Optional<User> user = userRepository.findById(Integer.parseInt(owner));
if (user.isPresent()) {
addElement(info, Edit.Info.Elem.OWNERID, user.get().getId());
String ownerName = user.get().getName();
addElement(info, Edit.Info.Elem.OWNERNAME, ownerName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jeeves.server.context.ServiceContext;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.bulk.BulkRequest;
Expand Down Expand Up @@ -271,11 +272,11 @@ private void createIndex(String indexId, String indexName, boolean dropIndexFirs
DeleteIndexRequest request = new DeleteIndexRequest(indexName);
AcknowledgedResponse deleteIndexResponse = client.getClient().indices().delete(request, RequestOptions.DEFAULT);
if (deleteIndexResponse.isAcknowledged()) {
LOGGER.debug("Index '{}' removed.", new Object[]{indexName});
LOGGER.debug("Index '{}' removed.", indexName);
}
} catch (Exception e) {
// index does not exist ?
LOGGER.debug("Error during index '{}' removal. Error is: {}", new Object[]{indexName, e.getMessage()});
LOGGER.debug("Error during index '{}' removal. Error is: {}", indexName, e.getMessage());
}
}

Expand Down Expand Up @@ -304,7 +305,7 @@ private void createIndex(String indexId, String indexName, boolean dropIndexFirs
CreateIndexResponse createIndexResponse = client.getClient().indices().create(createIndexRequest, RequestOptions.DEFAULT);

if (createIndexResponse.isAcknowledged()) {
LOGGER.debug("Index '{}' created", new Object[]{indexName});
LOGGER.debug("Index '{}' created", indexName);
} else {
final String message = String.format("Index '%s' was not created. Error is: %s", indexName, createIndexResponse.toString());
LOGGER.error(message);
Expand All @@ -317,10 +318,13 @@ private void createIndex(String indexId, String indexName, boolean dropIndexFirs
indexName));
}
}
} catch (ElasticsearchParseException ex) {
LOGGER.error(ex.getMessage(), ex);
throw new IOException(ex.getMessage());
} catch (Exception cnce) {
final String message = String.format("Could not connect to index '%s'. Error is %s. Is the index server up and running?",
defaultIndex, cnce.getMessage());
LOGGER.error(message);
LOGGER.error(message, cnce);
throw new IOException(message);
}
}
Expand Down Expand Up @@ -444,7 +448,7 @@ private void sendDocumentsToIndex() {
} catch (Exception e) {
LOGGER.error(
"An error occurred while indexing {} documents in current indexing list. Error is {}.",
new Object[]{listOfDocumentsToIndex.size(), e.getMessage()});
listOfDocumentsToIndex.size(), e.getMessage());
} finally {
// TODO: Trigger this async ?
documents.keySet().forEach(uuid -> overviewFieldUpdater.process(uuid));
Expand Down Expand Up @@ -489,14 +493,14 @@ private void checkIndexResponse(BulkResponse bulkItemResponses,
// TODO: Report the JSON which was causing the error ?

LOGGER.error("Document with error #{}: {}.",
new Object[]{e.getId(), e.getFailureMessage()});
e.getId(), e.getFailureMessage());
LOGGER.error(failureDoc);

try {
listErrorOfDocumentsToIndex.put(e.getId(), mapper.writeValueAsString(docWithErrorInfo));
} catch (JsonProcessingException e1) {
LOGGER.error("Generated document for the index is not properly formatted. Check document #{}: {}.",
new Object[]{e.getId(), e1.getMessage()});
e.getId(), e1.getMessage());
}
}
});
Expand All @@ -505,7 +509,7 @@ private void checkIndexResponse(BulkResponse bulkItemResponses,
BulkResponse response = client.bulkRequest(defaultIndex, listErrorOfDocumentsToIndex);
if (response.status().getStatus() != 201) {
LOGGER.error("Failed to save error documents {}.",
new Object[]{Arrays.toString(errorDocumentIds.toArray())});
Arrays.toString(errorDocumentIds.toArray()));
}
}
}
Expand Down Expand Up @@ -638,7 +642,7 @@ public ObjectNode documentToJson(Element xml) {
mapper.readTree(node.getText()));
} catch (IOException e) {
LOGGER.error("Parsing invalid JSON node {} for property {}. Error is: {}",
new Object[]{node.getTextNormalize(), propertyName, e.getMessage()});
node.getTextNormalize(), propertyName, e.getMessage());
}
} else {
arrayNode.add(
Expand All @@ -657,7 +661,7 @@ public ObjectNode documentToJson(Element xml) {
doc.set("geom", mapper.readTree(nodeElements.get(0).getTextNormalize()));
} catch (IOException e) {
LOGGER.error("Parsing invalid geometry for JSON node {}. Error is: {}",
new Object[]{nodeElements.get(0).getTextNormalize(), e.getMessage()});
nodeElements.get(0).getTextNormalize(), e.getMessage());
}
continue;
}
Expand All @@ -670,7 +674,7 @@ public ObjectNode documentToJson(Element xml) {
));
} catch (IOException e) {
LOGGER.error("Parsing invalid JSON node {} for property {}. Error is: {}",
new Object[]{nodeElements.get(0).getTextNormalize(), propertyName, e.getMessage()});
nodeElements.get(0).getTextNormalize(), propertyName, e.getMessage());
}
} else {
doc.put(propertyName,
Expand Down
6 changes: 3 additions & 3 deletions docs/manual/docs/install-guide/installing-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The GeoNetwork search engine is built on top of Elasticsearch. The platform is u

## Manual installation

Download Elasticsearch from <https://www.elastic.co/downloads/elasticsearch> and unzip the file.
Download Elasticsearch 7.x (at least `7.9.2`) from <https://www.elastic.co/downloads/elasticsearch> and unzip the file.

``` shell
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2.tar.gz
Expand All @@ -20,7 +20,7 @@ elasticsearch-7.9.2/bin/elasticsearch
Stop Elasticsearch using

``` shell
elasticsearch-7.6.2/bin/elasticsearch stop
elasticsearch-7.9.2/bin/elasticsearch stop
```

GeoNetwork will start even if Elasticsearch index is down. A warning will be displayed. Once the Elasticsearch index is up, indices are created if they do not exist.
Expand Down Expand Up @@ -60,7 +60,7 @@ Access Elasticsearch admin page from <http://localhost:9200/>.

## Configure connection

Update Elasticsearch connection details in `` `WEB-INF/config.properties ```` and restart the application (see :code:\`web/src/main/webResources/WEB-INF/config.properties``):
Update Elasticsearch connection details in ```WEB-INF/config.properties``` and restart the application:

``` shell
es.protocol=http
Expand Down
1 change: 0 additions & 1 deletion docs/manual/docs/maintainer-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ For installation instructions, please refer to the [Installation guide](../insta

- [Installation](../install-guide/index.md)
- [Setup](../administrator-guide/index.md)
- [Setting up search/content statistics](statistics/index.md)
- [Production Use](production-use/index.md)
- [Updating the application](updating/index.md)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 0 additions & 16 deletions docs/manual/docs/maintainer-guide/statistics/index.md

This file was deleted.

This file was deleted.

56 changes: 0 additions & 56 deletions docs/manual/docs/maintainer-guide/statistics/setup-geonetwork.md

This file was deleted.

38 changes: 0 additions & 38 deletions docs/manual/docs/maintainer-guide/statistics/setup-kibana.md

This file was deleted.

24 changes: 13 additions & 11 deletions docs/manual/docs/overview/authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ In brief the committee votes on proposals on the geonetwork-dev mailinglist. Pro

### Members of the Project Steering Committee

- Florent Gravin
- Francois Prunayre
- Jeroen Ticheler - Chair
- Jo Cook
- Jose Garcia
- Paul van Genuchten
- Simon Pigot
- Jeroen Ticheler (jeroen ticheler * geocat net) [GeoCat](https://www.geocat.net) - Chair
- Francois Prunayre [Titellus](https://titellus.net)
- Simon Pigot [CSIRO](https://www.csiro.au)
- Florent Gravin [CamptoCamp](https://camptocamp.com)
- Jose Garcia [GeoCat](https://www.geocat.net)
- Jo Cook [Astun Technology](https://www.astuntechnology.com)
- Paul van Genuchten [ISRIC](https://www.isric.org)

### Former members of the PSC

- Andrea Carboni
- Archie Warnock
- Patrizia Monteduro
- Patrizia Monteduro (Patrizia Monteduro * fao org) [FAO-UN](https://www.fao.org)
- Emanuele Tajariol (e tajariol * mclink it - GeoSolutions)
- Jesse Eichar
- Emanuele Tajariol
- Andrea Carboni (acarboni * crisalis-tech com - Independent consultant)
- Archie Warnock (warnock * awcubed com) [A/WWW Enterprises](https://www.awcubed.com)

## Committers

Expand All @@ -42,6 +42,8 @@ Committers list is available [here for the core team](https://github.com/orgs/ge
- Paul van Genuchten
- Antonio Cerciello
- Michel Gabriel
- Jody Garnett
- David Blasby

## Contributors

Expand Down
5 changes: 0 additions & 5 deletions docs/manual/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@ nav:
- install-guide/logging.md
- install-guide/map-print-setup.md
- install-guide/loading-samples.md
- 'Setting up search/content statistics':
- maintainer-guide/statistics/index.md
- maintainer-guide/statistics/setup-elasticsearch.md
- maintainer-guide/statistics/setup-kibana.md
- maintainer-guide/statistics/setup-geonetwork.md
- maintainer-guide/production-use/index.md
- 'Updating the application': maintainer-guide/updating/index.md
- 'API':
Expand Down
Loading
Loading