Package com.day.cq.wcm.api.components
Interface Component
-
- All Superinterfaces:
Adaptable,LabeledResource
- All Known Subinterfaces:
VirtualComponent
public interface Component extends Adaptable, LabeledResource
Defines a CQ5 Component. Note: for performance reasons, most of the component data is provided using the underlying system component. in order to check whether a user has access to a component,isAccessible()should be called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetCellName()Returns the cell name of this component.ComponentEditConfiggetChildEditConfig()Returns the child edit config of this component or the one of it's super component.java.lang.StringgetComponentGroup()Returns the name of the component group.ComponentEditConfiggetDeclaredChildEditConfig()Returns the child edit config of this componentComponentEditConfiggetDeclaredEditConfig()Returns the edit config of this componentjava.lang.StringgetDefaultView()Returns the default view for this componentjava.lang.StringgetDesignDialogPath()Returns the design dialog path of this component or of an inherited one.ComponentEditConfiggetDesignEditConfig(java.lang.String cellName)Returns the design edit config for the given cell namejava.lang.StringgetDialogPath()Returns the dialog path of this component or of an inherited one.ComponentEditConfiggetEditConfig()Returns the edit config of this component or the one of it's super component.java.util.Map<java.lang.String,java.lang.String>getHtmlTagAttributes()Returns additional tag attributes that are added to the surrounding html tag.java.lang.StringgetIconPath()Returns the path to an icon for this component ornullif the component does not provide an icon.java.lang.String[]getInfoProviders()Returns a collection of info provider names that are configured for this page-level component.ResourcegetLocalResource(java.lang.String name)Finds the resource with the given name that is stored "in" this component.ValueMapgetProperties()Returns thepropertiesof this Component.java.lang.StringgetResourceType()Returns the resource type to be used for this component.ComponentgetSuperComponent()Returns the super component if the super resource type is defined and points to a valid component.java.lang.StringgetTemplatePath()Returns the path to the template for the component's content.java.lang.StringgetThumbnailPath()Returns the path to a thumbnail for this component ornullif the component does not provide a thumbnail.java.util.Collection<VirtualComponent>getVirtualComponents()Returns a collection of virtual components that are configured for this component.booleanisAccessible()Checks if this component is accessible, i.e.booleanisAnalyzable()Checks if this component is analyzable.booleanisContainer()Checks if this component is a container component.booleanisDesignable()Checks if this component is designable.booleanisEditable()Checks if this component is editable.booleannoDecoration()Checks if this component does not need decoration when included.-
Methods inherited from interface com.day.cq.commons.LabeledResource
getDescription, getName, getPath, getTitle
-
-
-
-
Method Detail
-
isAccessible
boolean isAccessible()
Checks if this component is accessible, i.e. if the current session can access the underlying resource.- Returns:
trueif the component is accessible.- Since:
- 5.4
-
getCellName
java.lang.String getCellName()
Returns the cell name of this component. If the cell name is an empty string is returned, the wcm request filter will not create a new edit context.- Returns:
- the cell name
-
isEditable
boolean isEditable()
Checks if this component is editable. This is the case if it defines or inherits a dialog- Returns:
trueif the component is editable.
-
isDesignable
boolean isDesignable()
Checks if this component is designable. This is the case if it defines or inherits a design dialog- Returns:
trueif the component is designable.
-
isContainer
boolean isContainer()
Checks if this component is a container component. For example a paragraph system component. Container components affect the cell name generation of included resources where the cell name of the respective component is used instead of the name of the addressed resource.- Returns:
trueif this component is a container.
-
isAnalyzable
boolean isAnalyzable()
Checks if this component is analyzable. This is the case if it defines an analytics node.- Returns:
trueif the component is analyzable.
-
noDecoration
boolean noDecoration()
Checks if this component does not need decoration when included.- Returns:
trueif this component does not need decoration when included.
-
getDialogPath
java.lang.String getDialogPath()
Returns the dialog path of this component or of an inherited one. Please note, that inheriting a dialog is not always desirable, since (currently) the resource type is defined as hidden field in the dialog. so extending a component without defining an own dialog would result in content having the base component's resource type.- Returns:
- the dialog path or
null
-
getDesignDialogPath
java.lang.String getDesignDialogPath()
Returns the design dialog path of this component or of an inherited one.- Returns:
- the design dialog path or
null
-
getIconPath
java.lang.String getIconPath()
Returns the path to an icon for this component ornullif the component does not provide an icon. If this component does not define a path the one of the super component is returned. Note: the path is a webapp relative URL. eg: /docroot/c1.gif- Returns:
- the path to an icon or
null
-
getThumbnailPath
java.lang.String getThumbnailPath()
Returns the path to a thumbnail for this component ornullif the component does not provide a thumbnail. If this component does not define a path the one of the super component is returned. Note: the path is a webapp relative URL. eg: /docroot/c1.gif- Returns:
- the path to a thumbnail or
null
-
getComponentGroup
java.lang.String getComponentGroup()
Returns the name of the component group. This is merely informational for dialogs that want to group the components.- Returns:
- the name of the component group or
nullif not defined.
-
getProperties
ValueMap getProperties()
Returns thepropertiesof this Component.- Returns:
- the component properties
-
getDeclaredEditConfig
ComponentEditConfig getDeclaredEditConfig()
Returns the edit config of this component- Returns:
- the edit config or
nullif not available
-
getDeclaredChildEditConfig
ComponentEditConfig getDeclaredChildEditConfig()
Returns the child edit config of this component- Returns:
- the child edit config or
nullif not available
-
getEditConfig
ComponentEditConfig getEditConfig()
Returns the edit config of this component or the one of it's super component.- Returns:
- the edit config or
nullif not available
-
getChildEditConfig
ComponentEditConfig getChildEditConfig()
Returns the child edit config of this component or the one of it's super component.- Returns:
- the edit config or
nullif not available
-
getDesignEditConfig
ComponentEditConfig getDesignEditConfig(java.lang.String cellName)
Returns the design edit config for the given cell name- Parameters:
cellName- name of the cell- Returns:
- the design edit config
-
getHtmlTagAttributes
java.util.Map<java.lang.String,java.lang.String> getHtmlTagAttributes()
Returns additional tag attributes that are added to the surrounding html tag.- Returns:
- map of additional tag attributes.
-
getSuperComponent
Component getSuperComponent()
Returns the super component if the super resource type is defined and points to a valid component.- Returns:
- the super component or
null
-
getResourceType
java.lang.String getResourceType()
Returns the resource type to be used for this component. this is usually the path of this component without the first path segment, but can be overridden by setting the "sling:resourceType".- Returns:
- the resource type
-
getLocalResource
Resource getLocalResource(java.lang.String name)
Finds the resource with the given name that is stored "in" this component. If the resource cannot be found, the super component is asked. This is usually used in image scripts that need to load additional images.- Parameters:
name- name of the resource- Returns:
- resource or null
-
getVirtualComponents
java.util.Collection<VirtualComponent> getVirtualComponents()
Returns a collection of virtual components that are configured for this component.- Returns:
- a collection of virtual components.
-
getDefaultView
java.lang.String getDefaultView()
Returns the default view for this component- Returns:
- the default view or
nullis not defined.
-
getTemplatePath
java.lang.String getTemplatePath()
Returns the path to the template for the component's content.- Returns:
- path to the template for the component's content.
nullif not defined
-
getInfoProviders
java.lang.String[] getInfoProviders()
Returns a collection of info provider names that are configured for this page-level component.- Returns:
- the provider names
-
-