diff --git a/productMods/edit/forms/addGrantRoleToPerson.jsp b/productMods/edit/forms/addGrantRoleToPerson.jsp index e20af304..5b470976 100644 --- a/productMods/edit/forms/addGrantRoleToPerson.jsp +++ b/productMods/edit/forms/addGrantRoleToPerson.jsp @@ -39,6 +39,8 @@ This is intended to create a set of statements like: String intDatatypeUri = XSD.xint.toString(); vreq.setAttribute("intDatatypeUri", intDatatypeUri); vreq.setAttribute("intDatatypeUriJson", MiscWebUtils.escape(intDatatypeUri)); + vreq.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString())); + String predicateUri = (String)request.getAttribute("predicateUri"); ObjectProperty op = wdf.getObjectPropertyDao().getObjectPropertyByURI( predicateUri ); if( op != null && op.getURIInverse() != null ){ @@ -69,7 +71,17 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest Investigator Create a new investigator entry for <%= subjectName %> <% } %> - + + + + ?role <${startYearUri}> ?startYear . + + + + + ?role <${endYearUri}> ?endYear . + + @prefix core: <${vivoCore}> . @prefix rdf: <${rdf}> . @@ -106,9 +118,9 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest "predicate" : ["rolePredicate", "${predicateUriJson}" ], "object" : ["role", "${objectUriJson}", "URI" ], - "n3required" : [ "${n3ForGrantRole}" ], + "n3required" : [ "${n3ForGrantRole}", "${startYearAssertion}" ], - "n3optional" : [ "${n3ForNewGrant}" , "${n3ForInverse}" ], + "n3optional" : [ "${n3ForNewGrant}", "${n3ForInverse}", "${endYearAssertion}" ], "newResources" : { "role" : "${defaultNamespace}", "grant" : "${defaultNamespace}" }, @@ -117,7 +129,7 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest "inverseRolePredicate" : "${inversePredicate}" }, "literalsInScope": { }, "urisOnForm" : [ "grant" ], - "literalsOnForm" : [ "grantLabel" ], + "literalsOnForm" : [ "grantLabel", "startYear", "endYear" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { }, @@ -145,6 +157,28 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest "rangeDatatypeUri" : "${stringDatatypeUriJson}", "rangeLang" : "", "assertions" : ["${n3ForExistingPub}"] + }, + "startYear" : { + "newResource" : "false", + "validators" : [ "datatype:${gYearDatatypeUriJson}" ], + "optionsType" : "UNDEFINED", + "literalOptions" : [ ], + "predicateUri" : "", + "objectClassUri" : "", + "rangeDatatypeUri" : "${gYearDatatypeUriJson}", + "rangeLang" : "", + "assertions" : ["${startYearAssertion}"] + }, + "endYear" : { + "newResource" : "false", + "validators" : [ "datatype:${gYearDatatypeUriJson}" ], + "optionsType" : "UNDEFINED", + "literalOptions" : [ ], + "predicateUri" : "", + "objectClassUri" : "", + "rangeDatatypeUri" : "${gYearDatatypeUriJson}", + "rangeLang" : "", + "assertions" : ["${endYearAssertion}"] } } } @@ -184,6 +218,7 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest %> + @@ -198,7 +233,10 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest <%-- bdc34: for some odd reason id and name should not be grant in this input element. --%> - + + + +

* required fields

