List<String> qualificationFormatList = Arrays.asList(QUALIFICATION_FORMATS);
_qualificationIndex = qualificationFormatList.indexOf(_qualifierFormat);
if (map.containsKey("dataSource")) {
EOModelMap dataSourceMap = new EOModelMap(map.getMap("dataSource"));
try {
EODataSource dataSource = EODataSourceFactory.createDataSourceFromMap(dataSourceMap, _wooModel.getModelGroup());
dataSource.loadFromMap(dataSourceMap, failures);
_dataSource = dataSource;
} catch (Throwable e) {
e.printStackTrace();
}
if (_dataSource instanceof EODetailDataSource) {
EODetailDataSource ds = (EODetailDataSource) _dataSource;
_hasMasterDetail = true;
setMasterEntityName(ds.getMasterClass());
setDetailKeyName(ds.getDetailKey());
_detailDataSource = ds;
}
else if (_dataSource instanceof EODatabaseDataSource) {
EODatabaseDataSource ds = (EODatabaseDataSource) _dataSource;
_hasMasterDetail = false;
setEntityName(ds.getEntityName());
_databaseDataSource = ds;
}
if (_entityName == null) {
// XXX Invalid display group
if (dataSourceMap.containsKey("fetchSpecification")) {
EOModelMap fetchSpecMap = new EOModelMap(dataSourceMap.getMap("fetchSpecification"));
_entityName = fetchSpecMap.getString("entityName", true);
}
else if (dataSourceMap.containsKey("masterClassDescription")) {
_entityName = dataSourceMap.getString("masterClassDescription", true);
}
}
}
List<Map<Object, Object>> sortOrderList = map.getList("sortOrdering");
if (sortOrderList != null) {
for (Map<Object, Object> sortOrdering : sortOrderList) {
if (sortOrdering != null) {
EOModelMap sortOrderingMap = new EOModelMap(sortOrdering);
_sortOrder.loadFromMap(sortOrderingMap);
_isSorted = true;
}
}
}