Continue to reduce the Model Madness!
Add OntModelCache to the top of the stack of RDF data structures. Add DataStructuresProvider to the bottom of the stack. Redesign ModelAccess method signatures. Create the ShowSources page. Remove RequestModelsPrep, except for setting the Collator. Reduce the complexity of ContentModelsSetup and ConfigurationModelsSetup. VIVO-225 VIVO-819 VIVO-820 VIVO-821 VIVO-823 VIVO-832
This commit is contained in:
parent
c9362db3c1
commit
78c8f102f8
171 changed files with 4196 additions and 2826 deletions
|
@ -3,7 +3,8 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames"%>
|
||||
|
||||
<%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %>
|
||||
|
@ -22,7 +23,7 @@
|
|||
" FILTER(afn:bnode(?bnode) = \"" + conceptIdStr + "\")\n" +
|
||||
"}";
|
||||
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getBaseOntModel();
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getOntModel(ModelNames.FULL_ASSERTIONS);
|
||||
Model conceptDescription = ModelFactory.createDefaultModel();
|
||||
try {
|
||||
ontModel.enterCriticalSection(Lock.READ);
|
||||
|
|
|
@ -4,13 +4,15 @@
|
|||
|
||||
<%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames"%>
|
||||
|
||||
<% request.setAttribute("requestedActions", SimplePermission.USE_MISCELLANEOUS_CURATOR_PAGES.ACTION); %>
|
||||
<vitro:confirmAuthorization />
|
||||
|
||||
<%
|
||||
if (request.getParameter("execute") != null) {
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getBaseOntModel();
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getOntModel(ModelNames.FULL_ASSERTIONS);
|
||||
int results = doRemoval(ontModel);
|
||||
request.setAttribute("removalCount", results);
|
||||
}
|
||||
|
@ -67,7 +69,7 @@
|
|||
" FILTER(afn:bnode(?bnode) = \"" + bnodeId + "\")\n" +
|
||||
"}";
|
||||
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getBaseOntModel();
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getOntModel(ModelNames.FULL_ASSERTIONS);
|
||||
Model conceptDescription = ModelFactory.createDefaultModel();
|
||||
try {
|
||||
ontModel.enterCriticalSection(Lock.READ);
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
<%@taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames"%>
|
||||
<% request.setAttribute("requestedActions", SimplePermission.USE_MISCELLANEOUS_CURATOR_PAGES.ACTION); %>
|
||||
<vitro:confirmAuthorization />
|
||||
|
||||
|
@ -17,7 +18,7 @@
|
|||
String describeQueryStr =
|
||||
"DESCRIBE <" + resourceURIStr + ">";
|
||||
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getBaseOntModel();
|
||||
OntModel ontModel = ModelAccess.on(getServletContext()).getOntModel(ModelNames.FULL_ASSERTIONS);
|
||||
Model resourceDescription = ModelFactory.createDefaultModel();
|
||||
try {
|
||||
ontModel.enterCriticalSection(Lock.READ);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
<%@page import="com.hp.hpl.jena.vocabulary.OWL"%>
|
||||
<%@page import="com.hp.hpl.jena.rdf.model.ModelMaker"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess.ModelMakerID"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService"%>
|
||||
<%@page import="java.util.Iterator"%>
|
||||
<%@page import="java.util.ArrayList"%>
|
||||
<%@page import="java.util.List"%>
|
||||
|
@ -123,7 +123,7 @@ td {
|
|||
<ul class="clean">
|
||||
<%
|
||||
try {
|
||||
ModelMaker maker = ModelAccess.on(application).getModelMaker(ModelMakerID.CONFIGURATION);
|
||||
ModelMaker maker = ModelAccess.on(application).getModelMaker(WhichService.CONFIGURATION);
|
||||
for (Iterator it = maker.listModels(); it.hasNext();) {
|
||||
String modelName = (String) it.next();
|
||||
%>
|
||||
|
|
21
webapp/web/css/showSources.css
Normal file
21
webapp/web/css/showSources.css
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/* Styles for Freemarker template admin/showSources */
|
||||
|
||||
#show-sources pre {
|
||||
font-family: monospace;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
#show-sources table {
|
||||
width: 100%;
|
||||
border: solid black;
|
||||
}
|
||||
|
||||
#show-sources th {
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
|
||||
#show-sources td {
|
||||
border: 1px solid gray;
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<%@ page import="com.hp.hpl.jena.ontology.Individual" %>
|
||||
<%@ page import="com.hp.hpl.jena.ontology.OntModel" %>
|
||||
<%@ page import="com.hp.hpl.jena.rdf.model.ModelMaker" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<select name="workflowURI">
|
||||
|
||||
<%
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getJenaOntModel();
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
|
||||
jenaOntModel.enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
List savedQueries = (List) request.getAttribute("workflows");
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<%@ page import="com.hp.hpl.jena.ontology.Individual"%>
|
||||
<%@ page import="com.hp.hpl.jena.ontology.OntModel"%>
|
||||
<%@ page import="com.hp.hpl.jena.rdf.model.ModelMaker"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess.ModelMakerID"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService"%>
|
||||
<%@ page import="com.hp.hpl.jena.shared.Lock"%>
|
||||
<%@ page import="java.util.Iterator"%>
|
||||
<%@ page import="java.util.List"%>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<vitro:confirmAuthorization />
|
||||
|
||||
<%
|
||||
ModelMaker maker = ModelAccess.on(getServletContext()).getModelMaker(ModelMakerID.CONFIGURATION);
|
||||
ModelMaker maker = ModelAccess.on(getServletContext()).getModelMaker(WhichService.CONFIGURATION);
|
||||
%>
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
|||
<h3>SPARQL Query <select name="savedQuery">
|
||||
<option value="">select saved query</option>
|
||||
<%
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getJenaOntModel();
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
|
||||
jenaOntModel.enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
List savedQueries = (List) request.getAttribute("savedQueries");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<%@ page import="com.hp.hpl.jena.ontology.Individual" %>
|
||||
<%@ page import="com.hp.hpl.jena.ontology.OntModel" %>
|
||||
<%@ page import="com.hp.hpl.jena.rdf.model.ModelMaker" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess"%>
|
||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<select name="workflowStepURI">
|
||||
|
||||
<%
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getJenaOntModel();
|
||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
|
||||
jenaOntModel.enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
List workflowSteps = (List) request.getAttribute("workflowSteps");
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<#-- Template to display the source of our RDF data, both for the context and for the current request. -->
|
||||
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/showSources.css" />')}
|
||||
|
||||
<section id="show-sources" role="region">
|
||||
<p>
|
||||
<em>The information displayed here has also been written to the log.</em>
|
||||
</p>
|
||||
|
||||
<h2>Current RDF Data Structures</h2>
|
||||
|
||||
<h3>RDFServices</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th> </th><th>Context</th><th>Request</th>
|
||||
</tr>
|
||||
<#list rdfServices?keys as which>
|
||||
<tr>
|
||||
<th>${which}</th>
|
||||
<td><pre>${rdfServices[which].context}</pre></td>
|
||||
<td><pre>${rdfServices[which].request}</pre></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>Datasets</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th> </th><th>Context</th><th>Request</th>
|
||||
</tr>
|
||||
<#list datasets?keys as which>
|
||||
<tr>
|
||||
<th>${which}</th>
|
||||
<td><pre>${datasets[which].context}</pre></td>
|
||||
<td><pre>${datasets[which].request}</pre></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>ModelAccess</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Context</th>
|
||||
<td><pre>${modelAccess.context}</pre></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Request</th>
|
||||
<td><pre>${modelAccess.request}</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Models</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><th>(Context only)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th><th>CONFIGURATION</th>
|
||||
</tr>
|
||||
<#list models.CONFIGURATION?keys as name>
|
||||
<tr>
|
||||
<td><pre>${name}</pre></td>
|
||||
<td><pre>${models.CONFIGURATION[name].context}</pre></td>
|
||||
</tr>
|
||||
</#list>
|
||||
<tr>
|
||||
<th> </th><th>CONTENT</th>
|
||||
</tr>
|
||||
<#list models.CONTENT?keys as name>
|
||||
<tr>
|
||||
<td><pre>${name}</pre></td>
|
||||
<td><pre>${models.CONTENT[name].context}</pre></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
<h3>OntModels</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><th>Context</th><th>Request</th>
|
||||
</tr>
|
||||
<#list ontModels?keys as name>
|
||||
<tr>
|
||||
<td><pre>${name}</pre></td>
|
||||
<td><pre>${ontModels[name].context}</pre></td>
|
||||
<td><pre>${ontModels[name].request}</pre></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
|
||||
</section>
|
|
@ -66,6 +66,8 @@
|
|||
<br/>
|
||||
<a href="${urls.base}/admin/showAuth">Show authorization info</a>
|
||||
<a href="${urls.base}/admin/showThreads">Show background threads</a>
|
||||
<br/>
|
||||
<a href="${urls.base}/admin/showSources">Show RDF data sources</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue