Skip to content

Proposal Edit A Set Of Records

François Prunayre edited this page Nov 25, 2015 · 18 revisions
Date 2015-08-27 Contacts Arnaud De Groof, François Prunayre, Vincent Bombaerts
Status On going Release 3.1
Resources Available Ticket #
Source code https://github.com/fxprunayre/core-geonetwork/tree/improvement/edit-a-set-of-record
Funding Metawal

Overview

Batch editor provides the capability to update a set of records at once.

Proposal

Editing a set of records

Selecting records to edit

Editor, Reviewers and Administrator can edit a set of records using the batch editing menu.

Accessing the batch editor

First, the user select a set of records to update by running searches and selecting the records to edit.

Step 1

User can:

  • restrict to his records only by checking "only my record",
  • use facets for filtering or can run full text search,
  • select records by clicking the checkbox or use the selection menu to select all, all in page or clear selection,
  • click the "view selection only" to display the current selection.

Search is restricted to:

  • editable records for current user and
  • template and metadata (ie. no directory entry).

At some point, the set of records could also be a predefined search (See https://github.com/geonetwork/core-geonetwork/wiki/Proposal-Save-Your-Search - this is not part of this proposal).

Editing records

After selection, user can define the changes to be applied to the set of records.

Defining changes

Step 2

The fields that can be updated for ISO19139 records are the following:

  • Identification
  • title: Update existing title.
  • keyword: Insert a new keyword in the first descriptiveKeyword block.
  • topic category: Insert a new topic category.
  • geographic extent: Insert a new geographic extent.
  • resource language: Insert a new resource language.
  • resource status: Insert, or replace if existing
  • parent identifier: Insert, or replace if existing, the parent identifier.
  • Constraints
  • access constraints: Insert a new access constraint.
  • lineage: Replace current lineage or insert a new one.
  • Contact
  • resource contact: Add a new one.
  • distributor: Add a new one.
  • metadata contact: Add a new one.
  • Metadata
  • metadata language: Replace current metadata language or insert a new one.

For Dublin Core record, only title can be updated.

When the element is a codelist (eg. resource status), the list of values is proposed (defined in codelist.xml). When the element could have autocompletion (eg. parent identifier), the list of values is proposed by a custom directive (eg. gn-metadata-picker). When the element is complex ie. not a single value field (eg. contact, extent) a custom directive is defined.

Step 2

One section per standard is created to define the fields to be change.

Step 2

ISO19139 and ISO19115-3 multilingual metadata are not supported using the form (may be using the advanced mode).

Updates are made using the following rule:

  • If the field is mandatory, then the value replace the current one in the metadata record
  • If the field allows multiple element, then the new value is added in the metadata record

Defining changes manually

An advanced mode allows (advanced) users to define manually XPath and values.

Step 2

Configuring changes

The list of fields and section are defined per schema. The form configuration is made in config-editor.xml in a batchEditing section.

The configuration defines a set of section containing fields characterized by:

  • name: Field identifier (translated on the client side)
  • xpath: XPath of the element to be updated
  • use: Type of form input
  • insertMode: gn_add, gn_replace (See GN XPath update API)
  • removable: To allow to mark a field to be deleted
  • template (optional): XML Snippet to be inserted

Example:

  • A simple gco:CharacterString in ISO19139
<field name="title"
             xpath="gmd:identificationInfo/gmd:MD_DataIdentification/
                      gmd:citation/gmd:CI_Citation/gmd:title"
             indexField="title">
        <template><![CDATA[<gco:CharacterString xmlns:gco='http://www.isotc211.org/2005/gco'>{{value}}</gco:CharacterString>]]></template>
</field>
  • A codelist element in ISO19139
<field name="topicCats"
       xpath="gmd:identificationInfo/gmd:MD_DataIdentification/
                gmd:topicCategory"
       use="data-gn-codelist-picker"
       codelist="gmd:MD_TopicCategoryCode"
       indexField="topicCat"
       insertMode="gn_add">
  <template><![CDATA[<gmd:MD_TopicCategoryCode xmlns:gmd='http://www.isotc211.org/2005/gmd' codeListValue='{{value}}'/>]]></template>
</field>
  • A field based on a custom directive generating the XML snippet to insert
<field name="extent"
             xpath="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent"
             use="data-gn-draw-bbox"
             insertMode="gn_add"/>

Applying changes

When changes defined, user can apply them to the selection.

Step 3

TODO:

  • A report is displayed listing the number of records updated, with errors.
  • Changes layout to improve

Also covered in that proposal

  • Selection service is migrated to Spring MVC
  • Selection service provide the list of currently selected records (and not only the number). It allows to have display current selection

Proposal Type

  • Type: UX
  • Module: Editing

Voting History

  • Vote Proposed: ...

Future improvements & TODO

Bugs:

  • Subtemplates mix

Features:

  • Updates
  • Handle multiple updates if XPath match more than one node
  • Add mode to update only if a match is found
  • Delete: Only first matching node is deleted
  • Edits
  • Load and save configuration for the advanced mode
  • Report changes
  • Add backup (& restore) feature
  • Add a search and replace feature (could replace the current batch replacer & search & replace processing)
  • Doc for the XPath update API

Participants

  • Vincent Bombaerts
  • Arnaud De Groof
  • Francois Prunayre
Clone this wiki locally