Package lumis.portal.el
Class PortalFunctionMapper
- java.lang.Object
-
- lumis.portal.el.PortalFunctionMapper
-
- All Implemented Interfaces:
FunctionMapper
,IExtendedFunctionMapper
- Direct Known Subclasses:
PageWebResourceFunctionMapper
public class PortalFunctionMapper extends Object implements IExtendedFunctionMapper
Portal general EL function mapper.Resolves EL functions to be available in any portal context.
- Since:
- 5.6.0
- Version:
- $Revision: 21880 $ $Date: 2018-09-21 17:07:19 -0300 (Fri, 21 Sep 2018) $
-
-
Constructor Summary
Constructors Constructor Description PortalFunctionMapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterEvaluation()
Performs any needed operations after the evaluation happens.void
beforeEvaluation()
Performs any initialization needed before the evaluation is performed.static String
concat(Object[] objects)
Concatenates the strings.static String
encodeURL(String[] args)
Encodes
the given string to be used in URLs.static String
escapeJs(String stringToEscape)
Escape a string to be used in JavaScript.static String
escapeXml(String stringToEscape)
Escape a string to be used in XMLstatic String
localize(String[] args)
Resolves the string.protected static String
localize(IResource baseResource, String[] args)
Resolves the string.protected static String
localize(IResource baseResource, PageWebResource pwr, String[] args)
Resolves the string.protected static String
processLocalizationParameters(String[] args)
Adds all parameters to the localization stringMethod
resolveFunction(String prefix, String methodName)
-
-
-
Method Detail
-
localize
public static String localize(String[] args) throws PortalException
Resolves the string.- Parameters:
args
- the localize function parameters.
1. First argument is the identifier of the string to be localized.
2. Second argument is optional, and is a list of resource paths separated by ';' to be included in the localization.
3+. Any extra argument will be considered a localization parameter.- Returns:
- localized string.
- Throws:
PortalException
- if an error occur localizing the string.- Since:
- 5.6.0
-
localize
protected static String localize(IResource baseResource, String[] args) throws PortalException
Resolves the string.- Parameters:
baseResource
- TheIResource
to useargs
- the localize function parameters.
1. First argument is the identifier of the string to be localized.
2. Second argument is optional, and is a list of resource paths separated by ';' to be included in the localization.
3+. Any extra argument will be considered a localization parameter.- Returns:
- localized string.
- Throws:
PortalException
- if an error occur localizing the string.- Since:
- 9.0.0
-
localize
protected static String localize(IResource baseResource, PageWebResource pwr, String[] args) throws PortalException
Resolves the string.- Parameters:
baseResource
- TheIResource
to useargs
- the localize function parameters.
1. First argument is the identifier of the string to be localized.
2. Second argument is the web resource to be considered for localization (theme localization requires this).
3. Third argument is optional, and is a list of resource paths separated by ';' to be included in the localization.
4+. Any extra argument will be considered a localization parameter.- Returns:
- localized string.
- Throws:
PortalException
- if an error occur localizing the string.- Since:
- 11.0.0
-
processLocalizationParameters
protected static String processLocalizationParameters(String[] args)
Adds all parameters to the localization string- Parameters:
args
- the array with the localization string, resource and parameters- Returns:
- the localization string with all parameters, ready to be sent to the
ILocalizationManager.localize(String, IResource)
- Since:
- 9.0.0
-
resolveFunction
public Method resolveFunction(String prefix, String methodName)
- Specified by:
resolveFunction
in interfaceFunctionMapper
-
beforeEvaluation
public void beforeEvaluation()
Performs any initialization needed before the evaluation is performed.- Since:
- 7.0.0
-
afterEvaluation
public void afterEvaluation()
Performs any needed operations after the evaluation happens. It should be called infinally
.- Since:
- 7.0.0
-
escapeJs
public static String escapeJs(String stringToEscape)
Escape a string to be used in JavaScript.- Parameters:
stringToEscape
- The string to escape.- Returns:
- The escaped string
- Since:
- 8.1.0
-
escapeXml
public static String escapeXml(String stringToEscape)
Escape a string to be used in XML- Parameters:
stringToEscape
- The string to escape.- Returns:
- The escaped string
- Since:
- 8.1.0
-
concat
public static String concat(Object[] objects) throws PortalException
Concatenates the strings.- Parameters:
objects
- the objects to get the string value and concatenate, in order.- Returns:
- The strings concatenated.
- Throws:
PortalException
- Since:
- 8.2.0
-
encodeURL
public static String encodeURL(String[] args) throws UnsupportedEncodingException
Encodes
the given string to be used in URLs. The String to be encoded is the first position ofargs
. The parameterargs
must have one or two positions. If it has one position, thenUTF-8
will be used as the charset when encoding. If it has two positions, then the string in the second position will be used as charset when encoding.- Parameters:
args
- the arguments.- Returns:
- the encoded String
- Throws:
UnsupportedEncodingException
- Since:
- 9.0.0
-
-