NIHVIVO-736 Modify JSPs to use the <vitro:confirmLoginStatus> custom JSP tag.
This commit is contained in:
parent
0bd050a78b
commit
66559f58ab
16 changed files with 68 additions and 110 deletions
|
@ -8,7 +8,6 @@
|
|||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||
|
@ -16,11 +15,15 @@
|
|||
<%@ page import="java.util.HashMap" %>
|
||||
<%@ page import="org.apache.commons.logging.Log" %>
|
||||
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%
|
||||
//org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
||||
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editDatapropStmtRequestDispatch.jsp");
|
||||
%>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
// Decide which form to forward to, set subjectUri, subjectUriJson, predicateUri, predicateUriJson in request
|
||||
// Also get the Individual for the subjectUri and put it in the request scope
|
||||
|
@ -39,10 +42,6 @@
|
|||
final String DEFAULT_VITRO_NS_FORM = "defaultVitroNsDataPropForm.jsp";
|
||||
final String DEFAULT_ERROR_FORM = "error.jsp";
|
||||
|
||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {
|
||||
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
||||
}
|
||||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
if( EditConfiguration.getEditKey( vreq ) == null ){
|
||||
vreq.setAttribute("editKey",EditConfiguration.newEditKey(session));
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %>
|
||||
<%@ page import="java.util.HashMap" %>
|
||||
|
@ -15,10 +14,14 @@
|
|||
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
||||
<%@ page errorPage="/error.jsp" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%!
|
||||
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.editRequestDispatch.jsp");
|
||||
%>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
/*
|
||||
Decide which form to forward to, set subjectUri, subjectUriJson, predicateUri, and predicateUriJson in request.
|
||||
|
@ -40,11 +43,6 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
|||
final String DEFAULT_ERROR_FORM = "error.jsp";
|
||||
final String DEFAULT_ADD_INDIVIDUAL = "defaultAddMissingIndividualForm.jsp";
|
||||
|
||||
if (!VitroRequestPrep.isSelfEditing(request)
|
||||
&& !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {
|
||||
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
||||
}
|
||||
|
||||
String editKey = (EditConfiguration.getEditKey(request) == null)
|
||||
? EditConfiguration.newEditKey(session)
|
||||
: EditConfiguration.getEditKey(request);
|
||||
|
|
|
@ -5,32 +5,30 @@
|
|||
<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %>
|
||||
<%@ page import="com.hp.hpl.jena.rdf.model.Property" %>
|
||||
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StandardModelSelector"%>
|
||||
<%@ page import="com.hp.hpl.jena.shared.Lock"%>
|
||||
<%@ page import="com.hp.hpl.jena.ontology.OntModel"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent"%>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jstl/functions" %>
|
||||
<%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("edu.cornell.mannlib.vitro.jsp.edit.forms.datapropStmtDelete");
|
||||
|
||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {%>
|
||||
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StandardModelSelector"%>
|
||||
<%@page import="com.hp.hpl.jena.shared.Lock"%>
|
||||
<%@page import="com.hp.hpl.jena.ontology.OntModel"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent"%><c:redirect url="<%= Controllers.LOGIN %>" />
|
||||
<% }
|
||||
|
||||
String subjectUri = request.getParameter("subjectUri");
|
||||
String predicateUri = request.getParameter("predicateUri");
|
||||
String datapropKeyStr = request.getParameter("datapropKey");
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.RoleIdentifier"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty"%>
|
||||
|
@ -31,6 +30,9 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jstl/functions" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%!
|
||||
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.propDelete.jsp");
|
||||
|
@ -48,12 +50,6 @@ public WebappDaoFactory getUnfilteredDaoFactory() {
|
|||
</c:url>
|
||||
|
||||
<%
|
||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||
if (!selfEditing && !isLoggedIn) {%>
|
||||
<c:redirect url="<%= Controllers.LOGIN %>" />
|
||||
<% }
|
||||
|
||||
String subjectUri = request.getParameter("subjectUri");
|
||||
String predicateUri = request.getParameter("predicateUri");
|
||||
String objectUri = request.getParameter("objectUri");
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||
|
@ -25,6 +24,7 @@
|
|||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%--
|
||||
Current stop gap solution for back button problems
|
||||
|
@ -41,11 +41,10 @@ and set a flag in the request to indicate "back button confusion"
|
|||
<%
|
||||
log.debug("Starting datapropertyBackButtonProblems.jsp");
|
||||
%>
|
||||
<%
|
||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.CURATOR)) {
|
||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||
}
|
||||
|
||||
<vitro:confirmLoginStatus level="CURATOR" allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
List<String> errorMessages = new ArrayList<String>();
|
||||
Object sessionOntModel = request.getSession().getAttribute("jenaOntModel");
|
||||
OntModel jenaOntModel = (sessionOntModel != null && sessionOntModel instanceof OntModel) ? (OntModel)sessionOntModel:
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
||||
|
@ -39,6 +38,7 @@
|
|||
<%@page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.DependentResourceDeleteJena"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%-- N3 based deletion.
|
||||
|
||||
|
@ -48,13 +48,10 @@
|
|||
build the assertions graph and remove that from the system model.
|
||||
|
||||
--%>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||
if (!selfEditing && !isLoggedIn) {
|
||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||
}
|
||||
|
||||
/* the post parameters seem to get consumed by the parsing so
|
||||
* we have to make a copy. */
|
||||
Map <String,String[]> queryParameters = null;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||
|
@ -31,6 +30,7 @@
|
|||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.event.EditEvent"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%-- 2nd prototype of processing, adapted for data property editing
|
||||
|
||||
|
@ -65,15 +65,12 @@ and set a flag in the request to indicate "back button confusion"
|
|||
|
||||
final Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.processDatapropRdfForm.jsp");
|
||||
%>
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
log.debug("Starting processDatapropRdfForm.jsp");
|
||||
|
||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||
if (!selfEditing && !isLoggedIn) {
|
||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||
}
|
||||
|
||||
List<String> errorMessages = new ArrayList<String>();
|
||||
|
||||
//Object sessionOntModel = request.getSession().getAttribute("jenaOntModel");
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
||||
|
@ -42,8 +41,14 @@
|
|||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.ModelChangePreprocessor"%>
|
||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||
<%@ page import="java.net.URLDecoder" %>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.DependentResourceDeleteJena"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.Individual"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.InsertException"%>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="vitro" uri="/WEB-INF/tlds/VitroUtils.tld" %>
|
||||
|
||||
<%-- 2nd prototype of processing.
|
||||
|
||||
|
@ -53,20 +58,10 @@ be processed as n3 by Jena then it is an error in processing the form.
|
|||
The optional n3 blocks will proccessed if their variables are bound and
|
||||
are well formed.
|
||||
--%>
|
||||
<%
|
||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||
if (!selfEditing && !isLoggedIn) {
|
||||
%>
|
||||
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.DependentResourceDeleteJena"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.Individual"%>
|
||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.InsertException"%><c:redirect url="<%= Controllers.LOGIN %>" />
|
||||
|
||||
<vitro:confirmLoginStatus allowSelfEditing="true" />
|
||||
|
||||
<%
|
||||
}
|
||||
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue