[GeoNetwork-devel] Update fixed info and timestamp on batch edit

Hi list,

when batch editing records the parameters passed to updateMetadata function make it not to run update-fixed-info and also to not update the gmd:dateStamp element [1]:

boolean validate = false;
boolean ufo = false;
boolean index = true;

dataMan.updateMetadata(
    serviceContext, record.getId() + "", metadata,
    validate, ufo, index,
    "eng", // Not used when validate is false
    changeDate, false);

Is there any reason for not running update-fixed-info here and for not updating the last modified date inside the document?

[1] https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java#L204-L213

···


Vriendelijke groeten / Kind regards,

Juan Luis Rodríguez.


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.

Hi Juan,

Not sure for UFO but sometime users don’t want to update the dateStamp - eg. when fixing typo.
So we can add a parameter for this ?

For the dateStamp, I would put a default to false as you can use the API to update it if you really want. But if you prefer true, that’s fine too. (Similar discussion here https://github.com/geonetwork/core-geonetwork/pull/3747)

For UFO, it really makes sense to run it when changing CharacterString and multilingual records, gml elements so maybe can always be applied ? or at least by default true ?

Francois

Le mer. 17 avr. 2019 à 10:38, Juan Luis Rodríguez Ponce <juanluisrp@anonymised.com> a écrit :

Hi list,

when batch editing records the parameters passed to updateMetadata function make it not to run update-fixed-info and also to not update the gmd:dateStamp element [1]:

boolean validate = false;
boolean ufo = false;
boolean index = true;

dataMan.updateMetadata(
    serviceContext, record.getId() + "", metadata,
    validate, ufo, index,
    "eng", // Not used when validate is false
    changeDate, false);

Is there any reason for not running update-fixed-info here and for not updating the last modified date inside the document?

[1] https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java#L204-L213


Vriendelijke groeten / Kind regards,

Juan Luis Rodríguez.


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.

Hi Francois,

Hi Juan,

Not sure for UFO but sometime users don’t want to update the dateStamp - eg. when fixing typo.
So we can add a parameter for this ?

For the dateStamp, I would put a default to false as you can use the API to update it if you really want. But if you prefer true, that’s fine too. (Similar discussion here https://github.com/geonetwork/core-geonetwork/pull/3747)

For UFO, it really makes sense to run it when changing CharacterString and multilingual records, gml elements so maybe can always be applied ? or at least by default true ?

The thing is that update timestamp requires updateFixedInfo to be true since is that XSLT the one that changes the gmd:dateStamp.

if (ufo) {
   ...

   metadataXml = updateFixedInfo(schema, Optional.of(intId), uuid, metadataXml, parentUuid,
         (updateDateStamp ? UpdateDatestamp.YES : UpdateDatestamp.NO), context);
}

I could set the ufo to be always true and update the datetamp based on a parameter received by the API.

···


Vriendelijke groeten / Kind regards,

Juan Luis Rodríguez.


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.