NIHVIVO-1871 Fix addPublicationToPerson form so at least we don't get to a broken form in repair mode. Redirecting to authorship page, which is a low-cost though not ideal solution.

This commit is contained in:
rjy7 2011-01-25 23:05:22 +00:00
parent 94160c55eb
commit 06a97d36b1

View file

@ -63,7 +63,7 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers
Individual subject = (Individual) request.getAttribute("subject");
Individual obj = (Individual) request.getAttribute("object");
//check to see if this is an edit of existing, if yes redirect to pub
// Check to see if this is an edit of existing, if yes redirect to pub
if( obj != null ){
List<ObjectPropertyStatement> stmts = obj.getObjectPropertyStatements( nodeToPubProp );
if( stmts != null && stmts.size() > 0 ){
@ -78,6 +78,20 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers
}
}
}
/* This form is not prepared to deal with editing an existing relationship, so redirect
* to authorship page if no publication was found. This is not ideal, because you can't add
* a linked information resource from that page, but you can at least continue to the back end.
* May want to modify form in a future version to support repair mode.
*/
if (obj != null) {
String objectUri = obj.getURI();
%>
<jsp:forward page="/individual">
<jsp:param value="<%= objectUri %>" name="uri"/>
</jsp:forward>
<%
}
%>
<c:set var="vivoOnt" value="http://vivoweb.org/ontology" />