com.day.cq.wcm.api.components
Interface Component

All Superinterfaces:
org.apache.sling.api.adapter.Adaptable, LabeledResource
All Known Subinterfaces:
VirtualComponent
All Known Implementing Classes:
ComponentImpl, VirtualComponentImpl

public interface Component
extends org.apache.sling.api.adapter.Adaptable, LabeledResource

Defines a CQ5 Component


Method Summary
 String getCellName()
          Returns the cell name of this component.
 ComponentEditConfig getChildEditConfig()
          Returns the child edit config of this component or the one of it's super component.
 String getComponentGroup()
          Returns the name of the component group.
 ComponentEditConfig getDeclaredChildEditConfig()
          Returns the child edit config of this component
 ComponentEditConfig getDeclaredEditConfig()
          Returns the edit config of this component
 String getDesignDialogPath()
          Returns the design dialog path of this component or of an inherited one.
 ComponentEditConfig getDesignEditConfig(String cellName)
          Returns the design edit config for the given cell name
 String getDialogPath()
          Returns the dialog path of this component or of an inherited one.
 ComponentEditConfig getEditConfig()
          Returns the edit config of this component or the one of it's super component.
 Map<String,String> getHtmlTagAttributes()
          Returns additional tag attributes that are added to the surrounding html tag.
 String getIconPath()
          Returns the path to an icon for this component or null if the component does not provide an icon.
 org.apache.sling.api.resource.Resource getLocalResource(String name)
          Finds the resource with the given name that is stored "in" this component.
 org.apache.sling.api.resource.ValueMap getProperties()
          Returns the properties of this Component.
 String getResourceType()
          Returns the resource type to be used for this component.
 Component getSuperComponent()
          Returns the super component if the super resource type is defined and points to a valid component.
 String getThumbnailPath()
          Returns the path to a thumbnail for this component or null if the component does not provide a thumbnail.
 Collection<VirtualComponent> getVirtualComponents()
          Returns a collection of virtual components that are configured for this component.
 boolean isContainer()
          Checks if this component is a container component.
 boolean isDesignable()
          Checks if this component is designable.
 boolean isEditable()
          Checks if this component is editable.
 boolean noDecoration()
          Checks if this component does not need decoration when included.
 
Methods inherited from interface org.apache.sling.api.adapter.Adaptable
adaptTo
 
Methods inherited from interface com.day.cq.commons.LabeledResource
getDescription, getName, getPath, getTitle
 

Method Detail

getCellName

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:
true if 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:
true if 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:
true if this component is a container.

noDecoration

boolean noDecoration()
Checks if this component does not need decoration when included.

Returns:
true if this component does not need decoration when included.

getDialogPath

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

String getDesignDialogPath()
Returns the design dialog path of this component or of an inherited one.

Returns:
the design dialog path or null

getIconPath

String getIconPath()
Returns the path to an icon for this component or null if 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

String getThumbnailPath()
Returns the path to a thumbnail for this component or null if 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

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 null if not defined.

getProperties

org.apache.sling.api.resource.ValueMap getProperties()
Returns the properties of this Component.

Returns:
the component properties

getDeclaredEditConfig

ComponentEditConfig getDeclaredEditConfig()
Returns the edit config of this component

Returns:
the edit config or null if not available

getDeclaredChildEditConfig

ComponentEditConfig getDeclaredChildEditConfig()
Returns the child edit config of this component

Returns:
the child edit config or null if 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 null if 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 null if not available

getDesignEditConfig

ComponentEditConfig getDesignEditConfig(String cellName)
Returns the design edit config for the given cell name

Parameters:
cellName - name of the cell
Returns:
the design edit config

getHtmlTagAttributes

Map<String,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

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

org.apache.sling.api.resource.Resource getLocalResource(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

Collection<VirtualComponent> getVirtualComponents()
Returns a collection of virtual components that are configured for this component.

Returns:
a collection of virtual components.


Copyright © 2008 Day Management AG. All Rights Reserved.