Class InputDTZ

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Arrangeable, Badgeable, ValueValidator, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

The class implements an Input field to work with date, time and time zone. It's possible configure the field to show only components you want.
See Also:
GCApi:
component
  • Field Details

    • RANGE_DATE_FROM

      public static final String RANGE_DATE_FROM
      See Also:
    • RANGE_DATE_TO

      public static final String RANGE_DATE_TO
      See Also:
    • RANGE_TIME_FROM

      public static final String RANGE_TIME_FROM
      See Also:
    • RANGE_TIME_TO

      public static final String RANGE_TIME_TO
      See Also:
    • RANGE_TIME_FULL

      public static final String RANGE_TIME_FULL
      See Also:
    • _componentDate

      protected boolean _componentDate
    • _componentTime

      protected boolean _componentTime
    • _componentZone

      protected boolean _componentZone
    • _menuhourrange

      protected String _menuhourrange
    • _menuminuterange

      protected String _menuminuterange
    • _menuminutestep

      protected String _menuminutestep
    • _constrainedHours

      protected boolean _constrainedHours
    • _constrainedMinutes

      protected boolean _constrainedMinutes
    • _msgConstraintsError

      protected String _msgConstraintsError
    • _hourSystem

      protected String _hourSystem
    • _range

      protected String _range
    • _accept00

      protected boolean _accept00
    • _accept24

      protected boolean _accept24
    • _zonename

      protected ForeignField _zonename
    • _zonevalue

      protected String _zonevalue
    • _mergename

      protected ForeignField _mergename
    • SDF_DATE_READ

      public static final String SDF_DATE_READ
      standard date format accepted as read input (see SimpleDateFormat and setSDFDREAD(s) )
      See Also:
    • SDF_DATE_WRITE

      public static final String SDF_DATE_WRITE
      standard date format accepted as write input (see SimpleDateFormat and setSDFDREAD(s) )
      See Also:
    • SDF_TIME

      public static final String SDF_TIME
      standard time format accepted as input (see SimpleDateFormat and setSDFT(s) )
      See Also:
    • _sSdfT

      protected String _sSdfT
    • _sSdfDRead

      protected String _sSdfDRead
    • _sSdfDWrite

      protected String _sSdfDWrite
    • _msgMonthsList

      protected String _msgMonthsList
    • _msgShortMonthsList

      protected String _msgShortMonthsList
    • _msgDaysList

      protected String _msgDaysList
    • _dayTypes

      protected String _dayTypes
    • _firstDayOfWeek

      protected String _firstDayOfWeek
    • _regexpD

      protected String _regexpD
    • _regexpT

      protected String _regexpT
    • _iconTimePicker

      protected Icon _iconTimePicker
    • _iconDatePicker

      protected Icon _iconDatePicker
    • _sizeD

      protected String _sizeD
    • _sizeT

      protected String _sizeT
    • _maxlengthD

      protected String _maxlengthD
    • _maxlengthT

      protected String _maxlengthT
    • _autoevent

      protected String _autoevent
    • _autoeventparam

      protected String _autoeventparam
    • _autoeventmsg

      protected String _autoeventmsg
    • _autoeventanchor

      protected String _autoeventanchor
    • _placeholderD

      protected String _placeholderD
    • _placeholderT

      protected String _placeholderT
    • _titleD

      protected String _titleD
    • _titleT

      protected String _titleT
    • _titleZ

      protected String _titleZ
    • ariaDescriptionD

      protected String ariaDescriptionD
    • ariaDescriptionT

      protected String ariaDescriptionT
    • ariaDescriptionZ

      protected String ariaDescriptionZ
    • _msgD

      protected String _msgD
    • _msgT

      protected String _msgT
    • _msgT2

      protected String _msgT2
    • _to

      protected String _to
    • _toName

      protected String _toName
    • _from

      protected String _from
    • _fromName

      protected String _fromName
    • _msgErroreRange

      protected String _msgErroreRange
  • Constructor Details

    • InputDTZ

      public InputDTZ()
      Creates a new instance of InputDTZ
  • Method Details

    • parseZoneValue

      protected static TimeZone parseZoneValue(String zone, Component c)
    • setINTERVAL

      public void setINTERVAL(String interval)
      Sets the interval in minutes for the time picker dropdown. This determines the granularity of time selection in the picker.
      Parameters:
      interval - String representation of the interval value in minutes
      Throws:
      NumberFormatException - if the provided string cannot be parsed as an integer
    • getINTERVAL

      public int getINTERVAL()
      Gets the current interval setting for the time picker.
      Returns:
      The interval value in minutes
    • setCOMPONENTS

      public void setCOMPONENTS(String s)
      Set the components to show in field. The possible components are date, time and time zone.
      Parameters:
      s - The string that contains the combination of the three characters to use to configure which components to display:
      • 'd': date;
      • 't': time;
      • 'z': time zone.
      The order of the characters in the string is not deterministic.
    • setZONEVALUE

      public void setZONEVALUE(String zonevalue)
      Set the time zone component. The value to be set must exists or in the package within company.properties or within the time zone database of IANA.
      Parameters:
      zonevalue - The string that contains the value of time zone to set.
    • setZONENAME

      public void setZONENAME(String zonename)
      Set the name of the field to use as time zone field. So the field having this attribute is not time zone component, instead the field having the name passed as a parameter must be a time zone field.
      Parameters:
      zonename - The string that indicate the name of field to use as time zone settings.
    • setMERGENAME

      public void setMERGENAME(String mergename)
      Set the name of the other field to combine for create an unique value to send to the server. Obviously the fields must be different components. For example is possible use this attribute in a field with the time component to indicate a field with the date component so as to combine the two values togheter.
      Parameters:
      mergename - The string that indicate the name of field to use as merge.
    • setMENUHOURRANGE

      public void setMENUHOURRANGE(String s)
      Sets the range of hours that can be set for the time
      Parameters:
      s - The string that determines a range using the from-to format or separating the possible values using commas
    • setMENUMINUTERANGE

      public void setMENUMINUTERANGE(String s)
      Sets the range of minutes that can be set for the time
      Parameters:
      s - the string that determines a range using the from-to format or separating the possible values using commas
    • setMENUMINUTESTEP

      public void setMENUMINUTESTEP(String s)
      Sets the step for the creation of the minutes item in the picker; determines which values are acceptable for minutes
      Parameters:
      s - Possible values are: 30 (means that the minutes can be :00 or :30), 15 (means that the minutes can be :00, :15, :30 or :45), 10(means that the minutes can be :00, :10, :20, :30, :40, :50) and 5 (means that the minutes can be :00, :05, :10, :15, :20, :25, :30, :35, :40, :45, :50, :55); if the value is not among these, it will be forced to 5
    • setRANGE

      public void setRANGE(String s)
      Set the field as a part of a time range. It can be an interval of hours or dates. If the field is used as part of a range of dates, the time component of field is not be displayed. Same thing with the date component in case the field is a part of a time range.
      Parameters:
      s - String to define which type of range you are defining. Below are the allowed values:
      • "DATE_FROM": set the start of the date range. If the date isn't set, it is automatically set to DATE_MIN
      • "DATE_TO": set the end of the date range. If the date isn't set, it is automatically set to DATE_MAX
      • "TIME_FROM": set the start of the time range. If the time isn't set, it is automatically set to TIME_MIN
      • "TIME_TO": set the end of the time range. If the time isn't set, it is automatically set to TIME_MAX
      • "FULL": set the range as date and hour passed.
    • setAUTOEVENTANCHOR

      public void setAUTOEVENTANCHOR(String s)
      Defines the name of the anchor that is used to reposition the scrolling of the page following the execution of the autoevent associated with the Input. The name must correspond to the value of a reference attribute of a Grid or a Section, set using the appropriate set methods (Grid.setREF(String), Section.setREF(String)).
      The relocation mechanism works only with non-Ajax events, the ones that reload the page.
      Parameters:
      s - The name of the anchor
    • setAUTOEVENT

      public void setAUTOEVENT(String s)
      Set an event on the field that is launched when the field lose the focus.
      Parameters:
      s - Name of the event to launch when the field lose the focus.
    • setAUTOEVENTPARAM

      public void setAUTOEVENTPARAM(String s)
      Set the value that will be passed to the hash getter as a parameter when the autoevent is triggered. The key of the value into hash getter will be "param"
      Parameters:
      s - Value passed to the hash getter as a parameter
    • setAUTOEVENTMSG

      public void setAUTOEVENTMSG(String s)
      Set the message that will appear into a javascript pop up when the autoevent is triggered.
      Parameters:
      s - Message to show into the javascript pop up.
    • setSDFDREAD

      public void setSDFDREAD(String s)
      Set the date format will be sent to server with submit of the field (see SimpleDateFormat). If it isn't set the default value is the value of the key "DATE_FORMAT_READ" in dictionary. If this also does not exits, set the format with the default value: ""dd/MM/yy""
      Parameters:
      s - The string of the date format.
    • setSDFDWRITE

      public void setSDFDWRITE(String s)
      Set the date format to show in the field or accepted if the user enter the value manually (see SimpleDateFormat). If it isn't set the default value is the value of the key "DATE_FORMAT_WRITE" in dictionary. If this also does not exits, set the format with the default value: ""dd/MM/yyyy""
      Parameters:
      s - The string of the date format.
    • setSDFT

      public void setSDFT(String s)
      Set the time format to show in the field or accepted if the user enter the value manually, and time format will be sent to server with submit of the field (see SimpleDateFormat). If it isn't set the default value is ""HH:mm"".
      Parameters:
      s - The string of the time format.
    • setFIRSTDAYOFWEEK

      public void setFIRSTDAYOFWEEK(String s)
      Set what day is the first of the week when user open the calendar. The default day is monday.
      Parameters:
      s - Character to set the first day of the week (case insensitive). The possible value are:
      • "m": Monday;
      • "s": Sunday.
    • setPLACEHOLDERD

      public void setPLACEHOLDERD(String s)
      Set the placeholder for the date component.
      Parameters:
      s - String that will be set as placeholder. It's translated.
    • setPLACEHOLDERT

      public void setPLACEHOLDERT(String s)
      Set the placeholder for the time component.
      Parameters:
      s - String that will be set as placeholder. It's translated.
    • setTITLE

      public void setTITLE(String s)
      Set for all the components the string that appears when you move over the field with mouse. The string is translated.
      Overrides:
      setTITLE in class Control
      Parameters:
      s - String that will be set as title.
    • setTITLED

      public void setTITLED(String s)
      Set for the date component the string that appears when you move over the field with mouse. The string is translated.
      Parameters:
      s - String that will be set as title.
    • setTITLET

      public void setTITLET(String s)
      Set for the time component the string that appears when you move over the field with mouse. The string is translated.
      Parameters:
      s - String that will be set as title.
    • setTITLEZ

      public void setTITLEZ(String s)
      Set for the time zone component the string that appears when you move over the field with mouse. The string is translated.
      Parameters:
      s - String that will be set as title.
    • setARIADESCRIPTION

      public void setARIADESCRIPTION(String s)
      Set for all the components the aria-description attribute.
      Overrides:
      setARIADESCRIPTION in class Control
      Parameters:
      s - String that will be set as aria-descrioption attribute.
    • setARIADESCRIPTIOND

      public void setARIADESCRIPTIOND(String s)
      Set for the date component the aria-description attribute.
      Parameters:
      s - String that will be set as aria-descrioption attribute.
    • setARIADESCRIPTIONT

      public void setARIADESCRIPTIONT(String s)
      Set for the time component the aria-description attribute.
      Parameters:
      s - String that will be set as aria-descrioption attribute.
    • setARIADESCRIPTIONZ

      public void setARIADESCRIPTIONZ(String s)
      Set for the time zone component the aria-description attribute.
      Parameters:
      s - String that will be set as aria-descrioption attribute.
    • setFROM

      public void setFROM(String s)
      Set a minimum constraint in the field with a date component. It is a inclusive limit.
      Parameters:
      s - String with the value to set as limit. It is possible insert a string in the format "dd/MM/yyyy" or the string "now" to indicate the current date as limit.
    • setTO

      public void setTO(String s)
      Set a maximum constraint in the field with a date component. It is a inclusive limit.
      Parameters:
      s - String with the value to set as limit. It is possible insert a string in the format "dd/MM/yyyy" or the string "now" to indicate the current date as limit.
    • setFROMNAME

      public void setFROMNAME(String s)
      Indicate the name of the field to use as "from" constraint.
      Parameters:
      s - Name of the field to use
    • setTONAME

      public void setTONAME(String s)
      Indicate the name of the field to use as "to" constraint.
      Parameters:
      s - Name of the field to use
    • setSIZED

      public void setSIZED(String s)
      Sets the html size attribute of the date component
      Parameters:
      s - The size attribute expressed in number of characters
    • setSIZET

      public void setSIZET(String s)
      Sets the html size attribute of the time component
      Parameters:
      s - The size attribute expressed in number of characters
    • setZoneValue

      public void setZoneValue(String zonevalue)
      Set the time zone component. The value to be set must exists or in the package within company.properties or within the time zone database of IANA.
      Parameters:
      zonevalue - The string that contains the value of time zone to set.
    • isComponentDateActive

      public boolean isComponentDateActive()
      Gets if the date component is active or not.
      Returns:
      true if the date component is active, false otherwise.
    • isComponentTimeActive

      public boolean isComponentTimeActive()
      Gets if the time component is active or not.
      Returns:
      true if the time component is active, false otherwise.
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Input
    • setupTimeFormat

      protected void setupTimeFormat()
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is created.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • getZoneName

      protected ForeignField getZoneName()
    • registerValidators

      protected void registerValidators()
      Overrides:
      registerValidators in class Input
    • registerZoneValidators

      protected void registerZoneValidators()
    • getVisibleDescriptionHtml

      protected org.apache.ecs.Element getVisibleDescriptionHtml(Object generationhandle, EntitySet es)
      Overrides:
      getVisibleDescriptionHtml in class Input
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Override the method getContentHtml(generationhandle, es). It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts.
      Specified by:
      getContentHtml in interface Arrangeable
      Overrides:
      getContentHtml in class Input
      Parameters:
      generationhandle - the unique generating handle
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the input field or null if the field don't have a graphical representation
    • addDateContentHtml

      protected void addDateContentHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.html.TR tr, boolean ro, boolean enabled, String style)
    • addTimeContentHtml

      protected void addTimeContentHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.html.TR tr, boolean ro, boolean enabled, String style)
    • addZoneContentHtml

      protected void addZoneContentHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.html.TR tr, boolean ro, boolean enabled, String style)
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Override the method getHiddenHtml(generationhandle, es). Before to return hidden html, set the active components of the InputDTZ element.
      Specified by:
      getHiddenHtml in interface Arrangeable
      Overrides:
      getHiddenHtml in class Input
      Parameters:
      generationhandle - the unique generating handle
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the hidden part of the field or null if the field is visible.
    • addDateHiddenHtml

      protected void addDateHiddenHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.ElementContainer ec)
    • addTimeHiddenHtml

      protected void addTimeHiddenHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.ElementContainer ec)
    • addZoneHiddenHtml

      protected void addZoneHiddenHtml(Object generationhandle, EntitySet es, TimeZone z, org.apache.ecs.ElementContainer ec)
    • validateDate

      protected void validateDate(org.apache.ecs.html.Input i, EntitySet es, boolean ro, String from, String to)
    • validateTime

      protected void validateTime(org.apache.ecs.html.Input i, EntitySet es, boolean ro)
    • validateZone

      protected void validateZone(org.apache.ecs.html.Select sel, boolean ro)
    • prepareName

      protected String prepareName()
      Overrides:
      prepareName in class Input
    • prepareValueD

      protected String prepareValueD(TimeZone tz)
    • prepareValueT

      protected String prepareValueT(TimeZone tz)
    • staticValue

      protected Date staticValue(TimeZone tz)
    • formatNowValue

      protected String formatNowValue(String value, TimeZone zone)
    • prepareValueZ

      protected TimeZone prepareValueZ()
    • getOreList

      protected String getOreList()
    • getMinList

      protected String getMinList()
    • setTitle

      public void setTitle(String s)
      Set the string for all the components that appears when you move over the field with mouse. The string is not translate and the change is notified to trigger an ajax event that refresh the component.
      Overrides:
      setTitle in class Control
      Parameters:
      s - The string to set as title.
    • setTitleD

      public void setTitleD(String s)
      Set the string for the date component that appears when you move over the field with mouse. The string is not translate and the change is notified to trigger an ajax event that refresh the component.
      Parameters:
      s - The string to set as title.
    • setTitleT

      public void setTitleT(String s)
      Set the string for the time component that appears when you move over the field with mouse. The string is not translate and the change is notified to trigger an ajax event that refresh the component.
      Parameters:
      s - The string to set as title.
    • setTitleZ

      public void setTitleZ(String s)
      Set the string for the time zone component that appears when you move over the field with mouse. The string is not translate and the change is notified to trigger an ajax event that refresh the component.
      Parameters:
      s - The string to set as title.
    • validateConcreteValue

      protected void validateConcreteValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Overrides:
      validateConcreteValue in class Input
      Throws:
      ValidationException
    • getDefaultValue

      public Object getDefaultValue()
      Description copied from class: Input
      Gets the default value set for this component.
      The default value of the component is the value set for the attribute value into the xml. See Input.setVALUE(String)
      Overrides:
      getDefaultValue in class Input
      Returns:
      The default value set for this component
    • setModelProperties

      public void setModelProperties(@NotNull @NotNull DataAttribute dataAttribute)
      Description copied from interface: overit.geocall.ux.edm.ModelConfigurable
      Sets the model properties based on the provided DataAttribute.
      Specified by:
      setModelProperties in interface overit.geocall.ux.edm.ModelConfigurable
      Overrides:
      setModelProperties in class Input
      Parameters:
      dataAttribute - a non-null DataAttribute used to set model properties