Package org.mycore.common.xsl
Class MCRParameterCollector
java.lang.Object
org.mycore.common.xsl.MCRParameterCollector
Collects parameters used in XSL transformations, by copying them from
MCRConfiguration, from the HTTP and MyCoRe session, from request attributes etc.
- Author:
- Frank Lützenkirchen
-
Constructor Summary
ConstructorDescriptionCollects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set.MCRParameterCollector
(boolean onlySetXSLParameters) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set.MCRParameterCollector
(jakarta.servlet.http.HttpServletRequest request) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set.MCRParameterCollector
(jakarta.servlet.http.HttpServletRequest request, boolean onlySetXSLParameters) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set. -
Method Summary
Modifier and TypeMethodDescriptionstatic MCRParameterCollector
getParameter
(String name, String defaultValue) Returns the parameter with the given nameReturns the parameter map.int
hashCode()
void
setParameter
(String name, Object value) Sets the parameter with the given namevoid
setParameters
(Map<String, String> param) Sets all parameters from the given mapvoid
setParametersTo
(Transformer transformer) Sets XSL parameters for the given transformer by taking them from the properties object provided.
-
Constructor Details
-
MCRParameterCollector
public MCRParameterCollector(jakarta.servlet.http.HttpServletRequest request) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set. First, all configuration properties from MCRConfiguration are copied. Second, those variables stored in the HTTP session, that start with "XSL." are copied. Next, variables stored in the MCRSession are copied. Next, HTTP request parameters are copied. Only those parameters starting with "XSL." are copied from session and request,- Parameters:
request
- the HttpRequest causing the XSL transformation, must NOT be null
-
MCRParameterCollector
public MCRParameterCollector(jakarta.servlet.http.HttpServletRequest request, boolean onlySetXSLParameters) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set. First, all configuration properties from MCRConfiguration are copied. Second, those variables stored in the HTTP session, that start with "XSL." are copied. Next, variables stored in the MCRSession are copied. Next, HTTP request parameters are copied. Next, HTTP request attributes are copied.- Parameters:
request
- the HttpRequest causing the XSL transformation, must NOT be nullonlySetXSLParameters
- if true, only those parameters starting with "XSL." are copied from session and request
-
MCRParameterCollector
public MCRParameterCollector()Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set. First, all configuration properties from MCRConfiguration are copied. Next, those variables stored in the MCRSession that start with "XSL." are copied. -
MCRParameterCollector
public MCRParameterCollector(boolean onlySetXSLParameters) Collects parameters The collecting of parameters is done in steps, each step may overwrite parameters that already have been set. First, all configuration properties from MCRConfiguration are copied. Next, those variables stored in the MCRSession are copied.- Parameters:
onlySetXSLParameters
- if true, only those parameters starting with "XSL." are copied from session
-
-
Method Details
-
setParameter
Sets the parameter with the given name -
setParameters
Sets all parameters from the given map -
getParameter
Returns the parameter with the given name -
getParameterMap
Returns the parameter map. -
setParametersTo
Sets XSL parameters for the given transformer by taking them from the properties object provided.- Parameters:
transformer
- the Transformer object thats parameters should be set
-
getInstanceFromUserSession
-
hashCode
public int hashCode()
-