From ca5c31382540cd491b4148edcc16a56ab835f8df Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Mon, 26 Feb 2024 10:36:14 +0100 Subject: [PATCH 1/2] Configured browsing by language --- dspace/config/dspace.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 5e3389af34b2..60e46607c21f 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -1160,8 +1160,8 @@ webui.browse.index.1 = dateissued:item:dateissued webui.browse.index.2 = author:metadata:dc.contributor.*\,dc.creator:text webui.browse.index.3 = title:item:title webui.browse.index.4 = subject:metadata:dc.subject.*:text -# webui.browse.index.5 = publisher:metadata:dc.publisher:text -# webui.browse.index.6 = language:metadata:dc.language.iso:iso_lang +webui.browse.index.5 = language:metadata:local.language.name:text +# webui.browse.index.6 = publisher:metadata:dc.publisher:text # webui.browse.index.7 = itemtype:metadata:dc.type:text # webui.browse.index.8 = rights:metadata:dc.rights.label:text From 189511012836dfe2d63f26de56356d5c08f8a75b Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 27 Feb 2024 09:23:22 +0100 Subject: [PATCH 2/2] Updated tests following the browsing cfg --- .../dspace/app/rest/BrowsesResourceControllerIT.java | 11 ++++++----- .../dspace/app/rest/matcher/BrowseIndexMatcher.java | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java index 1618cbf001ab..57a8dbb3c2b7 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java @@ -64,15 +64,15 @@ public void findAll() throws Exception { //We expect the content type to be "application/hal+json;charset=UTF-8" .andExpect(content().contentType(contentType)) - //Our default Discovery config has 5 browse indexes, so we expect this to be reflected in the page + //Our default Discovery config has 6 browse indexes, so we expect this to be reflected in the page // object .andExpect(jsonPath("$.page.size", is(20))) - .andExpect(jsonPath("$.page.totalElements", is(5))) + .andExpect(jsonPath("$.page.totalElements", is(6))) .andExpect(jsonPath("$.page.totalPages", is(1))) .andExpect(jsonPath("$.page.number", is(0))) - //The array of browse index should have a size 5 - .andExpect(jsonPath("$._embedded.browses", hasSize(5))) + //The array of browse index should have a size 6 + .andExpect(jsonPath("$._embedded.browses", hasSize(6))) //Check that all (and only) the default browse indexes are present .andExpect(jsonPath("$._embedded.browses", containsInAnyOrder( @@ -80,7 +80,8 @@ public void findAll() throws Exception { BrowseIndexMatcher.contributorBrowseIndex("asc"), BrowseIndexMatcher.titleBrowseIndex("asc"), BrowseIndexMatcher.subjectBrowseIndex("asc"), - BrowseIndexMatcher.hierarchicalBrowseIndex("srsc") + BrowseIndexMatcher.hierarchicalBrowseIndex("srsc"), + BrowseIndexMatcher.languageBrowseIndex("asc") ))) ; } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/BrowseIndexMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/BrowseIndexMatcher.java index 59a53f475a0a..e7664ceaad78 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/BrowseIndexMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/BrowseIndexMatcher.java @@ -117,9 +117,9 @@ public static Matcher publisherBrowseIndex(final String order) { public static Matcher languageBrowseIndex(final String order) { return allOf( - hasJsonPath("$.metadata", contains("dc.language.iso")), - hasJsonPath("$.metadataBrowse", Matchers.is(true)), - hasJsonPath("$.dataType", equalToIgnoringCase("iso_lang")), + hasJsonPath("$.metadata", contains("local.language.name")), + hasJsonPath("$.browseType", equalToIgnoringCase(BROWSE_TYPE_VALUE_LIST)), + hasJsonPath("$.dataType", equalToIgnoringCase("text")), hasJsonPath("$.order", equalToIgnoringCase(order)), hasJsonPath("$.sortOptions[*].name", containsInAnyOrder("title", "dateissued", "dateaccessioned")), hasJsonPath("$._links.self.href", is(REST_SERVER_URL + "discover/browses/language")),