-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Pass created, modified, issued date from thesaurus to the schemas #6972
Pass created, modified, issued date from thesaurus to the schemas #6972
Conversation
I don't believe this is the fix that we are looking for.... I think the real bug in this case is that it should never set the last modified date to the system date or the file date. In our case, we are regularly doing deployments in an K8S environment, and we always copy the thesaurus files during the deployment - this does not mean that the last modified date for the thesaurus was changed. I believe it should instead just leave it last modified date empty and not modify the values that already exists in the metadata files. If someone really wants a last modified date set then the date should be managed in the thesaurus file. What are your thoughts? |
@ianwallen the "problem" is that https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19139/src/main/plugin/iso19139/convert/thesaurus-transformation.xsl creates all the thesaurus block from scratch, probably as only receives the parameters of the keyword(s) to add and not the full metadata record. For me the solution would be to store the creation/publish dates in the vocabulary file, which is possible. The current code server-side code retrieves the modification date (if it exists). core-geonetwork/core/src/main/java/org/fao/geonet/kernel/Thesaurus.java Lines 968 to 980 in d7a4b80
I think it can also be updated to handle the creation date. |
The issue is this single default date is too general. At schema level (i.e. HNAP 19139) it's hard to tell what to do with it. I have modified this pull request to pass all possible dates (created, modified, issued) to the schema level. And will let schema decides what to do with the dates. The original date logic is still there which I see it first uses issued date, then go modified. If none is found, then it will use the file system date. I will make some PR at HNAP metadata to handle this logic. So this change will also give all schemas more flexibilities to deal with these dates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested and looks fine. Nice improvement.
@wangf1122 I've updated the PR with xslt changes also: https://github.com/GeoCat/core-geonetwork/tree/main.thesaurus.last.modify.date.flag-xsl-updates
But can't make a pull request to your repository, probably you'll need to give some permissions, otherwise include this commit changes also: GeoCat@4020bfa
I have cherry picked your commit into this pull request. All good. Thanks. |
#6972) * add isFileSystemDate flag to thesaurus model * pass thesaurus created, issued, modified date to the schemas. * Fixed null pointer exception. * remove date conversion * Revert default thesaurus date to original code * add more dateformat to parsing Thesaurus date * Update thesaurus-transformation.xsl --------- Co-authored-by: Jose García <[email protected]>
schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/convert/thesaurus-transformation.xsl
Show resolved
Hide resolved
#6972 adds retrieval of `dct:issued|modified|created` dates but multiple dates could be added more than one time with same date type code. Improve the mapping.
geonetwork#6972 adds retrieval of `dct:issued|modified|created` dates but multiple dates could be added more than one time with same date type code. Improve the mapping.
* Thesaurus / Date parsing fix. https://github.com/geonetwork/core-geonetwork/pull/6972/files#diff-c7548d94bdb4268915f50f66df5a90f1f7868e4fb1de2f3d2938397e202aaf2fR1057 added month and year format support. This was resolving thesaurus date to the last matching format ie. 1st January for the default date. This can be tested using regions thesaurus which will contains 2 dates for the thesaurus block. * Thesaurus / Avoid having multiple dates with same type code #6972 adds retrieval of `dct:issued|modified|created` dates but multiple dates could be added more than one time with same date type code. Improve the mapping. * Thesaurus / INSPIRE registry / Only keep one date to avoid validation errors * Thesaurus / LD registry registry / Only keep one date No need for duplicated date
This is to fix the issue metadata101/iso19139.ca.HNAP#308
The issue is the schema transformation style sheet doesn't know if the date is from the thesaurus itself or from the file system last modified date. Therefore, it cannot adjust logic to render different XML template.