From 1663e9ff2d5b402bf53e0aff3ac9d2bc9210c4e3 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Mon, 5 Apr 2010 15:27:20 +0000 Subject: [PATCH] NIHVIVO-195 Custom activity forms basically working now. --- productMods/edit/forms/css/customForm.css | 5 +- productMods/edit/forms/personHasActivity.jsp | 66 +++++++++++--------- 2 files changed, 40 insertions(+), 31 deletions(-) diff --git a/productMods/edit/forms/css/customForm.css b/productMods/edit/forms/css/customForm.css index 4595eeff..84ecbad7 100644 --- a/productMods/edit/forms/css/customForm.css +++ b/productMods/edit/forms/css/customForm.css @@ -98,5 +98,8 @@ option { /*display: none; Hide if Javascript disabled. Javascript will show. */ border-color: #FF7700; color: #FF7700; - +} + +#content form textarea { + width: 30%; } diff --git a/productMods/edit/forms/personHasActivity.jsp b/productMods/edit/forms/personHasActivity.jsp index 18a8842d..43e15da7 100644 --- a/productMods/edit/forms/personHasActivity.jsp +++ b/productMods/edit/forms/personHasActivity.jsp @@ -25,20 +25,20 @@ <%@ 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.personHasPositionHistory.jsp"); + public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.personHasActivity.jsp"); %> <% VitroRequest vreq = new VitroRequest(request); WebappDaoFactory wdf = vreq.getWebappDaoFactory(); vreq.setAttribute("defaultNamespace", ""); //empty string triggers default new URI behavior - - String flagURI = null; - if (vreq.getAppBean().isFlag1Active()) { - flagURI = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing"; + + String flagUri = null; + if (wdf.getApplicationDao().isFlag1Active()) { + flagUri = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing"; } else { - flagURI = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering + flagUri = wdf.getVClassDao().getTopConcept().getURI(); // fall back to owl:Thing if not portal filtering } - vreq.setAttribute("flagURI",flagURI); + vreq.setAttribute("flagUri",flagUri); request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString())); request.setAttribute("gYearMonthDatatypeUriJson", MiscWebUtils.escape(XSD.gYearMonth.toString())); @@ -46,7 +46,7 @@ - + @@ -55,21 +55,26 @@ - + + - + + - + + - + + - - + + + <%-- Then enter a SPARQL query for each field, by convention concatenating the field id with "Existing" to convey that the expression is used to retrieve any existing value for the field in an existing individual. @@ -77,14 +82,14 @@ and in the literalsOnForm --%> SELECT ?existingLabel WHERE { - ?activityUri <${label}> ?existingLabel } + ?activityUri <${labelUri}> ?existingLabel } <%-- Pair the "existing" query with the skeleton of what will be asserted for a new statement involving this field. The actual assertion inserted in the model will be created via string substitution into the ? variables. NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%> - ?activityUri <${label}> ?label . + ?activityUri <${labelUri}> ?label . @@ -125,16 +130,16 @@ - ?activityUri <${label}> ?label ; - a <${predicateUri}> ; - a <${activityUri} ; - a <${flagUri} ; + ?activityUri <${labelUri}> ?label ; + a <${activityClass}> ; + a <${activitySuperClass}> ; + a <${flagUri}> ; <${inverseUri}> ?person ; - <${inverseActivityUri}> ?person . + <${inverseSuperPropertyUri}> ?person . ?person <${predicateUri}> ?activityUri ; - <${activityUri}> ?activityUri . - s + <${superPropertyUri}> ?activityUri . + @@ -155,13 +160,13 @@ "urisInScope" : { }, "literalsInScope": { }, - "urisOnForm" : [ "activityUri"], - "literalsOnForm" : [ "name", "description", "role", "startYearMonth", "endYearMonth" ], + "urisOnForm" : [ ], + "literalsOnForm" : [ "label", "description", "role", "startYearMonth", "endYearMonth" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { }, "sparqlForExistingLiterals" : { - "name" : "${labelExisting}", + "label" : "${labelExisting}", "description" : "${descriptionExisting}", "role" : "${roleExisting}", "startYearMonth" : "${startYearMonthExisting}", @@ -170,7 +175,7 @@ "sparqlForExistingUris" : { }, "fields" : { - "name" : { + "label" : { "newResource" : "false", "validators" : [ "nonempty" ], "optionsType" : "UNDEFINED", @@ -201,7 +206,7 @@ "objectClassUri" : "", "rangeDatatypeUri" : "${stringDatatypeUriJson}", "rangeLang" : "", - "assertions" : [ "${descriptionAssertion}" ] + "assertions" : [ "${roleAssertion}" ] }, "startYearMonth" : { "newResource" : "false", @@ -228,7 +233,7 @@ } } -<% +<% log.debug(request.getAttribute("editjson")); EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); @@ -248,6 +253,7 @@ String subjectName = ((Individual) request.getAttribute("subject")).getName(); %> + @@ -294,7 +300,7 @@
" > - +