From cb611da8adb21ff878479ca86cbced928a3ccb3a Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 24 Oct 2013 17:18:13 -0400 Subject: [PATCH] issued credential was using dateTimeValue not dateIssued; also property config changes for VIVO-408 --- .../themes/wilma/i18n/all_es.properties | 8 ++- .../listViewConfig-issuedCredential.xml | 6 +- .../edit/forms/dateTimeValueForm.ftl | 58 +++++++++++++++++++ rdf/display/everytime/PropertyConfig.n3 | 27 +++++++++ .../PersonHasIssuedCredentialGenerator.java | 2 +- themes/wilma/i18n/all.properties | 9 ++- 6 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 productMods/templates/freemarker/edit/forms/dateTimeValueForm.ftl diff --git a/languages/example/themes/wilma/i18n/all_es.properties b/languages/example/themes/wilma/i18n/all_es.properties index c779a684..1dc13fa6 100644 --- a/languages/example/themes/wilma/i18n/all_es.properties +++ b/languages/example/themes/wilma/i18n/all_es.properties @@ -869,4 +869,10 @@ select_credential_or_enter_name = Por favor, introduzca o seleccione un valor en type_of_credential = Tipo de Credencial credential_name = Nombre de Credencial selected_credential = Credential seleccionado -year_issued = Año de Emisión \ No newline at end of file +year_issued = Año de Emisión +year_awarded_for = año otorgado por +create_year_awarded = Crear año concede +edit_year_awarded = Editar año concede +publication_date_for = fecha de publicación de +create_publication_date = Crear fecha de publicación +edit_publication_date = Editar fecha de publicación diff --git a/productMods/config/listViewConfig-issuedCredential.xml b/productMods/config/listViewConfig-issuedCredential.xml index a59a9fd1..349187ad 100644 --- a/productMods/config/listViewConfig-issuedCredential.xml +++ b/productMods/config/listViewConfig-issuedCredential.xml @@ -44,7 +44,7 @@ ?dateTimeEndValue core:dateTime ?dateTimeEnd } } - OPTIONAL { ?issuedCredential core:dateTimeValue ?dateTimeValue + OPTIONAL { ?issuedCredential core:dateIssued ?dateTimeValue OPTIONAL { ?dateTimeValue core:dateTime ?dateTime } } } ORDER BY DESC(?dateTime) DESC(?dateTimeEnd) @@ -136,12 +136,12 @@ CONSTRUCT { ?subject ?property ?issuedCredential . ?issuedCredential a core:IssuedCredential . - ?issuedCredential core:dateTimeValue ?dateTimeValue . + ?issuedCredential core:dateIssued ?dateTimeValue . ?dateTimeValue core:dateTime ?dateTime } WHERE { ?subject ?property ?issuedCredential . ?issuedCredential a core:IssuedCredential . - ?issuedCredential core:dateTimeValue ?dateTimeValue . + ?issuedCredential core:dateIssued ?dateTimeValue . ?dateTimeValue core:dateTime ?dateTime } diff --git a/productMods/templates/freemarker/edit/forms/dateTimeValueForm.ftl b/productMods/templates/freemarker/edit/forms/dateTimeValueForm.ftl new file mode 100644 index 00000000..48439917 --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/dateTimeValueForm.ftl @@ -0,0 +1,58 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for adding/editing time values --> + +<#--Retrieve certain edit configuration information--> +<#assign editMode = editConfiguration.pageData.editMode /> +<#assign htmlForElements = editConfiguration.pageData.htmlForElements /> +<#assign domainUri = editConfiguration.pageData.domainUri!"" /> + +<#if editMode == "edit"> + <#assign titleVerb="${i18n().edit_capitalized}"> + <#assign disabledVal="disabled"> + <#assign submitButtonText="${i18n().edit_date_time_value}"> +<#else> + <#assign titleVerb="${i18n().create_capitalized}"> + <#assign submitButtonText="${i18n().create_date_time_value}"> + <#assign disabledVal=""/> + +<#if domainUri?contains("IAO_0000030")> + <#assign titleObject="${i18n().publication_date_for}"> + <#if editMode == "edit"> + <#assign submitButtonText="${i18n().edit_publication_date}"> + <#else> + <#assign submitButtonText="${i18n().create_publication_date}"> + +<#elseif domainUri?contains("AwardReceipt")> + <#assign titleObject="${i18n().year_awarded_for}"> + <#if editMode == "edit"> + <#assign submitButtonText="${i18n().edit_year_awarded}"> + <#else> + <#assign submitButtonText="${i18n().create_year_awarded}"> + +<#else> + <#assign titleObject="${i18n().date_time_value_for}"> + + +

${titleVerb} ${titleObject} ${editConfiguration.subjectName}

+ +
+<#--Need to draw edit elements for dates here--> + <#if htmlForElements?keys?seq_contains("dateTimeField")> + ${htmlForElements["dateTimeField"]} + + +

+ + + + ${i18n().or} + + ${i18n().cancel_link} +

+
+${stylesheets.add('', + '')} + +${scripts.add('', + '')} \ No newline at end of file diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 24f027fb..0ae8434d 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -710,5 +710,32 @@ local:grantRelatesConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; :propertyGroup . +### faux properties for dateTimeValue ### +local:publicationDateContext a :ConfigContext ; + :hasConfiguration local:publicationDateConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . +local:publicationDateConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-dateTimeValue.xml"^^xsd:string ; + :displayName "publication date" ; + vitro:displayRankAnnot 10; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:yearAwardedContext a :ConfigContext ; + :hasConfiguration local:yearAwardedConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:yearAwardedConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-dateTimeValue.xml"^^xsd:string ; + :displayName "year awarded" ; + vitro:displayRankAnnot 10; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java index 594f5d4e..760b04c3 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java @@ -28,7 +28,7 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem final static String issuedCredentialTypeClass = vivoCore + "IssuedCredential"; final static String credentialTypeClass = vivoCore + "Credential"; - final static String yearCredentialedPred = vivoCore + "dateTimeValue"; + final static String yearCredentialedPred = vivoCore + "dateIssued"; final static String issuedCredentialToInterval = vivoCore + "dateTimeInterval"; final static String intervalType = vivoCore + "DateTimeInterval"; final static String intervalToStart = vivoCore + "start"; diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index 1f90bda2..f2a2052c 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -876,4 +876,11 @@ select_credential_or_enter_name = Please enter or select a value in the Credenti type_of_credential = Type of Credential credential_name = Credential Name selected_credential = Selected Credential -year_issued = Year Issued \ No newline at end of file +year_issued = Year Issued +year_awarded_for = year awarded for +create_year_awarded = Create year awarded +edit_year_awarded = Edit year awarded +publication_date_for = publication date for +create_publication_date = Create publication date +edit_publication_date = Edit publication date +