Class MCRParameterCollector

java.lang.Object
org.mycore.common.xsl.MCRParameterCollector

public class MCRParameterCollector extends Object
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 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 null
      onlySetXSLParameters - 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

      public void setParameter(String name, Object value)
      Sets the parameter with the given name
    • setParameters

      public void setParameters(Map<String,String> param)
      Sets all parameters from the given map
    • getParameter

      public String getParameter(String name, String defaultValue)
      Returns the parameter with the given name
    • getParameterMap

      public Map<String,Object> getParameterMap()
      Returns the parameter map.
    • setParametersTo

      public void setParametersTo(Transformer transformer)
      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

      public static MCRParameterCollector getInstanceFromUserSession()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object