Search in sources :

Example 1 with SearchComposition

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;
}
Also used : SearchComposition(com.opentext.ia.sdk.dto.SearchComposition)

Example 2 with SearchComposition

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());
}
Also used : XForm(com.opentext.ia.sdk.dto.XForm) ResultMaster(com.opentext.ia.sdk.dto.result.ResultMaster) SearchComposition(com.opentext.ia.sdk.dto.SearchComposition) AllSearchComponents(com.opentext.ia.sdk.dto.result.AllSearchComponents) Test(org.junit.jupiter.api.Test)

Example 3 with SearchComposition

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);
}
Also used : SearchComposition(com.opentext.ia.sdk.dto.SearchComposition)

Example 4 with SearchComposition

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");
}
Also used : SearchComposition(com.opentext.ia.sdk.dto.SearchComposition) AllSearchComponents(com.opentext.ia.sdk.dto.result.AllSearchComponents)

Aggregations

SearchComposition (com.opentext.ia.sdk.dto.SearchComposition)4 AllSearchComponents (com.opentext.ia.sdk.dto.result.AllSearchComponents)2 XForm (com.opentext.ia.sdk.dto.XForm)1 ResultMaster (com.opentext.ia.sdk.dto.result.ResultMaster)1 Test (org.junit.jupiter.api.Test)1