NIHVIVO-144 Add edit/delete links to primary and additional links on front end individual page. (These links generate errors when clicked, though.)
This commit is contained in:
parent
7f3ba68290
commit
53ac7a2587
5 changed files with 140 additions and 141 deletions
|
@ -22,7 +22,13 @@
|
|||
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.defaultLinkForm.jsp");
|
||||
%>
|
||||
<%
|
||||
String predicateUri = (String)request.getAttribute("predicateUri");
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
||||
vreq.setAttribute("defaultNamespace", wdf.getDefaultNamespace());
|
||||
|
||||
String propertyUri = (String) request.getAttribute("predicateUri");
|
||||
String objectUri = (String) request.getAttribute("objectUri");
|
||||
|
||||
%>
|
||||
|
||||
<c:set var="vitroUri" value="<%= VitroVocabulary.vitroURI %>" />
|
||||
|
@ -39,16 +45,14 @@
|
|||
Each of these must then be referenced in the sparqlForExistingLiterals section of the JSON block below
|
||||
and in the literalsOnForm --%>
|
||||
<v:jsonset var="urlExisting" >
|
||||
PREFIX vitro: <${vitroUri}> .
|
||||
SELECT ?urlExisting
|
||||
WHERE { ?link vitro:linkURL ?urlExisting }
|
||||
WHERE { ?subject ?predicate ?urlExisting }
|
||||
</v:jsonset>
|
||||
<%-- Pair the "existing" query with the skeleton of what will be asserted for a new statement involving this field.
|
||||
The actual assertion inserted in the model will be created via string substitution into the ? variables.
|
||||
NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%>
|
||||
<v:jsonset var="urlAssertion" >
|
||||
@prefix vitro: <${vitroUri}> .
|
||||
?link vitro:linkURL ?url .
|
||||
?subject ?predicate ?url .
|
||||
</v:jsonset>
|
||||
|
||||
<v:jsonset var="anchorExisting" >
|
||||
|
@ -68,7 +72,7 @@
|
|||
@prefix rdf: <${rdfUri}> .
|
||||
@prefix vitro: <${vitroUri}> .
|
||||
|
||||
?subject <${predicateUri}> ?link .
|
||||
?subject ?predicate ?link .
|
||||
|
||||
?link rdf:type vitro:Link .
|
||||
|
||||
|
@ -96,7 +100,7 @@
|
|||
|
||||
"n3required" : [ "${n3ForEdit}" ],
|
||||
"n3optional" : [ "${n3Optional}" ],
|
||||
"newResources" : { "link" : "http://vivo.library.cornell.edu/ns/0.1#individual" },
|
||||
"newResources" : { "link" : "${defaultNamespace}" },
|
||||
"urisInScope" : { },
|
||||
"literalsInScope" : { },
|
||||
"urisOnForm" : [ ],
|
||||
|
@ -144,8 +148,7 @@
|
|||
EditConfiguration.putConfigInSession(editConfig, session);
|
||||
}
|
||||
|
||||
Model model = (Model)application.getAttribute("jenaOntModel");
|
||||
String objectUri = (String)request.getAttribute("objectUri");
|
||||
Model model = (Model)application.getAttribute("jenaOntModel");
|
||||
if( objectUri != null ){
|
||||
editConfig.prepareForObjPropUpdate(model);
|
||||
}else{
|
||||
|
@ -157,7 +160,7 @@
|
|||
|
||||
String submitLabel="";
|
||||
String title="";
|
||||
String linkType = predicateUri.equals(VitroVocabulary.PRIMARY_LINK) ? "primary" : "additional";
|
||||
String linkType = propertyUri.equals(VitroVocabulary.PRIMARY_LINK) ? "primary" : "additional";
|
||||
if (objectUri != null) {
|
||||
title = "Edit <em>" + linkType + " link</em> for " + subject.getName();
|
||||
submitLabel = "Save changes";
|
||||
|
@ -173,7 +176,7 @@
|
|||
<h2><%= title %></h2>
|
||||
<form action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
||||
<v:input type="text" label="URL" id="url" size="70"/>
|
||||
<v:input type="text" label="Link anchor text" id="anchor" size="60"/>
|
||||
<v:input type="text" label="Link anchor text" id="anchor" size="70"/>
|
||||
<p class="submit"><v:input type="submit" id="submit" value="<%=submitLabel%>" cancel="${param.subjectUri}"/></p>
|
||||
</form>
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityBasic.jsp");
|
||||
%>
|
||||
<%
|
||||
log.debug("Starting entityBasic.jsp");
|
||||
Individual entity = (Individual)request.getAttribute("entity");
|
||||
log.debug("Starting entityBasic.jsp");
|
||||
Individual entity = (Individual)request.getAttribute("entity");
|
||||
%>
|
||||
|
||||
<c:set var="labelUri" value="http://www.w3.org/2000/01/rdf-schema#label" />
|
||||
|
@ -86,13 +86,6 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
|
|||
<c:set var='portal' value='${currentPortalId}'/>
|
||||
<c:set var='portalBean' value='${currentPortal}'/>
|
||||
|
||||
<%-- Using VitroVocabulary constants instead.
|
||||
RY Description not working - FIX
|
||||
<c:set var="labelUri" value="http://www.w3.org/2000/01/rdf-schema#label" />
|
||||
<c:set var="typeUri" value="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" />
|
||||
<c:set var="vitroUri" value="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" />
|
||||
--%>
|
||||
|
||||
<c:set var='themeDir'><c:out value='${portalBean.themeDir}' /></c:set>
|
||||
|
||||
<div id="content">
|
||||
|
@ -150,7 +143,7 @@ RY Description not working - FIX
|
|||
|
||||
<%-- Links --%>
|
||||
<c:if test="${ showEdits || !empty entity.url || !empty entity.linksList }">
|
||||
<div id="dprop-vitro-urls" class="propsItem ${editingClass}">
|
||||
<div id="dprop-vitro-links" class="propsItem ${editingClass}">
|
||||
<c:if test="${showEdits}">
|
||||
<h3 class="propertyName">links</h3>
|
||||
<c:choose>
|
||||
|
@ -163,42 +156,49 @@ RY Description not working - FIX
|
|||
</c:choose>
|
||||
<edLnk:editLinks item="${addUrlPredicate}" icons="false" />
|
||||
</c:if>
|
||||
<div class="datatypeProperties">
|
||||
<div class="datatypePropertyValue">
|
||||
<div class="statementWrap">
|
||||
<ul class="externalLinks">
|
||||
<c:if test="${!empty entity.anchor}">
|
||||
<c:choose>
|
||||
<c:when test="${!empty entity.url}">
|
||||
<c:url var="entityUrl" value="${entity.url}" />
|
||||
<li class="primary"><a class="externalLink" href="<c:out value="${entityUrl}"/>"><p:process>${entity.anchor}</p:process></a></li>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<li class="primary"><span class="externalLink"><p:process>${entity.anchor}</p:process></span></li>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<%--
|
||||
<c:if test="${showEdits}">
|
||||
<c:set var="editLinks"><edLnk:editLinks item="<%= VitroVocabulary.LINK_ANCHOR %>" data="${entity.anchor}" icons="false"/></c:set>
|
||||
<c:if test="${!empty editLinks}"><span class="editLinks">${editLinks}</span></c:if>
|
||||
</c:if>
|
||||
--%>
|
||||
</c:if>
|
||||
<c:if test="${!empty entity.linksList }">
|
||||
<c:forEach items="${entity.linksList}" var='link' varStatus="count">
|
||||
<c:url var="linkUrl" value="${link.url}" />
|
||||
<c:choose>
|
||||
<c:when test="${empty entity.url && count.first==true}"><li class="first"></c:when>
|
||||
<c:otherwise><li></c:otherwise>
|
||||
</c:choose>
|
||||
<a class="externalLink" href="<c:out value="${linkUrl}"/>"><p:process>${link.anchor}</p:process></a></li>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="externalLinks properties">
|
||||
<%-- Primary link --%>
|
||||
<c:if test="${!empty entity.anchor}">
|
||||
<c:choose>
|
||||
<c:when test="${!empty entity.url}">
|
||||
<c:url var="entityUrl" value="${entity.url}" />
|
||||
<li class="primary">
|
||||
<span class="statementWrap">
|
||||
<a class="externalLink" href="<c:out value="${entityUrl}"/>"><p:process>${entity.anchor}</p:process></a>
|
||||
<c:if test="${showEdits}">
|
||||
<c:set var="editLinks"><edLnk:editLinks item="<%= VitroVocabulary.PRIMARY_LINK %>" data="${entity.url}" icons="false"/></c:set>
|
||||
<c:if test="${!empty editLinks}"><span class="editLinks">${editLinks}</span></c:if>
|
||||
</c:if>
|
||||
</span>
|
||||
</li>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<%-- RY For now, not providing editing links for anchor text with no url. Should fix. --%>
|
||||
<li class="primary"><span class="externalLink"><p:process>${entity.anchor}</p:process></span></li>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:if>
|
||||
|
||||
<%-- Additional links --%>
|
||||
<c:if test="${!empty entity.linksList }">
|
||||
<c:forEach items="${entity.linksList}" var='link' varStatus="count">
|
||||
<c:url var="linkUrl" value="${link.url}" />
|
||||
<c:choose>
|
||||
<c:when test="${empty entity.url && count.first==true}"><li class="first"></c:when>
|
||||
<c:otherwise><li></c:otherwise>
|
||||
</c:choose>
|
||||
<span class="statementWrap">
|
||||
<a class="externalLink" href="<c:out value="${linkUrl}"/>"><p:process>${link.anchor}</p:process></a>
|
||||
<c:if test="${showEdits}">
|
||||
<c:set var="editLinks"><edLnk:editLinks item="<%= VitroVocabulary.ADDITIONAL_LINK %>" data="${linkUrl}" icons="false"/></c:set>
|
||||
<c:if test="${!empty editLinks}"><span class="editLinks">${editLinks}</span></c:if>
|
||||
</c:if>
|
||||
</span>
|
||||
</li>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div> <!-- end dprop-vitro-links -->
|
||||
</c:if>
|
||||
|
||||
<%-- Thumbnail (with citation) --%>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue