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.StringgetAppliedCssClasses()Returns the style system information associated with the current grid.java.util.Map<java.lang.String,java.lang.String>getColumnClassNames()intgetColumnCount()java.util.Collection<? extends ResponsiveColumn>getColumns()java.lang.StringgetCssClass()Deprecated.<T extends Resource>
TgetEffectiveResource()AllowedComponentsExportergetExportedAllowedComponents()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.StringgetExportedType()Returns the type of the resource for which the export is performed.java.lang.StringgetGridClassNames()java.util.List<ResponsiveColumn>getParagraphs()Deprecated.UsegetColumns()java.lang.StringgetPath()Returns the absolute path of this resource in the resource tree.ResourceMetadatagetResourceMetadata()Deprecated.ResourceResolvergetResourceResolver()Deprecated.java.lang.StringgetResourceSuperType()Deprecated.java.lang.StringgetResourceType()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:
getGridClassNamesin 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:
getColumnClassNamesin interfaceResponsiveGridExporter- Returns:
- The CSS class names associated with each responsive grid column and listed by column name
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCountin 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
TemplatedResourceAdobePatentID="P6273-US"
-
getPath
@Nonnull public java.lang.String getPath()
Description copied from interface:ResourceReturns the absolute path of this resource in the resource tree.
-
getExportedAllowedComponents
public AllowedComponentsExporter getExportedAllowedComponents()
- Specified by:
getExportedAllowedComponentsin 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:ContainerExporterReturns 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:
getExportedItemsin interfaceContainerExporter- Returns:
- the map of all exported child items
- See Also:
ComponentExporter.getExportedType()
-
getExportedItemsOrder
@Nonnull public java.lang.String[] getExportedItemsOrder()
Description copied from interface:ContainerExporterReturns 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:
getExportedItemsOrderin 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:ComponentExporterReturns 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:
getExportedTypein 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:ResourceThe 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 theResourceResolveris 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:
getResourceTypein interfaceResource- Returns:
- The resource type
-
getResourceSuperType
@Deprecated public java.lang.String getResourceSuperType()
Deprecated.Description copied from interface:ResourceReturns the super type of the resource if the resource defines its own super type. Otherwisenullis 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:
getResourceSuperTypein interfaceResource- Returns:
- The super type of the resource or
null.
-
getResourceMetadata
@Nonnull @Deprecated public ResourceMetadata getResourceMetadata()
Deprecated.Description copied from interface:ResourceReturns the meta data of this resource. The concrete data contained in theResourceMetadataobject returned is implementation specific except for theResourceMetadata.RESOLUTION_PATHproperty which is required to be set to the part of the request URI used to resolve the resource.- Specified by:
getResourceMetadatain interfaceResource- Returns:
- The resource meta data
- See Also:
ResourceMetadata
-
getResourceResolver
@Nonnull @Deprecated public ResourceResolver getResourceResolver()
Deprecated.Description copied from interface:ResourceReturns theResourceResolverfrom which this resource has been retrieved.- Specified by:
getResourceResolverin interfaceResource- Returns:
- The resource resolver
-
getAppliedCssClasses
@Nullable public java.lang.String getAppliedCssClasses()
Description copied from interface:ResponsiveGridExporterReturns the style system information associated with the current grid.- Specified by:
getAppliedCssClassesin interfaceResponsiveGridExporter- Returns:
- CSS classes selected by the content author delimited using a SPACE character
-
-