Package sk.iway.iwcm.rest
Class PropertiesRestController
java.lang.Object
sk.iway.iwcm.rest.RestController
sk.iway.iwcm.rest.PropertiesRestController
PropertiesController.java
Return text properties in given language by prefix, or exact match
Possible languages: sk, cz, en, de, pl, hu, cho, ru, esp
Return text properties in given language by prefix, or exact match
Possible languages: sk, cz, en, de, pl, hu, cho, ru, esp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns pair property key - property value by property language and exact property key.getKeysWithPrefix
(javax.servlet.http.HttpServletRequest request, String lng, String prefix) Returns list of pairs: text property key and text property value, in given language starting with given prefix.getKeysWithPrefixWithoutIpValidation
(javax.servlet.http.HttpServletRequest request, String lng, String prefix) Methods inherited from class sk.iway.iwcm.rest.RestController
isIpAddressAllowed
-
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 languageprefix
- starting property key string for required property- Returns:
- list of pairs: text property key and text property value
-
getKeysWithPrefixWithoutIpValidation
-
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 keylng
- property language- Returns:
- pair of text property key and text property value
-