Package org.opencms.xml.containerpage
Class CmsDynamicFunctionParser
java.lang.Object
org.opencms.xml.containerpage.CmsDynamicFunctionParser
The parser class for creating dynamic function beans from XML contents.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<CmsDynamicFunctionBean.Format>
getAdditionalFormats
(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes) Parses all the additional formats from the XML content.protected CmsResource
Gets the function formatter resource, possibly from the cache.protected Locale
getLocaleToUse
(CmsObject cms, CmsXmlContent xmlContent) Gets the locale to use for parsing the dynamic function.protected CmsDynamicFunctionBean.Format
getMainFormat
(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes) Parses the main format from the XML content.protected String
getString
(CmsObject cms, I_CmsXmlContentValueLocation location) Gets the string value of an XML content location.protected String
getStringValue
(CmsObject cms, I_CmsXmlContentValueLocation location, String defaultValue) Converts a (possibly null) content value location to a string.protected CmsDynamicFunctionBean.Format
parseAdditionalFormat
(CmsObject cms, I_CmsXmlContentValueLocation location, CmsResource functionRes) Parses an additional format from the XML content.parseFunctionBean
(CmsObject cms, CmsResource res) Parses a dynamic function bean given a resource.parseFunctionBean
(CmsObject cms, CmsXmlContent content) Parses a dynamic function bean from an in-memory XML content object.protected CmsDynamicFunctionBean
parseFunctionBean
(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes, CmsResource functionFormatter) Parses a dynamic function bean.parseParameter
(CmsObject cms, I_CmsXmlContentValueLocation valueLocation) Parses a request parameter for the JSP from the XML content.parseParameters
(CmsObject cms, I_CmsXmlContentLocation location, String name) Parses all parameters for the JSP from the XML content.protected CmsXmlContentProperty
parseProperty
(CmsObject cms, I_CmsXmlContentLocation field) Helper method for parsing a settings definition.protected Map<String,
CmsXmlContentProperty> parseSettings
(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionResource) Parses the settings for the dynamic function from the XML content.
-
Field Details
-
N_CONTAINER_SETTINGS
The node name for the formatter settings.- See Also:
-
-
Constructor Details
-
CmsDynamicFunctionParser
public CmsDynamicFunctionParser()
-
-
Method Details
-
parseFunctionBean
Parses a dynamic function bean given a resource.- Parameters:
cms
- the current CMS contextres
- the resource from which to read the dynamic function- Returns:
- the dynamic function bean created from the resource
- Throws:
CmsException
- if something goes wrong
-
parseFunctionBean
public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsXmlContent content) throws CmsException Parses a dynamic function bean from an in-memory XML content object.- Parameters:
cms
- the current CMS contextcontent
- the XML content from which to read the dynamic function bean- Returns:
- the dynamic function bean read from the XML content
- Throws:
CmsException
- if something goes wrong
-
getAdditionalFormats
protected List<CmsDynamicFunctionBean.Format> getAdditionalFormats(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes) Parses all the additional formats from the XML content.- Parameters:
cms
- the current CMS contextlocation
- the location from which to parse the additional formatsfunctionRes
- the dynamic function resource- Returns:
- the list of parsed formats
-
getFunctionFormatter
Gets the function formatter resource, possibly from the cache.- Parameters:
cms
- the current CMS context- Returns:
- the function formatter resource
- Throws:
CmsException
- if something goes wrong
-
getLocaleToUse
Gets the locale to use for parsing the dynamic function.- Parameters:
cms
- the current CMS contextxmlContent
- the xml content from which the dynamic function should be read- Returns:
- the locale from which the dynamic function should be read
-
getMainFormat
protected CmsDynamicFunctionBean.Format getMainFormat(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes) Parses the main format from the XML content.- Parameters:
cms
- the current CMS contextlocation
- the location from which to parse main formatfunctionRes
- the dynamic function resource- Returns:
- the parsed main format
-
getString
Gets the string value of an XML content location.- Parameters:
cms
- the current CMS contextlocation
- an XML content location- Returns:
- the string value of that XML content location
-
getStringValue
protected String getStringValue(CmsObject cms, I_CmsXmlContentValueLocation location, String defaultValue) Converts a (possibly null) content value location to a string.- Parameters:
cms
- the current CMS contextlocation
- the content value locationdefaultValue
- the value to return if the location is null- Returns:
- the string value of the content value location
-
parseAdditionalFormat
protected CmsDynamicFunctionBean.Format parseAdditionalFormat(CmsObject cms, I_CmsXmlContentValueLocation location, CmsResource functionRes) Parses an additional format from the XML content.- Parameters:
cms
- the current CMS contextlocation
- the location from which to parse the additional formatfunctionRes
- the dynamic function resource- Returns:
- the additional format
-
parseFunctionBean
protected CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionRes, CmsResource functionFormatter) Parses a dynamic function bean.- Parameters:
cms
- the current CMS contextlocation
- the location from which to parse the dynamic function beanfunctionRes
- the dynamic function resourcefunctionFormatter
- the function formatter resource- Returns:
- the parsed dynamic function bean
-
parseParameter
protected CmsPair<String,String> parseParameter(CmsObject cms, I_CmsXmlContentValueLocation valueLocation) Parses a request parameter for the JSP from the XML content.- Parameters:
cms
- the current CMS contextvalueLocation
- the location from which to parse the parameter- Returns:
- the parsed parameter key/value pair
-
parseParameters
protected Map<String,String> parseParameters(CmsObject cms, I_CmsXmlContentLocation location, String name) Parses all parameters for the JSP from the XML content.- Parameters:
cms
- the current CMS contextlocation
- the location from which to read the parametersname
- the name of the tag from which to read the parameters- Returns:
- the parsed map of parameters
-
parseProperty
Helper method for parsing a settings definition.- Parameters:
cms
- the current CMS contextfield
- the node from which to read the settings definition- Returns:
- the parsed setting definition
-
parseSettings
protected Map<String,CmsXmlContentProperty> parseSettings(CmsObject cms, I_CmsXmlContentLocation location, CmsResource functionResource) Parses the settings for the dynamic function from the XML content.- Parameters:
cms
- the current CMS contextlocation
- the location from which to read the dynamic function settingsfunctionResource
- the dynamic function resource- Returns:
- the parsed map of settings for the dynamic function
-