Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/adobe/aem-core-wcm-c…
Browse files Browse the repository at this point in the history
…omponents into issue/1367
  • Loading branch information
jkoebner committed Jul 16, 2021
2 parents e22351d + ff28c39 commit cb3fe74
Show file tree
Hide file tree
Showing 1,222 changed files with 44,238 additions and 13,020 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
X_GITHUB_USERNAME: ${{ secrets.ADOBE_BOT_GITHUB_USERNAME }}
X_GITHUB_PASSWORD: ${{ secrets.ADOBE_BOT_GITHUB_PASSWORD }}
run: mvn -B -Prelease,cloud,ossrh,adobe-public -s ./.github/workflows/settings.xml clean deploy
run: mvn -B -Prelease,cloud,ossrh,adobe-public -s ./.github/workflows/settings.xml clean deploy -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
4 changes: 2 additions & 2 deletions CONFIGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ AEM uses [OSGi configurations](https://experienceleague.adobe.com/docs/experienc
| Configuration | Description |
|---|---|
| [FormParagraphPostProcessor](config/src/content/jcr_root/apps/core/wcm/config.author/com.day.cq.wcm.foundation.forms.impl.FormParagraphPostProcessor-core-components.config) | Enables functionality of [Core Form container](content/src/content/jcr_root/apps/core/wcm/components/form/container/v2/container) |
| [MobileEmulatorProvider](config/src/content/jcr_root/apps/core/wcm/config.author/com.day.cq.wcm.mobile.core.impl.MobileEmulatorProvider-core-components.config) | Enables mobile devices emulation in the editor for [Page component](content/src/content/jcr_root/apps/core/wcm/components/page/v2/page) |
| [MobileEmulatorProvider](config/src/content/jcr_root/apps/core/wcm/config.author/com.day.cq.wcm.mobile.core.impl.MobileEmulatorProvider-core-components.config) | Enables mobile devices emulation in the editor for [Page component](content/src/content/jcr_root/apps/core/wcm/components/page/v3/page) |

## Context-Aware configurations

The following [context-aware configurations](https://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configuration.html) are defined by the AEM WCM Core Components:

| 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/v2/page): scripts, links, meta elements |
| [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 |

Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ Set of standardized Web Content Management (WCM) components for [Adobe Experienc
* **Contributions** are welcome, read our [contributing guide](CONTRIBUTING.md) for more information.
* **Ideas and questions** are discussed on our [public mailing list](https://groups.google.com/forum/#!forum/aem-core-components-dev); you can also [subscribe via email](mailto:aem-core-components-dev+subscribe@googlegroups.com).

### Usability Study 2020

We're conducting a usability study by using the [System Usability Scale](https://measuringu.com/sus/), a reliable tool to measure the perceived usability.
Please help us making the Core Components better by responding to our **[short usability questionnaire](https://s2.userzoom.com/m/MSBDNTc1MlMxMDk1)**. Thank you!

## Documentation

* **[Component Library](https://www.adobe.com/go/aem_cmp_library):** A collection of examples to view the components in their various configurations.
Expand All @@ -33,7 +28,7 @@ Please help us making the Core Components better by responding to our **[short u
* **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.
* **Accessible:** They comply [WCAG 2.1 standard](https://www.w3.org/TR/WCAG21/), provide ARIA labels, and support keyboard navigation ([known issues](https://github.com/adobe/aem-core-wcm-components/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+accessibility+in%3Atitle)).
* **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).
* **Design Kit:** A [UI kit for Adobe XD](https://experienceleague.adobe.com/docs/experience-manager-learn/assets/AEM-CoreComponents-UI-Kit.xd) allows designers to create wireframes that they can then [style as needed](https://github.com/adobe/aem-guides-wknd/releases/download/aem-guides-wknd-0.0.2/AEM_UI-kit-WKND.xd).
Expand Down Expand Up @@ -97,7 +92,7 @@ For existing projects, take example from the [AEM Project Archetype](https://git

Core Components | AEM as a Cloud Service | AEM 6.5 | AEM 6.4 | Java SE | Maven
----------------|------------------------|---------|---------|---------|---------
[2.15.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.15.2) | Continual | 6.5.5.0+ (*) | 6.4.8.1+ (*) | 8, 11 | 3.3.9+
[2.17.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.17.2) | Continual | 6.5.6.0+ (*) | 6.4.8.4+ (*) | 8, 11 | 3.3.9+

(*) - Since version 2.11.0 `org.apache.sling.models.impl` version 1.4.12 or higher is required (due to [SLING-8781](https://issues.apache.org/jira/browse/SLING-8781)). This will be provided for AEM 6.4 and 6.5 in a future Service Pack. Until then, the Sling Models bundle is included in the `core.wcm.components.all` package.

Expand All @@ -117,6 +112,10 @@ You can also install individual packages/bundles by issuing the following comman

mvn clean install -PautoInstallPackage -pl <project_name(s)> -am

With AEM as a Cloud Service SDK, use the `cloud` profile as follows to deploy the components into `/libs` instead of `/apps`:

mvn clean install -PautoInstallSinglePackage,cloud

Note that:
* `-pl/-projects` option specifies the list of projects that you want to install
* `-am/-also-make` options specifies that dependencies should also be built
Expand Down
5 changes: 5 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ See below for a full list of system requirements for historical versions of the

Core Components | Extension | AEM 6.5 | AEM 6.4 | AEM 6.3 | Java | Maven
----------------|-----------|---------|---------|---------|------|------
[2.17.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.17.2) | - | 6.5.6.0+ | 6.4.8.4+ | - | 8, 11 | 3.3.9+
[2.17.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.17.0) | - | 6.5.6.0+ | 6.4.8.4+ | - | 8, 11 | 3.3.9+
[2.16.4](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.16.4) | - | 6.5.5.0+ | 6.4.8.1+ | - | 8, 11 | 3.3.9+
[2.16.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.16.2) | - | 6.5.5.0+ | 6.4.8.1+ | - | 8, 11 | 3.3.9+
[2.16.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.16.0) | - | 6.5.5.0+ | 6.4.8.1+ | - | 8, 11 | 3.3.9+
[2.15.2](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.15.2) | - | 6.5.5.0+ | 6.4.8.1+ | - | 8, 11 | 3.3.9+
[2.15.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.15.0) | - | 6.5.5.0+ | 6.4.8.1+ | - | 8, 11 | 3.3.9+
[2.14.0](https://github.com/adobe/aem-core-wcm-components/releases/tag/core.wcm.components.reactor-2.14.0) | - | 6.5.5.0+ | 6.4.8.1+ | - | 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.15.3-SNAPSHOT</version>
<version>2.17.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.15.3-SNAPSHOT</version>
<version>2.17.3-SNAPSHOT</version>
<packaging>content-package</packaging>

<name>Adobe Experience Manager Core WCM Components Full Package</name>
Expand Down
19 changes: 10 additions & 9 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.15.3-SNAPSHOT</version>
<version>2.17.3-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

<artifactId>core.wcm.components.core</artifactId>
<version>2.15.3-SNAPSHOT</version>
<version>2.17.3-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>Adobe Experience Manager Core WCM Components Core Bundle</name>
Expand Down Expand Up @@ -70,6 +70,7 @@
<Import-Package>
com.adobe.cq.commerce.*;resolution:=optional,
javax.annotation;version=0.0.0,
com.day.cq.dam.api;version="[1.24,2.0)",
*
</Import-Package>
</instructions>
Expand Down Expand Up @@ -235,7 +236,7 @@
</execution>
</executions>
<configuration>
<slingUrl>http://${aem.host}:${aem.port}/system/console</slingUrl>
<slingUrl>http://${aem.host}:${aem.port}${aem.contextPath}/system/console</slingUrl>
<failOnError>true</failOnError>
</configuration>
</plugin>
Expand Down Expand Up @@ -363,6 +364,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
Expand Down Expand Up @@ -417,7 +423,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
<version>2.20.0</version>
<version>2.22.0</version>
<scope>test</scope>
</dependency>
<!-- for testing we need the new ResourceTypeBasedResourcePicker -->
Expand Down Expand Up @@ -493,10 +499,6 @@
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</dependency>
<dependency>
<groupId>uk.org.lidalia</groupId>
<artifactId>slf4j-test</artifactId>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
Expand Down Expand Up @@ -543,7 +545,6 @@
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2021 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
package com.adobe.cq.wcm.core.components.commons.editor.dialog;

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.Self;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.apache.sling.models.factory.ModelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.cq.wcm.core.components.models.Image;
import com.adobe.cq.wcm.core.components.util.ComponentUtils;
import com.day.cq.wcm.api.Page;
import com.day.cq.wcm.api.PageManager;

/**
* Defines a Sling Model used by the {@code core/wcm/components/commons/editor/dialog/pageimagethumbnail/v1/pageimagethumbnail} dialog component.
*
* @since com.adobe.cq.wcm.core.components.commons.editor.dialog 1.0.0
*/
@Model(
adaptables = SlingHttpServletRequest.class
)
public class PageImageThumbnail {

private final static Logger log = LoggerFactory.getLogger(PageImageThumbnail.class);

@Self
private SlingHttpServletRequest request;

@SlingObject
private ResourceResolver resourceResolver;

@Inject
private ModelFactory modelFactory;

private String alt;
private String src;

@PostConstruct
protected void initModel() {
String path = request.getRequestPathInfo().getSuffix();
if (StringUtils.isBlank(path)) {
RequestParameter itemParam = request.getRequestParameter("item");
if (itemParam == null) {
log.error("Suffix and 'item' param are blank");
return;
}
path = itemParam.getString();
}

PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
if (pageManager == null) {
log.error("pagemanager is null");
return;
}

Resource component = resourceResolver.getResource(path);
Page containingPage = pageManager.getContainingPage(component);
if (containingPage == null) {
log.error("page is null");
return;
}

Resource featuredImage = ComponentUtils.getFeaturedImage(containingPage);
if (featuredImage == null) {
log.error("the featured image is null");
return;
}

Image imageModel = modelFactory.getModelFromWrappedRequest(request, featuredImage, Image.class);
if (imageModel == null) {
log.error("the image model is null");
return;
}

alt = imageModel.getAlt();
src = imageModel.getSrc();
}


/**
* Returns the alternative text of the featured image of the page, which the component belongs to.
*
* @return the alternative text of the page image
*/
public String getAlt() {
return alt;
}

/**
* Returns the src attribute of the featured image of the page, which the component belongs to.
*
* @return the alternative text of the page image
*/
public String getSrc() {
return src;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2021 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/**
* <p>
* This package defines the Sling Models exposed for the dialog widgets.
* </p>
*
*/
@Version("1.0.0")
package com.adobe.cq.wcm.core.components.commons.editor.dialog;

import org.osgi.annotation.versioning.Version;

0 comments on commit cb3fe74

Please sign in to comment.