Merge branch 'develop' into feature/fauxEditing
This commit is contained in:
commit
f4b3728822
3 changed files with 25 additions and 31 deletions
|
@ -8,9 +8,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.jena.atlas.lib.Pair;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.PropertyDao.FullPropertyKey;
|
||||
|
||||
public class WebappDaoFactoryConfig {
|
||||
|
||||
|
@ -18,7 +16,7 @@ public class WebappDaoFactoryConfig {
|
|||
private String defaultNamespace;
|
||||
private Set<String> nonUserNamespaces;
|
||||
private boolean isUnderlyingStoreReasoned = false;
|
||||
public Map<Pair<String,Pair<ObjectProperty, String>>, String> customListViewConfigFileMap;
|
||||
public Map<FullPropertyKey, String> customListViewConfigFileMap;
|
||||
|
||||
public WebappDaoFactoryConfig() {
|
||||
preferredLanguages = Arrays.asList("en-US", "en", "EN");
|
||||
|
@ -59,12 +57,12 @@ public class WebappDaoFactoryConfig {
|
|||
return this.isUnderlyingStoreReasoned;
|
||||
}
|
||||
|
||||
public Map<Pair<String,Pair<ObjectProperty, String>>, String> getCustomListViewConfigFileMap() {
|
||||
public Map<FullPropertyKey, String> getCustomListViewConfigFileMap() {
|
||||
return this.getCustomListViewConfigFileMap();
|
||||
}
|
||||
|
||||
public void setCustomListViewConfigFileMap(
|
||||
Map<Pair<String,Pair<ObjectProperty, String>>, String> map) {
|
||||
Map<FullPropertyKey, String> map) {
|
||||
this.customListViewConfigFileMap = map;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import java.util.Map;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.jena.atlas.lib.Pair;
|
||||
|
||||
import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
|
||||
import com.hp.hpl.jena.ontology.ConversionException;
|
||||
|
@ -58,8 +57,7 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
|
||||
public ObjectPropertyDaoJena(RDFService rdfService,
|
||||
DatasetWrapperFactory dwf,
|
||||
Map<Pair<String,Pair<ObjectProperty, String>>, String>
|
||||
customListViewConfigFileMap,
|
||||
Map<FullPropertyKey, String> customListViewConfigFileMap,
|
||||
WebappDaoFactoryJena wadf) {
|
||||
super(rdfService, dwf, wadf);
|
||||
this.customListViewConfigFileMap = customListViewConfigFileMap;
|
||||
|
@ -1090,12 +1088,12 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
// Map key is inner pair of object property and range class URI,
|
||||
// with first member of outer pair being a domain class URI.
|
||||
// If domain or range is unspecified, OWL.Thing.getURI() is used in the key.
|
||||
Map<Pair<String,Pair<ObjectProperty, String>>, String> customListViewConfigFileMap;
|
||||
Map<FullPropertyKey, String> customListViewConfigFileMap;
|
||||
|
||||
@Override
|
||||
public String getCustomListViewConfigFileName(ObjectProperty op) {
|
||||
if (customListViewConfigFileMap == null) {
|
||||
customListViewConfigFileMap = new HashMap<Pair<String,Pair<ObjectProperty, String>>, String>();
|
||||
customListViewConfigFileMap = new HashMap<>();
|
||||
}
|
||||
if (customListViewConfigFileMap.isEmpty()) {
|
||||
long start = System.currentTimeMillis();
|
||||
|
@ -1125,33 +1123,31 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
}
|
||||
} else {
|
||||
String filename = soln.getLiteral("filename").getLexicalForm();
|
||||
log.debug("putting " + domainUri + " " + prop.getURI() + " " + rangeUri + " " + filename + " into list view map");
|
||||
customListViewConfigFileMap.put(
|
||||
new Pair<String,Pair<ObjectProperty,String>>(
|
||||
domainUri, new Pair<ObjectProperty, String>(
|
||||
prop, rangeUri)), filename);
|
||||
FullPropertyKey key = new FullPropertyKey(domainUri, prop.getURI(), rangeUri);
|
||||
log.debug("putting " + key + " " + filename + " into list view map");
|
||||
customListViewConfigFileMap.put(key, filename);
|
||||
}
|
||||
}
|
||||
// If there are no custom list views, put a bogus entry in the map
|
||||
// to avoid further recomputation
|
||||
if (customListViewConfigFileMap.isEmpty()) {
|
||||
ObjectProperty bottom = new ObjectProperty();
|
||||
bottom.setURI(OWL.NS + "bottomObjectProperty");
|
||||
customListViewConfigFileMap.put(
|
||||
new Pair<String,Pair<ObjectProperty,String>>(
|
||||
null, new Pair<ObjectProperty, String>(
|
||||
bottom, null)), "nothing");
|
||||
new FullPropertyKey(null, OWL.NS + "bottomObjectProperty", null),
|
||||
"nothing");
|
||||
}
|
||||
qexec.close();
|
||||
}
|
||||
String customListViewConfigFileName = customListViewConfigFileMap.get(new Pair<String, Pair<ObjectProperty, String>>(op.getDomainVClassURI(), new Pair<ObjectProperty,String>(op, op.getRangeVClassURI())));
|
||||
FullPropertyKey key = new FullPropertyKey(op);
|
||||
String customListViewConfigFileName = customListViewConfigFileMap.get(key);
|
||||
if (customListViewConfigFileName == null) {
|
||||
log.debug("no list view found for " + op.getURI() + " qualified by range " + op.getRangeVClassURI() + " and domain " + op.getDomainVClassURI());
|
||||
customListViewConfigFileName = customListViewConfigFileMap.get(new Pair<String, Pair<ObjectProperty, String>>(OWL.Thing.getURI(), new Pair<ObjectProperty,String>(op, op.getRangeVClassURI())));
|
||||
log.debug("no list view found for " + key);
|
||||
key = new FullPropertyKey(null, op.getURI(), op.getRangeVClassURI());
|
||||
customListViewConfigFileName = customListViewConfigFileMap.get(key);
|
||||
}
|
||||
if (customListViewConfigFileName == null) {
|
||||
log.debug("no list view found for " + op.getURI() + " qualified by range " + op.getRangeVClassURI());
|
||||
customListViewConfigFileName = customListViewConfigFileMap.get(new Pair<String, Pair<ObjectProperty, String>>(OWL.Thing.getURI(), new Pair<ObjectProperty,String>(op, OWL.Thing.getURI())));
|
||||
log.debug("no list view found for " + key);
|
||||
key = new FullPropertyKey(null, op.getURI(), null);
|
||||
customListViewConfigFileName = customListViewConfigFileMap.get(key);
|
||||
}
|
||||
|
||||
return customListViewConfigFileName;
|
||||
|
|
|
@ -18,10 +18,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.jena.atlas.lib.Pair;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
|
||||
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.PropertyDao.FullPropertyKey;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryConfig;
|
||||
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
|
||||
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.JoinedOntModelCache;
|
||||
|
@ -123,11 +122,12 @@ public class BasicShortTermDataStructuresProvider implements
|
|||
return ("true".equals(isStoreReasoned));
|
||||
}
|
||||
|
||||
private Map<Pair<String, Pair<ObjectProperty, String>>, String> getCustomListViewConfigFileMap() {
|
||||
Map<Pair<String, Pair<ObjectProperty, String>>, String> map = (Map<Pair<String, Pair<ObjectProperty, String>>, String>) ctx
|
||||
private Map<FullPropertyKey, String> getCustomListViewConfigFileMap() {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<FullPropertyKey, String> map = (Map<FullPropertyKey, String>) ctx
|
||||
.getAttribute("customListViewConfigFileMap");
|
||||
if (map == null) {
|
||||
map = new ConcurrentHashMap<Pair<String, Pair<ObjectProperty, String>>, String>();
|
||||
map = new ConcurrentHashMap<FullPropertyKey, String>();
|
||||
ctx.setAttribute("customListViewConfigFileMap", map);
|
||||
}
|
||||
return map;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue