KeywordsSearcher { public void search(KeywordSearchParams params) throws Exception { this._results = params.search(_thesaurusFinder); } KeywordsSearcher(IsoLanguagesMapper mapper, ThesaurusFinder thesaurusFinder);  KeywordsSearcher(ServiceContext context, ThesaurusFinder thesaurusFinder); static Element toRawElement(Element rootEl, KeywordBean kb); KeywordBean searchById(String id, String sThesaurusName, String... languages); void searchTopConcepts(String sThesaurusName, String... languages); void search(KeywordSearchParams params); void search(String contextLanguage, Element params); void search(String contextLanguage, Element params, Comparator<KeywordBean> comparator); void searchForRelated(Element params, KeywordRelation request, @Nullable Comparator<KeywordBean> comparator,
                                 String... languages); void searchForRelated(String id, String sThesaurusName, KeywordRelation request, @Nullable Comparator<KeywordBean> comparator,
                                 String... languages); int getNbResults(); List<KeywordBean> getResults(); Element getXmlResults(); void selectUnselectKeywords(Element params); void selectUnselectKeywords(Set<String> idSet); void clearSelection(); Element getSelectedKeywordsAsXml(); List<KeywordBean> getSelectedKeywordsInList(); KeywordBean getKeywordFromResultsById(int id); KeywordBean getKeywordFromResultsById(String id); KeywordBean getKeywordFromResultsByUriCode(String code);  }
@Test public void testSearchNoContextEngLangNoSearchAllThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .addLang("eng"); searcher.search(params.build()); assertSearchNoContextEngLangNoSearchAllThesauri(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextEngLangNoSearchAllThesauri(searcher); }
@Test public void testSearchNoContextMultiLangNoSearchAllThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchNoContextMultiLangNoSearchAllThesauri(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextMultiLangNoSearchAllThesauri(searcher); }
@Test public void testSearchNoContextMultiLangKeywordSearchAllThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .keyword("fooVal", KeywordSearchType.CONTAINS, false) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchNoContextMultiLangSearchAllThesauri(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextMultiLangSearchAllThesauri(searcher); }
@Test public void testSearchNoContextMultiLangKeywordNoSearchOneCategory() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .thesauriDomainName(thesaurusBlah.getDname()) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchNoContextMultiLangNoSearchOneCategory(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextMultiLangNoSearchOneCategory(searcher); }
@Test public void testSearchNoContextMultiLangKeywordSearchOneSpecificThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .addThesaurus(thesaurusBlah.getKey()) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchNoContextMultiLangKeywordSearchOneSpecificThesauri(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextMultiLangKeywordSearchOneSpecificThesauri(searcher); }
@Test public void testSearchNoContextMultiLangKeywordSearchTwoSpecificThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .addThesaurus(thesaurusBlah.getKey()) .addThesaurus(thesaurusFoo.getKey()) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchNoContextMultiLangKeywordSearchTwoSpecificThesauri(searcher); searcher.search(null, params.toXmlParams()); assertSearchNoContextMultiLangKeywordSearchTwoSpecificThesauri(searcher); }
@Test public void testSearchContextMultiLangKeywordNoSearchTwoSpecificThesauri() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .addThesaurus(thesaurusBlah.getKey()) .addThesaurus(thesaurusFoo.getKey()) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search("ger", params.toXmlParams()); assertSearchNoContextMultiLangKeywordSearchTwoSpecificThesauri(searcher); }
@Test public void testSearchUriSearch() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordSearchParamsBuilder params = new KeywordSearchParamsBuilder(isoLangMapper) .uri(THESAURUS_KEYWORD_NS + 30) .addLang("fre") .addLang("eng") .addLang("chi"); searcher.search(params.build()); assertSearchUriSearch(searcher); searcher.search(null, params.toXmlParams()); assertSearchUriSearch(searcher); }