Skip to content

Commit

Permalink
Clean up jsp files
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Oct 24, 2023
1 parent 5a30c66 commit 8729b0b
Show file tree
Hide file tree
Showing 19 changed files with 225 additions and 309 deletions.
18 changes: 9 additions & 9 deletions webapp/src/main/webapp/error.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%@page import="org.apache.commons.logging.Log"%>
<%@page import="org.apache.commons.logging.LogFactory"%>
<%
// We have seen that this page can throw its own error.
// We have seen that this page can throw its own error.
// Before it does so, be sure that we have written the original error to the log.
Object c = request.getAttribute("javax.servlet.jsp.jspException");
if (c instanceof Throwable) {
Expand All @@ -18,15 +18,15 @@
}
VitroRequest vreq = new VitroRequest(request);
ApplicationBean appBean = vreq.getAppBean();
String themeDir = appBean.getThemeDir();
VitroRequest vreq = new VitroRequest(request);
ApplicationBean appBean = vreq.getAppBean();
String themeDir = appBean.getThemeDir();
request.setAttribute("bodyJsp", "/errorbody.jsp");
request.setAttribute("title", "Error");
request.setAttribute("css", "");
request.setAttribute("themeDir", themeDir);
%>
request.setAttribute("bodyJsp", "/errorbody.jsp");
request.setAttribute("title", "Error");
request.setAttribute("css", "");
request.setAttribute("themeDir", themeDir);
%>