diff --git a/productMods/edit/forms/addRoleToPersonTwoStage.jsp b/productMods/edit/forms/addRoleToPersonTwoStage.jsp index aaf842b6..f5aa961c 100644 --- a/productMods/edit/forms/addRoleToPersonTwoStage.jsp +++ b/productMods/edit/forms/addRoleToPersonTwoStage.jsp @@ -38,7 +38,7 @@ <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.utils.TitleCase" %> - +<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartDateBeforeEndDate"%> <%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.LogFactory" %> @@ -83,6 +83,8 @@ vreq.setAttribute("intDatatypeUri", intDatatypeUri); vreq.setAttribute("intDatatypeUriJson", MiscWebUtils.escape(intDatatypeUri)); + vreq.setAttribute("gYearMonthDatatypeUriJson", MiscWebUtils.escape(XSD.gYearMonth.toString())); + vreq.setAttribute("roleActivityTitleCase", TitleCase.toTitleCase(vreq.getParameter("roleActivityTypeLabel"))); ObjectProperty op = wdf.getObjectPropertyDao().getObjectPropertyByURI( predicateUri ); if( op != null && op.getURIInverse() != null ){ @@ -97,6 +99,23 @@ <%--blank triggers default URI generation behavior --%> + + + SELECT ?existingStartYearMonth WHERE { + ?role <${startYearMonthUri}> ?existingStartYearMonth } + + + ?role <${startYearMonthUri}> ?startYearMonth . + + + + + SELECT ?existingEndYearMonth WHERE { + ?role <${endYearMonthUri}> ?existingEndYearMonth } + + + ?role <${endYearMonthUri}> ?endYearMonth . + @prefix core: <${vivoCore}> . @@ -129,8 +148,8 @@ "predicate" : ["rolePredicate", "${predicateUriJson}" ], "object" : ["role", "${objectUriJson}", "URI" ], - "n3required" : [ "${n3ForNewRole}" ], - "n3optional" : [ "${n3ForNewActivity}", "${n3ForInverse}" ], + "n3required" : [ "${n3ForNewRole}", "${startYearMonthAssertion}" ], + "n3optional" : [ "${n3ForNewActivity}", "${n3ForInverse}", "${endYearMonthAssertion}" ], "newResources" : { "role" : "${defaultNamespace}", "roleActivity" : "${defaultNamespace}" }, @@ -138,7 +157,7 @@ "urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" }, "literalsInScope": { }, "urisOnForm" : [ "roleActivity", "roleActivityType" ], - "literalsOnForm" : [ "title" ], + "literalsOnForm" : [ "title", "startYearMonth", "endYearMonth" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { }, @@ -177,6 +196,28 @@ "rangeDatatypeUri" : "", "rangeLang" : "", "assertions" : [ ] + }, + "startYearMonth" : { + "newResource" : "false", + "validators" : [ "datatype:${gYearMonthDatatypeUriJson}" ], + "optionsType" : "UNDEFINED", + "literalOptions" : [ ], + "predicateUri" : "", + "objectClassUri" : "", + "rangeDatatypeUri" : "${gYearMonthDatatypeUriJson}", + "rangeLang" : "", + "assertions" : ["${startYearMonthAssertion}"] + }, + "endYearMonth" : { + "newResource" : "false", + "validators" : [ "datatype:${gYearMonthDatatypeUriJson}" ], + "optionsType" : "UNDEFINED", + "literalOptions" : [ ], + "predicateUri" : "", + "objectClassUri" : "", + "rangeDatatypeUri" : "${gYearMonthDatatypeUriJson}", + "rangeLang" : "", + "assertions" : ["${endYearMonthAssertion}"] } } } @@ -189,7 +230,7 @@ EditConfiguration.putConfigInSession(editConfig,session); } - //editConfig.addValidator(new PersonHasPublicationValidator()); + editConfig.addValidator(new StartDateBeforeEndDate("startYearMonth","endYearMonth") ); //this will return the browser to the new activity entity after an edit. editConfig.setEntityToReturnTo("?roleActivity"); @@ -213,6 +254,7 @@ %> + @@ -231,6 +273,9 @@

(Verify this match)

+ + +

diff --git a/productMods/edit/forms/css/autocomplete.css b/productMods/edit/forms/css/autocomplete.css index f771a59e..46519f7d 100644 --- a/productMods/edit/forms/css/autocomplete.css +++ b/productMods/edit/forms/css/autocomplete.css @@ -7,4 +7,15 @@ .acSelectionInfo { background-color: #d9d9d9; padding: .5em 1em; +} + + +/* jQuery UI autocomplete */ +ul.ui-autocomplete { + font-size: .95em; +} + +li.ui-menu-item a.ui-corner-all { + text-align: left; + padding-left: .25em; } \ No newline at end of file diff --git a/productMods/edit/forms/css/customForm.css b/productMods/edit/forms/css/customForm.css index 076a3ea4..9bfb1e34 100644 --- a/productMods/edit/forms/css/customForm.css +++ b/productMods/edit/forms/css/customForm.css @@ -104,13 +104,3 @@ option { width: 30%; } - -/* jQuery UI autocomplete */ -ul.ui-autocomplete { - font-size: .95em; -} - -li.ui-menu-item a.ui-corner-all { - text-align: left; - padding-left: .25em; -} \ No newline at end of file diff --git a/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css b/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css index 8692614b..fd603423 100644 --- a/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css +++ b/productMods/edit/forms/css/customFormWithAdvanceTypeSelection.css @@ -23,3 +23,4 @@ .verifyMatch { margin-left: .5em; } +