Package lumis.portal.page
Class PageWebResourceFunctionMapper
- java.lang.Object
-
- lumis.portal.el.PortalFunctionMapper
-
- lumis.portal.page.PageWebResourceFunctionMapper
-
- All Implemented Interfaces:
FunctionMapper
,IExtendedFunctionMapper
- Direct Known Subclasses:
ServiceContainerRequestFunctionMapper
public class PageWebResourceFunctionMapper extends PortalFunctionMapper
FunctionMapper
that resolves the functions inPageWebResource
context.- Since:
- 7.0.0
- Version:
- $Revision: 24195 $ $Date: 2020-10-22 11:39:20 -0300 (Thu, 22 Oct 2020) $
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
BEFORE_WRITE_FUNCTION_NAME
Define the before write function name.
-
Constructor Summary
Constructors Constructor Description PageWebResourceFunctionMapper(PageWebResource pageWebResource, HttpServletRequest request)
Creates a new instance with the given parameters.
-
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
localize(String[] args)
Resolves the string.Method
resolveFunction(String prefix, String localName)
static String
resolveURL(String url)
Resolves the given URL.
The URL will only be resolved against the applied themes if the requested page was previously set withinbeforeEvaluation()
.static String
writeIfNotYetWritten(String fragment, String key)
Returns the given fragment if the given key was not used yet.-
Methods inherited from class lumis.portal.el.PortalFunctionMapper
concat, encodeURL, escapeJs, escapeXml, localize, localize, processLocalizationParameters
-
-
-
-
Field Detail
-
BEFORE_WRITE_FUNCTION_NAME
protected static final String BEFORE_WRITE_FUNCTION_NAME
Define the before write function name.- Since:
- 7.0.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PageWebResourceFunctionMapper
public PageWebResourceFunctionMapper(PageWebResource pageWebResource, HttpServletRequest request)
Creates a new instance with the given parameters.- Parameters:
pageWebResource
- the page web resource.- Since:
- 7.0.0
-
-
Method Detail
-
beforeEvaluation
public void beforeEvaluation()
Description copied from class:PortalFunctionMapper
Performs any initialization needed before the evaluation is performed.- Overrides:
beforeEvaluation
in classPortalFunctionMapper
-
afterEvaluation
public void afterEvaluation()
Description copied from class:PortalFunctionMapper
Performs any needed operations after the evaluation happens. It should be called infinally
.- Overrides:
afterEvaluation
in classPortalFunctionMapper
-
resolveFunction
public Method resolveFunction(String prefix, String localName)
- Specified by:
resolveFunction
in interfaceFunctionMapper
- Overrides:
resolveFunction
in classPortalFunctionMapper
-
resolveURL
public static String resolveURL(String url) throws PortalException
Resolves the given URL.
The URL will only be resolved against the applied themes if the requested page was previously set withinbeforeEvaluation()
.- Parameters:
url
- the URL to be resolved.- Returns:
- the resolved URL.
- Throws:
PortalException
- Since:
- 7.0.0
-
writeIfNotYetWritten
public static String writeIfNotYetWritten(String fragment, String key) throws IOException
Returns the given fragment if the given key was not used yet. Otherwise returnsnull
.- Parameters:
fragment
- the fragment to be rendered in before writer.key
- the unique key to use.- Throws:
IOException
- Since:
- 7.0.0
-
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:
- 11.0.0
-
-