Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterDateAccessioned" />
<ref bean="searchFilterContentInOriginalBundle"/>
<ref bean="searchFilterEntityType"/>
</list>
Expand All @@ -171,6 +172,7 @@
<ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterDateAccessioned" />
<ref bean="searchFilterContentInOriginalBundle"/>
<ref bean="searchFilterFileNameInOriginalBundle" />
<ref bean="searchFilterFileDescriptionInOriginalBundle" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3209,6 +3209,7 @@ public void discoverSearchObjectsTestForMinMaxValues() throws Exception {
FacetEntryMatcher.entityTypeFacet(),
FacetEntryMatcher.subjectFacet(),
FacetEntryMatcher.dateIssuedFacetWithMinMax("1990-02-13", "2010-10-17"),
FacetEntryMatcher.dateAccessionedFacet(),
FacetEntryMatcher.hasContentInOriginalBundleFacet()
)))
//There always needs to be a self link available
Expand Down Expand Up @@ -3279,6 +3280,7 @@ public void discoverSearchFacetsTestForMinMaxValues() throws Exception {
FacetEntryMatcher.entityTypeFacet(),
FacetEntryMatcher.subjectFacet(),
FacetEntryMatcher.dateIssuedFacetWithMinMax("1990-02-13", "2010-10-17"),
FacetEntryMatcher.dateAccessionedFacet(),
FacetEntryMatcher.hasContentInOriginalBundleFacet()
)))
//There always needs to be a self link available
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ public static Matcher<? super Object> dateIssuedFacet() {
);
}

public static Matcher<? super Object> dateAccessionedFacet() {
return allOf(
hasJsonPath("$.name", is("dateAccessioned")),
hasJsonPath("$.facetType", is("date")),
hasJsonPath("$.facetLimit", any(Integer.class)),
hasJsonPath("$.openByDefault", any(Boolean.class)),
hasJsonPath("$._links.self.href", containsString("api/discover/facets/dateAccessioned")),
hasJsonPath("$._links", matchNextLink("api/discover/facets/dateAccessioned"))
);
}

public static Matcher<? super Object> dateIssuedFacetWithMinMax(String min, String max) {
return allOf(
hasJsonPath("$.name", is("dateIssued")),
Expand All @@ -155,6 +166,19 @@ public static Matcher<? super Object> dateIssuedFacetWithMinMax(String min, Stri
);
}

public static Matcher<? super Object> dateAccessionedFacetWithMinMax(String min, String max) {
return allOf(
hasJsonPath("$.name", is("dateAccessioned")),
hasJsonPath("$.facetType", is("date")),
hasJsonPath("$.facetLimit", any(Integer.class)),
hasJsonPath("$.minValue", is(min)),
hasJsonPath("$.maxValue", is(max)),
hasJsonPath("$.openByDefault", any(Boolean.class)),
hasJsonPath("$._links.self.href", containsString("api/discover/facets/dateAccessioned")),
hasJsonPath("$._links", matchNextLink("api/discover/facets/dateAccessioned"))
);
}

public static Matcher<? super Object> hasContentInOriginalBundleFacet() {
return allOf(
hasJsonPath("$.name", is("has_content_in_original_bundle")),
Expand Down
18 changes: 18 additions & 0 deletions dspace/config/spring/api/discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterDateAccessioned" />
<ref bean="searchFilterContentInOriginalBundle"/>
<!-- <ref bean="searchFilterHasGeospatialMetadata"/> -->
<ref bean="searchFilterEntityType"/>
Expand All @@ -211,6 +212,7 @@
<ref bean="searchFilterAuthor" />
<ref bean="searchFilterSubject" />
<ref bean="searchFilterIssued" />
<ref bean="searchFilterDateAccessioned" />
<ref bean="searchFilterContentInOriginalBundle"/>
<ref bean="searchFilterFileNameInOriginalBundle" />
<ref bean="searchFilterFileDescriptionInOriginalBundle" />
Expand Down Expand Up @@ -2679,6 +2681,22 @@
<property name="exposeMinAndMaxValue" value="true"/>
</bean>

<bean id="searchFilterDateAccessioned" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="dateAccessioned"/>
<property name="metadataFields">
<list>
<value>dc.date.accessioned</value>
</list>
</property>
<property name="type" value="date"/>
<property name="facetLimit" value="5"/>
<property name="sortOrderSidebar" value="COUNT"/>
<property name="sortOrderFilterPage" value="COUNT"/>
<property name="isOpenByDefault" value="false"/>
<property name="pageSize" value="10"/>
<property name="exposeMinAndMaxValue" value="true"/>
</bean>

<!-- Spatial facet -->
<bean id="searchFilterGeospatialPoint" class="org.dspace.discovery.configuration.DiscoverySearchFilterFacet">
<property name="indexFieldName" value="point"/>
Expand Down
Loading