Search in sources :

Example 1 with AllSearchComponents

use of com.opentext.ia.sdk.dto.result.AllSearchComponents in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class PropertiesBasedConfigurer 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 : AllSearchComponents(com.opentext.ia.sdk.dto.result.AllSearchComponents)

Example 2 with AllSearchComponents

use of com.opentext.ia.sdk.dto.result.AllSearchComponents in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class WhenWorkingWithAllSearchComponenents method shouldHaveNoDefaults.

@Test
void shouldHaveNoDefaults() {
    AllSearchComponents components = new AllSearchComponents();
    assertNull(components.getResultMaster());
    assertNull(components.getSearchComposition());
    assertNull(components.getXform());
}
Also used : AllSearchComponents(com.opentext.ia.sdk.dto.result.AllSearchComponents) Test(org.junit.jupiter.api.Test)

Example 3 with AllSearchComponents

use of com.opentext.ia.sdk.dto.result.AllSearchComponents 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 4 with AllSearchComponents

use of com.opentext.ia.sdk.dto.result.AllSearchComponents 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

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