Skip to content
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

Support withheld to filter out elements defined in the schema filters configurations in Lucene query output #6897

Merged
merged 7 commits into from
Mar 17, 2023

Conversation

josegar74
Copy link
Member

@josegar74 josegar74 commented Mar 9, 2023

Similar to #6869, but for 3.12.x to support withheld filter elements in Lucene query output.

Also includes:

  • Add support for authenticated operation in metadata operation filters.
  • Fix in the metadata operation filters XPATH expressions in iso19139 and iso19115-3.2008 schemas.
  • Fix in MEF export formats to withheld elements.

A test case:

  1. Edit https://github.com/geonetwork/core-geonetwork/blob/3.12.x/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/update-fixed-info.xsl and add the following template to withheld all contacts, except the Identification Info > Point of Contact (Contact for the resource).
  <!-- Withheld mdb:contact, cit:citedResponsibleParty, mrd:distributorContact elements -->
  <xsl:template match="mdb:contact|cit:citedResponsibleParty|mrd:distributorContact" priority="10">
    <xsl:copy>
      <xsl:copy-of select="@*[name() != 'gco:nilReason']" />
      <xsl:attribute name="gco:nilReason">withheld</xsl:attribute>

      <xsl:apply-templates select="*" />
    </xsl:copy>
  </xsl:template>
  1. Create an ISO19115-3.2008 metadata with the template for geographical data.

  2. Check the metadata default view, full view, pdf: all contacts should be displayed. The XML view should contain all the contact details.

  3. Publish the metadata.

  4. With an anonymous user or a logged user that can't edit the metadata, check the metadata default view, full view, pdf: only the Identification Info > Point of Contact (Contact for the resource) should be displayed. The XML view should contain the contact details for Identification Info > Point of Contact (Contact for the resource), for the others should contain the root element with the attribute gco:nilReason=""withheld" without containing the contact information.

@josegar74 josegar74 added this to the 3.12.10 milestone Mar 9, 2023
@josegar74 josegar74 changed the title https://github.com/geonetwork/core-geonetwork/pull/6869 Support withheld to filter out elements defined in the schema filters configurations in Lucene query output Mar 9, 2023
@josegar74 josegar74 force-pushed the withheld-improvements-312 branch from ffdfa3c to 359229d Compare March 9, 2023 09:11
They are read-only. Can't be modified after the instance creation.
@josegar74
Copy link
Member Author

@juanluisrp thanks for the review. I've added the changes suggested in 6fe41ca

Copy link
Contributor

@juanluisrp juanluisrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. LGTM.

@josegar74 josegar74 merged commit d5aaf2a into geonetwork:3.12.x Mar 17, 2023
josegar74 added a commit to delwp-gn/core-geonetwork that referenced this pull request Mar 17, 2023
… configurations in Lucene query output (geonetwork#6897)

* Support withheld authenticated operation in the schema operation filters

* MEF export - withheld elements in additional formats export

* Fix iso19139 / iso19115-3.2008 filter operations xpath

* Support withheld in Lucene query output

* Make fields final

They are read-only. Can't be modified after the instance creation.

* Some minor changes

* Remove unused constructor and create an enumeration for metadata schema operations

---------

Co-authored-by: Juan Luis Rodríguez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants