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: 25003 $ $Date: 2022-05-12 11:09:19 -0300 (Thu, 12 May 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.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 java.lang.String
localize(java.lang.String[] args)
Resolves the string.java.lang.reflect.Method
resolveFunction(java.lang.String prefix, java.lang.String localName)
static java.lang.String
resolveURL(java.lang.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 java.lang.String
writeIfNotYetWritten(java.lang.String fragment, java.lang.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 java.lang.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 java.lang.reflect.Method resolveFunction(java.lang.String prefix, java.lang.String localName)
- Specified by:
resolveFunction
in interfaceFunctionMapper
- Overrides:
resolveFunction
in classPortalFunctionMapper
-
resolveURL
public static java.lang.String resolveURL(java.lang.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 java.lang.String writeIfNotYetWritten(java.lang.String fragment, java.lang.String key) throws java.io.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:
java.io.IOException
- Since:
- 7.0.0
-
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:
- 11.0.0
-
-