<commit_before><%-- $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:if 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:if>
        	
        <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>
				        
						<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>
			    			    <commit_msg>NIHVIVO-362 Merge from rel-1.0-maint branch: Fixed comma issues in position history custom short view that were observed while investigating this bug.<commit_after><%-- $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:if 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:if>
        	
        <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>
			    			    
{'fraction_non_alphanumeric': 0.16712630998345285, 'fraction_numerical': 0.002482073910645339, 'mean_word_length': 1.9846364883401921, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7653806', 'n_tokens_mistral': 3331, 'n_tokens_neox': 2932, 'n_words': 495}