NIHVIVO-1869 Remove old custom short view jsps and enclosing directory. Removed remnants of old start and end year properties from add role form.

This commit is contained in:
rjy7 2011-01-26 17:10:24 +00:00
parent 247026988e
commit 3ed8ed456f
18 changed files with 0 additions and 797 deletions

View file

@ -151,31 +151,6 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
<c:set var="labelRequired" ><%= (mode == EditMode.ADD || mode == EditMode.REPAIR) ?"\"nonempty\"," : "" %></c:set>
<c:set var="typeRequired" ><%= (mode == EditMode.ADD || mode == EditMode.REPAIR) ?"\"nonempty\"" : "" %></c:set>
<%--
<c:choose>
<c:when test="${numDateFields == 1}">
<c:set var="startYearPredicate" value="${vivoCore}year" />
</c:when>
<c:otherwise>
<c:set var="startYearPredicate" value="${vivoCore}startYear" />
</c:otherwise>
</c:choose>
--%>
<c:set var="startYearPredicate">
<c:choose>
<c:when test="${numDateFields == 1}">${vivoCore}year</c:when>
<c:otherwise>${vivoCore}startYear</c:otherwise>
</c:choose>
</c:set>
<v:jsonset var="startYearAssertion" >
?role <${startYearPredicate}> ?startYear .
</v:jsonset>
<c:set var="endYearPredicate" value="${vivoCore}endYear" />
<v:jsonset var="endYearAssertion" >
?role <${endYearPredicate}> ?endYear .
</v:jsonset>
<v:jsonset var="roleLabelAssertion" >
?role <${label}> ?roleLabel .
</v:jsonset>
@ -233,14 +208,6 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
?existingActivity rdfs:label ?existingTitle . }
</v:jsonset>
<v:jsonset var="startYearQuery">
SELECT ?existingStartYear WHERE { ?role <${startYearPredicate}> ?existingStartYear .}
</v:jsonset>
<v:jsonset var="endYearQuery">
SELECT ?existingStartYear WHERE { ?role <${endYearPredicate}> ?existingStartYear .}
</v:jsonset>
<v:jsonset var="activityQuery">
PREFIX core: <${vivoCore}>
SELECT ?existingActivity WHERE { ?role core:roleIn ?existingActivity . }

View file

@ -1,78 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:choose>
<c:when test="${!empty individual}"><%-- individual is the OBJECT of the property referenced -- the Authorship individual, not the Person or Publication --%>
<c:choose>
<c:when test="${!empty predicateUri}">
<c:choose>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#authorInAuthorship'}"><%-- SUBJECT is a Person, so get info from Authorship about related Publication --%>
<c:choose>
<c:when test="${!empty individual.objectPropertyMap['http://vivoweb.org/ontology/core#linkedInformationResource']}"><%-- this Authorship is linked to an InformationResource --%>
<c:set var="infoResource" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#linkedInformationResource'].objectPropertyStatements[0].object}" />
<c:set var="name" value="${infoResource.name}"/>
<c:set var="label" value="${infoResource.VClass.name}"/>
<c:set var="uri" value="${infoResource.URI}"/>
<c:set var="year" value="${infoResource.dataPropertyMap['http://vivoweb.org/ontology/core#year'].dataPropertyStatements[0].data}" />
</c:when>
<c:otherwise><%-- this Position is not linked to a Publication yet; use Authorship name as a placeholder and add link to the Authorship so user can add more information --%>
<c:choose>
<c:when test="${!empty individual.name}">
<c:set var="name" value="${individual.name}"/>
</c:when>
<c:otherwise>
<c:set var="name" value="unlabeled authorship"/>
</c:otherwise>
</c:choose>
<c:set var="label" value="(no publication linked yet)"/>
<c:set var="uri" value="${individual.URI}"/>
</c:otherwise>
</c:choose>
</c:when>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#informationResourceInAuthorship'}"><%-- SUBJECT is a Publication, so get info from Authorship about the related Person --%>
<c:choose>
<c:when test="${!empty individual.objectPropertyMap['http://vivoweb.org/ontology/core#linkedAuthor']}"><%-- there is a related Person --%>
<c:set var="author" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#linkedAuthor'].objectPropertyStatements[0].object}" />
<c:set var="name" value="${author.name}"/>
<c:set var="label" value="${author.dataPropertyMap['http://vivoweb.org/ontology/core#preferredTitle'].dataPropertyStatements[0].data}" />
<c:set var="uri" value="${author.URI}"/>
</c:when>
<c:when test="${!empty individual.dataPropertyMap['http://vivoweb.org/ontology/core#authorNameAsListed'].dataPropertyStatements[0].data}"><%-- only an author name has been specified --%>
<c:set var="name" value="<strong>${individual.dataPropertyMap['http://vivoweb.org/ontology/core#authorNameAsListed'].dataPropertyStatements[0].data}</strong>"/>
</c:when>
<c:otherwise><%-- no related Person yet (likely from before custom form available) --%>
<c:choose>
<c:when test="${!empty individual.name}"><c:set var="name" value="${individual.name}"/></c:when>
<c:otherwise><c:set var="name" value="unlabeled authorship"/></c:otherwise>
</c:choose>
<c:set var="label" value="(no author linked yet)"/>
<c:set var="uri" value="${individual.URI}"/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:set var="name" value="unknown predicate"/>
<c:set var="label" value="please contact your VIVO support team"/>
<c:set var="uri" value="${predicateUri}"/>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty uri}">
<c:url var="olink" value="/entity"><c:param name="uri" value="${uri}"/></c:url>
<a href="<c:out value="${olink}"/>">${name}</a> ${label}&nbsp;${year}
</c:when>
<c:otherwise>
<strong>${name}</strong> ${label}&nbsp;${year}
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="No predicate available for custom rendering ..."/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="Got nothing to draw here ..."/>
</c:otherwise>
</c:choose>

