2010-04-02 15:59:48 +00:00
|
|
|
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
|
|
|
|
2010-06-11 21:11:19 +00:00
|
|
|
<%-- Custom form for adding an educational attainment to an individual
|
|
|
|
|
|
|
|
Classes:
|
2010-06-24 15:14:07 +00:00
|
|
|
core:EducationalTraining - primary new individual being created
|
2010-06-11 21:11:19 +00:00
|
|
|
foaf:Person - existing individual
|
|
|
|
foaf:Organization - new or existing individual
|
|
|
|
core:AcademicDegree - existing individual
|
|
|
|
|
2010-06-24 15:14:07 +00:00
|
|
|
Data properties of EducationalTraining:
|
2010-06-11 21:11:19 +00:00
|
|
|
core:majorField
|
|
|
|
core:departmentOrSchool
|
|
|
|
core:supplementalInformation
|
|
|
|
|
|
|
|
Object properties (domain : range)
|
|
|
|
|
2010-07-14 15:27:44 +00:00
|
|
|
core:educationalTraining (Person : EducationalTraining) - inverse of core:educationalTrainingOf
|
|
|
|
core:educationalTrainingOf (EducationalTraining : Person) - inverse of core:educationalTraining
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2010-07-14 15:27:44 +00:00
|
|
|
core:degreeEarned (EducationalTraining : AcademicDegree) - inverse of core:degreeOutcomeOf
|
|
|
|
core:degreeOutcomeOf (AcademicDegree : EducationalTraining) - inverse of core:degreeEarned
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2010-06-24 15:14:07 +00:00
|
|
|
core:organizationGrantingDegree (EducationalTraining : Organization) - no inverse
|
2010-06-11 21:11:19 +00:00
|
|
|
|
2010-07-06 22:48:04 +00:00
|
|
|
Future version
|
|
|
|
--------------
|
|
|
|
Classes:
|
|
|
|
core:DateTimeValue
|
|
|
|
core:DateTimeValuePrecision
|
|
|
|
Object properties:
|
2010-06-24 15:14:07 +00:00
|
|
|
core:dateTimeValue (EducationalTraining : DateTimeValue)
|
2010-06-11 21:11:19 +00:00
|
|
|
core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision)
|
|
|
|
--%>
|
|
|
|
|
2010-04-02 15:59:48 +00:00
|
|
|
<%@ page import="java.util.List" %>
|
|
|
|
<%@ page import="java.util.ArrayList" %>
|
|
|
|
<%@ page import="java.util.Arrays" %>
|
|
|
|
|
|
|
|
<%@ page import="com.hp.hpl.jena.rdf.model.Literal"%>
|
|
|
|
<%@ page import="com.hp.hpl.jena.rdf.model.Model"%>
|
|
|
|
<%@ page import="com.hp.hpl.jena.vocabulary.XSD" %>
|
|
|
|
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual"%>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary"%>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration"%>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory"%>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
|
|
|
|
<%@ page import="org.apache.commons.logging.Log" %>
|
|
|
|
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
2010-09-02 15:39:56 +00:00
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %>
|
|
|
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %>
|
2010-04-02 15:59:48 +00:00
|
|
|
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
|
|
|
|
<%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %>
|
|
|
|
|
|
|
|
<%!
|
|
|
|
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.personHasEducationalBackground.jsp");
|
|
|
|
%>
|
|
|
|
<%
|
|
|
|
VitroRequest vreq = new VitroRequest(request);
|
|
|
|
WebappDaoFactory wdf = vreq.getWebappDaoFactory();
|
|
|
|
vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior
|
|
|
|
|
|
|
|
request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString()));
|
|
|
|
request.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString()));
|
|
|
|
%>
|
|
|
|
|
|
|
|
<c:set var="vivoCore" value="http://vivoweb.org/ontology/core#" />
|
|
|
|
<c:set var="rdfs" value="<%= VitroVocabulary.RDFS %>" />
|
|
|
|
<c:set var="label" value="${rdfs}label" />
|
|
|
|
<c:set var="orgClass" value="http://xmlns.com/foaf/0.1/Organization" />
|
2010-04-02 20:15:08 +00:00
|
|
|
<c:set var="degreeClass" value="${vivoCore}AcademicDegree" />
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<%-- Define predicates used in n3 assertions and sparql queries --%>
|
2010-04-02 20:15:08 +00:00
|
|
|
<c:set var="majorFieldPred" value="${vivoCore}majorField" />
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:set var="yearPred" value="${vivoCore}year" />
|
|
|
|
<c:set var="deptPred" value="${vivoCore}departmentOrSchool" />
|
|
|
|
<c:set var="infoPred" value="${vivoCore}supplementalInformation" />
|
|
|
|
<c:set var="degreeEarned" value="${vivoCore}degreeEarned" />
|
|
|
|
<c:set var="degreeOutcomeOf" value="${vivoCore}degreeOutcomeOf" />
|
|
|
|
<c:set var="orgGrantingDegree" value="${vivoCore}organizationGrantingDegree" />
|
2010-04-02 20:15:08 +00:00
|
|
|
|
2010-07-06 14:05:57 +00:00
|
|
|
<%-- For new datetime handling in ontology - v1.2
|
2010-06-11 21:11:19 +00:00
|
|
|
<c:set var="dateTimeValue" value="${vivoCore}DateTimeValue" />
|
|
|
|
<c:set var="hasDateTimeValue" value="${vivoCore}dateTimeValue" />
|
|
|
|
<c:set var="precisionValue" value="${vivoCore}YearPrecision" />
|
|
|
|
<c:set var="hasPrecision" value="${vivoCore}dateTimePrecision" />
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="existingYearQuery" >
|
2010-04-02 20:15:08 +00:00
|
|
|
SELECT ?existingYear WHERE {
|
2010-09-02 15:39:56 +00:00
|
|
|
?edTraining <${hasDateTimeValue}> ?existingYear . }
|
2010-04-02 20:15:08 +00:00
|
|
|
</v:jsonset>
|
2010-06-11 21:11:19 +00:00
|
|
|
<v:jsonset var="yearAssertion" >
|
|
|
|
@prefix core: <${vivoCore}> .
|
|
|
|
?dateTime a core:DateTimeValue ;
|
|
|
|
core:dateTime ?year ;
|
|
|
|
core:dateTimeValuePrecision core:YearPrecision .
|
2010-09-02 15:39:56 +00:00
|
|
|
?edTraining core:dateTimeValue ?dateTime .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
2010-06-14 01:40:59 +00:00
|
|
|
--%>
|
2010-07-06 14:05:57 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<%-- Assertions for adding a new educational training entry --%>
|
|
|
|
|
|
|
|
<v:jsonset var="orgTypeAssertion">
|
|
|
|
?org a ?orgType .
|
2010-06-14 01:40:59 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:jsonset var="orgLabelAssertion">
|
|
|
|
?org <${label}> ?orgLabel .
|
2010-06-14 01:40:59 +00:00
|
|
|
</v:jsonset>
|
2010-07-06 14:05:57 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="degreeAssertion" >
|
|
|
|
?edTraining <${degreeEarned}> ?degree .
|
|
|
|
?degree <${degreeOutcomeOf}> ?edTraining .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:jsonset var="majorFieldAssertion" >
|
|
|
|
?edTraining <${majorFieldPred}> ?majorField .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="yearAssertion" >
|
|
|
|
?edTraining <${yearPred}> ?year .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:jsonset var="deptAssertion" >
|
|
|
|
?edTraining <${deptPred}> ?dept .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="infoAssertion" >
|
|
|
|
?edTraining <${infoPred}> ?info .
|
2010-04-02 20:15:08 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:jsonset var="n3ForNewEdTraining">
|
|
|
|
@prefix core: <${vivoCore}> .
|
|
|
|
|
|
|
|
?person core:educationalTraining ?edTraining .
|
|
|
|
|
|
|
|
?edTraining a core:EducationalTraining ;
|
|
|
|
core:educationalTrainingOf ?person ;
|
|
|
|
<${orgGrantingDegree}> ?org .
|
2010-04-02 20:15:08 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<%-- This property has no inverse --%>
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="n3ForEdTrainingToOrg" >
|
|
|
|
?edTraining <${orgGrantingDegree}> ?org .
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<%-- Queries for editing an existing educational training entry --%>
|
|
|
|
|
|
|
|
<v:jsonset var="orgQuery" >
|
|
|
|
SELECT ?existingOrg WHERE {
|
|
|
|
?edTraining <${orgGrantingDegree}> ?existingOrg . }
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="orgLabelQuery" >
|
|
|
|
SELECT ?existingOrgLabel WHERE {
|
|
|
|
?edTraining <${orgGrantingDegree}> ?existingOrg .
|
|
|
|
?existingOrg <${label}> ?existingOrgLabel .
|
|
|
|
}
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:jsonset var="orgTypeQuery" >
|
|
|
|
SELECT ?existingOrgType WHERE {
|
|
|
|
?edTraining <${orgGrantingDegree}> ?existingOrg .
|
|
|
|
?existingOrg a ?existingOrgType .
|
|
|
|
}
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="degreeQuery" >
|
|
|
|
SELECT ?existingDegree WHERE {
|
|
|
|
?edTraining <${degreeEarned}> ?existingDegree . }
|
|
|
|
</v:jsonset>
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="majorFieldQuery" >
|
|
|
|
SELECT ?existingMajorField WHERE {
|
|
|
|
?edTraining <${majorFieldPred}> ?existingMajorField . }
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="yearQuery" >
|
|
|
|
SELECT ?existingYear WHERE {
|
|
|
|
?edTraining <${yearPred}> ?existingYear . }
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
<v:jsonset var="deptQuery" >
|
|
|
|
SELECT ?existingDept WHERE {
|
|
|
|
?edTraining <${deptPred}> ?existingDept . }
|
2010-04-02 15:59:48 +00:00
|
|
|
</v:jsonset>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<v:jsonset var="infoQuery" >
|
|
|
|
SELECT ?existingInfo WHERE {
|
|
|
|
?edTraining <${infoPred}> ?existingInfo . }
|
|
|
|
</v:jsonset>
|
|
|
|
|
|
|
|
|
2010-04-02 15:59:48 +00:00
|
|
|
<v:jsonset var="orgClassUriJson">${orgClass}</v:jsonset>
|
2010-04-02 20:15:08 +00:00
|
|
|
<v:jsonset var="degreeClassUriJson">${degreeClass}</v:jsonset>
|
2010-04-02 15:59:48 +00:00
|
|
|
|
|
|
|
<c:set var="editjson" scope="request">
|
|
|
|
{
|
|
|
|
"formUrl" : "${formUrl}",
|
|
|
|
"editKey" : "${editKey}",
|
|
|
|
"urlPatternToReturnTo" : "/entity",
|
|
|
|
|
|
|
|
"subject" : ["person", "${subjectUriJson}" ],
|
|
|
|
"predicate" : ["predicate", "${predicateUriJson}" ],
|
2010-09-02 15:39:56 +00:00
|
|
|
"object" : ["edTraining", "${objectUriJson}", "URI" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
"n3required" : [ "${n3ForNewEdTraining}", "${majorFieldAssertion}" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
"n3optional" : [ "${n3ForEdTrainingToOrg}",
|
|
|
|
"${orgLabelAssertion}", "${orgTypeAssertion}",
|
2010-07-06 16:22:26 +00:00
|
|
|
"${degreeAssertion}", "${deptAssertion}", "${infoAssertion}", "${yearAssertion}" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
"newResources" : { "edTraining" : "${defaultNamespace}",
|
|
|
|
"org" : "${defaultNamespace}" },
|
2010-04-02 15:59:48 +00:00
|
|
|
|
|
|
|
"urisInScope" : { },
|
|
|
|
"literalsInScope": { },
|
2010-09-02 15:39:56 +00:00
|
|
|
"urisOnForm" : [ "org", "orgType", "degree" ],
|
|
|
|
"literalsOnForm" : [ "orgLabel", "majorField", "year", "dept", "info" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
"filesOnForm" : [ ],
|
|
|
|
"sparqlForLiterals" : { },
|
|
|
|
"sparqlForUris" : { },
|
|
|
|
"sparqlForExistingLiterals" : {
|
2010-09-02 15:39:56 +00:00
|
|
|
"orgLabel" : "${orgLabelQuery}",
|
|
|
|
"majorField" : "${majorFieldQuery}",
|
|
|
|
"year" : "${yearQuery}",
|
|
|
|
"dept" : "${deptQuery}",
|
|
|
|
"info" : "${infoQuery}"
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
|
|
|
"sparqlForExistingUris" : {
|
2010-09-02 15:39:56 +00:00
|
|
|
"org" : "${orgQuery}",
|
|
|
|
"orgType" : "${orgTypeQuery}",
|
|
|
|
"degree" : "${degreeQuery}"
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
|
|
|
"fields" : {
|
2010-09-02 15:39:56 +00:00
|
|
|
"degree" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
2010-07-06 16:22:26 +00:00
|
|
|
"validators" : [ ],
|
2010-04-02 20:15:08 +00:00
|
|
|
"optionsType" : "INDIVIDUALS_VIA_VCLASS",
|
|
|
|
"literalOptions" : [ "Select one" ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "${degreeClassUriJson}",
|
|
|
|
"rangeDatatypeUri" : "",
|
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : [ "${degreeAssertion}" ]
|
|
|
|
},
|
|
|
|
"majorField" : {
|
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ "nonempty", "datatype:${stringDatatypeUriJson}" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"assertions" : [ "${majorFieldAssertion}" ]
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
2010-04-02 20:15:08 +00:00
|
|
|
"year" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
2010-07-06 16:22:26 +00:00
|
|
|
"validators" : [ "datatype:${gYearDatatypeUriJson}" ],
|
2010-04-02 20:15:08 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
2010-04-02 15:59:48 +00:00
|
|
|
"predicateUri" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"objectClassUri" : "",
|
2010-06-14 01:40:59 +00:00
|
|
|
"rangeDatatypeUri" : "${gYearDatatypeUriJson}",
|
2010-04-02 20:15:08 +00:00
|
|
|
"rangeLang" : "",
|
|
|
|
"assertions" : ["${yearAssertion}"]
|
|
|
|
},
|
2010-09-02 15:39:56 +00:00
|
|
|
"org" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ ],
|
|
|
|
"optionsType" : "INDIVIDUALS_VIA_VCLASS",
|
|
|
|
"literalOptions" : [ "Select one" ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "${orgClassUriJson}",
|
|
|
|
"rangeDatatypeUri" : "",
|
|
|
|
"rangeLang" : "",
|
2010-09-02 15:39:56 +00:00
|
|
|
"assertions" : [ "${n3ForEdTrainingToOrg}" ]
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
2010-09-02 15:39:56 +00:00
|
|
|
"orgLabel" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ ],
|
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
|
|
|
"rangeLang" : "",
|
2010-09-02 15:39:56 +00:00
|
|
|
"assertions" : [ "${orgLabelAssertion}" ]
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
2010-09-02 15:39:56 +00:00
|
|
|
"orgType" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
|
|
|
"validators" : [ ],
|
|
|
|
"optionsType" : "CHILD_VCLASSES",
|
|
|
|
"literalOptions" : [ "Select one" ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "${orgClassUriJson}",
|
|
|
|
"rangeDatatypeUri" : "",
|
|
|
|
"rangeLang" : "",
|
2010-09-02 15:39:56 +00:00
|
|
|
"assertions" : [ "${orgTypeAssertion}" ]
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
2010-04-02 20:15:08 +00:00
|
|
|
"dept" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
2010-04-02 20:15:08 +00:00
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
2010-04-02 15:59:48 +00:00
|
|
|
"rangeLang" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"assertions" : ["${deptAssertion}"]
|
2010-04-02 15:59:48 +00:00
|
|
|
},
|
2010-04-02 20:15:08 +00:00
|
|
|
"info" : {
|
2010-04-02 15:59:48 +00:00
|
|
|
"newResource" : "false",
|
2010-04-02 20:15:08 +00:00
|
|
|
"validators" : [ "datatype:${stringDatatypeUriJson}" ],
|
2010-04-02 15:59:48 +00:00
|
|
|
"optionsType" : "UNDEFINED",
|
|
|
|
"literalOptions" : [ ],
|
|
|
|
"predicateUri" : "",
|
|
|
|
"objectClassUri" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"rangeDatatypeUri" : "${stringDatatypeUriJson}",
|
2010-04-02 15:59:48 +00:00
|
|
|
"rangeLang" : "",
|
2010-04-02 20:15:08 +00:00
|
|
|
"assertions" : ["${infoAssertion}"]
|
|
|
|
}
|
2010-04-02 15:59:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</c:set>
|
|
|
|
<%
|
|
|
|
log.debug(request.getAttribute("editjson"));
|
|
|
|
|
|
|
|
EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request);
|
|
|
|
if (editConfig == null) {
|
|
|
|
editConfig = new EditConfiguration((String) request.getAttribute("editjson"));
|
|
|
|
EditConfiguration.putConfigInSession(editConfig,session);
|
|
|
|
}
|
|
|
|
|
|
|
|
Model model = (Model) application.getAttribute("jenaOntModel");
|
|
|
|
String objectUri = (String) request.getAttribute("objectUri");
|
|
|
|
if (objectUri != null) { // editing existing
|
|
|
|
editConfig.prepareForObjPropUpdate(model);
|
|
|
|
} else { // adding new
|
|
|
|
editConfig.prepareForNonUpdate(model);
|
|
|
|
}
|
|
|
|
|
|
|
|
String subjectName = ((Individual) request.getAttribute("subject")).getName();
|
|
|
|
%>
|
|
|
|
|
|
|
|
<c:set var="subjectName" value="<%= subjectName %>" />
|
|
|
|
<%
|
|
|
|
if (objectUri != null) { // editing existing entry
|
|
|
|
%>
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:set var="editMode" value="edit" />
|
|
|
|
<c:set var="titleVerb" value="Edit" />
|
2010-04-02 20:15:08 +00:00
|
|
|
<c:set var="title" value="Edit educational background entry for ${subjectName}" />
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:set var="submitButtonText" value="Edit Educational Training" />
|
|
|
|
<c:set var="disabledVal" value="disabled" />
|
2010-04-02 15:59:48 +00:00
|
|
|
<%
|
|
|
|
} else { // adding new entry
|
|
|
|
%>
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:set var="editMode" value="add" />
|
|
|
|
<c:set var="titleVerb" value="Create" />
|
|
|
|
<c:set var="submitButtonText" value="Educational Training" />
|
|
|
|
<c:set var="disabledVal" value="" />
|
2010-04-02 15:59:48 +00:00
|
|
|
<% }
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
List<String> customJs = new ArrayList<String>(Arrays.asList(JavaScript.JQUERY_UI.path(),
|
|
|
|
JavaScript.CUSTOM_FORM_UTILS.path(),
|
|
|
|
"/edit/forms/js/customFormWithAutocomplete.js"
|
|
|
|
));
|
2010-04-02 15:59:48 +00:00
|
|
|
request.setAttribute("customJs", customJs);
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
List<String> customCss = new ArrayList<String>(Arrays.asList(Css.JQUERY_UI.path(),
|
|
|
|
Css.CUSTOM_FORM.path(),
|
|
|
|
"/edit/forms/css/autocomplete.css",
|
|
|
|
"/edit/forms/css/customFormWithAutocomplete.css"
|
|
|
|
));
|
|
|
|
request.setAttribute("customCss", customCss);
|
2010-04-02 15:59:48 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
<c:set var="requiredHint" value="<span class='requiredHint'> *</span>" />
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:set var="yearHint" value="<span class='hint'>(YYYY)</span>" />
|
2010-04-02 15:59:48 +00:00
|
|
|
|
|
|
|
<jsp:include page="${preForm}" />
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<h2>${titleVerb} educational training entry for <%= subjectName %></h2>
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<form action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
2010-04-02 15:59:48 +00:00
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<p class="inline"><v:input type="select" label="Organization Type ${requiredHint}" name="orgType" disabled="${disabledVal}" id="typeSelector" /></p>
|
|
|
|
|
|
|
|
<div class="fullViewOnly">
|
|
|
|
|
|
|
|
<p><v:input type="text" id="relatedIndLabel" name="orgLabel" label="Name ${requiredHint}" cssClass="acSelector" disabled="${disabledVal}" size="50" /></p>
|
|
|
|
|
|
|
|
<%-- Store these values in hidden fields, because the displayed fields are disabled and don't submit. This ensures that when
|
|
|
|
returning from a validation error, we retain the values. --%>
|
|
|
|
<c:if test="${editMode == 'edit'}">
|
|
|
|
<v:input type="hidden" id="orgType" />
|
|
|
|
<v:input type="hidden" id="orgLabel" />
|
|
|
|
</c:if>
|
|
|
|
|
|
|
|
<div class="acSelection">
|
|
|
|
<%-- RY maybe make this a label and input field. See what looks best. --%>
|
|
|
|
<p class="inline"><label></label><span class="acSelectionInfo"></span> <a href="<c:url value="/individual?uri=" />" class="verifyMatch">(Verify this match)</a></p>
|
|
|
|
<v:input type="hidden" id="org" cssClass="acUriReceiver" /> <!-- Field value populated by JavaScript -->
|
2010-04-02 22:30:09 +00:00
|
|
|
</div>
|
2010-09-02 15:39:56 +00:00
|
|
|
|
|
|
|
<v:input type="select" label="Degree" id="degree" />
|
|
|
|
|
|
|
|
<v:input type="text" label="Major Field of Degree ${requiredHint}" id="majorField" size="30" />
|
|
|
|
|
|
|
|
<v:input type="text" label="Year ${yearHint}" id="year" size="4" />
|
|
|
|
|
2010-04-02 20:30:31 +00:00
|
|
|
<v:input type="text" label="Department or School Name within the Organization" id="dept" size="50" />
|
2010-09-02 15:39:56 +00:00
|
|
|
|
2010-04-02 20:30:31 +00:00
|
|
|
<v:input type="text" label="Supplemental Information" id="info" size="50" />
|
2010-07-06 15:48:33 +00:00
|
|
|
<p>e.g., <em>Postdoctoral training</em> or <em>Transferred</em></p>
|
2010-04-02 15:59:48 +00:00
|
|
|
</div>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<p class="submit"><v:input type="submit" id="submit" value="${submitButtonText}" cancel="true"/></p>
|
2010-04-02 15:59:48 +00:00
|
|
|
|
|
|
|
<p id="requiredLegend" class="requiredHint">* required fields</p>
|
|
|
|
</form>
|
|
|
|
|
2010-09-02 15:39:56 +00:00
|
|
|
<c:url var="acUrl" value="/autocomplete?tokenize=true&stem=true" />
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var customFormData = {
|
|
|
|
acUrl: '${acUrl}',
|
|
|
|
editMode: '${editMode}',
|
|
|
|
submitButtonTextType: 'compound'
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2010-04-02 15:59:48 +00:00
|
|
|
<jsp:include page="${postForm}"/>
|