Class PropertiesRestController

java.lang.Object
sk.iway.iwcm.rest.RestController
sk.iway.iwcm.rest.PropertiesRestController

@RestController public class PropertiesRestController extends RestController
PropertiesController.java

Return text properties in given language by prefix, or exact match
Possible languages: sk, cz, en, de, pl, hu, cho, ru, esp
  • Constructor Details

    • PropertiesRestController

      public PropertiesRestController()
  • Method Details

    • getKeysWithPrefix

      @RequestMapping(path="/rest/properties/{lng}/{prefix:.+}", method=GET) public Map<String,String> getKeysWithPrefix(javax.servlet.http.HttpServletRequest request, @PathVariable String lng, @PathVariable String prefix)
      Returns list of pairs: text property key and text property value, in given language starting with given prefix.

      Example:

      URL - /rest/properties/sk/components.abtesting
      Returned pairs:
      components.abtesting.dialog_title = AB testovanie
      components.abtesting.allowed = AB testovanie povolene
      components.abtesting.ratio = Pomer
      components.abtesting.variantName = Nazov varianty
      components.abtesting.example = Priklad
      Parameters:
      request -
      lng - property language
      prefix - starting property key string for required property
      Returns:
      list of pairs: text property key and text property value
    • getKeysWithPrefixWithoutIpValidation

      public Map<String,String> getKeysWithPrefixWithoutIpValidation(javax.servlet.http.HttpServletRequest request, String lng, String prefix)
    • getKey

      @RequestMapping(path="/rest/property/{lng}/{key:.+}/**", method=GET) public Map.Entry<String,String> getKey(javax.servlet.http.HttpServletRequest request, @PathVariable String key, @PathVariable String lng)
      Returns pair property key - property value by property language and exact property key.
      If property contains variables: {0}, {1}, {2}, ..., it is possible to fill them with additional path variables.

      Examples:

      1)
      Property key (in slovak) - converter.number.invalidNumber
      Property value - Hodnota ({1}) v poli {0} musi byt cislo
      URL - /rest/property/sk/converter.number.invalidNumber/4/test
      Returned property value - Hodnota (test) v poli 4 musi byt cislo

      2)
      Property key (in slovak) - calendar.invitation.saveok-A
      Property value - Dakujeme za akceptovanie schodzky.
      URL - /rest/property/sk/calendar.invitation.saveok-A
      Returned property value - Dakujeme za akceptovanie schodzky.
      Parameters:
      request -
      key - property key
      lng - property language
      Returns:
      pair of text property key and text property value