Class ResponsiveGrid
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- com.day.cq.wcm.foundation.model.responsivegrid.ResponsiveGrid
-
- All Implemented Interfaces:
ComponentExporter
,ContainerExporter
,ResponsiveGridExporter
,Adaptable
,Resource
@Model(adaptables=SlingHttpServletRequest.class, adapters={ResponsiveGrid.class,ComponentExporter.class}, defaultInjectionStrategy=OPTIONAL, resourceType="wcm/foundation/components/responsivegrid") public class ResponsiveGrid extends AbstractResource implements ResponsiveGridExporter
Sling model for the Responsive grid component. A Responsive grid component provides access to its columns and generates a set of specific responsive data.
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
-
-
Constructor Summary
Constructors Constructor Description ResponsiveGrid()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getAppliedCssClasses()
Returns the style system information associated with the current grid.java.util.Map<java.lang.String,java.lang.String>
getColumnClassNames()
int
getColumnCount()
java.util.Collection<? extends ResponsiveColumn>
getColumns()
java.lang.String
getCssClass()
Deprecated.<T extends Resource>
TgetEffectiveResource()
AllowedComponentsExporter
getExportedAllowedComponents()
java.util.Map<java.lang.String,? extends ComponentExporter>
getExportedItems()
Returns the map of all exported child items (resource names from Sling Model classes).java.lang.String[]
getExportedItemsOrder()
Returns the order of items in the map.java.lang.String
getExportedType()
Returns the type of the resource for which the export is performed.java.lang.String
getGridClassNames()
java.util.List<ResponsiveColumn>
getParagraphs()
Deprecated.UsegetColumns()
java.lang.String
getPath()
Returns the absolute path of this resource in the resource tree.ResourceMetadata
getResourceMetadata()
Deprecated.ResourceResolver
getResourceResolver()
Deprecated.java.lang.String
getResourceSuperType()
Deprecated.java.lang.String
getResourceType()
Deprecated.-
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
-
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
adaptTo, setAdapterManager, unsetAdapterManager
-
-
-
-
Method Detail
-
getGridClassNames
public java.lang.String getGridClassNames()
- Specified by:
getGridClassNames
in interfaceResponsiveGridExporter
- Returns:
- The CSS class names to be applied to the current grid.
-
getColumnClassNames
@Nonnull public java.util.Map<java.lang.String,java.lang.String> getColumnClassNames()
- Specified by:
getColumnClassNames
in interfaceResponsiveGridExporter
- Returns:
- The CSS class names associated with each responsive grid column and listed by column name
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceResponsiveGridExporter
- Returns:
- The number of columns available for direct children in the grid.
-
getColumns
@Nonnull public java.util.Collection<? extends ResponsiveColumn> getColumns()
- Returns:
- The columns of the current responsive grid.
-
getEffectiveResource
@Nonnull public <T extends Resource> T getEffectiveResource()
- Type Parameters:
T
- The type of the resource- Returns:
- Returns the resource optionally wrapped into a
TemplatedResource
AdobePatentID="P6273-US"
-
getPath
@Nonnull public java.lang.String getPath()
Description copied from interface:Resource
Returns the absolute path of this resource in the resource tree.
-
getExportedAllowedComponents
public AllowedComponentsExporter getExportedAllowedComponents()
- Specified by:
getExportedAllowedComponents
in interfaceResponsiveGridExporter
- Returns:
- Allowed Components object for the current grid.
-
getExportedItems
@Nonnull public java.util.Map<java.lang.String,? extends ComponentExporter> getExportedItems()
Description copied from interface:ContainerExporter
Returns the map of all exported child items (resource names from Sling Model classes).
NOTE: Methods whose JSON serialization would lead to the same JSON property name (":items") will not be serialized.
- Specified by:
getExportedItems
in interfaceContainerExporter
- Returns:
- the map of all exported child items
- See Also:
ComponentExporter.getExportedType()
-
getExportedItemsOrder
@Nonnull public java.lang.String[] getExportedItemsOrder()
Description copied from interface:ContainerExporter
Returns the order of items in the map.
NOTE: This information is required because the JSON specification and most implementations don't provide a stable order of items in JSON objects. Methods whose JSON serialization would lead to the same JSON property name (":order") will not be serialized.
- Specified by:
getExportedItemsOrder
in interfaceContainerExporter
- Returns:
- the order of the items in the map; the array can be empty if the item order is not provided by the underlying persistence layer
-
getExportedType
@Nonnull public java.lang.String getExportedType()
Description copied from interface:ComponentExporter
Returns the type of the resource for which the export is performed.
NOTE: methods whose JSON serialization would lead to the same JSON property name (":type") will not be serialized.
- Specified by:
getExportedType
in interfaceComponentExporter
- Returns:
- the type of the component
-
getParagraphs
@Deprecated public java.util.List<ResponsiveColumn> getParagraphs()
Deprecated.UsegetColumns()
- Returns:
- The columns of the current responsive grid.
-
getCssClass
@Deprecated public java.lang.String getCssClass()
Deprecated.- Returns:
- The CSS class names to be applied to the current grid.
-
getResourceType
@Nonnull @Deprecated public java.lang.String getResourceType()
Deprecated.Description copied from interface:Resource
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc. It is usually a path in the repository, where scripts and other tools definitions are found, but theResourceResolver
is free to set this to any suitable value such as the primary node type of the JCR node from which the resource is created.If the resource instance represents a resource which is not actually existing, this method returns
Resource.RESOURCE_TYPE_NON_EXISTING
.- Specified by:
getResourceType
in interfaceResource
- Returns:
- The resource type
-
getResourceSuperType
@Deprecated public java.lang.String getResourceSuperType()
Deprecated.Description copied from interface:Resource
Returns the super type of the resource if the resource defines its own super type. Otherwisenull
is returned. A resource might return a resource super type to overwrite the resource type hierarchy. If a client is interested in the effective resource super type of a resource, it should callResourceResolver.getParentResourceType(Resource)
.- Specified by:
getResourceSuperType
in interfaceResource
- Returns:
- The super type of the resource or
null
.
-
getResourceMetadata
@Nonnull @Deprecated public ResourceMetadata getResourceMetadata()
Deprecated.Description copied from interface:Resource
Returns the meta data of this resource. The concrete data contained in theResourceMetadata
object returned is implementation specific except for theResourceMetadata.RESOLUTION_PATH
property which is required to be set to the part of the request URI used to resolve the resource.- Specified by:
getResourceMetadata
in interfaceResource
- Returns:
- The resource meta data
- See Also:
ResourceMetadata
-
getResourceResolver
@Nonnull @Deprecated public ResourceResolver getResourceResolver()
Deprecated.Description copied from interface:Resource
Returns theResourceResolver
from which this resource has been retrieved.- Specified by:
getResourceResolver
in interfaceResource
- Returns:
- The resource resolver
-
getAppliedCssClasses
@Nullable public java.lang.String getAppliedCssClasses()
Description copied from interface:ResponsiveGridExporter
Returns the style system information associated with the current grid.- Specified by:
getAppliedCssClasses
in interfaceResponsiveGridExporter
- Returns:
- CSS classes selected by the content author delimited using a SPACE character
-
-