Class InputLanguage

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

@Component @Configurable public class InputLanguage extends Input
This component provides the possibility to manage the translation of a field's value over several languages. The set of languages are defined in the company.lang configuration. NB: the languages (except the default) must have the tableSuffix attribute to assign the values of each translation to the correct data model field.

For example, having this company configuration:


  company.lang=it
  company.lang.it.label=Italian
  company.lang.it.ianaCode=it
  company.lang=en-US
  company.lang.en-US.label=English
  company.lang.en-US.name=en-US
  company.lang.en-US.tableSuffix=_EN
  company.lang.en-US.ianaCode=en
  company.lang=es-ES
  company.lang.es-ES.label=Spanish
  company.lang.es-ES.name=es-ES
  company.lang.es-ES.tableSuffix=_ES
  company.lang.es-ES.ianaCode=es
  
and a form containing a InputLanguage like this

  <InputLanguage name="HOBBY" label="Hobby" />
  
the parameters passed inside a submit action will be:
  • HOBBY
  • HOBBY_EN
  • HOBBY_ES
See Also:
GCApi:
component
  • Constructor Details

    • InputLanguage

      public InputLanguage()
  • Method Details

    • setup

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

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

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. 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 handle of the generation
      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
    • getVisibleDescriptionHtml

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

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. It returns the hidden but active html part of an hidden input field.
      Specified by:
      getHiddenHtml in interface Arrangeable
      Overrides:
      getHiddenHtml in class Input
      Parameters:
      generationhandle - The handle of the generation
      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.
    • hasTranslation

      protected boolean hasTranslation()
      This method is used decide if either display or not the translations menu.
      Returns:
      true if the menu shoul be displayed, false otherwise.
    • setupAutocomplete

      protected void setupAutocomplete(org.apache.ecs.html.Input i, boolean ro)
      Overrides:
      setupAutocomplete in class Input
    • getName

      protected ForeignField getName(Lang lang)
    • prepareName

      protected String prepareName(Lang lang)
    • prepareValue

      protected String prepareValue(Lang lang)
    • 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
    • validateConcreteValue

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

      protected void validateInputMenu(org.apache.ecs.html.Input i, boolean ro, Lang lang)