Updates for resolving NIHVIVO-3217 and NIHVIVO-3218
This commit is contained in:
parent
591af24749
commit
d3f77a374c
2 changed files with 18 additions and 3 deletions
|
@ -866,14 +866,21 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
if (customListViewConfigFileMap == null) {
|
||||
customListViewConfigFileMap = new HashMap<ObjectProperty, String>();
|
||||
OntModel displayModel = getOntModelSelector().getDisplayModel();
|
||||
//Get all property to list view config file mappings in the system
|
||||
QueryExecution qexec = QueryExecutionFactory.create(listViewConfigFileQuery, displayModel);
|
||||
ResultSet results = qexec.execSelect();
|
||||
//Iterate through mappings looking for the current property and setting up a hashmap for subsequent retrieval
|
||||
while (results.hasNext()) {
|
||||
QuerySolution soln = results.next();
|
||||
String propertyUri = soln.getResource("property").getURI();
|
||||
ObjectProperty prop = getObjectPropertyByURI(propertyUri);
|
||||
if (prop == null) {
|
||||
log.warn("Can't find property for uri " + propertyUri);
|
||||
//This is a warning only if this property is the one for which we're searching
|
||||
if(op.getURI().equals(propertyUri)){
|
||||
log.warn("Can't find property for uri " + propertyUri);
|
||||
} else {
|
||||
log.debug("Can't find property for uri " + propertyUri);
|
||||
}
|
||||
} else {
|
||||
String filename = soln.getLiteral("filename").getLexicalForm();
|
||||
customListViewConfigFileMap.put(prop, filename);
|
||||
|
|
|
@ -655,7 +655,15 @@ public class WebappDaoFactoryJena implements WebappDaoFactory {
|
|||
|
||||
OntModelSelectorImpl specialSelector = new OntModelSelectorImpl();
|
||||
specialSelector.setFullModel(unionModel);
|
||||
specialSelector.setApplicationMetadataModel(specialModel);
|
||||
//Keeping original application metadata model and adding special model
|
||||
//adding both allows us to prevent errors in ApplicationDao which may depend on
|
||||
//a specific individual from the regular application metadata model to pick theme
|
||||
//Adding the new model would take care of special situations where the switch model may
|
||||
//contain important information
|
||||
OntModel newApplicationModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
|
||||
newApplicationModel.add(specialModel);
|
||||
newApplicationModel.add(originalSelector.getApplicationMetadataModel());
|
||||
specialSelector.setApplicationMetadataModel(newApplicationModel);
|
||||
|
||||
if(specialDisplayModel != null) {
|
||||
specialSelector.setDisplayModel(specialDisplayModel);
|
||||
|
|
Loading…
Add table
Reference in a new issue