Class CmsTemplatePlugin
- java.lang.Object
-
- org.opencms.ade.configuration.plugins.CmsTemplatePlugin
-
public class CmsTemplatePlugin extends java.lang.Object
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
Fields Modifier and Type Field Description static java.lang.String
N_ATTRIBUTE
Attribute node name.static java.lang.String
N_GROUP
Content value node name.static java.lang.String
N_KEY
Key node name.static java.lang.String
N_ORDER
Content value node name.static java.lang.String
N_TARGET
XML node name.static java.lang.String
N_VALUE
Value node name.
-
Constructor Summary
Constructors Constructor Description CmsTemplatePlugin(CmsLinkInfo target, java.lang.String group, int order, java.lang.String origin, java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
getAttributes()
Gets the configured attributes of the plugin.java.lang.String
getGroup()
Gets the plugin group.int
getOrder()
Returns the plugin order.java.lang.String
getOrigin()
The plugin origin, for debugging purposes.CmsLinkInfo
getTarget()
Gets the plugin target.static java.util.List<CmsTemplatePlugin>
parsePlugins(CmsObject cms, I_CmsXmlContentLocation parent, java.lang.String subName)
Parses the template plugins.java.lang.String
toString()
-
-
-
Field Detail
-
N_ATTRIBUTE
public static final java.lang.String N_ATTRIBUTE
Attribute node name.- See Also:
- Constant Field Values
-
N_GROUP
public static final java.lang.String N_GROUP
Content value node name.- See Also:
- Constant Field Values
-
N_KEY
public static final java.lang.String N_KEY
Key node name.- See Also:
- Constant Field Values
-
N_ORDER
public static final java.lang.String N_ORDER
Content value node name.- See Also:
- Constant Field Values
-
N_TARGET
public static final java.lang.String N_TARGET
XML node name.- See Also:
- Constant Field Values
-
N_VALUE
public static final java.lang.String N_VALUE
Value node name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsTemplatePlugin
public CmsTemplatePlugin(CmsLinkInfo target, java.lang.String group, int order, java.lang.String origin, java.util.Map<java.lang.String,java.lang.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 Detail
-
parsePlugins
public static java.util.List<CmsTemplatePlugin> parsePlugins(CmsObject cms, I_CmsXmlContentLocation parent, java.lang.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
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Gets the configured attributes of the plugin.- Returns:
- the plugin attributes
-
getGroup
public java.lang.String getGroup()
Gets the plugin group.- Returns:
- the plugin group
-
getOrder
public int getOrder()
Returns the plugin order.Plugins are sorted by descending order when retrieved in the template.
- Returns:
- the plugin order
-
getOrigin
public java.lang.String getOrigin()
The plugin origin, for debugging purposes.- Returns:
- the plugin origin
-
getTarget
public CmsLinkInfo 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-