use of org.alfresco.repo.dictionary.M2ModelDiff in project SearchServices by Alfresco.
the class AlfrescoSolrDataModel method validateModel.
private Set<String> validateModel(M2Model model) {
HashSet<String> errors = new HashSet<String>();
try {
dictionaryDAO.getCompiledModel(QName.createQName(model.getName(), namespaceDAO));
} catch (DictionaryException e) {
// No model to diff
return errors;
} catch (NamespaceException e) {
// namespace unknown - no model
return errors;
}
List<M2ModelDiff> modelDiffs = dictionaryDAO.diffModelIgnoringConstraints(model);
for (M2ModelDiff modelDiff : modelDiffs) {
if (modelDiff.getDiffType().equals(M2ModelDiff.DIFF_UPDATED)) {
errors.add("Model not updated: " + model.getName() + " Failed to validate model update - found non-incrementally updated " + modelDiff.getElementType() + " '" + modelDiff.getElementName() + "'");
}
}
return errors;
}
Aggregations