diff --git a/webapp/languages/es_GO/i18n/all_es_GO.properties b/webapp/languages/es_GO/i18n/all_es_GO.properties index 5544aafb0..9f9b3ca3b 100644 --- a/webapp/languages/es_GO/i18n/all_es_GO.properties +++ b/webapp/languages/es_GO/i18n/all_es_GO.properties @@ -685,6 +685,7 @@ select_existing_collaborator = Seleccione un colaborador existente para {0} selected = Seleccionado change_selection = cambiar la selección there_are_no_entries_for_selection = No hay entradas en el sistema desde el cual elegir. +the_range_class_does_not_exist= La clase de rango de esta propiedad no existe en el sistema. editing_prohibited = Esta propiedad no está configurado actualmente para prohibir la edición. confirm_entry_deletion_from = ¿Está seguro de que desea eliminar la siguiente entrada del @@ -740,6 +741,7 @@ custom_template_containing_content = Plantilla personalizada que contiene todo e a_menu_page = Esta es una página de menú menu_item_name = Menu Nombre del artículo if_blank_page_title_used = Si se deja en blanco, se utilizará el título de la página. +multiple_content_default_template_error = Con varios tipos de contenido , debe especificar una plantilla personalizada . label = etiqueta no_classes_to_select = No hay clases en el sistema desde el cual elegir. @@ -862,3 +864,5 @@ view_labels_capitalized = Ver etiquetas view_labels_for = Ver Etiquetas de select_an_existing_document = Seleccione un documento existente + +datetime_year_required = Intervalos de fecha / hora deben empezar por un año. Ingrese una Fecha de inicio, un fin de año o los dos. diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/DateTimeIntervalValidationVTwo.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/DateTimeIntervalValidationVTwo.java index aa3ca0ed6..ae87a397c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/DateTimeIntervalValidationVTwo.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/DateTimeIntervalValidationVTwo.java @@ -27,6 +27,7 @@ public class DateTimeIntervalValidationVTwo implements N3ValidatorVTwo { private String startFieldName; private String endFieldName; + private String templateName; private String startValueName; private String endValueName; @@ -43,6 +44,16 @@ public class DateTimeIntervalValidationVTwo implements N3ValidatorVTwo { endPrecisionName = endFieldName + "-precision"; } + public DateTimeIntervalValidationVTwo(String startFieldName, String endFieldName, String template){ + this.templateName = template; + this.startFieldName = startFieldName; + this.endFieldName = endFieldName; + startValueName = startFieldName + "-value"; + endValueName = endFieldName + "-value"; + startPrecisionName = startFieldName + "-precision"; + endPrecisionName = endFieldName + "-precision"; + } + public Map validate(EditConfigurationVTwo editConfig, MultiValueEditSubmission editSub) { Map> existingLiterals = editConfig.getLiteralsInScope(); @@ -63,8 +74,13 @@ public class DateTimeIntervalValidationVTwo implements N3ValidatorVTwo { // errors.put(startFieldName, "If there is an end date, there should be a start date"); // return errors; // } - - + // We need to ensure that the user has entered a start year or end year -- tlw72 + if ( templateName != null && templateName.equals("dateTimeIntervalForm.ftl")) { + if ( literalListIsNull(formStartYear) && literalListIsNull(formEndYear) ) { + errors.put(startFieldName, "Date/time intervals must begin with a year. Please enter a start year, an end year or both."); + return errors; + } + } //Assuming form start year and form end year are working in conjunction with multiple values int index; if (!literalListIsNull(formStartYear) && !literalListIsNull(formEndYear)) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/DateTimeIntervalFormGenerator.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/DateTimeIntervalFormGenerator.java index 22c8fcb5c..7daa9743c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/DateTimeIntervalFormGenerator.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/DateTimeIntervalFormGenerator.java @@ -92,7 +92,7 @@ public class DateTimeIntervalFormGenerator extends conf.addField(startField); conf.addField(endField); //Need to add validators - conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); + conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField","dateTimeIntervalForm.ftl")); //Adding additional data, specifically edit mode addFormSpecificData(conf, vreq); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java index 8235202a6..866ea5404 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java @@ -20,6 +20,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.Property; import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup; import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance; +import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; @@ -292,6 +293,14 @@ public class GroupedPropertyList extends BaseTemplateModel { } else if (op.getRangeVClassURI() == null) { return (piOp.getRangeVClassURI() != null); } else { + //Check and see if the range vclass exists for the possible piOp and populated op properties, + //because for populated properties, if the range class is a union, + //blank nodes will be broken and the code should instead use the existing or piOp range class uri + VClass piOpRangeClass = wadf.getVClassDao().getVClassByURI(piOp.getRangeVClassURI()); + VClass opRangeClass = wadf.getVClassDao().getVClassByURI(op.getRangeVClassURI()); + //if the possible range class exists but the populated one does not, then return true to allow the possible + //class to be utilized + if(piOpRangeClass != null && opRangeClass == null) return true; return (wadf.getVClassDao().isSubClassOf( piOp.getRangeVClassURI(), op.getRangeVClassURI())); } diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties index 818c27c4a..0fce78764 100644 --- a/webapp/web/i18n/all.properties +++ b/webapp/web/i18n/all.properties @@ -875,4 +875,6 @@ selection_in_process = Your selection is being processed. view_labels_capitalized = View Labels view_labels_for = View Labels for -select_an_existing_document = Select an existing document \ No newline at end of file +select_an_existing_document = Select an existing document + +datetime_year_required = Date/time intervals must begin with a year. Enter either a Start Year, an End Year or both. \ No newline at end of file diff --git a/webapp/web/templates/freemarker/edit/forms/dateTimeIntervalForm.ftl b/webapp/web/templates/freemarker/edit/forms/dateTimeIntervalForm.ftl index c7139c5c6..f61c42b61 100644 --- a/webapp/web/templates/freemarker/edit/forms/dateTimeIntervalForm.ftl +++ b/webapp/web/templates/freemarker/edit/forms/dateTimeIntervalForm.ftl @@ -58,7 +58,7 @@ <#if htmlForElements?keys?seq_contains("endField")> ${i18n().end_capitalized}  ${htmlForElements["endField"]} - + *${i18n().datetime_year_required}

@@ -69,8 +69,7 @@

-${stylesheets.add('', - '')} +${stylesheets.add('')} ${scripts.add('', '')} \ No newline at end of file