<jsp:include page="/templates/page/doctype.jsp"/>
Expand Down
9 changes: 4 additions & 5 deletions webapp/src/main/webapp/jenaIngest/csv2rdfSelectUri.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ function disableProperties(){
<input type="radio" value="pattern" name="concatenate" onclick="selectProperties()">Use pattern based on values of </input>


<%
Map<String,LinkedList<String>> propertyMap = (Map) request.getAttribute("propertyMap");
Set<Entry<String,LinkedList<String>>> set = propertyMap.entrySet();
Iterator<Entry<String,LinkedList<String>>> itr = set.iterator();
Entry<String, LinkedList<String>> entry = null;
<% Map<String,LinkedList<String>> propertyMap = (Map) request.getAttribute("propertyMap");
Set<Entry<String,LinkedList<String>>> set = propertyMap.entrySet();
Iterator<Entry<String,LinkedList<String>>> itr = set.iterator();
Entry<String, LinkedList<String>> entry = null;
%>

<select name="property" id="properties" disabled="disabled">
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/main/webapp/jenaIngest/executeWorkflow.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
<select name="workflowURI">

<%
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
jenaOntModel.enterCriticalSection(Lock.READ);
try {
List savedQueries = (List) request.getAttribute("workflows");
for (Iterator it = savedQueries.iterator(); it.hasNext();) {
Individual savedQuery = (Individual) it.next();
for (Iterator it = savedQueries.iterator(); it.hasNext();) {
Individual savedQuery = (Individual) it.next();
String queryURI = savedQuery.getURI();
String queryLabel = savedQuery.getLabel(null);
%> <option value="<%=queryURI%>"><%=queryLabel%></option> <%
%> <option value="<%=queryURI%>"><%=queryLabel%></option> <%
}
} finally {
jenaOntModel.leaveCriticalSection();
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/main/webapp/jenaIngest/merge_result.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h2><a class="ingestMenu" href="ingest">Ingest Menu</a> > Merge Individuals</h2>

<%
MergeResult resultObj = (MergeResult) request.getAttribute("result");
MergeResult resultObj = (MergeResult) request.getAttribute("result");
String result = resultObj.getResultText();
%>

Expand Down
5 changes: 2 additions & 3 deletions webapp/src/main/webapp/jenaIngest/permanentURI.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ URIs exactly of the form created through the GUI interface.</p>
<input type="hidden" name="action" value="permanentURI" />
<p>Current namespace of resources
<select name=oldNamespace>
<%
List namespaces = (List)request.getAttribute("namespaceList");
<%List namespaces = (List)request.getAttribute("namespaceList");
if(namespaces != null) {
Iterator namespaceItr = namespaces.iterator();
Integer count = 0;
while (namespaceItr.hasNext()){
String namespaceText = (String) namespaceItr.next();
%>
%>
<option value="<%=namespaceText%>"><%=namespaceText%></option>
<% }
}%>
Expand Down
9 changes: 4 additions & 5 deletions webapp/src/main/webapp/jenaIngest/renameBNodesURISelect.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ function disableProperties(){
<input type="radio" value="pattern" name="concatenate" onclick="selectProperties()">Use pattern based on values of </input>


<%
Map<String,LinkedList<String>> propertyMap = (Map) request.getAttribute("propertyMap");
Set<Entry<String,LinkedList<String>>> set = propertyMap.entrySet();
Iterator<Entry<String,LinkedList<String>>> itr = set.iterator();
Entry<String, LinkedList<String>> entry = null;
<% Map<String,LinkedList<String>> propertyMap = (Map) request.getAttribute("propertyMap");
Set<Entry<String,LinkedList<String>>> set = propertyMap.entrySet();
Iterator<Entry<String,LinkedList<String>>> itr = set.iterator();
Entry<String, LinkedList<String>> entry = null;
%>
<%if(itr.hasNext()){%>
<select name="property" id="properties" disabled="disabled">
Expand Down
4 changes: 1 addition & 3 deletions webapp/src/main/webapp/jenaIngest/renameResult.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@

<h2><a class="ingestMenu" href="ingest">Ingest Menu</a> > Rename Resource</h2>

<%
String result = (String) request.getAttribute("result");
%>
<%String result = (String) request.getAttribute("result");%>
<p><b><%=result%></b></p>
52 changes: 25 additions & 27 deletions webapp/src/main/webapp/jenaIngest/sparqlConstruct.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@
<h3>SPARQL Query <select name="savedQuery">
<option value="">select saved query</option>
<%
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
jenaOntModel.enterCriticalSection(Lock.READ);
try {
List savedQueries = (List) request.getAttribute("savedQueries");
for (Iterator it = savedQueries.iterator(); it.hasNext();) {
Individual savedQuery = (Individual) it.next();
String queryURI = savedQuery.getURI();
String queryLabel = savedQuery.getLabel(null);
%>
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
jenaOntModel.enterCriticalSection(Lock.READ);
try {
List savedQueries = (List) request.getAttribute("savedQueries");
for (Iterator it = savedQueries.iterator(); it.hasNext();) {
Individual savedQuery = (Individual) it.next();
String queryURI = savedQuery.getURI();
String queryLabel = savedQuery.getLabel(null);
%>
<option value="<%=queryURI%>"><%=queryLabel%></option>
<%
}
} finally {
jenaOntModel.leaveCriticalSection();
}
%>
}
} finally {
jenaOntModel.leaveCriticalSection();
}
%>
</select>

<textarea rows="25" cols="40" name="sparqlQueryStr" class="maxWidth"><c:choose>
Expand All @@ -77,19 +77,17 @@ PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
PREFIX swrl: &lt;http://www.w3.org/2003/11/swrl#&gt;
PREFIX swrlb: &lt;http://www.w3.org/2003/11/swrlb#&gt;<%
List prefixes = (List)request.getAttribute("prefixList");
if(prefixes != null){
Iterator prefixItr = prefixes.iterator();
Integer count = 0;
while (prefixItr.hasNext()){
String prefixText = (String) prefixItr.next();
if(prefixText.equals("(not yet specified)")){
count++;
prefixText = "p." + count.toString();
}
String urlText = (String) prefixItr.next();
%>
PREFIX swrlb: &lt;http://www.w3.org/2003/11/swrlb#&gt;<%List prefixes = (List)request.getAttribute("prefixList");
if(prefixes != null){
Iterator prefixItr = prefixes.iterator();
Integer count = 0;
while (prefixItr.hasNext()){
String prefixText = (String) prefixItr.next();
if(prefixText.equals("(not yet specified)")){
count++;
prefixText = "p." + count.toString();
}
String urlText = (String) prefixItr.next();%>
PREFIX <%=prefixText%>: <<%=urlText%>><%}}%>


Expand Down
10 changes: 5 additions & 5 deletions webapp/src/main/webapp/jenaIngest/workflowStep.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
<select name="workflowStepURI">

<%
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
jenaOntModel.enterCriticalSection(Lock.READ);
try {
List workflowSteps = (List) request.getAttribute("workflowSteps");
for (Iterator it = workflowSteps.iterator(); it.hasNext();) {
Individual workflowStep = (Individual) it.next();
for (Iterator it = workflowSteps.iterator(); it.hasNext();) {
Individual workflowStep = (Individual) it.next();
String workflowStepURI = workflowStep.getURI();
String workflowStepLabel = workflowStep.getLabel(null);
String workflowStepString = (workflowStepLabel != null) ? workflowStepLabel : workflowStepURI;
%> <option value="<%=workflowStepURI%>"><%=workflowStepString%></option> <%
String workflowStepString = (workflowStepLabel != null) ? workflowStepLabel : workflowStepURI;
%> <option value="<%=workflowStepURI%>"><%=workflowStepString%></option> <%
}
} finally {
jenaOntModel.leaveCriticalSection();
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/main/webapp/jenaIngest/xmlFileUploadSuccess.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<vitro:confirmAuthorization />

<p>Uploaded XML files and converted to RDF.</p>
<p>Loaded <%=request.getAttribute("statementCount")%> statements to the model <%=request.getAttribute("targetModel")%>.</p>
<p>Loaded <%= request.getAttribute("statementCount") %> statements to the model <%= request.getAttribute("targetModel") %>.</p>

<h2><a class="ingestMenu" href="ingest">Ingest Menu</a></h2>
10 changes: 5 additions & 5 deletions webapp/src/main/webapp/jsp/checkDatatypeProperties.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<%@ page import="edu.cornell.mannlib.vedit.beans.ButtonForm" %>

<%
if (request.getAttribute("title") != null) {
%>
if (request.getAttribute("title") != null) { %>
<h2><%=request.getAttribute("title")%></h2><%
}
}
ArrayList<String> logResults = (ArrayList<String>)request.getAttribute("results");
ArrayList<String> logResults = (ArrayList<String>)request.getAttribute("results");
%>
%>

<div class="editingForm">
<table style="margin-bottom:1.5ex;">
Expand Down
4 changes: 1 addition & 3 deletions webapp/src/main/webapp/templates/alpha/alphaIndex.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
</c:if>
</c:forEach>

<%
if( request.getAttribute("alpha") != null && ! "all".equalsIgnoreCase((String)request.getAttribute("alpha"))) {
%>
<% if( request.getAttribute("alpha") != null && ! "all".equalsIgnoreCase((String)request.getAttribute("alpha"))) { %>
<a href='<c:url value=".${requestScope.servlet}?&amp;alpha=all&amp;${requestScope.controllerParam}"/>'>all </a>
<c:if test='${not empty requestScope.count }'>
(${requestScope.count} that start with ${requestScope.alpha })
Expand Down
Loading

0 comments on commit 8729b0b

Please sign in to comment.