View file

@ -1,7 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasClinicalRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#clinicalRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
</jsp:include>

View file

@ -1,129 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.StringUtils" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%--
This is a custom short view render for educational background.
The variable individual is the OBJECT of the property statement to be rendered. --
In this JSP that is the Educational Training object, not the Person, Organization or DegreeType
--%>
<c:choose>
<c:when test="${!empty individual}">
<c:choose>
<%-- SUBJECT is a Person --%>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#educationalTraining'}">
<%-- Degree type and major --%>
<c:set var="degreeLabel" value="" />
<c:set var="degreeType" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#degreeEarned'].objectPropertyStatements[0].object}"/>
<c:if test="${ !empty degreeType }">
<c:set var="degreeAbbr" value="${degreeType.dataPropertyMap['http://vivoweb.org/ontology/core#abbreviation'].dataPropertyStatements[0].data}"/>
<c:set var="degreeLabel" value="${!empty degreeAbbr ? degreeAbbr : degreeType.name }" />
</c:if>
<%-- RY 12/10/10 majorField is no longer required, so make sure we display something reasonable if there is no major field. --%>
<c:set var="degreeMajor" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#majorField'].dataPropertyStatements[0].data}"/>
<c:choose>
<c:when test="${ !empty degreeLabel && !empty degreeMajor }">
<c:set var="degreeStr" value="${degreeLabel} in ${degreeMajor}" />
</c:when>
<c:when test="${ !empty degreeLabel}">
<c:set var="degreeStr" value="${degreeLabel}" />
</c:when>
<c:when test="${ !empty degreeMajor }">
<c:set var="degreeStr" value="${degreeMajor}" />
</c:when>
<c:otherwise>
<c:set var="degreeStr" value="" />
</c:otherwise>
</c:choose>
<%-- Organization granting degree --%>
<c:set var="selectedOrganization" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#trainingAtOrganization'].objectPropertyStatements[0].object}"/>
<c:if test="${ ! empty selectedOrganization }">
<c:url var="selectedOrganizationURL" value="/individual">
<c:param name="uri" value="${selectedOrganization.URI}"/>
</c:url>
<c:set var="selectedOrganizationStr" ><a href='${selectedOrganizationURL}'><p:process>${selectedOrganization.name}</p:process></a></c:set>
</c:if>
<%-- Optional department/school to organization --%>
<c:set var="degreeDeptOrSchool" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#departmentOrSchool'].dataPropertyStatements[0].data}"/>
<c:if test="${ ! empty degreeDeptOrSchool }">
</c:if>
<%-- Year of degree --%>
<c:set var="year" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#year'].dataPropertyStatements[0].data}"/>
<%-- Supplemental information --%>
<c:set var="degreeSupplementalInfo" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#supplementalInformation'].dataPropertyStatements[0].data}"/>
<%-- Build the output string --%>
<c:choose>
<c:when test="${empty degreeStr && empty selectedOrganizationStr && empty degreeDeptOrSchool}">
<a href="${objLink}"><p:process>educational background ${individual.name}</p:process></a>
</c:when>
<c:otherwise>
<%= StringUtils.join(", ", (String) pageContext.getAttribute("degreeStr"),
(String) pageContext.getAttribute("selectedOrganizationStr"),
(String) pageContext.getAttribute("degreeDeptOrSchool"),
(String) pageContext.getAttribute("year"),
(String) pageContext.getAttribute("degreeSupplementalInfo") ) %>
</c:otherwise>
</c:choose>
</c:when>
<%-- SUBJECT is a Degree Type --%>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#degreeOutcomeOf'}">
<c:set var="year" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#year'].dataPropertyStatements[0].data}"/>
<c:set var="degreeMajor" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#majorField'].dataPropertyStatements[0].data}"/>
<c:set var="selectedOrganization" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#organizationGrantingDegree'].objectPropertyStatements[0].object}"/>
<c:set var="selectedOrganizationName" value="${selectedOrganization.name}"/>
<c:set var="person" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#educationalTrainingOf'].objectPropertyStatements[0].object}"/>
<c:set var="personName" value="${person.name}"/>
<c:url var="personURL" value="/individual"><c:param name="uri" value="${person.URI}"/></c:url>
<c:set var="personLink" ><a href='${personURL}'>${personName}</a></c:set>
<c:url var="objLink" value="/individual"><c:param name="uri" value="${individual.URI}"/></c:url>
<c:choose>
<c:when test="${! empty personName && ! empty year && ! empty degreeMajor && ! empty selectedOrganizationName }">
${personLink} in ${degreeMajor}, ${selectedOrganizationName}, ${year}
</c:when>
<c:when test="${! empty personName && empty year && ! empty degreeMajor && ! empty selectedOrganizationName }">
${personLink} in ${degreeMajor}, ${selectedOrganizationName}
</c:when>
<c:when test="${! empty personName && empty year && ! empty degreeMajor && empty selectedOrganizationName }">
${personLink} in ${degreeMajor}
</c:when>
<c:when test="${! empty personName && ! empty year && empty degreeMajor && ! empty selectedOrganizationName }">
${personLink} ${selectedOrganizationName}, ${year}
</c:when>
<c:otherwise>
<a href="${objLink}">educational background ${individual.name}</a>
</c:otherwise>
</c:choose>
</c:when>
<%-- The predicate was not one of the predicted ones, so create a normal link --%>
<c:otherwise>
<c:url var="objLink" value="/individual"><c:param name="uri" value="${individual.URI}"/></c:url>
<a href="${objLink}">${individual.name}</a>
</c:otherwise>
</c:choose>
</c:when>
<%-- This clause is when there is no object individual defined, it should never be reached. --%>
<c:otherwise>
<c:out value="Nothing to draw in educationalTrainingShortView"/>
</c:otherwise>
</c:choose>

