use of com.opentext.ia.sdk.dto.SearchComposition in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class PropertiesBasedApplicationConfigurer method createSearchComposition.
private SearchComposition createSearchComposition(String name) {
SearchComposition result = createObject(name, SearchComposition.class);
result.setSearchName(SEARCH_NAME);
result.setVersion(1L);
return result;
}
use of com.opentext.ia.sdk.dto.SearchComposition in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class WhenWorkingWithAllSearchComponenents method shouldUpdateStateWhenSettersAreCalled.
@Test
void shouldUpdateStateWhenSettersAreCalled() {
AllSearchComponents components = new AllSearchComponents();
ResultMaster resultMaster = new ResultMaster();
SearchComposition searchComposition = new SearchComposition();
XForm xform = new XForm();
components.setResultMaster(resultMaster);
components.setSearchComposition(searchComposition);
components.setXform(xform);
assertEquals(searchComposition, components.getSearchComposition());
assertEquals(resultMaster, components.getResultMaster());
assertEquals(xform, components.getXform());
}
use of com.opentext.ia.sdk.dto.SearchComposition in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class PropertiesBasedApplicationConfigurer method ensureSearchComposition.
private void ensureSearchComposition(String searchName) throws IOException {
String name = templatedString(SEARCH_COMPOSITION_NAME, searchName);
if (StringUtils.isBlank(name)) {
name = "Set 1";
}
SearchComposition composition = ensureNamedItem(cache.getSearch(), LINK_SEARCH_COMPOSITIONS, SearchCompositions.class, name, this::createSearchComposition);
ensureAllSearchComponents(searchName, composition);
cache.setSearchComposition(composition);
}
use of com.opentext.ia.sdk.dto.SearchComposition in project infoarchive-sip-sdk by Enterprise-Content-Management.
the class PropertiesBasedApplicationConfigurer method ensureAllSearchComponents.
private void ensureAllSearchComponents(String searchName, SearchComposition composition) throws IOException {
AllSearchComponents components = new AllSearchComponents();
components.setSearchComposition(composition);
components.setXform(createXForm(searchName, composition.getName(), composition.getVersion()));
components.setResultMaster(createResultMaster(searchName, composition.getName(), composition.getVersion()));
SearchComposition updatedComposition = restClient.put(composition.getUri(LINK_ALLCOMPONENTS), SearchComposition.class, components);
Objects.requireNonNull(updatedComposition, "Failed to update search composition");
}
Aggregations