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

Batch edit / Improvements #6239

Merged
merged 9 commits into from
Apr 28, 2022
Merged

Batch edit / Improvements #6239

merged 9 commits into from
Apr 28, 2022

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented Apr 8, 2022

Add examples selector

To facilitate usage of the XPath batch editing and examples that can be easily picked up

  • In batch editor
    image

  • In CSW harvester config
    image

Thanks @vbombaerts for the ISO19115-3 examples.

Add copy/paste xpath config

image

image

Editing fix

Inserting a snippet in an element which does not exist could create an additional self closing tag

curl 'http://localhost:8080/geonetwork/srv/api/records/batchediting/preview?diffType=patch&uuids=a1051701-7e01-4ed3-aa6b-48ef3e4eeb05' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: eng' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Cookie: XSRF-TOKEN=8ad98c39-e5fc-487e-8f52-6b208a116caa; JSESSIONID=node01feonmtzzwvl11fmcx382wucan1.node0; serverTime=1649765688698; sessionExpiry=1649767788698' \
  -H 'X-XSRF-TOKEN: 8ad98c39-e5fc-487e-8f52-6b208a116caa' \
  --data-raw '[{"xpath":"/mdb:distributionInfo/mrd:MD_Distribution/mrd:distributor","value":"<gn_add><mrd:distributor xmlns:mrd=\"http://standards.iso.org/iso/19115/-3/mrd/1.0\"/></gn_add>"}]' \
  --compressed

on a record with no distribution section will return

    <mrd:MD_Distribution>
      <mrd:distributor />
      <mrd:distributor />

A workaround was define in update-fixed-info for topicCategory when using the standard editor.

Other changes

  • Add icon for each type of edits
  • Do not display twice search and replace changes
    image

@fxprunayre fxprunayre added this to the 4.0.7 milestone Apr 8, 2022
Inserting a snippet eg. mrd:distributor in a non existing section
mdb:distributionInfo/mrd:MD_Distribution/mrd:distributor a self closing
mrd:distributor was created in addition to the inserted ones.

Add some more tests inserting in parent, in non existing element, in
element at position.
@@ -318,13 +318,6 @@
</xsl:copy>
</xsl:template>


<!-- The topic category directive may create empty topic. -->
Copy link
Member

Choose a reason for hiding this comment

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

Why is this template removed?

Copy link
Member Author

@fxprunayre fxprunayre Apr 22, 2022

Choose a reason for hiding this comment

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

Because it was probably added as a workaround to the fact that "Inserting a snippet in an element which does not exist could create an additional self closing tag". The directive for topics category is using the XPath insert API and is this case.

@@ -248,14 +248,6 @@
</xsl:copy>
</xsl:template>

<!-- ================================================================= -->

<xsl:template
Copy link
Member

Choose a reason for hiding this comment

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

Same question as the previous one.

@@ -85,7 +86,7 @@ public void getUsers() throws Exception {
.session(this.mockHttpSession)
.accept(MediaType.parseMediaType("application/json")))
.andExpect(status().isOk())
.andExpect(jsonPath("$", hasSize(5)))
.andExpect(jsonPath("$", hasSize(6)))
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this change is related to the PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

None yet

2 participants