Class DateTimeWithPrecisionVTwo

  • All Implemented Interfaces:
    EditElementVTwo

    public class DateTimeWithPrecisionVTwo
    extends BaseEditElementVTwo
    This is intended to work in conjunction with a template to create the HTML for a datetime with precision and to convert the submitted parameters into varname -> Literal and varname -> URI maps. The variables that get passed to the template are defined in: DateTimeWithPrecision.getMapForTemplate() Two variables will be defined for the N3 edit graphs (These are NOT variables passed to FM templates): $fieldname.precision - URI of datetime precision $fieldname.value - DateTime literal
    • Constructor Detail

      • DateTimeWithPrecisionVTwo

        public DateTimeWithPrecisionVTwo​(FieldVTwo field)
      • DateTimeWithPrecisionVTwo

        public DateTimeWithPrecisionVTwo​(FieldVTwo field,
                                         String minimumPrecisionURI,
                                         String displayRequiredLevelUri)
    • Method Detail

      • getLiterals

        public Map<String,​List<org.apache.jena.rdf.model.Literal>> getLiterals​(String fieldName,
                                                                                     EditConfigurationVTwo editConfig,
                                                                                     Map<String,​String[]> queryParameters)
        This gets the literals for a submitted form from the queryParmeters. It will only be called if getValidationErrors() doesn't return any errors.
      • getDateTime

        protected org.apache.jena.rdf.model.Literal getDateTime​(Map<String,​String[]> queryParameters)
      • getSubmittedPrecision

        protected String getSubmittedPrecision​(Map<String,​String[]> queryParameters)
                                        throws Exception
        Precision is based on the values returned by the form. Throws an exception with the error message if the queryParameters cannot make a valid date/precision because there are values missing.
        Throws:
        Exception
      • setRequiredMinimumPrecision

        public void setRequiredMinimumPrecision​(VitroVocabulary.Precision requiredMinimumPrecision)
      • getValueVariableName

        public String getValueVariableName()
      • getPrecisionVariableName

        public String getPrecisionVariableName()