Skip to content

Commit

Permalink
Merge branch 'main' into issue/2526
Browse files Browse the repository at this point in the history
  • Loading branch information
LSantha authored Feb 27, 2024
2 parents 9fd670b + f28f5fd commit e46ea2a
Show file tree
Hide file tree
Showing 125 changed files with 7,143 additions and 4,640 deletions.
8 changes: 4 additions & 4 deletions CONFIGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AEM uses [OSGi configurations](https://experienceleague.adobe.com/docs/experienc
| [ComponentConfigImpl](config/src/content/jcr_root/apps/core/wcm/config/com.adobe.cq.dam.cfm.impl.component.ComponentConfigImpl-core-comp-v1.config) | Enables Content Fragment management for [Content Fragment component](content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment). Reference documentation: https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/content-fragments-config-components-rendering.html |
| [RTEFilterServletFactory](config/src/content/jcr_root/apps/core/wcm/config/com.adobe.cq.ui.wcm.commons.internal.servlets.rte.RTEFilterServletFactory.amended-core-components.config) | Enables usage of RTE (Rich Text Editor) with [Text component](content/src/content/jcr_root/apps/core/wcm/components/text/v2/text). Reference documentation: https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/rich-text-editor.html |
| [OEmbedClientImplConfigurationFactory](config/src/content/jcr_root/apps/core/wcm/config/com.adobe.cq.wcm.core.components.internal.services.embed.OEmbedClientImplConfigurationFactory-*.config) | Enables out-of-the-box OEmbed configurations for several services, with [Embed component](content/src/content/jcr_root/apps/core/wcm/components/embed/v1/embed) |
| [AdaptiveImageServletMappingConfigurationFactory](config/src/content/jcr_root/apps/core/wcm/config/com.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServletMappingConfigurationFactory-*.config) | Enables adaptive image support for [Image component](content/src/content/jcr_root/apps/core/wcm/components/image/v2/image) |
| [AdaptiveImageServletMappingConfigurationFactory](config/src/content/jcr_root/apps/core/wcm/config/com.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServletMappingConfigurationFactory-*.config) | Enables adaptive image support for [Image component](content/src/content/jcr_root/apps/core/wcm/components/image/v2/image) |
| [MailServlet](config/src/content/jcr_root/apps/core/wcm/config/com.day.cq.wcm.foundation.forms.impl.MailServlet-core-components.config) | Enables email support for user-submitted information in [Core Form container](content/src/content/jcr_root/apps/core/wcm/components/form/container/v2/container) |
| [ServiceUserMapperImpl](config/src/content/jcr_root/apps/core/wcm/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-componentsservice.config) | Enables access rights for [ClientLibraries](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/models/ClientLibraries.java) and [ComponentFiles](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/models/ComponentFiles.java) helpers |

Expand All @@ -28,11 +28,11 @@ The following [context-aware configurations](https://sling.apache.org/documentat
| Configuration | Description |
|---|---|
| [HtmlPageItemsConfig](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/config/HtmlPageItemsConfig.java) | Holds information on items to be included by [Page component](content/src/content/jcr_root/apps/core/wcm/components/page/v3/page): scripts, links, meta elements |
| [PdfViewerCaConfig](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/services/CaConfigReferenceProvider.java) | Holds configuration for [PDF Viewer component](content/src/content/jcr_root/apps/core/wcm/components/pdfviewer/v1/pdfviewer) |
| [DataLayerConfig](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/DataLayerConfig.java) | Toggles the [Adobe Client Data Layer](https://github.com/adobe/adobe-client-data-layer) integration |
| [PdfViewerCaConfig](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/services/CaConfigReferenceProvider.java) | Holds configuration for [PDF Viewer component](content/src/content/jcr_root/apps/core/wcm/components/pdfviewer/v1/pdfviewer) |
| [DataLayerConfig](bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/DataLayerConfig.java) | Toggles and configures the [Adobe Client Data Layer and Google Data Layer](https://github.com/adobe/adobe-client-data-layer) integrations |

At the moment, there is no editing UI for context-aware configuration available out-of-the-box. Developers can either:

* Deploy predefined context-ware configurations via content packages.
* Change context-aware configurations using `SlingPostServlet` or `CRXDE Lite`.
* Use the [wcm.io context-aware configuration editor](https://wcm.io/caconfig/editor/). An example setup is included with the Core Components Library example content (see https://github.com/adobe/aem-core-wcm-components/pull/1410)
* Use the [wcm.io context-aware configuration editor](https://wcm.io/caconfig/editor/). An example setup is included with the Core Components Library example content (see https://github.com/adobe/aem-core-wcm-components/pull/1410)
41 changes: 30 additions & 11 deletions DATA_LAYER_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,49 @@ limitations under the License.

# Data Layer Integration with the Core Components

The Core Components provide an out-of-the-box integration with the [Adobe Client Data Layer](https://github.com/adobe/adobe-client-data-layer), which for convenience is called data layer in this page.
The Core Components provide an out-of-the-box integration with the [Adobe Client Data Layer](https://github.com/adobe/adobe-client-data-layer) and Google Tag Manager Data Layers. For convenience these are referred to in the page as ACDL and GDL.

## Enabling the Data Layer

The data layer is disabled by default.
The data layer is disabled by default.

To enable the data layer for your site:
1. Create the following structure below the `/conf` node:
`/conf/<my-site>/sling:configs/com.adobe.cq.wcm.core.components.internal.DataLayerConfig`
1. Add the `enabled` boolean property and set it to `true`.
1. Add a `sling:configRef` property to the `jcr:content` node of your site below `/content` (e.g. `/content/<my-site>/jcr:content`) and set it to `/conf/<my-site>`
2. Add the `enabled` boolean property and set it to `true`.
3. If a datalayer object name other than `adobeDataLayer` is required (e.g. `dataLayer` for most GDLs), add a string property `name` to the same node, with the required Data Layer object name as the value.
4. Add a `sling:configRef` property to the `jcr:content` node of your site below `/content` (e.g. `/content/<my-site>/jcr:content`) and set it to `/conf/<my-site>`

## Preventing the Data Layer client library from being included
## Google Data Layer Creation

The data layer client library is included by default by the Page component. As there are other ways to include this library (e.g. through Adobe Launch), it might be needed to prevent its inclusion through the Page component.
While Core Components includes the ACDL Library unless explicitly disabled (below), it does not include the GDL library. The Core Components code will create an appropriately named Data Layer array, but a standard Google Tag Manager code snippet must be included in the page to consume this array and create a full GDL. This is done according to Google documentation and is not directly related to Core Components.

## Google Global Tag - GTag

Google's GTag code is not currently supported.

## Generic Data Layer Use

The Core Components Data Layer integration supports Data Layer name configuration, and the logic uses the standard JavaScript array push() method. If the Data Layer is enabled, but the ACDL library is not loaded, and the Data Layer is not consumed by a Google solution, there will still be a plain JavaScript array available with the configured name, and containing Core Components data, although with 'event' entries that are intended for an Event-Driven Data Layer like the ACDL or GDL. This plain array Data Layer is generic and may be suitable for other Data Layer providers or consumers.

## Preventing the Adobe Data Layer client library from being included

The ACDL library is included by default by the Page component. If using a GDL, or already including the ACDL library in some other way such as using AEP Data Collection Tags, the ACDL library should not be loaded.

To prevent the ACDL library from being included by the Page component:

To prevent the data layer client library from being included by the Page component:
1. Create the following structure below the `/conf` node:
`/conf/<my-site>/sling:configs/com.adobe.cq.wcm.core.components.internal.DataLayerConfig`
1. Add the `skipClientlibInclude` boolean property and set it to `true`.
1. Add a `sling:configRef` property to the `jcr:content` node of your site below `/content` (e.g. `/content/<my-site>/jcr:content`) and set it to `/conf/<my-site>`
2. Add the `skipClientlibInclude` boolean property and set it to `true`.
3. Add a `sling:configRef` property to the `jcr:content` node of your site below `/content` (e.g. `/content/<my-site>/jcr:content`) and set it to `/conf/<my-site>`

## Data Layer State Structure

When the data layer is enabled, the javascript `adobeDataLayer` object is available on the page and is populated with the components and their properties that are used on the page.
When the data layer is enabled, a JavaScript Data Layer object will be available. By default, the object name is `adobeDataLayer`. If a name has been defined in the Data Layer configuration (see [Enabling the Data Layer](#enabling-the-data-layer)) the object will be named accordingly. The Data Layer will be populated with the components and their properties that are used on the page.

The data layer state (returned by calling `adobeDataLayer.getState()`) is an object with two objects (`page` and `component`). All the components are stored below the `component` object as a flat structure. The structure looks as follows:
### Data Layer State - ACDL

If an ACDL is used the data layer state (returned by calling `adobeDataLayer.getState()`) is an object with two objects (`page` and `component`). All the components are stored below the `component` object as a flat structure. The structure looks as follows:
```
{
"page": {
Expand Down Expand Up @@ -122,6 +138,9 @@ Calling `adobeDataLayer.getState()` in the browser console will return e.g.:
}
}
```
### Data Layer State - GDL

Google Data Layers do not have a getState() method which can provide a consolidated _computed state_ of the Data Layer. To view the raw Data Layer enter the name of the Data Layer in the browser console, e.g. `dataLayer`. The computed state can be viewed using Google and third party debugging tools.

## Components supporting the Data Layer

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Set of standardized Web Content Management (WCM) components for [Adobe Experienc
* **Cloud-Ready:** Whether on [AEM as a Cloud Service](https://docs.adobe.com/content/help/en/experience-manager-cloud-service/landing/home.html), on [Adobe Managed Services](https://github.com/adobe/aem-project-archetype/tree/master/src/main/archetype/dispatcher.ams), or on-premise, they just work.
* **Versatile:** The components represent generic concepts with which the authors can assemble nearly any layout.
* **Configurable:** Template-level [content policies](https://docs.adobe.com/content/help/en/experience-manager-65/developing/platform/templates/page-templates-editable.html#content-policies) define which features the page authors are allowed to use or not.
* **Trackable:** The [Adobe Client Data Layer](DATA_LAYER_INTEGRATION.md) integration allows to track all aspects of the visitor experience.
* **Trackable:** The [Adobe Client Data Layer and Google Data Layer](DATA_LAYER_INTEGRATION.md) integrations support the tracking of all aspects of the visitor experience.
* **Accessible:** They comply [WCAG 2.1 standard](https://www.w3.org/TR/WCAG21/), provide ARIA labels, and support keyboard navigation.
* **SEO-Friendly:** The HTML output is semantic and provides schema.org microdata annotations.
* **WebApp-Ready:** The [streamlined JSON output](https://docs.adobe.com/content/help/en/experience-manager-learn/foundation/development/develop-sling-model-exporter.html) allows client-side rendering, still with a possibility of [in-context editing](https://docs.adobe.com/content/help/en/experience-manager-learn/sites/spa-editor/spa-editor-framework-feature-video-use.html).
Expand Down Expand Up @@ -93,7 +93,7 @@ For existing projects, take example from the [AEM Project Archetype](https://git

Core Components | AEM as a Cloud Service | AEM 6.5 | Java SE | Maven
----------------|------------------------|-----------|---------|---------
[2.23.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.2) | Continual | 6.5.17.0+ | 8, <br/>11 | 3.3.9+
[2.24.2+](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.4) | Continual | 6.5.19.0+ | 8, <br/>11 | 3.3.9+

For the requirements from previous Core Component releases, see [Historical System Requirements](VERSIONS.md).

Expand Down
7 changes: 5 additions & 2 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

See below for a full list of system requirements for historical versions of the Core Components:

Core Components | Extension | AEM 6.5 | AEM 6.4 | AEM 6.3 | Java | Maven
----------------|-----------|-----------|---------|---------|------|------
Core Components | Extension | AEM 6.5 | AEM 6.4 | AEM 6.3 | Java | Maven
----------------|-----------|-----------|---------|---------|-------|------
[2.24.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.4) | - | 6.5.19.0+ | - | - | 8, 11 | 3.3.9+
[2.24.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.4) | - | 6.5.19.0+ | - | - | 8, 11 | 3.3.9+
[2.23.4](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.4) | - | 6.5.17.0+ | - | - | 8, 11 | 3.3.9+
[2.23.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.2) | - | 6.5.17.0+ | - | - | 8, 11 | 3.3.9+
[2.23.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.23.0) | - | 6.5.17.0+ | - | - | 8, 11 | 3.3.9+
[2.22.12](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.22.12) | - | 6.5.14.0+ | - | - | 8, 11 | 3.3.9+
Expand Down
4 changes: 2 additions & 2 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<parent>
<artifactId>core.wcm.components.parent</artifactId>
<groupId>com.adobe.cq</groupId>
<version>2.23.3-SNAPSHOT</version>
<version>2.24.3-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<artifactId>core.wcm.components.all</artifactId>
<version>2.23.3-SNAPSHOT</version>
<version>2.24.3-SNAPSHOT</version>
<packaging>content-package</packaging>

<name>Adobe Experience Manager Core WCM Components Full Package</name>
Expand Down
49 changes: 17 additions & 32 deletions bundles/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<parent>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.parent</artifactId>
<version>2.23.3-SNAPSHOT</version>
<version>2.24.3-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

<artifactId>core.wcm.components.core</artifactId>
<version>2.23.3-SNAPSHOT</version>
<version>2.24.3-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>Adobe Experience Manager Core WCM Components Core Bundle</name>
Expand Down Expand Up @@ -75,6 +75,8 @@
javax.annotation.meta;resolution:=optional,
com.day.cq.dam.api;version="[1.24,2.0)",
com.day.cq.dam.api.handler;version="[2,3)",
com.adobe.cq.dam.cfm.content;version="[1.1,2)",
com.adobe.cq.dam.cfm.converter;version="[1,2)",
*
</Import-Package>
</instructions>
Expand Down Expand Up @@ -353,11 +355,6 @@
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<!-- javax.inject 1 -->
<dependency>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<groupId>org.apache.geronimo.specs</groupId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -374,14 +371,18 @@
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.9</version>
<version>1.2.13</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -406,36 +407,15 @@
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>

<dependency>
<groupId>com.adobe.cq.dam</groupId>
<artifactId>cq-dam-cfm-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-osgi</artifactId>
<groupId>com.day.commons.osgi.wrapper</groupId>
<artifactId>com.day.commons.osgi.wrapper.commons-httpclient</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -547,11 +527,16 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>4.7.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
package com.adobe.cq.wcm.core.components.commons.editor.dialog.inherited;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.request.RequestParameter;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.Self;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.apache.sling.models.factory.ModelFactory;
Expand Down Expand Up @@ -57,7 +57,7 @@ public class PageImageThumbnail {
@SlingObject
private ResourceResolver resourceResolver;

@Inject
@OSGiService
private ModelFactory modelFactory;

private String alt;
Expand Down
Loading

0 comments on commit e46ea2a

Please sign in to comment.