View file

@ -1,9 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#co-PrincipalInvestigatorRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="grant"/>
<jsp:param name="roleLabelForPerson" value="Co-Principal Investigator"/>
</jsp:include>

View file

@ -1,9 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#principalInvestigatorRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="grant"/>
<jsp:param name="roleLabelForPerson" value="Principal Investigator"/>
</jsp:include>

View file

@ -1,9 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasInvestigatorRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#investigatorRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="grant"/>
<jsp:param name="roleLabelForPerson" value="Investigator"/>
</jsp:include>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasLeaderRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#leaderRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="leadership role"/>
</jsp:include>

View file

@ -1,43 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%-- rjy7 NIHVIVO-1158 Under core:authorInAuthorship on a person's page, we are now displaying the object property statements
for the related property core:linkedInformationResource, so that we can collate by publication subclass. The subject is the
Authorship, and the object is the InformationResource, so the authorship short view defined on Authorships no longer applies.
We thus define an information resource short view to display the publications. --%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:choose>
<c:when test="${!empty individual}"><%-- individual is the OBJECT of the property referenced -- the InformationResource individual --%>
<c:choose>
<c:when test="${!empty predicateUri}">
<c:choose>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#authorInAuthorship'}">
<c:set var="name" value="${individual.name}"/>
<c:set var="uri" value="${individual.URI}"/>
<c:set var="year" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#year'].dataPropertyStatements[0].data}" />
</c:when>
<c:otherwise>
<c:set var="name" value="unknown predicate - please contact your VIVO support team"/>
<c:set var="uri" value="${predicateUri}"/>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty uri}">
<c:url var="olink" value="/entity"><c:param name="uri" value="${uri}"/></c:url>
<a href="<c:out value="${olink}"/>">${name}</a> ${year}
</c:when>
<c:otherwise>
<strong>${name}</strong> ${year}
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="No predicate available for custom rendering ..."/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="Got nothing to draw here ..."/>
</c:otherwise>
</c:choose>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasMemberRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#memberRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="member role"/>
</jsp:include>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasOutreachProviderRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#outreachProviderRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="outreach role"/>
</jsp:include>

