Class PropDB

java.lang.Object
sk.iway.iwcm.i18n.PropDB

public class PropDB extends Object
PropDB.java
  • Constructor Details

    • PropDB

      protected PropDB()
  • Method Details

    • save

      @Deprecated public static void save(IwayProperties iwprop, String lng, String addPrefix, String filterPrefix, boolean onlyNewKeys)
      Deprecated.
      - use version with Identity user parameter
      Metoda spravi insert/update do customizovanych properties, ak v danom jazyku uz je v db dany kluc spravi sa update ak tam taky kluc nie je, spravi sa insert
      Parameters:
      iwprop -
      lng -
      addPrefix - - prida zadany prefix na zaciatok kluca
      filterPrefix - - ulozi iba kluce zacinajuce na tento prefix
      onlyNewKeys - - ak je true, a ak uz taky kluc existuje, nevykona sa update
    • save

      public static void save(Identity user, IwayProperties iwprop, String lng, String addPrefix, String filterPrefix, boolean onlyNewKeys)
      Metoda spravi insert/update do customizovanych properties, ak v danom jazyku uz je v db dany kluc spravi sa update ak tam taky kluc nie je, spravi sa insert
      Parameters:
      user - - aktualne prihlaseny pouzivatel
      iwprop -
      lng -
      addPrefix - - prida zadany prefix na zaciatok kluca
      filterPrefix - - ulozi iba kluce zacinajuce na tento prefix
      onlyNewKeys - - ak je true, a ak uz taky kluc existuje, nevykona sa update
    • filterByPerms

      public static List<String> filterByPerms(Identity user, List<String> propList)
      Odfiltruje zoznam textovych klucov podla nastaveni konstanty propertiesEnabledKeys a prav usera (na neobmedzene zobrazenie textov)
      Parameters:
      user -
      propList -
      Returns:
    • filterByPerms

      public static Map<String,String> filterByPerms(Identity user, Map<String,String> propList)
    • isKeyVisibleToUser

      public static boolean isKeyVisibleToUser(Identity user, String[] enabledKeys, String key)
    • canEdit

      public static boolean canEdit(Identity user, String key)
      Overi, ci pouzivatel moze upravit dany kluc
      Parameters:
      user -
      key -
      Returns:
    • escapeUnsafeValue

      public static String escapeUnsafeValue(Identity user, String lng, String key, String newValue)
      Riesi problem s HTML kodom v prekladovych textoch. Ak pouzivatel nema pravo na zobrazenie vsetkych prekladovych textov vykona escape specialnych znakov na entitu. Povolene su len vybrane HTML tagy a vybrane atributy priklad (povoleny): Toto je XSS pokus xss priklad (escapnuty): Toto je XSS pokus");alert(1)
      Parameters:
      user -
      lng -
      key -
      newValue -
      Returns: