Search in sources :

Example 1 with ResultMaster

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

the class PropertiesBasedConfigurer method createResultMaster.

private ResultMaster createResultMaster(String searchName, String compositionName, long version) {
    ResultMaster result = new ResultMaster();
    result.setVersion(version);
    result.setNamespaces(createNamespaces(templatedString(SEARCH_QUERY, searchName)));
    List<Column> columns = result.getDefaultTab().getColumns();
    result.getDefaultTab().setExportEnabled(templatedBoolean(SEARCH_COMPOSITION_RESULT_MAIN_EXPORT_ENABLED_TEMPLATE, searchName));
    result.getDefaultTab().getExportConfigurations().addAll(uriFromNamesAndType(EXPORT_CONFIGURATION, getStrings(SEARCH_COMPOSITION_RESULT_MAIN_EXPORT_CONFIG_TEMPLATE, searchName)));
    for (Map<String, String> config : getSearchColumnConfigs(searchName, compositionName)) {
        String name = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_NAME, searchName, compositionName));
        String label = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_LABEL, searchName, compositionName));
        String path = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_PATH, searchName, compositionName));
        DataType dataType = DataType.valueOf(config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_TYPE, searchName, compositionName)));
        DefaultSort sortOrder = DefaultSort.valueOf(config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_SORT, searchName, compositionName)));
        Column column = Column.fromSchema(name, label, path, dataType, sortOrder);
        columns.add(column);
    }
    return result;
}
Also used : DefaultSort(com.opentext.ia.sdk.dto.result.Column.DefaultSort) Column(com.opentext.ia.sdk.dto.result.Column) ResultMaster(com.opentext.ia.sdk.dto.result.ResultMaster) DataType(com.opentext.ia.sdk.dto.result.Column.DataType)

Example 2 with ResultMaster

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

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

the class PropertiesBasedApplicationConfigurer method createResultMaster.

private ResultMaster createResultMaster(String searchName, String compositionName, long version) {
    ResultMaster result = new ResultMaster();
    result.setVersion(version);
    result.setNamespaces(createNamespaces(templatedString(SEARCH_QUERY, searchName)));
    Tab defaultTab = result.getDefaultTab();
    List<Column> columns = defaultTab.getColumns();
    defaultTab.setExportEnabled(templatedBoolean(SEARCH_COMPOSITION_RESULT_MAIN_EXPORT_ENABLED_TEMPLATE, searchName));
    defaultTab.getExportConfigurations().addAll(uriFromNamesAndType(EXPORT_CONFIGURATION, getStrings(SEARCH_COMPOSITION_RESULT_MAIN_EXPORT_CONFIG_TEMPLATE, searchName)));
    for (Map<String, String> config : getSearchColumnConfigs(searchName, compositionName)) {
        String name = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_NAME, searchName, compositionName));
        String label = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_LABEL, searchName, compositionName));
        String path = config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_PATH, searchName, compositionName));
        DataType dataType = DataType.valueOf(config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_TYPE, searchName, compositionName)));
        DefaultSort sortOrder = DefaultSort.valueOf(config.get(resolveTemplatedKey(SEARCH_COMPOSITION_RESULT_MAIN_COLUMN_SORT, searchName, compositionName)));
        Column column = Column.fromSchema(name, label, path, dataType, sortOrder);
        columns.add(column);
    }
    return result;
}
Also used : DefaultSort(com.opentext.ia.sdk.dto.result.Column.DefaultSort) Tab(com.opentext.ia.sdk.dto.result.Tab) Column(com.opentext.ia.sdk.dto.result.Column) ResultMaster(com.opentext.ia.sdk.dto.result.ResultMaster) DataType(com.opentext.ia.sdk.dto.result.Column.DataType)

Aggregations

ResultMaster (com.opentext.ia.sdk.dto.result.ResultMaster)3 Column (com.opentext.ia.sdk.dto.result.Column)2 DataType (com.opentext.ia.sdk.dto.result.Column.DataType)2 DefaultSort (com.opentext.ia.sdk.dto.result.Column.DefaultSort)2 SearchComposition (com.opentext.ia.sdk.dto.SearchComposition)1 XForm (com.opentext.ia.sdk.dto.XForm)1 AllSearchComponents (com.opentext.ia.sdk.dto.result.AllSearchComponents)1 Tab (com.opentext.ia.sdk.dto.result.Tab)1 Test (org.junit.jupiter.api.Test)1