Closed StefanJaq closed 3 years ago
additional comment: At Geonetwork this functionality is possible and configurable.
hi Stefan, we are no longer developing on Geoportal 1.x and ArcGIS for INSPIRE also has the Geoportal 2.x editor since 10.8. In the new editor, you can control this by a small modification to the DataDocumentType.js object in the INSPIRE 2 profile. There you can include 2 utility functions:
beforeInitializeElement: function(gxeDocument, element) {
// add specific element initializations here
var p = element.gxePath, xDoc = gxeDocument;
...
}
and
beforeInitializeAttribute: function(gxeDocument, attribute) {
// add specific attribute initializations here
var p = attribute.gxePath, xDoc = gxeDocument;
...
}
These functions are called when initializing the element/attribute widgets in the editor. At this point in the editor lifecycle, you can set values, change optional/mandatory settings, etc. p
represents the element/attribute you want to change. To set the value of an element that is for example a gco:Date
that's part of a custom element in a profile with namespace myprofile
to today's date you would use:
if (p === "/gmd:MD_Metadata/myprofile:date/gco:Date") {
var today = new Date();
element.value = today.toDateString();
}
Several customers request following functionality:
Automatically update of the „Metadata Date" Field with the current date at every save. The behaviour, if it updates automatically or not, can be configured e.g. at gpt.xml. Nice to have: The user can set the behaviour in the client UI for the edit session which overules the in the gpt.xml configured default behaviour.