Class TranslateTerm

java.lang.Object
byps.BValueClass
de.elo.ix.client.ValueClass
de.elo.ix.client.TranslateTerm
All Implemented Interfaces:
Serializable

public class TranslateTerm extends ValueClass implements Serializable
Objects of this class represent one term in different languages.
Since:
7.00.000.000
See Also:
  • Field Details

    • guid

      protected String guid
      GUID
    • deleted

      protected boolean deleted
      True, if this entry is logically deleted.
    • tStamp

      protected String tStamp
      Last modified. ISO date with seaparator "." measured in UTC.
    • termLangs

      protected String[] termLangs
      Term in its languages. The Term termLangs[i] is in Language langs[i]. If a translation does not exist, the corresponding termLangs[.] is an empty string.
      See Also:
    • langs

      protected String[] langs
      The languages of the terms in termLangs. Each of the items have to be a language tag of a registered language. Otherwise, the corresponding term in termLangs is ignored in IXServicePortIF.checkinTranslateTerms(ClientInfo, TranslateTerm[], LockZ). The constant TranslateTermC.DEFAULT_LANGUAGES contains the initially registered languages.

      To read all registered Languages:

       
       TranslateTerm ttR = conn.ix().checkoutTranslateTerms(new String[] {TranslateTermC.GUID_SYSTEM_LANGUAGES}, LockC.NO)[0];
       String[] langs = ttR.getLangs();
       
       

      The List of registered languages can be overwritten by:

       
       TranslateTerm tt = new TranslateTerm();
       tt.setGuid( TranslateTermC.GUID_SYSTEM_LANGUAGES );
       tt.setLangs( langs );
       conn.ix().checkinTranslateTerms( new TranslateTerm[] {tt}, LockC.NO );
       
       
      In an array of TranslateTerm objects returned in FindResult or returned by checkoutTranslateTerm, all objects share the same array langs.
      See Also:
    • tStampSync

      protected String tStampSync
      Timestamp of this object's last export by the replication.
      Since:
      9.99.009.001
    • translationKey

      protected String translationKey
      Optional language independent translation key. This value must match the regular expression TranslateTermC.TRANSLATION_KEY_REGEX.
      Since:
      9.00.018.008
    • level

      protected int level
      Priority level of this entry.
      Since:
      21.02.000.005
    • packageName

      protected String packageName
      Configuration package.
      Since:
      21.02.000.005
  • Constructor Details

    • TranslateTerm

      public TranslateTerm()
      Constructor
    • TranslateTerm

      public TranslateTerm(TranslateTerm rhs)
      Copy constructor
      Parameters:
      rhs -
    • TranslateTerm

      public TranslateTerm(TranslateTerm rhs, String[] retLangs, boolean disableFallback)
      Copy constructor that copies only the given languages.
      Parameters:
      rhs - Source object
      retLangs - Languages to copy
      disableFallback - If there is no translation for a language, do not assing the term of the default language.
  • Method Details

    • fromSystemLanguages

      public static TranslateTerm fromSystemLanguages(String[] langs)
      Create special TranslateTerm object for storing system languages.
      Parameters:
      langs - System languages
      Returns:
      Term object
    • getLanguageWithoutCountry

      public static String getLanguageWithoutCountry(String language)
      Get language code without country code. Language code and country code must be separated by hyphen.
      Parameters:
      language - Language optionally inclusive country, e.g. de-CH
      Returns:
      language without country, e.g. de
    • getGuid

      public String getGuid()
    • setGuid

      public void setGuid(String guid)
    • isDeleted

      public boolean isDeleted()
    • setDeleted

      public void setDeleted(boolean deleted)
    • getTStamp

      public String getTStamp()
    • setTStamp

      public void setTStamp(String stamp)
    • getTermLangs

      public String[] getTermLangs()
    • setTermLangs

      public void setTermLangs(String[] termLangs)
    • getTermOfLang

      public String getTermOfLang(int langIndex)
      Get term of given language index.
      Parameters:
      langIndex - language index in langs
      Returns:
      term or empty string if langIndex is invalid
    • setTermOfLang

      public void setTermOfLang(String term, int langIndex)
      Set term of given language index.
      Parameters:
      term - term to be set
      langIndex - language index in langs
    • getTermOfLang

      public String getTermOfLang(String lang)
      Get term of language.
      Parameters:
      lang - One of the languages in langs
      Returns:
      term or empty string if lang is not found in langs
    • setTermOfLang

      public void setTermOfLang(String term, String lang)
      Set term of language.
      Parameters:
      term - term
      lang - One of the languages in langs
    • isEmpty

      public boolean isEmpty()
      Return true if this object contains no translations.
      Returns:
      true if termLangs is empty or all items are empty.
    • getLangs

      public String[] getLangs()
    • setLangs

      public void setLangs(String[] langs)
    • getTStampSync

      public String getTStampSync()
    • setTStampSync

      public void setTStampSync(String stampSync)
    • getTranslationKey

      public String getTranslationKey()
    • setTranslationKey

      public void setTranslationKey(String translationKey)
    • getLevel

      public int getLevel()
    • setLevel

      public void setLevel(int level)
    • getPackageName

      public String getPackageName()
    • setPackageName

      public void setPackageName(String packageName)
    • toString

      public String toString()
      Overrides:
      toString in class Object