return itemDefaultValues;
}
private void readDefinition(WGFileContainer model) throws DocumentException, WGAPIException, NoSuchAlgorithmException, IOException {
SAXReader saxReader = new SAXReader();
MD5HashingInputStream inputStream = new MD5HashingInputStream(model.getFileData(MODEL_FILE));
_definition = saxReader.read(new InputStreamReader(inputStream, "UTF-8"));
inputStream.close();
String redirection = _definition.getRootElement().attributeValue("redirect");
if (redirection != null) {
WGFileContainer redirectModel = model.getDatabase().getFileContainer(redirection);
readDefinition(redirectModel);
return;
}
_definitionTime = model.getLastModified().getTime();
String versionStr = _definition.getRootElement().attributeValue("version", "1.0");
try {
_definitionHash = inputStream.getHash();
}
catch (NumberFormatException e) {
LOG.error("Exception parsing model version '" + versionStr + "'. Fallback to version 1.0.", e);
}
}