From a003bbf80fc84b1b1fbea7cff70ae047589f9f36 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 6 Jul 2010 16:22:26 +0000 Subject: [PATCH] NIHVIVO-700 Made degree field optional in ed background form. Also added validation for year datatype to year field. --- .../forms/personHasEducationalBackground.jsp | 14 ++--- .../entity/educationalTrainingShortView.jsp | 59 +++++++++++-------- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/productMods/edit/forms/personHasEducationalBackground.jsp b/productMods/edit/forms/personHasEducationalBackground.jsp index 69b6d58f..3fb8cbf7 100644 --- a/productMods/edit/forms/personHasEducationalBackground.jsp +++ b/productMods/edit/forms/personHasEducationalBackground.jsp @@ -207,11 +207,11 @@ the org type still gets asserted. --%> "predicate" : ["predicate", "${predicateUriJson}" ], "object" : ["edTrainingUri", "${objectUriJson}", "URI" ], - "n3required" : [ "${n3ForStmtToPerson}", "${degreeAssertion}", "${majorFieldAssertion}" ], + "n3required" : [ "${n3ForStmtToPerson}", "${majorFieldAssertion}" ], - "n3optional" : [ "${organizationUriAssertion}", - "${n3ForNewOrg}", "${newOrgNameAssertion}", "${newOrgTypeAssertion}", - "${deptAssertion}", "${infoAssertion}", "${yearAssertion}" ], + "n3optional" : [ "${organizationUriAssertion}", "${n3ForNewOrg}", + "${newOrgNameAssertion}", "${newOrgTypeAssertion}", + "${degreeAssertion}", "${deptAssertion}", "${infoAssertion}", "${yearAssertion}" ], "newResources" : { "edTrainingUri" : "${defaultNamespace}", "newOrg" : "${defaultNamespace}" }, @@ -236,7 +236,7 @@ the org type still gets asserted. --%> "fields" : { "degreeUri" : { "newResource" : "false", - "validators" : [ "nonempty" ], + "validators" : [ ], "optionsType" : "INDIVIDUALS_VIA_VCLASS", "literalOptions" : [ "Select one" ], "predicateUri" : "", @@ -258,7 +258,7 @@ the org type still gets asserted. --%> }, "year" : { "newResource" : "false", - "validators" : [ ], + "validators" : [ "datatype:${gYearDatatypeUriJson}" ], "optionsType" : "UNDEFINED", "literalOptions" : [ ], "predicateUri" : "", @@ -387,7 +387,7 @@ the org type still gets asserted. --%>
" >
- +

diff --git a/productMods/templates/entity/educationalTrainingShortView.jsp b/productMods/templates/entity/educationalTrainingShortView.jsp index 6955d12a..7c1409cf 100644 --- a/productMods/templates/entity/educationalTrainingShortView.jsp +++ b/productMods/templates/entity/educationalTrainingShortView.jsp @@ -1,8 +1,9 @@ <%-- $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" %> -<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %> <%-- This is a custom short view render for educational background. @@ -16,19 +17,31 @@ <%-- SUBJECT is a Person --%> - <%-- Degree type and major --%> - + <%-- Degree type and major --%> + - - + + + + + - - - - - ${degreeStr} - - + + + + + + + + + + + + + + + + <%-- Organization granting degree --%> @@ -45,15 +58,9 @@ <%-- Year of degree --%> - - ${year} - <%-- Supplemental information --%> - - - ${degreeSupplementalInfo} - + <%-- Build the output string --%> @@ -81,25 +88,25 @@ - ${personName} + ${personName} - ${personLink} in ${degreeMajor}, ${selectedOrganizationName}, ${year} + ${personLink} in ${degreeMajor}, ${selectedOrganizationName}, ${year} - ${personLink} in ${degreeMajor}, ${selectedOrganizationName} + ${personLink} in ${degreeMajor}, ${selectedOrganizationName} - ${personLink} in ${degreeMajor} + ${personLink} in ${degreeMajor} - ${personLink} ${selectedOrganizationName}, ${year} + ${personLink} ${selectedOrganizationName}, ${year} - educational background ${individual.name} + educational background ${individual.name} @@ -107,7 +114,7 @@ <%-- The predicate was not one of the predicted ones, so create a normal link --%> - ${individual.name} + ${individual.name}