Search in sources :

Example 1 with DefaultSort

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

the class WhenWorkingWithColumn method shouldCreateSchemaColumn.

@Test
void shouldCreateSchemaColumn() {
    String name = data.string();
    String label = data.string();
    String path = data.string();
    DataType dataType = DataType.STRING;
    DefaultSort sort = DefaultSort.ASCENDING;
    Column column = Column.fromSchema(name, label, path, dataType, sort);
    assertEquals(name, column.getName());
    assertEquals(label, column.getLabel());
    assertEquals(path, column.getPath());
    assertEquals(dataType, column.getDataType());
    assertEquals(Type.SCHEMA_COLUMN_NAME, column.getType());
    assertEquals(sort, column.getDefaultSort());
}
Also used : DefaultSort(com.opentext.ia.sdk.dto.result.Column.DefaultSort) DataType(com.opentext.ia.sdk.dto.result.Column.DataType) Test(org.junit.jupiter.api.Test)

Example 2 with DefaultSort

use of com.opentext.ia.sdk.dto.result.Column.DefaultSort 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 3 with DefaultSort

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

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