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 java.lang.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 java.lang.String
concat(java.lang.Object[] objects)
Concatenates the strings.static java.lang.String
encodeURL(java.lang.String[] args)
Encodes
the given string to be used in URLs.static java.lang.String
escapeJs(java.lang.String stringToEscape)
Escape a string to be used in JavaScript.static java.lang.String
escapeXml(java.lang.String stringToEscape)
Escape a string to be used in XMLstatic java.lang.String
localize(java.lang.String[] args)
Resolves the string.protected static java.lang.String
localize(IResource baseResource, java.lang.String[] args)
Resolves the string.protected static java.lang.String
localize(IResource baseResource, PageWebResource pwr, java.lang.String[] args)
Resolves the string.protected static java.lang.String
processLocalizationParameters(java.lang.String[] args)
Adds all parameters to the localization stringjava.lang.reflect.Method
resolveFunction(java.lang.String prefix, java.lang.String methodName)
-
-
-
Method Detail
-
localize
public static java.lang.String localize(java.lang.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 java.lang.String localize(IResource baseResource, java.lang.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 java.lang.String localize(IResource baseResource, PageWebResource pwr, java.lang.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 java.lang.String processLocalizationParameters(java.lang.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 java.lang.reflect.Method resolveFunction(java.lang.String prefix, java.lang.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 java.lang.String escapeJs(java.lang.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 java.lang.String escapeXml(java.lang.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 java.lang.String concat(java.lang.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 java.lang.String encodeURL(java.lang.String[] args) throws java.io.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:
java.io.UnsupportedEncodingException
- Since:
- 9.0.0
-
-