Batch Editing in GeoNetwork 4.x
Official GeoNetwork documentation can be found at: https://docs.geonetwork-opensource.org/stable/user-guide/workflow/batchediting/
The Batch editing tool can be accessed from the Contribute tab in the header menu by users with at least Editor privileges and has three steps to it, which will also constitute the subsections of this guide.
We recommend you take a backup of the records you wish to change before proceeding, as changes cannot be easily undone.
1. Choose a set of records
As well as searching for a record by title (as in Figure 1.1.1), a user can also filter the records using the Filter facets on the left-hand side of the screen. The options available for filtering are:
Type of resources
Status
Validation status
Catalogues
Record groups
Record authors
Access
Published in that group
Standards
Harvested
Record types
The Filter and Search terms can be cleared by clicking on the “x” button at the right of the search bar.
Once the desired records have been located and selected using the tick box next to their title, an option for the user to View selection only becomes available at the right of the search bar.
Once the user is happy with the selection of records that are going to be changed, the next steps become available to be selected.
2. Define edits
Three distinct types of edits are available to the user:
Search and replace
XPath editing
Form editing
2.1. Search and replace
The fields available are:
Value- the value to be replaced
Replacement- the new value
Regular expression flags- dropdown menu options include:
i: enables case-insensitive matching
c: disables case-insensitive matching
n: allows the period to match the newline character
m: enables multiline mode
2.2. XPath editing
XPath stands for XML Path Language. It uses a non-XML syntax to provide a flexible way of addressing (pointing to) different parts of an XML document. It can also be used to test addressed nodes within a document to determine whether they match a pattern or not.
A good summary of its syntax can be found here: https://www.w3schools.com/xml/xpath_syntax.asp
The fields available are:
Title (optional)
Replacement mode- dropdown menu options include:
Add the element or value (in the first matching parent) or create it
Replace the element or value (in the first matching parent)
Remove all matching elements
XPath- the XPath to the element or value to be replaced
Text or XML value- the new value or element
Once the fields have been filled in accordingly, the user needs to click the “+” button to confirm the change.
At this point, the user has a few options:
Fill the top fields again and click the “+” button to add another batch edit to the same set of records
Click the button to edit an existing batch edit
Click the button to remove an existing batch edit
Click the button to copy the contents of an existing batch edit
2.3. Form editing
Depending on the type of records selected, the list of fields you can update may change. When editing a mandatory field like the title, the field is updated. When editing a field which can contain multiple values, a new value is added.
Each of the sections can be expanded to show the available fields to edit, and a new value can be inserted in the relevant fields.
There is also the option to reset all the changes by clicking on the “Reset changes“ button at the bottom of the page.
3. Apply changes
Once the user is happy with the set of records that will be changed and the modifications that will be applied, they can navigate to the last step - applying the changes.
This tab shows a summary of the changes that will be applied, as well as a list of records that will be changed and an option to “Update the modification date in the metadata document“.
Once the “ Save“ button has been clicked, the changes will be applied and can’t be reverted!
A report will be displayed showing the number of records processed and any errors or issues.