Adding ability for user accounts to be associated with individuals. NIHVIVO-121
This commit is contained in:
parent
5eb474a891
commit
1af92dc350
4 changed files with 91 additions and 20 deletions
|
@ -104,15 +104,17 @@
|
|||
<listener-class> edu.cornell.mannlib.vitro.webapp.search.lucene.LuceneSetup </listener-class>
|
||||
</listener>
|
||||
|
||||
<!--
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
edu.cornell.mannlib.vitro.webapp.auth.policy.setup.SelfEditingPolicySetup
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>
|
||||
edu.cornell.mannlib.vitro.webapp.auth.identifier.UserToIndIdentifierFactorySetup
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<listener>
|
||||
<listener-class> edu.cornell.mannlib.vitro.webapp.auth.policy.setup.EditorEditingPolicySetup
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.auth.identifier;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Setups context so that Identifiers for Individuals associated with Users are
|
||||
* added to requests.
|
||||
*
|
||||
* This only adds identifiers. A self-editing policy is also needed.
|
||||
*
|
||||
* @author bdc34
|
||||
*
|
||||
*/
|
||||
public class UserToIndIdentifierFactorySetup implements ServletContextListener{
|
||||
private static final Log log = LogFactory.getLog(UserToIndIdentifierFactorySetup.class.getName());
|
||||
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
ServletContext sc = sce.getServletContext();
|
||||
ServletIdentifierBundleFactory
|
||||
.addIdentifierBundleFactory(sc, new UserToIndIdentifierFactory());
|
||||
log.info("Set up Identifier Factory UserToIndIdentifierFactory.");
|
||||
}
|
||||
|
||||
public void contextDestroyed(ServletContextEvent arg0) {
|
||||
}
|
||||
}
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* the post parameters seem to get consumed by the parsing so
|
||||
* we have to make a copy. */
|
||||
Map <String,List<String>> queryParameters = null;
|
||||
Map <String,String[]> queryParameters = null;
|
||||
queryParameters = request.getParameterMap();
|
||||
|
||||
List<String> errorMessages = new ArrayList<String>();
|
||||
|
@ -205,10 +205,12 @@
|
|||
}
|
||||
|
||||
OntModel queryModel = editConfig.getQueryModelSelector().getModel(request,application);
|
||||
Model emptyModel = ModelFactory.createDefaultModel();
|
||||
|
||||
if( editConfig.isUseDependentResourceDelete() ){
|
||||
Model depResRetractions =
|
||||
DependentResourceDeleteJena
|
||||
.getDependentResourceDeleteForChange(null,allPossibleToDelete,queryModel);
|
||||
.getDependentResourceDeleteForChange(emptyModel,allPossibleToDelete,queryModel);
|
||||
allPossibleToDelete.add( depResRetractions );
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:edLnk="http://vitro.mannlib.cornell.edu/vitro/tags/PropertyEditLink" version="2.0">
|
||||
|
||||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
|
||||
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary"/>
|
||||
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.beans.User"/>
|
||||
|
||||
<div class="editingForm">
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
|||
|
||||
<div align="center">
|
||||
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
|
||||
<tr valign="bottom" align="center">
|
||||
<td>
|
||||
<tr align="center">
|
||||
<td valign="bottom">
|
||||
<form action="listUsers" method="get">
|
||||
<input type="hidden" name="home" value="${portalBean.portalId}" />
|
||||
<input type="submit" class="form-button" value="See All User Accounts"/>
|
||||
|
@ -42,8 +42,44 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<c:if test="true"> <!-- test="${requestScope.user.roleURI == 1 }"> -->
|
||||
|
||||
<table class="form-background" border="0" cellpadding="2" cellspacing="2">
|
||||
<tr align="center">
|
||||
<td>
|
||||
Add new individual that user may edit as
|
||||
<c:url var="addUrl" value="/edit/editRequestDispatch.jsp">
|
||||
<c:param name="subjectUri">${user.URI}</c:param>
|
||||
<c:param name="editform">admin/mayEditAs.jsp</c:param>
|
||||
</c:url>
|
||||
<a href="${addUrl}">add</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<c:if test="${requestScope.mayEditAsStmts != null }">
|
||||
<tr><td>User may edit as the following Individuals:</td></tr>
|
||||
<c:forEach items="${requestScope.mayEditAsStmts }" var="stmt">
|
||||
<tr>
|
||||
<td>${stmt.objectURI}</td>
|
||||
<c:url var="deleteUrl" value="/edit/editRequestDispatch.jsp">
|
||||
<c:param name="subjectUri">${user.URI}</c:param>
|
||||
<c:param name="predicateUri">${requestScope.predicateUri}</c:param>
|
||||
<c:param name="objectUri">${stmt.objectURI}</c:param>
|
||||
<c:param name="editform">admin/mayEditAs.jsp</c:param>
|
||||
</c:url>
|
||||
<td><a href="${deleteUrl}">delete</a></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${requestScope.mayEditAsStmts == null }">
|
||||
<tr><td>There are no Individuals in the system that the user may edit as.</td></tr>
|
||||
</c:if>
|
||||
|
||||
</table>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</jsp:root>
|
||||
|
|
Loading…
Add table
Reference in a new issue