View file

@ -1,140 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %>
<jsp:useBean id="now" class="org.joda.time.DateTime"/>
<c:choose>
<c:when test="${!empty individual}"><%-- individual is the OBJECT of the property referenced -- the Position, not the Person or Organization --%>
<c:set var="startYear" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#startYear'].dataPropertyStatements[0].data}"/>
<c:set var="endYear" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#endYear'].dataPropertyStatements[0].data}"/>
<c:choose>
<c:when test="${! empty startYear}">
<c:choose>
<c:when test="${! empty endYear}">
<c:set var="timeSpan" value=", ${startYear} - ${endYear}"/>
</c:when>
<c:otherwise>
<c:set var="timeSpan" value=", ${startYear} - "/>
</c:otherwise>
</c:choose>
</c:when>
<c:when test="${! empty endYear}">
<c:set var="timeSpan" value=", - ${endYear}" />
</c:when>
</c:choose>
<c:choose><%-- use working title in preference to HR title --%>
<c:when test="${!empty individual.dataPropertyMap['http://vivoweb.org/ontology/core#titleOrRole'].dataPropertyStatements[0].data}">
<c:set var="title" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#titleOrRole'].dataPropertyStatements[0].data}"/>
</c:when>
<c:when test="${!empty individual.dataPropertyMap['http://vivoweb.org/ontology/core#hrJobTitle'].dataPropertyStatements[0].data}">
<c:set var="title" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#hrJobTitle'].dataPropertyStatements[0].data}"/>
</c:when>
<c:otherwise>
<c:set var="title" value="${individual.name}"/>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty predicateUri}">
<c:choose>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#personInPosition'}"><%-- SUBJECT is a Person, so get info from Position about related Organization --%>
<c:choose>
<c:when test="${!empty individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionInOrganization']}"><%-- this Position is linked to an Organization --%>
<c:set var="objName" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionInOrganization'].objectPropertyStatements[0].object.name}"/>
<c:choose>
<c:when test="${!empty title}">
<c:set var="objLabel" value="${title}"/>
</c:when>
<c:otherwise>
<c:set var="objLabel" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionInOrganization'].objectPropertyStatements[0].object.moniker}"/>
</c:otherwise>
</c:choose>
<c:set var="objUri" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionInOrganization'].objectPropertyStatements[0].object.URI}"/>
</c:when>
<c:otherwise><%-- this Position is not linked to an Organization --%>
<c:choose>
<c:when test="${!empty individual.dataPropertyMap['http://vivoweb.org/ontology/core#involvedOrganizationName'].dataPropertyStatements[0].data}"><%-- an Organization name has been specified --%>
<c:set var="objName" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#involvedOrganizationName'].dataPropertyStatements[0].data}"/>
<c:set var="objLabel" value="${title}"/>
</c:when>
<c:otherwise><%-- not even an organization name, so just display the title in place of the name --%>
<c:set var="objName" value="${title}"/>
<c:set var="title" value=""/><%-- don't show title twice --%>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
<%-- Hack to control extra spaces...should be done differently though. --%>
<c:if test="${!empty objName && !empty objLabel}" >
<c:set var="objLabel" value=" ${objLabel}" />
</c:if>
<c:choose>
<c:when test="${!empty objUri}">
<c:url var="objLink" value="/entity"><c:param name="uri" value="${objUri}"/></c:url>
<a href="<c:out value="${objLink}"/>"><p:process>${objName}</p:process></a><p:process>${objLabel}${timeSpan}</p:process>
</c:when>
<c:otherwise>
<p:process><strong>${objName}</strong>${objLabel}${timeSpan}</p:process>
</c:otherwise>
</c:choose>
</c:when>
<c:when test="${predicateUri == 'http://vivoweb.org/ontology/core#organizationForPosition'}"><%-- SUBJECT is an Organization, so get info from Position about the related Person --%>
<c:choose>
<c:when test="${not empty endYear && now.year > endYear}" >
<%-- don't show because the position is not current --%>
</c:when>
<c:when test="${!empty individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionForPerson']}"><%-- there is a related Person --%>
<c:set var="objName" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionForPerson'].objectPropertyStatements[0].object.name}"/>
<c:choose>
<c:when test="${!empty title}">
<c:set var="objLabel" value="${title}"/>
</c:when>
<c:otherwise>
<c:set var="objLabel" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionForPerson'].objectPropertyStatements[0].object.moniker}"/>
</c:otherwise>
</c:choose>
<c:set var="objUri" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#positionForPerson'].objectPropertyStatements[0].object.URI}"/>
<c:choose>
<c:when test="${!empty objUri}">
<c:url var="objLink" value="/entity"><c:param name="uri" value="${objUri}"/></c:url>
<a href="<c:out value="${objLink}"/>"><p:process>${objName}</p:process></a> <p:process>${objLabel} ${timeSpan}</p:process>
</c:when>
<c:otherwise>
<p:process><strong>${objName}</strong> ${objLabel} ${timeSpan}</p:process>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise><%-- no related Person, which should not happen --%>
<c:set var="objName" value="${individual.name}"/>
<c:set var="objLabel" value="${title}"/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:set var="objName" value="unknown predicate"/>
<c:set var="objUri" value="${predicateUri}"/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="No predicate available for custom rendering ..."/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="Got nothing to draw here ..."/>
</c:otherwise>
</c:choose>

