-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cn-browse): support aliases for callNumberTypeId filters (#733)
Closes: MSEARCH-942
- Loading branch information
Showing
29 changed files
with
137 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ch/cql/CallNumberSearchTermProcessor.java → ...chterm/CallNumberSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/org/folio/search/cql/searchterm/CallNumberTypeIdSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.folio.search.cql.searchterm; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.folio.search.domain.dto.BrowseOptionType; | ||
import org.folio.search.domain.dto.BrowseType; | ||
import org.folio.search.service.consortium.BrowseConfigServiceDecorator; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class CallNumberTypeIdSearchTermProcessor implements SearchTermProcessor { | ||
|
||
private final BrowseConfigServiceDecorator configService; | ||
|
||
@Override | ||
public Object getSearchTerm(String inputTerm) { | ||
try { | ||
var browseOptionType = BrowseOptionType.fromValue(inputTerm); | ||
var browseConfig = configService.getConfig(BrowseType.CALL_NUMBER, browseOptionType); | ||
return browseConfig.getTypeIds().stream().map(Object::toString).toArray(String[]::new); | ||
} catch (IllegalArgumentException e) { | ||
return inputTerm; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ssificationNumberSearchTermProcessor.java → ...ssificationNumberSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o/search/cql/IsbnSearchTermProcessor.java → ...l/searchterm/IsbnSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o/search/cql/LccnSearchTermProcessor.java → ...l/searchterm/LccnSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o/search/cql/OclcSearchTermProcessor.java → ...l/searchterm/OclcSearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...folio/search/cql/SearchTermProcessor.java → ...h/cql/searchterm/SearchTermProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.folio.search.cql; | ||
package org.folio.search.cql.searchterm; | ||
|
||
public interface SearchTermProcessor { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 12 additions & 29 deletions
41
src/main/resources/swagger.api/examples/result/browseCallNumberResult.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,16 @@ | ||
value: | ||
items: | ||
- fullCallNumber: "Bilingualism: a bibliography of 1000 references with special reference to Wales." | ||
shelfKey: "Bilingualism: a bibliography of 1000 references with special reference to Wales." | ||
- fullCallNumber: "NS 1 .B5" | ||
callNumber: "NS 1 .B4" | ||
callNumberTypeId: "2b94c631-fca9-4892-a730-03ee529ff6c3" | ||
prefix: "pref1" | ||
isAnchor: true | ||
totalRecords: 1 | ||
instance: | ||
id: "d20569a7-9bba-44dd-9ad5-6f8f1d24ee1f" | ||
title: "Bilingualism: a bibliography of 1000 references with special reference to Wales." | ||
contributors: | ||
- name: "Eichhorst, Georg." | ||
publication: | ||
- publisher: "Duncker und Humblot" | ||
dateOfPublication: "1976" | ||
electronicAccess: | ||
- uri: "http://www.example.com" | ||
notes: | ||
- note: "Staff note" | ||
items: | ||
- barcode: "12345" | ||
notes: | ||
- note: "Staff note" | ||
electronicAccess: | ||
- uri: "http://www.example.com" | ||
holdings: | ||
- callNumber: "FS 124.44" | ||
notes: | ||
- note: "Staff note" | ||
electronicAccess: | ||
- uri: "http://www.example.com" | ||
prev: "string" | ||
next: "string" | ||
totalRecords: 1 | ||
- fullCallNumber: "NS 1 .B5 suf-1801" | ||
callNumber: "NS 1 .B5" | ||
suffix: "suf-1801" | ||
isAnchor: true | ||
totalRecords: 1 | ||
prev: "NS 1 .B4" | ||
next: "NS 1 .B5 suf-1801" | ||
totalRecords: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ql/CallNumberSearchTermProcessorTest.java → ...rm/CallNumberSearchTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...icationNumberSearchTermProcessorTest.java → ...icationNumberSearchTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ectiveShelvingOrderTermProcessorTest.java → ...ectiveShelvingOrderTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...arch/cql/IsbnSearchTermProcessorTest.java → ...archterm/IsbnSearchTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...arch/cql/LccnSearchTermProcessorTest.java → ...archterm/LccnSearchTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...arch/cql/OclcSearchTermProcessorTest.java → ...archterm/OclcSearchTermProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.