Class CmsTemplatePlugin
java.lang.Object
org.opencms.ade.configuration.plugins.CmsTemplatePlugin
Bean representing a template plugin.
Template plugins are links to external resources which are categorized into named groups and provided either by formatters of elements in the current page, or by the current sitemap configuration. They can be programmatically accessed by group name from the template. They also have an order attribute to control the order in which they wil be returned (plugins will be sorted by descending order).
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCmsTemplatePlugin
(CmsLinkInfo target, String group, int order, String origin, Map<String, String> attributes) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the configured attributes of the plugin.getGroup()
Gets the plugin group.int
getOrder()
Returns the plugin order.The plugin origin, for debugging purposes.Gets the plugin target.static List<CmsTemplatePlugin>
parsePlugins
(CmsObject cms, I_CmsXmlContentLocation parent, String subName) Parses the template plugins.toString()
-
Field Details
-
N_ATTRIBUTE
Attribute node name.- See Also:
-
N_GROUP
Content value node name.- See Also:
-
N_KEY
Key node name.- See Also:
-
N_ORDER
Content value node name.- See Also:
-
N_TARGET
XML node name.- See Also:
-
N_VALUE
Value node name.- See Also:
-
-
Constructor Details
-
CmsTemplatePlugin
public CmsTemplatePlugin(CmsLinkInfo target, String group, int order, String origin, Map<String, String> attributes) Creates a new instance.- Parameters:
target
- the plugin targetgroup
- the plugin grouporder
- the plugin orderorigin
- the origin from which the plugin was read (for debugging)attributes
- the attribute map
-
-
Method Details
-
parsePlugins
public static List<CmsTemplatePlugin> parsePlugins(CmsObject cms, I_CmsXmlContentLocation parent, String subName) Parses the template plugins.- Parameters:
cms
- the CMS contextparent
- the parent location under which the template plugins are locatedsubName
- the node name for the template plugins- Returns:
- the list of parsed template plugins
-
getAttributes
Gets the configured attributes of the plugin.- Returns:
- the plugin attributes
-
getGroup
Gets the plugin group.- Returns:
- the plugin group
-
getOrder
Returns the plugin order.Plugins are sorted by descending order when retrieved in the template.
- Returns:
- the plugin order
-
getOrigin
The plugin origin, for debugging purposes.- Returns:
- the plugin origin
-
getTarget
Gets the plugin target.When the plugins for a given group are retrieved, duplicate targets will be removed, and the position of each target in the resulting list is decided by the highest order for that target.
- Returns:
- the target
-
toString
-