View file

@ -1,10 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasPresenterRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#presenterRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="presenter role"/>
<jsp:param name="startYearPredicate" value="http://vivoweb.org/ontology/core#year" />
</jsp:include>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasResearcherRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#researcherRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="researcher role"/>
</jsp:include>

View file

@ -1,138 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %>
<%--
This short view is intended to be called to handle short views for roles
The following vars should be set by the jsp that is calling this short view
personToRolePredicate: URI of the person to role predicate.
roleToPersonPredicate: URI of the role to person predicate.
roleActivityToRolePredicate: URI of the activity to role predicate.
roleActivityLabel: human readable label of activity used for error messages
Optional vars:
roleLabelForPerson: human readable label for person when viewing from non-person side of role. Most short views
don't specify this value because the role name is displayed instead. Grant-related short views specify
this value because there is no specific role name.
startYearPredicate: defaults to http://vivoweb.org/ontology/core#startYear if not specified
--%>
<c:set var="startYearPredicate">${! empty param.startYearPredicate ? param.startYearPredicate : 'http://vivoweb.org/ontology/core#startYear'}</c:set>
<c:set var="showDateRange">${ startYearPredicate == 'http://vivoweb.org/ontology/core#startYear' }</c:set>
<c:set var="errorMsg" value=""/>
<c:choose>
<c:when test="${!empty individual}"><%-- individual is the OBJECT of the property referenced -- the Role individual, not the Person or grant --%>
<c:choose>
<c:when test="${!empty predicateUri}">
<%-- get years off role --%>
<c:set var="startYear" value="${individual.dataPropertyMap[startYearPredicate].dataPropertyStatements[0].data}"/>
<c:if test="${! empty startYear}">
<c:set var="endYear" value="${individual.dataPropertyMap['http://vivoweb.org/ontology/core#endYear'].dataPropertyStatements[0].data}"/>
<c:if test="${startYear == endYear}">
<c:set var="showDateRange" value="false" />
</c:if>
<c:if test="${showDateRange}">
<c:set var="endYearVal" value = " -" />
<c:if test="${! empty endYear}">
<c:set var="endYearVal" value="${endYearVal} ${endYear}" />
</c:if>
</c:if>
</c:if>
<c:choose>
<%-- SUBJECT is a Person, so get info from other part of the role --%>
<c:when test="${predicateUri == param.personToRolePredicate}">
<c:choose>
<c:when test="${ ! empty individual.objectPropertyMap['http://vivoweb.org/ontology/core#roleIn'] }">
<c:set var="roleActivity" value="${individual.objectPropertyMap['http://vivoweb.org/ontology/core#roleIn'].objectPropertyStatements[0].object}" />
<c:set var="name" value="${roleActivity.name}"/>
<%-- On the person page, it's redundant to display the role label in this case, since the object property
label contains the same information. --%>
<c:set var="label" value=""/>
<c:if test="${ empty param.roleLabelForPerson }" >
<c:set var="label" value="${ ! empty individual.rdfsLabel ? individual.rdfsLabel : ''}" />
</c:if>
<c:set var="uri" value="${roleActivity.URI}"/>
</c:when>
<c:otherwise>
<%-- This Role is not linked to anything yet; use name as a placeholder and
add link to the Role so user can add more information. --%>
<c:set var="name" value="unknown"/>
<c:set var="errorMsg" value="&nbsp;(unidentified activity - please edit)"/>
<c:set var="label" value="${ ! empty individual.rdfsLabel ? individual.rdfsLabel : 'unlabeled role' }"/>
<c:set var="uri" value=""/>
</c:otherwise>
</c:choose>
</c:when>
<%-- SUBJECT is an activity of some sort, so get info from the Role about the related Person --%>
<c:when test="${predicateUri == param.roleActivityToRolePredicate}">
<c:choose>
<%-- there is a related Person --%>
<c:when test="${!empty individual.objectPropertyMap[ param.roleToPersonPredicate ]}">
<c:set var="person" value="${individual.objectPropertyMap[ param.roleToPersonPredicate ].objectPropertyStatements[0].object}" />
<c:set var="name" value="${person.name}"/>
<c:set var="label" value="${individual.rdfsLabel}"/>
<c:if test="${ empty individual.rdfsLabel }">
<c:set var="label" value="${ ! empty param.roleLabelForPerson ? param.roleLabelForPerson : '' }"/>
</c:if>
<c:set var="uri" value="${person.URI}"/>
</c:when>
<%-- this is a Role with out a Person (likely from before custom form available) --%>
<c:otherwise>
<c:choose>
<c:when test="${!empty individual.name}"><c:set var="name" value="${individual.name}"/></c:when>
<c:otherwise><c:set var="name" value="unlabeled ${param.roleActivityLabel} to person relation"/></c:otherwise>
</c:choose>
<c:set var="name" value="unknown person"/>
<c:set var="label" value="${ ! empty individual.rdfsLabel ? individual.rdfsLabel : 'unlabeled param.roleActivityLabel to person relation' }"/>
<c:set var="errorMsg" value="&nbsp;(unidentified person - please edit)"/>
<c:set var="uri" value=""/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:set var="name" value="unknown predicate"/>
<c:set var="label" value="please contact your VIVO support team"/>
<c:set var="uri" value="${predicateUri}"/>
</c:otherwise>
</c:choose>
<%-- only show error messages if logged in --%>
<c:if test="${ ! showSelfEdits}">
<c:set var="errorMsg" value=""/>
</c:if>
<%-- output the actual html --%>
<c:choose>
<c:when test="${!empty uri}">
<c:url var="olink" value="/entity"><c:param name="uri" value="${uri}"/></c:url>
<a href="<c:out value="${olink}"/>">${name}</a>&nbsp;${label}&nbsp;${startYear}${endYearVal} ${errorMsg}
</c:when>
<c:otherwise>
<p:process><strong>${name}</strong> ${label}</p:process> ${errorMsg}
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="No predicate available for custom rendering ..."/>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:out value="Got nothing to draw here ..."/>
</c:otherwise>
</c:choose>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasServiceProviderRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#serviceProviderRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="service to profession role"/>
</jsp:include>

