Skip to content

Commit d7f3004

Browse files
committed
2.0
2 parents 1610c7b + 0328e33 commit d7f3004

File tree

309 files changed

+921
-29642
lines changed

Some content is hidden

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

309 files changed

+921
-29642
lines changed

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ SDL Digital Experience Accelerator Java Spring MVC web application
44

55
About
66
-----
7-
The SDL Digital Experience Accelerator (DXA) is a reference implementation of SDL Web 8 and SDL Tridion 2013 SP1(*) intended to help you create, design and publish an SDL Web/Tridion-based website quickly.
7+
The SDL Digital Experience Accelerator (DXA) is a reference implementation of SDL Web (version 8, 8.5, or Cloud) that we provide to help you more quickly create, design, and publish a website based on SDL Web.
88

9-
It is available for .NET and Java Web Applications and has a modular architecture consisting of a Framework and example web application providing core functionality and separate Modules for additional, optional functionality.
9+
DXA is available for both .NET and Java web applications. Its modular architecture consists of a framework and example web application, which includes all core SDL Web functionality as well as separate Modules for additional, optional functionality.
1010

11-
This repository contains the source code of the DXA Framework, example web application and Maven archetype for Java.
12-
The full DXA distribution (including CM-side items and installation support) is downloadable from the [SDL Appstore site](https://appstore.sdl.com/web-content-management/app/sdl-digital-experience-accelerator-java/737/) (latest version)
13-
or the [Releases in GitHub](https://github.com/sdl/dxa-web-application-java/releases) (all versions)
11+
This repository contains the source code of the DXA Framework, an example Java web application, and a Maven archetype for Java.
1412

13+
The full DXA distribution (including Content Manager-side items and installation support) is downloadable from the [SDL Appstore site](https://appstore.sdl.com/web-content-management/app/sdl-digital-experience-accelerator-java/737/) (latest version)
14+
or the [Releases in GitHub](https://github.com/sdl/dxa-web-application-java/releases) (all versions)
1515
Furthermore, the compiled DXA artifacts are available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cdxa).
16-
To facilitate upgrades, it is highly recommended to use official, compiled DXA artifacts from Maven Central instead of a custom build.
17-
If you really have to modify the DXA Framework, we kindly request you to submit your changes as a Contribution; see below.
1816

19-
(*) SDL Tridion 2013 SP1 is only supported up to DXA version 1.6.
17+
To facilitate upgrades, we strongly recommend that you use official, compiled DXA artifacts from Maven Central instead of a custom build.
18+
If you really must modify the DXA framework, we kindly request you to submit your changes as a Contribution (see the Branches and Contributions section below).
19+
2020

2121
Support
2222
---------------
@@ -25,12 +25,12 @@ If you encounter any issues with the Digital Experience Accelerator, please reac
2525

2626
- Report issues directly in [this repository](https://github.com/sdl/dxa-web-application-java/issues)
2727
- Ask questions 24/7 on the SDL Web Community at https://tridion.stackexchange.com
28-
- Contact Technical Support through the Customer Support Web Portal at https://www.sdl.com/support
28+
- Contact Technical Support through the SDL Support web portal at https://www.sdl.com/support
2929

3030

3131
Documentation
3232
-------------
33-
Documentation can be found online in the SDL documentation portal: http://docs.sdl.com/sdldxa2-ctp
33+
Documentation can be found online in the SDL documentation portal: http://docs.sdl.com/sdldxa20
3434

3535

3636
Repositories
@@ -41,51 +41,55 @@ The following repositories with source code are available:
4141
- https://github.com/sdl/dxa-html-design - Whitelabel HTML Design
4242
- https://github.com/sdl/dxa-model-service - Model Service (Java)
4343
- https://github.com/sdl/dxa-modules - Modules (.NET and Java)
44-
- https://github.com/sdl/dxa-web-application-dotnet - ASP.NET MVC web application (incl. framework)
45-
- https://github.com/sdl/dxa-web-application-java - Java Spring MVC web application (incl. framework)
44+
- https://github.com/sdl/dxa-web-application-dotnet - ASP.NET MVC web application (including framework)
45+
- https://github.com/sdl/dxa-web-application-java - Java Spring MVC web application (including framework)
4646

4747

4848
Branches and Contributions
4949
--------------------------
5050
We are using the following branching strategy:
5151

52-
- `master` - Represents the latest stable version. This may be a pre-release version (tagged as `DXA x.y Sprint z`). Updated each development Sprint (approx. bi-weekly).
52+
- `master` - Represents the latest stable version. This may be a pre-release version (tagged as `DXA x.y Sprint z`). Updated each development Sprint (approximately bi-weekly).
5353
- `develop` - Represents the latest development version. Updated very frequently (typically nightly).
54-
- `release/x.y` - Represents the x.y Release. If hotfixes are applicable, they will be applied to the appropriate release branch, so that the release branch actually represent the initial release plus hotfixes.
54+
- `release/x.y` - Represents the x.y Release. If hotfixes are applicable, they will be applied to the appropriate release branch so that the branch actually represents the initial release plus hotfixes.
5555

5656
All releases (including pre-releases and hotfix releases) are tagged.
5757

5858
Note that development sources (on `develop` branch) have dependencies on SNAPSHOT versions of the DXA artifacts, which are available here: https://oss.sonatype.org/content/repositories/snapshots/com/sdl/dxa/
5959

60-
If you wish to submit a Pull Request, it should normally be submitted on the `develop` branch, so it can be incorporated in the upcoming release.
60+
If you wish to submit a Pull Request, it should normally be submitted on the `develop` branch so that it can be incorporated in the upcoming release.
6161

62-
Fixes for really severe/urgent issues (which qualify as hotfixes) should be submitted as Pull Request on the appropriate release branch.
62+
Fixes for severe/urgent issues (that qualify as hotfixes) should be submitted as Pull Requests on the appropriate release branch.
6363

64-
Please always submit an Issue for the problem and indicate whether you think it qualifies as a hotfix; Pull Requests on release branches will only be accepted after agreement on the severity of the issue.
64+
Always submit an Issue for the problem, and indicate whether you think it qualifies as a hotfix. Pull Requests on release branches will only be accepted after agreement on the severity of the issue.
6565
Furthermore, Pull Requests on release branches are expected to be extensively tested by the submitter.
6666

67-
Of course, it's also possible (and appreciated) to report an Issue without associated Pull Requests.
67+
Of course, it is also possible (and appreciated) to report an issue without associated Pull Requests.
6868

6969

7070
DXA Builder
7171
-----------
72-
Current DXA Builder is available in Maven Central, latest DXA Builder is also available as a public snapshot.
72+
The current DXA Builder is available in Maven Central, and the latest DXA Builder is also available as a public snapshot.
73+
74+
If you have not configured a snapshot repository and don't want to, you may need to install the DXA Builder locally in order to run the SNAPSHOT.
75+
76+
To install it, run the wrapper script of the `dxa-builder` project: `gradlew(.bat) publishLocal`
77+
On Windows, you can also just run `get-started.cmd` script at first run.
7378

74-
You may need DXA Builder to be installed locally to run the SNAPSHOT build if you haven't configured snapshot repository and you don't want to.
75-
To install it run the wrapper script of `dxa-builder` project: `gradlew(.bat) publishLocal`
76-
On Windows you can also just run `get-started.cmd` script at first run.
7779

7880
DD4T support
7981
---
80-
DD4T 2.1 for Java is incorporated into DXA codebase in `dxa-compatible` artifact. You don't need separate dependencies on DD4T if you're migrating to DXA from DD4T.
82+
DD4T 2.1 for Java is incorporated into the DXA codebase in the `dxa-compatible` artifact. As a result, when migrating from DD4T to DXA, you do not need separate dependencies on DD4T.
83+
8184

8285
Snapshots
8386
---------
84-
DXA publishes SNAPSHOT versions to Sonatype. If you want to use them, you have to configure `https://oss.sonatype.org/content/repositories/snapshots` as a repository in your Maven settings. Read [this](https://maven.apache.org/settings.html#Repositories) for instructions.
87+
DXA publishes SNAPSHOT versions to Sonatype. To use them, configure `https://oss.sonatype.org/content/repositories/snapshots` as a repository in your Maven settings. Read [this](https://maven.apache.org/settings.html#Repositories) for instructions.
88+
8589

8690
License
8791
-------
88-
Copyright (c) 2014-2017 SDL Group.
92+
Copyright (c) 2014-2018 SDL Group.
8993

9094
Licensed under the Apache License, Version 2.0 (the "License");
9195
you may not use this file except in compliance with the License.

dxa-builder/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=2.0.0-SNAPSHOT
1+
version=2.0.0

dxa-dd4t-ms-provider/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>dxa-oss-parent</artifactId>
77
<groupId>com.sdl.dxa</groupId>
8-
<version>2.0.0-SNAPSHOT</version>
8+
<version>2.0.0</version>
99
<relativePath>../dxa-oss-parent/pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

dxa-framework/dxa-common-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.sdl.dxa</groupId>
88
<artifactId>dxa-framework</artifactId>
9-
<version>2.0.0-SNAPSHOT</version>
9+
<version>2.0.0</version>
1010
</parent>
1111

1212
<artifactId>dxa-common-api</artifactId>

dxa-framework/dxa-common-api/src/main/java/com/sdl/webapp/common/markup/html/builders/HtmlBuilders.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public static AnchorElementBuilder a() {
4545
}
4646

4747
public static AnchorElementBuilder a(String href) {
48-
return a().withHref(href);
48+
AnchorElementBuilder a = a();
49+
if (href == null) {
50+
return a;
51+
}
52+
String _href = href.trim();
53+
return _href.isEmpty() ? a : a.withHref(_href);
4954
}
5055

5156
public static ButtonElementBuilder button() {

dxa-framework/dxa-common-api/src/test/java/com/sdl/dxa/caching/wrapper/CacheTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void shouldDelegateKeyCalculationToConcreteCaches() {
6363
pagesCopyingCache.setKeyGenerator(keyGenerator);
6464
entitiesCache.setKeyGenerator(keyGenerator);
6565
MvcModelData mvcData = new MvcModelData("a", "a", "a", "c", "v", null);
66-
PageModelData pageData = (PageModelData) new PageModelData("1", null, null, null, null, null, null, "/url")
66+
PageModelData pageData = (PageModelData) new PageModelData("1", null, null, null, null, null, "/url")
6767
.setMvcData(mvcData);
6868
EntityModelData entityMvcData = (EntityModelData) new EntityModelData("2", null, null, null, null, mvcData, "1", "/url", null, null, null)
6969
.setMvcData(mvcData);

dxa-framework/dxa-common-api/src/test/java/com/sdl/webapp/common/markup/html/builders/HtmlBuildersTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.junit.Test;
44

55
import static org.hamcrest.CoreMatchers.is;
6+
import static org.junit.Assert.assertFalse;
67
import static org.junit.Assert.assertThat;
78

89
/**
@@ -38,6 +39,21 @@ public void testA() {
3839
assertThat(HtmlBuilders.a("http://localhost:8080").build().toHtml(), is("<a href=\"http://localhost:8080\"></a>"));
3940
}
4041

42+
@Test
43+
public void shouldNotAddHref_IfItsEmpty() {
44+
//given
45+
46+
//when
47+
AnchorElementBuilder nullA = HtmlBuilders.a(null);
48+
AnchorElementBuilder emptyA = HtmlBuilders.a("");
49+
AnchorElementBuilder trimA = HtmlBuilders.a(" ");
50+
51+
//then
52+
assertFalse(nullA.build().renderHtml().contains("href"));
53+
assertFalse(emptyA.build().renderHtml().contains("href"));
54+
assertFalse(trimA.build().renderHtml().contains("href"));
55+
}
56+
4157
@Test
4258
public void testButton() {
4359
assertThat(HtmlBuilders.button().build().toHtml(), is("<button></button>"));

dxa-framework/dxa-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>dxa-framework</artifactId>
77
<groupId>com.sdl.dxa</groupId>
8-
<version>2.0.0-SNAPSHOT</version>
8+
<version>2.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

dxa-framework/dxa-common/src/main/java/com/sdl/dxa/common/util/PathUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class PathUtils {
2929

3030
private static final Pattern PAGE_TITLE_SEQUENCE = Pattern.compile("^(?<sequence>\\d{3}\\s?)(?<pageName>(?<sequenceStop>[^\\d]).*)$");
3131

32-
private static final Pattern FILE_NAME_PATTERN = Pattern.compile(".*?/?(?<fileName>[^/.]*)\\.(?<extension>[^/.]*)$");
32+
private static final Pattern FILE_NAME_PATTERN = Pattern.compile(".*?/?(?<fileName>[^/.]*)(\\.(?<extension>[^/.]*))?$");
3333

3434
private static final Pattern INDEX_PATH_REGEXP = Pattern.compile("^(?<main>.*)(?<index>/(index(\\.html)?)?)$");
3535

dxa-framework/dxa-common/src/main/java/com/sdl/webapp/tridion/linking/AbstractLinkResolver.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import lombok.extern.slf4j.Slf4j;
1010
import org.jetbrains.annotations.Contract;
1111
import org.jetbrains.annotations.Nullable;
12+
import org.springframework.beans.factory.annotation.Value;
1213
import org.springframework.cache.annotation.Cacheable;
1314

1415
import java.util.Optional;
@@ -29,14 +30,20 @@ public abstract class AbstractLinkResolver implements LinkResolver {
2930
@Deprecated
3031
public static final String DEFAULT_PAGE_EXTENSION = PathUtils.getDefaultPageExtension();
3132

33+
@Value("${dxa.web.link-resolver.remove-extension:#{true}}")
34+
private boolean shouldRemoveExtension;
35+
36+
@Value("${dxa.web.link-resolver.strip-index-path:#{true}}")
37+
private boolean shouldStripIndexPath;
38+
3239
@Override
3340
@Cacheable(value = "defaultCache", key = "{ #root.methodName, #url, #localizationId, #resolveToBinary }")
3441
public String resolveLink(@Nullable String url, @Nullable String localizationId, boolean resolveToBinary) {
3542
final int publicationId = !Strings.isNullOrEmpty(localizationId) ? Integer.parseInt(localizationId) : 0;
3643

37-
String resolvedUrl = _resolveLink(url, publicationId, resolveToBinary);
38-
39-
return PathUtils.stripDefaultExtension(PathUtils.stripIndexPath(resolvedUrl));
44+
String resolvedLink = _resolveLink(url, publicationId, resolveToBinary);
45+
String resolvedUrl = shouldStripIndexPath ? PathUtils.stripIndexPath(resolvedLink) : resolvedLink;
46+
return shouldRemoveExtension ? PathUtils.stripDefaultExtension(resolvedUrl) : resolvedUrl;
4047
}
4148

4249
@Contract("null, _, _ -> null; !null, _, _ -> !null")

0 commit comments

Comments
 (0)