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;
}
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());
}
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;
}
Aggregations