Skip to content

Commit 0a18c8c

Browse files
committed
Merge branch 'develop'
2 parents b7cfc8b + f70856c commit 0a18c8c

File tree

86 files changed

+769
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+769
-735
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>wcm-io/renovate-config:maven",
5+
"github>wcm-io/renovate-config:automerge-all-minor"
6+
],
7+
"ignoreDeps": [
8+
"io.wcm.maven:io.wcm.maven.aem-dependencies"
9+
]
10+
}

.github/workflows/maven-build.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ name: Build
44

55
on:
66
push:
7-
branches-ignore:
8-
- master
9-
- experimental/**
7+
branches:
8+
- develop
109
pull_request:
11-
types: [opened, synchronize, reopened]
12-
branches-ignore:
13-
- master
14-
- experimental/**
1510
workflow_dispatch:
1611

1712
jobs:
@@ -20,7 +15,7 @@ jobs:
2015
runs-on: ${{ matrix.os }}
2116
strategy:
2217
matrix:
23-
java: [11, 17]
18+
java: [11, 17, 21]
2419
os: [ubuntu-latest]
2520
distribution: [temurin]
2621

@@ -32,6 +27,6 @@ jobs:
3227
java-version: ${{ matrix.java }}
3328
maven-executable: ./mvnw
3429
sonar-run-on-os: ubuntu-latest
35-
sonar-run-on-java-version: 11
30+
sonar-run-on-java-version: 21
3631
sonar-token: ${{ secrets.SONAR_TOKEN }}
3732
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/maven-deploy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
name: Deploy
44

5+
concurrency: ${{ github.workflow }}
6+
57
on:
68
push:
79
branches:
@@ -15,15 +17,15 @@ jobs:
1517

1618
steps:
1719
- name: Checkout code
18-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1921

2022
- name: Configure GIT
2123
run: |
2224
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
2325
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
2426
2527
- name: Setup JDK
26-
uses: actions/setup-java@v3
28+
uses: actions/setup-java@v4
2729
with:
2830
distribution: temurin
2931
java-version: 11

.github/workflows/release-from-tag.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
permissions:
1313
contents: write
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- uses: ncipollo/release-action@v1
1717
with:
18-
body: 'Changes: https://wcm.io/samples/changes-report.html'
18+
body: 'Changes: https://wcm.io/samples/changes.html'
1919
token: ${{ secrets.GITHUB_TOKEN }}

.mvn/wrapper/maven-wrapper.jar

-57.4 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ See [Maven Settings](https://github.com/wcm-io/io.wcm.samples/blob/develop/.mave
2626

2727
### System requirements
2828

29-
- AEM 6.5.7+ or AEMaaCS SDK
29+
- AEM 6.5.17+ or AEMaaCS SDK
3030
- Java 11

build-deploy_aem66.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# #%L
3+
# wcm.io
4+
# %%
5+
# Copyright (C) 2021 wcm.io
6+
# %%
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
# #L%
19+
20+
21+
SLING_URL="http://localhost:45026"
22+
23+
if [[ $0 == *":\\"* ]]; then
24+
DISPLAY_PAUSE_MESSAGE=true
25+
fi
26+
27+
if [ "$?" -ne "0" ]; then
28+
exit
29+
fi
30+
31+
./build-deploy.sh --sling.url=${SLING_URL} --display.pause.message=${DISPLAY_PAUSE_MESSAGE} "$@"

bundles/clientlibs/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm.samples</groupId>
2727
<artifactId>io.wcm.samples.parent</artifactId>
28-
<version>1.4.2</version>
28+
<version>1.5.0</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.samples.clientlibs</artifactId>
34-
<version>1.4.2</version>
34+
<version>1.5.0</version>
3535
<packaging>jar</packaging>
3636

3737
<name>Sample Application Clientlibs</name>

bundles/core/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm.samples</groupId>
2727
<artifactId>io.wcm.samples.parent</artifactId>
28-
<version>1.4.2</version>
28+
<version>1.5.0</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.samples.core</artifactId>
34-
<version>1.4.2</version>
34+
<version>1.5.0</version>
3535
<packaging>jar</packaging>
3636

3737
<name>Sample Application</name>
@@ -182,6 +182,7 @@
182182
SLING-INF/app-root;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/wcm-io-samples/core,\
183183
SLING-INF/app-i18n;overwrite:=true;ignoreImportProviders:=json;path:=/apps/wcm-io-samples/core/i18n,\
184184
SLING-INF/app-config;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/wcm-io-samples/config
185+
185186
Sling-Namespaces: wcmio=http://wcm.io/ns
186187

187188
Import-Package: \

bundles/core/src/main/java/io/wcm/samples/core/business/navigation/impl/NavigationManagerImpl.java

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -98,41 +98,35 @@ public NavigationPageItem getFooterNavigation() {
9898

9999
private NavigationPageItem getFooterNavigationSpecific(final Page footerNavRoot) {
100100
NavigationPageItem rootItem = createStructureItem(footerNavRoot);
101-
rootItem.setChildren(createChildItems(footerNavRoot, new ItemCreator() {
102-
@Override
103-
public NavigationPageItem create(final Page pPage) {
104-
NavigationPageItem columnItem = createStructureItem(pPage);
105-
columnItem.setChildren(createChildItems(pPage, new ValidLinkableItemCreator()));
106-
if (columnItem.getChildren().isEmpty()) {
107-
return null;
108-
}
109-
else {
110-
return columnItem;
111-
}
101+
rootItem.setChildren(createChildItems(footerNavRoot, page -> {
102+
NavigationPageItem columnItem = createStructureItem(page);
103+
columnItem.setChildren(createChildItems(page, new ValidLinkableItemCreator()));
104+
if (columnItem.getChildren().isEmpty()) {
105+
return null;
106+
}
107+
else {
108+
return columnItem;
112109
}
113110
}));
114111
return rootItem;
115112
}
116113

117114
private NavigationPageItem getFooterNavigationDerivedFromMainNav(final Page siteRootPage) {
118115
NavigationPageItem rootItem = createStructureItem(siteRootPage);
119-
rootItem.setChildren(createChildItems(siteRootPage, new ItemCreator() {
120-
@Override
121-
public NavigationPageItem create(final Page pPage) {
122-
NavigationPageItem columnItem = createStructureItem(pPage);
123-
List<NavigationPageItem> linkItems = new ArrayList<>();
124-
NavigationPageItem mainnavLinkItem = createLinkableItem(pPage);
125-
if (mainnavLinkItem.getLink().isValid()) {
126-
linkItems.add(mainnavLinkItem);
127-
}
128-
linkItems.addAll(createChildItems(pPage, new ValidLinkableItemCreator()));
129-
columnItem.setChildren(linkItems);
130-
if (columnItem.getChildren().isEmpty()) {
131-
return null;
132-
}
133-
else {
134-
return columnItem;
135-
}
116+
rootItem.setChildren(createChildItems(siteRootPage, page -> {
117+
NavigationPageItem columnItem = createStructureItem(page);
118+
List<NavigationPageItem> linkItems = new ArrayList<>();
119+
NavigationPageItem mainnavLinkItem = createLinkableItem(page);
120+
if (mainnavLinkItem.getLink().isValid()) {
121+
linkItems.add(mainnavLinkItem);
122+
}
123+
linkItems.addAll(createChildItems(page, new ValidLinkableItemCreator()));
124+
columnItem.setChildren(linkItems);
125+
if (columnItem.getChildren().isEmpty()) {
126+
return null;
127+
}
128+
else {
129+
return columnItem;
136130
}
137131
}));
138132
return rootItem;
@@ -170,23 +164,20 @@ private List<NavigationPageItem> createChildItems(final Page parentPage, final I
170164

171165
private List<NavigationPageItem> createChildItemsRecursively(final Page parentPage, final ItemCreator itemCreator,
172166
final int level, final int maxLevels) {
173-
return createChildItems(parentPage, new ItemCreator() {
174-
@Override
175-
public NavigationPageItem create(final Page pPage) {
176-
NavigationPageItem item = itemCreator.create(pPage);
177-
if (item != null && level < maxLevels) {
178-
item.setChildren(createChildItemsRecursively(pPage, itemCreator, level + 1, maxLevels));
179-
}
180-
return item;
167+
return createChildItems(parentPage, page -> {
168+
NavigationPageItem item = itemCreator.create(page);
169+
if (item != null && level < maxLevels) {
170+
item.setChildren(createChildItemsRecursively(page, itemCreator, level + 1, maxLevels));
181171
}
172+
return item;
182173
});
183174
}
184175

185176
private interface ItemCreator {
186177
NavigationPageItem create(Page pPage);
187178
}
188179

189-
private class ValidLinkableItemCreator implements ItemCreator {
180+
private final class ValidLinkableItemCreator implements ItemCreator {
190181
@Override
191182
public NavigationPageItem create(Page page) {
192183
NavigationPageItem item = createLinkableItem(page);

bundles/core/src/main/java/io/wcm/samples/core/config/WikipediaLinkType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public boolean accepts(@NotNull String linkRef) {
9090
ValueMap props = link.getLinkRequest().getResourceProperties();
9191

9292
// get wikipedia reference from link properties
93-
String wikiPageName = props.get(PN_LINK_WIKIPEDIA_REF, link.getLinkRequest().getReference());
93+
String wikiPageName = StringUtils.defaultString(props.get(PN_LINK_WIKIPEDIA_REF, String.class),
94+
link.getLinkRequest().getReference());
9495
String language = props.get(PN_LINK_WIKIPEDIA_LANGUAGE, DEFAULT_LANGUAGE);
9596

9697
// build link URL which is only an anchor tag in the preview.

bundles/core/src/main/java/io/wcm/samples/core/config/impl/LinkHandlerConfigImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import io.wcm.handler.link.spi.LinkHandlerConfig;
3232
import io.wcm.handler.link.spi.LinkType;
3333
import io.wcm.handler.link.type.ExternalLinkType;
34+
import io.wcm.handler.link.type.InternalCrossContextLinkType;
3435
import io.wcm.handler.link.type.InternalLinkType;
3536
import io.wcm.handler.link.type.MediaLinkType;
3637
import io.wcm.samples.core.config.AppTemplate;
@@ -45,6 +46,7 @@ public class LinkHandlerConfigImpl extends LinkHandlerConfig {
4546

4647
private static final List<Class<? extends LinkType>> LINK_TYPES = List.of(
4748
InternalLinkType.class,
49+
InternalCrossContextLinkType.class,
4850
ExternalLinkType.class,
4951
MediaLinkType.class,
5052
WikipediaLinkType.class);

bundles/core/src/main/java/io/wcm/samples/core/handler/ResponsiveImageMediaMarkupBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public class ResponsiveImageMediaMarkupBuilder extends SimpleImageMediaMarkupBuilder {
3737

3838
@Override
39-
protected HtmlElement<?> getImageElement(Media media) {
39+
protected HtmlElement getImageElement(Media media) {
4040
HtmlElement image = super.getImageElement(media);
4141

4242
if (image != null) {

bundles/core/src/main/webapp/app-root/components/global/include/linkRefNoTitleTab.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@
1010
"items": {
1111
"linkRef": {
1212
"sling:resourceType": "wcm-io/handler/link/components/granite/form/linkRefContainer",
13-
"showLinkTitle": false
13+
"showLinkTitle": false,
14+
"allLinkTypeFields": {
15+
"linkFragment": {
16+
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
17+
"name": "./linkFragment",
18+
"fieldLabel": "Fragment",
19+
"granite:class": "linkRefContainer-option-linktype-showhide-target",
20+
"granite:data": {
21+
"showhidetargetvalues": "internal,internalCrossContext"
22+
}
23+
}
24+
}
1425
}
1526
}
1627
}

bundles/core/src/main/webapp/app-root/components/global/include/linkRefTab.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@
1010
"items": {
1111
"linkRef": {
1212
"sling:resourceType": "wcm-io/handler/link/components/granite/form/linkRefContainer",
13-
"showLinkTitle": true
13+
"showLinkTitle": true,
14+
"allLinkTypeFields": {
15+
"linkFragment": {
16+
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
17+
"name": "./linkFragment",
18+
"fieldLabel": "Fragment",
19+
"granite:class": "linkRefContainer-option-linktype-showhide-target",
20+
"granite:data": {
21+
"showhidetargetvalues": "internal,internalCrossContext"
22+
}
23+
}
24+
}
1425
}
1526
}
1627
}

bundles/core/src/main/webapp/app-root/components/global/include/mediaRefTab.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"mediaRef": {
1010
"sling:resourceType": "wcm-io/handler/media/components/granite/form/fileupload",
1111
"fieldLabel": "Asset reference",
12-
"allowUpload": true
12+
"allowUpload": true,
13+
"validation": ["wcmio.handler.media.mediaFormat"]
1314
}
1415
}
1516
}

bundles/core/src/test/java/io/wcm/samples/core/business/navigation/impl/NavigationManagerImplTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void testGetMainNavigation() throws Exception {
7575
}
7676

7777
@Test
78-
void testGetMainNavigation_1Levels() throws Exception {
78+
void testGetMainNavigation_1Levels() {
7979
NavigationPageItem rootItem = underTest.getMainNavigation(1);
8080
List<NavigationPageItem> mainnavItems = rootItem.getChildren();
8181
assertEquals(5, mainnavItems.size());
@@ -84,7 +84,7 @@ void testGetMainNavigation_1Levels() throws Exception {
8484
}
8585

8686
@Test
87-
void testGetMainNavigation_0Levels() throws Exception {
87+
void testGetMainNavigation_0Levels() {
8888
NavigationPageItem rootItem = underTest.getMainNavigation(0);
8989
List<NavigationPageItem> mainnavItems = rootItem.getChildren();
9090
assertEquals(0, mainnavItems.size());
@@ -94,7 +94,7 @@ void testGetMainNavigation_0Levels() throws Exception {
9494
* Test footer navigation with separate definition at tools/footernav/*
9595
*/
9696
@Test
97-
void testGetFooterNavigation_ToolsFooterNav() throws Exception {
97+
void testGetFooterNavigation_ToolsFooterNav() {
9898
NavigationPageItem rootItem = underTest.getFooterNavigation();
9999
List<NavigationPageItem> footerNavItems = rootItem.getChildren();
100100
assertEquals(3, footerNavItems.size());

0 commit comments

Comments
 (0)