Class CmsDynamicFunctionParser


  • public class CmsDynamicFunctionParser
    extends java.lang.Object
    The parser class for creating dynamic function beans from XML contents.

    • Method Detail

      • getLocaleToUse

        protected java.util.Locale getLocaleToUse​(CmsObject cms,
                                                  CmsXmlContent xmlContent)
        Gets the locale to use for parsing the dynamic function.

        Parameters:
        cms - the current CMS context
        xmlContent - the xml content from which the dynamic function should be read
        Returns:
        the locale from which the dynamic function should be read
      • getString

        protected java.lang.String getString​(CmsObject cms,
                                             I_CmsXmlContentValueLocation location)
        Gets the string value of an XML content location.

        Parameters:
        cms - the current CMS context
        location - an XML content location
        Returns:
        the string value of that XML content location
      • getStringValue

        protected java.lang.String getStringValue​(CmsObject cms,
                                                  I_CmsXmlContentValueLocation location,
                                                  java.lang.String defaultValue)
        Converts a (possibly null) content value location to a string.

        Parameters:
        cms - the current CMS context
        location - the content value location
        defaultValue - the value to return if the location is null
        Returns:
        the string value of the content value location
      • parseFunctionBean

        protected CmsDynamicFunctionBean parseFunctionBean​(CmsObject cms,
                                                           I_CmsXmlContentLocation location,
                                                           CmsResource functionRes,
                                                           CmsResource functionFormatter)
        Parses a dynamic function bean.

        Parameters:
        cms - the current CMS context
        location - the location from which to parse the dynamic function bean
        functionRes - the dynamic function resource
        functionFormatter - the function formatter resource
        Returns:
        the parsed dynamic function bean
      • parseParameter

        protected CmsPair<java.lang.String,​java.lang.String> parseParameter​(CmsObject cms,
                                                                                  I_CmsXmlContentValueLocation valueLocation)
        Parses a request parameter for the JSP from the XML content.

        Parameters:
        cms - the current CMS context
        valueLocation - the location from which to parse the parameter
        Returns:
        the parsed parameter key/value pair
      • parseParameters

        protected java.util.Map<java.lang.String,​java.lang.String> parseParameters​(CmsObject cms,
                                                                                         I_CmsXmlContentLocation location,
                                                                                         java.lang.String name)
        Parses all parameters for the JSP from the XML content.

        Parameters:
        cms - the current CMS context
        location - the location from which to read the parameters
        name - the name of the tag from which to read the parameters
        Returns:
        the parsed map of parameters
      • parseSettings

        protected java.util.Map<java.lang.String,​CmsXmlContentPropertyparseSettings​(CmsObject cms,
                                                                                            I_CmsXmlContentLocation location,
                                                                                            CmsResource functionResource)
        Parses the settings for the dynamic function from the XML content.

        Parameters:
        cms - the current CMS context
        location - the location from which to read the dynamic function settings
        functionResource - the dynamic function resource
        Returns:
        the parsed map of settings for the dynamic function