View file

@ -1,144 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean"%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.flags.PortalFlagChoices" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page errorPage="/error.jsp"%>
<% /***********************************************
Displays the sparkline visualizations on individual profile pages
request.attributes:
an Entity object with the name "entity"
request.parameters:
None, should only work with requestScope attributes for security reasons.
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
for debugging info.
**********************************************/
Individual entity = (Individual)request.getAttribute("entity");
boolean displayVisualization = false;
if (entity == null){
String e = "sparklineVisuzalition.jsp expects that request attribute 'entity' be set to the Entity object to display.";
displayVisualization = false;
throw new JspException(e);
} else {
for (VClass currClass : entity.getVClasses()) {
if ("http://xmlns.com/foaf/0.1/Person".equalsIgnoreCase(currClass.getURI())) {
displayVisualization = true;
break;
}
}
}
//System.out.println("visualization is supposed to be displayed? > " + displayVisualization);
if (displayVisualization) {
%>
<c:set var='portalBean' value='${currentPortal}'/>
<c:set var="themeDir"><c:out value="${portalBean.themeDir}" /></c:set>
<c:url var="loadingImageLink" value="/${themeDir}site_icons/visualization/ajax-loader.gif"></c:url>
<!-- START Visualization Code -->
<c:url var="visualizationURL" value="/visualizationAjax">
<c:param name="container" value="vis_container"/>
<c:param name="vis" value="person_pub_count"/>
<c:param name="vis_mode" value="short"/>
<c:param name="uri" value="${entity.URI}"/>
</c:url>
<%-- PDF Visualization URL
For now we have disabled this.
<c:url var="pdfURL" value="/visualization">
<c:param name="render_mode" value="pdf"/>
<c:param name="container" value="vis_container"/>
<c:param name="vis" value="person_pub_count"/>
<c:param name="vis_mode" value="full"/>
<c:param name="uri" value="${entity.URI}"/>
</c:url>
--%>
<style type="text/css">
#vis_container {
cursor:pointer;
/*height:36px;
margin-left:24%;
margin-top:-2%;
position:absolute;*/
/*width:380px;*/
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
function renderVisualization(visualizationURL) {
<%--
$("#vis_container").empty().html('<img src="${loadingImageLink}" />');
--%>
$.ajax({
url: visualizationURL,
dataType: "html",
success:function(data){
$("#vis_container").html(data);
}
});
}
renderVisualization('${visualizationURL}');
});
//-->
</script>
<div id="vis_container">&nbsp;</div>
<!--[if lte IE 7]>
<style type="text/css">
#vis_container a{
padding-bottom:5px;
}
.vis_link a{
margin-top: 15px;
padding:10px;
display: block;
}
</style>
<![endif]-->
<%--
For now we have disabled PDF report vis.
<div id="pdf_url">
This is the <a href="${pdfURL}">link</a> to PDF report.
</div>
--%>
<!-- END Visualization Code -->
<%
}
%>

View file

@ -1,8 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<jsp:include page="roleShortView.jsp">
<jsp:param name="personToRolePredicate" value="http://vivoweb.org/ontology/core#hasTeacherRole"/>
<jsp:param name="roleToPersonPredicate" value="http://vivoweb.org/ontology/core#teacherRoleOf"/>
<jsp:param name="roleActivityToRolePredicate" value="http://vivoweb.org/ontology/core#relatedRole"/>
<jsp:param name="roleActivityLabel" value="teaching role"/>
</jsp:include>