From cf92af70e6738c7eea15541ae73d8e16cb71a950 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Tue, 21 Mar 2017 12:03:00 +0100 Subject: [PATCH 01/15] TSI-2379 Self-linking resolve should be still in DXA webapp (TSI-1267) --- .../converter/SourceConverterFactory.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java index 17627e957..d802fe756 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java @@ -5,10 +5,13 @@ import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; +import com.sdl.webapp.common.api.WebRequestContext; +import com.sdl.webapp.common.api.content.LinkResolver; import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField; import com.sdl.webapp.common.api.model.EntityModel; import com.sdl.webapp.common.api.model.entity.Link; import com.sdl.webapp.common.exceptions.DxaException; +import com.sdl.webapp.common.util.TcmUtils; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.fields.exceptions.UnsupportedTargetTypeException; import lombok.extern.slf4j.Slf4j; @@ -27,6 +30,12 @@ @Slf4j public class SourceConverterFactory { + @Autowired + private WebRequestContext webRequestContext; + + @Autowired + private LinkResolver linkResolver; + private Map, SourceConverter> converters = new HashMap<>(); @Autowired @@ -78,7 +87,8 @@ private static TypeInformation getTypeInformation(TypeDescriptor targetType) { public Object selfLink(Object toLink, TypeDescriptor targetType, ModelBuilderPipeline pipeline) throws DxaException { Class objectType = getClassForSelfLinking(toLink, targetType); - String url = toLink instanceof EntityModelData ? ((EntityModelData) toLink).getLinkUrl() : ((PageModelData) toLink).getUrlPath(); + String itemId = toLink instanceof EntityModelData ? ((EntityModelData) toLink).getId() : ((PageModelData) toLink).getId(); + String url = resolveLink(itemId, webRequestContext, linkResolver); if (objectType == String.class) { return url; } else if (Link.class.isAssignableFrom(objectType)) { @@ -112,4 +122,10 @@ private Class getClassForSelfLinking(Object toLink, TypeDescriptor targetType return objectType; } + + private static String resolveLink(String itemId, WebRequestContext webRequestContext, LinkResolver linkResolver) { + String publicationId = webRequestContext.getLocalization().getId(); + String url = TcmUtils.isTcmUri(itemId) ? itemId : TcmUtils.buildTcmUri(publicationId, itemId); + return linkResolver.resolveLink(url, publicationId); + } } From 7d0050f3cb238496303877622ae578c9bd2f676f Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Tue, 21 Mar 2017 15:25:50 +0100 Subject: [PATCH 02/15] Fix for legacy mapping component converted for cases when target class is on the top of abstraction --- .../converters/ComponentLinkFieldConverter.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java index 7df18924f..8ac94810a 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java @@ -5,8 +5,10 @@ import com.sdl.webapp.common.api.content.LinkResolver; import com.sdl.webapp.common.api.localization.Localization; import com.sdl.webapp.common.api.mapping.semantic.SemanticMappingException; +import com.sdl.webapp.common.api.model.EntityModel; import com.sdl.webapp.common.api.model.entity.AbstractEntityModel; import com.sdl.webapp.common.api.model.entity.Link; +import com.sdl.webapp.common.util.TcmUtils; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.fields.exceptions.UnsupportedTargetTypeException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; @@ -69,10 +71,11 @@ public Object createPageLink(org.dd4t.contentmodel.Page page, Class targetCla String pageId = page.getId(); final String url = linkResolver.resolveLink(pageId, null); - if (targetClass.isAssignableFrom(String.class)) { + if (targetClass == String.class) { return url; - } else if (targetClass.isAssignableFrom(Link.class)) { + } else if (Link.class.isAssignableFrom(targetClass)) { final Link link = new Link(); + link.setId(String.valueOf(TcmUtils.getItemId(pageId))); link.setUrl(url); return link; } else { @@ -85,18 +88,20 @@ public Object createComponentLink(org.dd4t.contentmodel.Component component, Cla String componentId = component.getId(); final String url = linkResolver.resolveLink(componentId, null); - if (targetClass.isAssignableFrom(String.class)) { + if (String.class == targetClass) { return url; - } else if (targetClass.isAssignableFrom(Link.class)) { + } else if (Link.class.isAssignableFrom(targetClass)) { final Link link = new Link(); + link.setId(String.valueOf(TcmUtils.getItemId(componentId))); link.setUrl(url); return link; - } else if (AbstractEntityModel.class.isAssignableFrom(targetClass)) { + } else if (EntityModel.class.isAssignableFrom(targetClass)) { //what we want should be assignable from what we want to have Localization localization = this.webRequestContext.getLocalization(); try { Object retval = builder.createEntityModel(component, localization); - if (targetClass.isAssignableFrom(retval.getClass())) { + // what we got should be assignable from what we expected + if (retval != null && targetClass.isAssignableFrom(retval.getClass())) { return retval; } else { return null; From 34e2fa9e3178b9ad0d65cc51d308888695299305 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Tue, 21 Mar 2017 17:10:43 +0100 Subject: [PATCH 03/15] TSI-2348 set preview token if found in claims (TSI-24) --- .../dxa/tridion/rest/DefaultModelService.java | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java index 6216b7c9b..a2018bdac 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java @@ -17,6 +17,9 @@ import com.sdl.webapp.common.api.content.PageNotFoundException; import com.sdl.webapp.common.api.localization.Localization; import com.sdl.webapp.common.exceptions.DxaItemNotFoundException; +import com.tridion.ambientdata.AmbientDataContext; +import com.tridion.ambientdata.claimstore.ClaimStore; +import com.tridion.ambientdata.web.WebClaims; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -33,9 +36,14 @@ import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.PostConstruct; +import java.net.URI; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.Properties; +import java.util.function.Consumer; import static java.nio.charset.Charset.defaultCharset; @@ -44,6 +52,12 @@ @Service public class DefaultModelService implements ModelService { + private static final String X_PREVIEW_SESSION_TOKEN = "x-preview-session-token"; + + private static final String PREVIEW_SESSION_TOKEN = "preview-session-token"; + + private static final String COOKIE = "Cookie"; + private final RestTemplate restTemplate; private final ObjectMapper objectMapper; @@ -127,7 +141,23 @@ private ResponseExtractor _defaultExtractor(Class type) { private T _processRequest(String serviceUrl, ResponseExtractor extractor, Object... params) throws ContentProviderException { try { - return restTemplate.execute(serviceUrl, HttpMethod.GET, null, extractor, params); + return restTemplate.execute(serviceUrl, HttpMethod.GET, request -> { + processClaimValue(WebClaims.REQUEST_HEADERS, X_PREVIEW_SESSION_TOKEN, claim -> { + //noinspection unchecked + List list = (List) claim; + request.getHeaders().put(X_PREVIEW_SESSION_TOKEN, list); + }); + + processClaimValue(WebClaims.REQUEST_COOKIES, PREVIEW_SESSION_TOKEN, claim -> { + String value = (String) claim; + List cookies = request.getHeaders().get(COOKIE); + if (cookies == null) { + cookies = new ArrayList<>(); + } + cookies.add(value); + request.getHeaders().put(COOKIE, cookies); + }); + }, extractor, params); } catch (HttpStatusCodeException e) { HttpStatus statusCode = e.getStatusCode(); log.info("Got response with a status code {}", statusCode); @@ -138,6 +168,16 @@ private T _processRequest(String serviceUrl, ResponseExtractor extractor, } } + private void processClaimValue(URI uri, String key, Consumer consumer) { + ClaimStore claimStore = AmbientDataContext.getCurrentClaimStore(); + if (claimStore != null) { + Map claims = claimStore.get(uri, Map.class); + if (claims != null && claims.containsKey(key)) { + consumer.accept(claims.get(key)); + } + } + } + @NotNull @Override @Cacheable(value = "default") From 76d5463169179b9f6a30637e8b476b56080a0ec5 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Fri, 24 Mar 2017 13:47:51 +0100 Subject: [PATCH 04/15] TSI-2384 Make R2 mapping the default (TSI-2375) --- .../src/main/java/com/sdl/webapp/Legacy.java} | 14 ++++----- .../BrokerComponentPresentationProvider.java | 2 ++ .../tridion/SpringContextConfiguration.java | 23 ++------------ .../fields/FieldConverterRegistry.java | 2 ++ .../ComponentLinkFieldConverter.java | 2 ++ .../fields/converters/DateFieldConverter.java | 2 ++ .../converters/EmbeddedFieldConverter.java | 2 ++ .../ExternalLinkFieldConverter.java | 2 ++ .../converters/KeywordFieldConverter.java | 2 ++ .../MultiLineTextFieldConverter.java | 2 ++ .../converters/MultimediaFieldConverter.java | 2 ++ .../converters/NumberFieldConverter.java | 2 ++ .../fields/converters/TextFieldConverter.java | 2 ++ .../converters/XhtmlFieldConverter.java | 2 ++ .../mapping/DefaultContentProvider.java | 2 ++ .../mapping/DefaultRichTextProcessor.java | 5 ++-- .../tridion/mapping/EntityBuilderImpl.java | 2 ++ .../mapping/ModelBuilderPipelineImpl.java | 2 ++ .../tridion/mapping/PageBuilderImpl.java | 2 ++ .../navigation/StaticNavigationProvider.java | 2 +- .../dxa/tridion/R2SpringConfiguration.java | 5 +--- .../converter/ContentModelDataConverter.java | 2 -- .../converter/EntityModelDataConverter.java | 2 -- .../converter/KeywordModelDataConverter.java | 2 -- .../converter/ListWrapperConverter.java | 2 -- .../mapping/converter/NumberConverter.java | 2 -- .../converter/RichTextDataConverter.java | 2 -- .../converter/SourceConverterFactory.java | 2 -- .../mapping/converter/StringConverter.java | 2 -- .../mapping/impl/DefaultContentProvider.java | 2 -- .../mapping/impl/DefaultModelBuilder.java | 2 -- .../impl/ModelBuilderPipelineImpl.java | 2 -- .../navigation/StaticNavigationProvider.java | 2 +- .../dxa/tridion/rest/DefaultModelService.java | 2 -- .../config/TridionSpringConfiguration.java | 30 +++++++++++++++++++ 35 files changed, 74 insertions(+), 63 deletions(-) rename dxa-framework/{dxa-r2-provider/src/main/java/com/sdl/dxa/R2.java => dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java} (69%) create mode 100644 dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/R2.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java similarity index 69% rename from dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/R2.java rename to dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java index f7f2c22f2..a0545e8d3 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/R2.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java @@ -1,6 +1,5 @@ -package com.sdl.dxa; +package com.sdl.webapp; -import com.sdl.webapp.tridion.navigation.DynamicNavigationProvider; import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; @@ -11,8 +10,8 @@ import java.lang.annotation.Target; /** - * Marker annotation/shortcut for R2 pipeline profile. This annotation should be put on {@link Component}s and subclasses - * to conditionally enable them in case of presence of {@code r2.provider} Spring profile. + * Marker annotation/shortcut for Legacy pipeline profile. This annotation should be put on {@link Component}s and subclasses + * to conditionally enable them in case of presence of {@code legacy.provider} Spring profile. *

Pay attention that this also makes a bean {@code @Primary}. This means that in case you have 2+ * beans of the same time, this potentially won't work, solution is simple (without double use of {@code @Primary}):

*

@@ -38,14 +37,11 @@
  *
  * @see Primary
  * @see Profile
- * @see DynamicNavigationProvider
- * @see com.sdl.dxa.tridion.navigation.StaticNavigationProvider
- * @see com.sdl.webapp.tridion.navigation.AbstractStaticNavigationProvider
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE, ElementType.METHOD})
-@Profile("r2.provider")
+@Profile("legacy.provider")
 @Primary
-public @interface R2 {
+public @interface Legacy {
 
 }
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java
index f5e35f9a7..86dfbc70a 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java
@@ -4,6 +4,7 @@
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sdl.web.api.broker.WebComponentPresentationFactoryImpl;
 import com.sdl.web.api.dynamic.WebComponentPresentationFactory;
+import com.sdl.webapp.Legacy;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.dd4t.contentmodel.ComponentPresentation;
@@ -28,6 +29,7 @@
  */
 @Service
 @Slf4j
+@Legacy
 public class BrokerComponentPresentationProvider extends BaseBrokerProvider implements ComponentPresentationProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(BrokerComponentPresentationProvider.class);
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java
index cb79381a4..c7dd532a1 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java
@@ -1,12 +1,7 @@
 package com.sdl.webapp.tridion;
 
-import com.sdl.web.api.content.BinaryContentRetriever;
-import com.sdl.web.api.dynamic.BinaryContentRetrieverImpl;
-import com.sdl.web.api.dynamic.DynamicMappingsRetriever;
-import com.sdl.web.api.dynamic.DynamicMappingsRetrieverImpl;
-import com.sdl.web.api.dynamic.DynamicMetaRetriever;
-import com.sdl.web.api.dynamic.DynamicMetaRetrieverImpl;
 import com.sdl.web.api.taxonomies.TaxonomyRelationManager;
+import com.sdl.webapp.Legacy;
 import com.tridion.taxonomies.TaxonomyFactory;
 import org.dd4t.contentmodel.impl.BaseField;
 import org.dd4t.contentmodel.impl.ComponentImpl;
@@ -34,6 +29,7 @@
 import org.springframework.context.annotation.Profile;
 
 @Configuration
+@Legacy
 @ComponentScan("com.sdl.webapp.tridion")
 public class SpringContextConfiguration {
 
@@ -82,21 +78,6 @@ public ComponentPresentationProvider componentPresentationProvider() {
         return componentPresentationProvider;
     }
 
-    @Bean
-    public DynamicMetaRetriever dynamicMetaRetriever() {
-        return new DynamicMetaRetrieverImpl();
-    }
-
-    @Bean
-    public BinaryContentRetriever binaryContentRetriever() {
-        return new BinaryContentRetrieverImpl();
-    }
-
-    @Bean
-    public DynamicMappingsRetriever dynamicMappingsRetriever() {
-        return new DynamicMappingsRetrieverImpl();
-    }
-
     @Bean
     public PayloadCacheProvider cacheProvider() {
         EHCacheProvider cacheProvider = new EHCacheProvider();
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java
index 1c96b3a0e..1f4a08cb5 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.converters.FieldConverter;
 import com.sdl.webapp.tridion.fields.exceptions.UnsupportedFieldTypeException;
 import org.dd4t.contentmodel.FieldType;
@@ -11,6 +12,7 @@
 import java.util.Map;
 
 @Component
+@Legacy
 public class FieldConverterRegistry {
 
     private final Map fieldConverters = new HashMap<>();
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java
index 8ac94810a..a212721ca 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.WebRequestContext;
 import com.sdl.webapp.common.api.content.ContentProviderException;
 import com.sdl.webapp.common.api.content.LinkResolver;
@@ -23,6 +24,7 @@
 import static com.sdl.webapp.common.util.StringUtils.toStrings;
 
 @Component
+@Legacy
 public class ComponentLinkFieldConverter extends AbstractFieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.COMPONENTLINK};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java
index 364a54c9b..7615949e9 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java
@@ -1,6 +1,7 @@
 package com.sdl.webapp.tridion.fields.converters;
 
 import com.google.common.base.Strings;
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
 import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline;
 import org.dd4t.contentmodel.FieldType;
@@ -14,6 +15,7 @@
 import static com.sdl.webapp.common.util.StringUtils.toStrings;
 
 @Component
+@Legacy
 public class DateFieldConverter extends AbstractFieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.DATE};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java
index cbad155db..1cb1324fc 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.mapping.semantic.SemanticMapper;
 import com.sdl.webapp.common.api.mapping.semantic.SemanticMappingException;
 import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField;
@@ -19,6 +20,7 @@
 import java.util.List;
 
 @Component
+@Legacy
 public class EmbeddedFieldConverter implements FieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.EMBEDDED};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java
index 408950fcb..df1269fb2 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
 import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline;
 import org.dd4t.contentmodel.FieldType;
@@ -9,6 +10,7 @@
 import java.util.List;
 
 @Component
+@Legacy
 public class ExternalLinkFieldConverter extends AbstractFieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.EXTERNALLINK};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java
index bc11ad288..ce659eb37 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java
@@ -1,6 +1,7 @@
 package com.sdl.webapp.tridion.fields.converters;
 
 import com.sdl.dxa.tridion.mapping.converter.source.keyword.Converter;
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.mapping.semantic.SemanticFieldDataProvider;
 import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField;
 import com.sdl.webapp.common.api.model.entity.Tag;
@@ -31,6 +32,7 @@
  */
 @Component
 @Slf4j
+@Legacy
 public class KeywordFieldConverter implements FieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.KEYWORD};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java
index 08ef0d622..cb22686e3 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
 import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline;
 import org.dd4t.contentmodel.FieldType;
@@ -9,6 +10,7 @@
 import java.util.List;
 
 @Component
+@Legacy
 public class MultiLineTextFieldConverter extends AbstractFieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.MULTILINETEXT};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java
index 436a306db..b2a239eef 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.WebRequestContext;
 import com.sdl.webapp.common.api.content.LinkResolver;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
@@ -12,6 +13,7 @@
 import java.util.List;
 
 @Component
+@Legacy
 public class MultimediaFieldConverter extends ComponentLinkFieldConverter {
 
     @Autowired
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java
index 9d420ab62..e342e4933 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
 import com.sdl.webapp.tridion.fields.exceptions.UnsupportedTargetTypeException;
 import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline;
@@ -12,6 +13,7 @@
 
 import static com.sdl.webapp.common.util.StringUtils.toStrings;
 
+@Legacy
 @Component
 public class NumberFieldConverter extends AbstractFieldConverter {
 
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java
index 475e53044..935735dc7 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException;
 import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline;
 import org.dd4t.contentmodel.FieldType;
@@ -9,6 +10,7 @@
 import java.util.List;
 
 @Component
+@Legacy
 public class TextFieldConverter extends AbstractFieldConverter {
 
     private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.TEXT};
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java
index a23cd6e84..a87234b82 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.fields.converters;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.WebRequestContext;
 import com.sdl.webapp.common.api.content.RichTextProcessor;
 import com.sdl.webapp.common.api.model.RichText;
@@ -15,6 +16,7 @@
 
 import static com.sdl.webapp.common.util.StringUtils.toStrings;
 
+@Legacy
 @Component
 public class XhtmlFieldConverter extends AbstractFieldConverter {
 
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java
index 01bb012db..715edb1d1 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java
@@ -2,6 +2,7 @@
 
 import com.sdl.web.api.content.BinaryContentRetriever;
 import com.sdl.web.api.dynamic.DynamicMetaRetriever;
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.WebRequestContext;
 import com.sdl.webapp.common.api.content.ContentProviderException;
 import com.sdl.webapp.common.api.content.LinkResolver;
@@ -53,6 +54,7 @@
  */
 @Slf4j
 @Service
+@Legacy
 public class DefaultContentProvider extends AbstractDefaultContentProvider {
 
     private static final Object LOCK = new Object();
diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java
index 598233dc3..85cf2158f 100644
--- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java
+++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java
@@ -1,5 +1,6 @@
 package com.sdl.webapp.tridion.mapping;
 
+import com.sdl.webapp.Legacy;
 import com.sdl.webapp.common.api.WebRequestContext;
 import com.sdl.webapp.common.api.content.LinkResolver;
 import com.sdl.webapp.common.api.content.RichTextProcessor;
@@ -54,9 +55,7 @@
 import static org.apache.commons.lang3.StringUtils.isEmpty;
 
 @Component
-/**
- * 

DefaultRichTextProcessor class.

- */ +@Legacy public class DefaultRichTextProcessor implements RichTextProcessor { /** diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java index 8542befae..be78c7937 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java @@ -1,5 +1,6 @@ package com.sdl.webapp.tridion.mapping; +import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.localization.Localization; import com.sdl.webapp.common.api.mapping.semantic.SemanticMapper; @@ -40,6 +41,7 @@ @Slf4j @Service +@Legacy public final class EntityBuilderImpl implements EntityBuilder { @Autowired diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java index d178a3054..23842b002 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java @@ -1,5 +1,6 @@ package com.sdl.webapp.tridion.mapping; +import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.content.ContentProvider; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.localization.Localization; @@ -23,6 +24,7 @@ */ @org.springframework.stereotype.Component @Slf4j +@Legacy public class ModelBuilderPipelineImpl implements ModelBuilderPipeline { private List pageBuilderHandlers; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java index 40e75dc49..8c8e2195a 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java @@ -1,6 +1,7 @@ package com.sdl.webapp.tridion.mapping; import com.google.common.base.Joiner; +import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.ContentProvider; import com.sdl.webapp.common.api.content.ContentProviderException; @@ -64,6 +65,7 @@ import static com.sdl.webapp.util.dd4t.MvcDataHelper.createRegionMvcData; import static com.sdl.webapp.util.dd4t.MvcDataHelper.getRegionName; +@Legacy @Component public final class PageBuilderImpl implements PageBuilder { diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java index 4b584b506..59d2b7706 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java @@ -19,7 +19,7 @@ @Service @Slf4j -@Profile("!r2.provider") +@Profile("legacy.provider") public class StaticNavigationProvider extends AbstractStaticNavigationProvider { private static final Object $LOCK = new Object(); diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java index e610f3f07..16ac205d9 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java @@ -1,7 +1,6 @@ package com.sdl.dxa.tridion; import com.fasterxml.jackson.databind.ObjectMapper; -import com.sdl.dxa.R2; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -11,17 +10,15 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; -@R2 @Slf4j @Configuration @EnableCaching public class R2SpringConfiguration { - @Autowired @Qualifier("dxaR2ObjectMapper") private ObjectMapper objectMapper; - + @Bean public RestTemplate modelServiceRestTemplate() { RestTemplate restTemplate = new RestTemplate(); diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ContentModelDataConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ContentModelDataConverter.java index bc031831b..dc1b71bac 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ContentModelDataConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ContentModelDataConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.ContentModelData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; @@ -17,7 +16,6 @@ import java.util.Collections; import java.util.List; -@R2 @Component @Slf4j public class ContentModelDataConverter implements SourceConverter { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/EntityModelDataConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/EntityModelDataConverter.java index 0f2ce1e8d..cbee7fd6a 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/EntityModelDataConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/EntityModelDataConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; @@ -15,7 +14,6 @@ import java.util.Collections; import java.util.List; -@R2 @Component @Slf4j public class EntityModelDataConverter implements SourceConverter { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/KeywordModelDataConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/KeywordModelDataConverter.java index 12307f907..95ce29b0b 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/KeywordModelDataConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/KeywordModelDataConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.KeywordModelData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.converter.source.keyword.Converter; @@ -13,7 +12,6 @@ import java.util.Collections; import java.util.List; -@R2 @Component public class KeywordModelDataConverter implements SourceConverter { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ListWrapperConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ListWrapperConverter.java index 139d242da..3ad45347d 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ListWrapperConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/ListWrapperConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.util.ListWrapper; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; @@ -17,7 +16,6 @@ import java.util.HashSet; import java.util.List; -@R2 @Component public class ListWrapperConverter implements SourceConverter { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/NumberConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/NumberConverter.java index 90855b6d5..f2b173587 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/NumberConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/NumberConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField; @@ -13,7 +12,6 @@ @Slf4j @Component -@R2 public class NumberConverter implements SourceConverter { @Override diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/RichTextDataConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/RichTextDataConverter.java index 9b23426dc..393b6ecdb 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/RichTextDataConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/RichTextDataConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.RichTextData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; @@ -21,7 +20,6 @@ @Slf4j @Component -@R2 public class RichTextDataConverter implements SourceConverter { @Override diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java index d802fe756..018c437e1 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/SourceConverterFactory.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; @@ -25,7 +24,6 @@ import java.util.Map; import java.util.Set; -@R2 @Service @Slf4j public class SourceConverterFactory { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/StringConverter.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/StringConverter.java index c2cee4dea..c5f2d2c33 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/StringConverter.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/StringConverter.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.converter; -import com.sdl.dxa.R2; import com.sdl.dxa.tridion.mapping.ModelBuilderPipeline; import com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider; import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField; @@ -18,7 +17,6 @@ import java.util.Date; import java.util.List; -@R2 @Component @Slf4j public class StringConverter implements SourceConverter { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultContentProvider.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultContentProvider.java index 1bb4d5572..43ac9faae 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultContentProvider.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultContentProvider.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.impl; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.ContentModelData; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.PageModelData; @@ -30,7 +29,6 @@ import static com.sdl.dxa.common.dto.PageRequestDto.PageInclusion.INCLUDE; -@R2 @Service("r2ContentProvider") @Slf4j public class DefaultContentProvider extends AbstractDefaultContentProvider { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultModelBuilder.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultModelBuilder.java index 8d61a277f..36b34fb7f 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultModelBuilder.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/DefaultModelBuilder.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.impl; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.BinaryContentData; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.ExternalContentData; @@ -52,7 +51,6 @@ */ @Slf4j @Service -@R2 public class DefaultModelBuilder implements EntityModelBuilder, PageModelBuilder { @Autowired diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/ModelBuilderPipelineImpl.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/ModelBuilderPipelineImpl.java index c51dfad25..fa22c4a90 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/ModelBuilderPipelineImpl.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/mapping/impl/ModelBuilderPipelineImpl.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.mapping.impl; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.tridion.mapping.EntityModelBuilder; @@ -29,7 +28,6 @@ * @see PageModelBuilder */ @Service("r2modelBuilder") -@R2 @Slf4j public class ModelBuilderPipelineImpl implements ModelBuilderPipeline { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java index f002c554d..f0546d950 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java @@ -15,7 +15,7 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; -@Profile("r2.provider") +@Profile("!legacy.provider") @Service("r2StaticNavigationProvider") public class StaticNavigationProvider extends AbstractStaticNavigationProvider { diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java index a2018bdac..fff38a020 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java @@ -1,7 +1,6 @@ package com.sdl.dxa.tridion.rest; import com.fasterxml.jackson.databind.ObjectMapper; -import com.sdl.dxa.R2; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.common.dto.EntityRequestDto; @@ -47,7 +46,6 @@ import static java.nio.charset.Charset.defaultCharset; -@R2 @Slf4j @Service public class DefaultModelService implements ModelService { diff --git a/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java new file mode 100644 index 000000000..c36fe3a6c --- /dev/null +++ b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java @@ -0,0 +1,30 @@ +package com.sdl.webapp.config; + +import com.sdl.web.api.content.BinaryContentRetriever; +import com.sdl.web.api.dynamic.BinaryContentRetrieverImpl; +import com.sdl.web.api.dynamic.DynamicMappingsRetriever; +import com.sdl.web.api.dynamic.DynamicMappingsRetrieverImpl; +import com.tridion.dynamiccontent.DynamicMetaRetriever; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@ComponentScan({"com.sdl.webapp.tridion", "com.sdl.dxa.tridion"}) +@Configuration +public class TridionSpringConfiguration { + + @Bean + public DynamicMetaRetriever dynamicMetaRetriever() { + return new DynamicMetaRetriever(); + } + + @Bean + public BinaryContentRetriever binaryContentRetriever() { + return new BinaryContentRetrieverImpl(); + } + + @Bean + public DynamicMappingsRetriever dynamicMappingsRetriever() { + return new DynamicMappingsRetrieverImpl(); + } +} From b90ff7cab8031259d5f9b0ad8848c929176565be Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Fri, 24 Mar 2017 16:45:11 +0100 Subject: [PATCH 05/15] TSI-2348 session preview token set for requests to MS (TSI-24) --- .../dxa/tridion/R2SpringConfiguration.java | 9 ++- .../dxa/tridion/rest/DefaultModelService.java | 76 ++++++++----------- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java index 16ac205d9..9a5b0ad64 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/R2SpringConfiguration.java @@ -10,6 +10,8 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import java.util.stream.Collectors; + @Slf4j @Configuration @EnableCaching @@ -22,7 +24,12 @@ public class R2SpringConfiguration { @Bean public RestTemplate modelServiceRestTemplate() { RestTemplate restTemplate = new RestTemplate(); - restTemplate.getMessageConverters().add(0, dxaR2MappingJackson2HttpMessageConverter()); + // replace the default JSON message converter with R2 on the right place in collection + restTemplate.setMessageConverters( + restTemplate.getMessageConverters().stream() + .map(converter -> converter instanceof MappingJackson2HttpMessageConverter ? + dxaR2MappingJackson2HttpMessageConverter() : converter) + .collect(Collectors.toList())); return restTemplate; } diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java index fff38a020..1a203b1e2 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java @@ -1,6 +1,5 @@ package com.sdl.dxa.tridion.rest; -import com.fasterxml.jackson.databind.ObjectMapper; import com.sdl.dxa.api.datamodel.model.EntityModelData; import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.common.dto.EntityRequestDto; @@ -22,29 +21,27 @@ import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.Cacheable; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import org.springframework.util.StreamUtils; import org.springframework.web.client.HttpStatusCodeException; -import org.springframework.web.client.ResponseExtractor; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.PostConstruct; import java.net.URI; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Properties; -import java.util.function.Consumer; - -import static java.nio.charset.Charset.defaultCharset; +import java.util.function.Function; @Slf4j @Service @@ -54,12 +51,8 @@ public class DefaultModelService implements ModelService { private static final String PREVIEW_SESSION_TOKEN = "preview-session-token"; - private static final String COOKIE = "Cookie"; - private final RestTemplate restTemplate; - private final ObjectMapper objectMapper; - @Value("${cil.cd.client.conf}") private String configurationFileName; @@ -80,9 +73,8 @@ public class DefaultModelService implements ModelService { private WebRequestContext webRequestContext; @Autowired - public DefaultModelService(RestTemplate restTemplate, @Qualifier("dxaR2ObjectMapper") ObjectMapper objectMapper) { + public DefaultModelService(RestTemplate restTemplate) { this.restTemplate = restTemplate; - this.objectMapper = objectMapper; } @PostConstruct @@ -115,13 +107,13 @@ public void initService() throws ConfigurationException { @Override @Cacheable(value = "default") public PageModelData loadPageModel(PageRequestDto pageRequest) throws ContentProviderException { - return _loadPage(pageModelUrl, _defaultExtractor(PageModelData.class), pageRequest); + return _loadPage(pageModelUrl, PageModelData.class, pageRequest); } - private T _loadPage(String serviceUrl, ResponseExtractor extractor, PageRequestDto pageRequest) throws ContentProviderException { + private T _loadPage(String serviceUrl, Class type, PageRequestDto pageRequest) throws ContentProviderException { Localization localization = webRequestContext.getLocalization(); try { - T page = _processRequest(serviceUrl, extractor, + T page = _processRequest(serviceUrl, type, pageRequest.getUriType(), pageRequest.getPublicationId() != 0 ? pageRequest.getPublicationId() : localization.getId(), pageRequest.getPath(), @@ -133,29 +125,25 @@ private T _loadPage(String serviceUrl, ResponseExtractor extractor, PageR } } - private ResponseExtractor _defaultExtractor(Class type) { - return response -> objectMapper.readValue(response.getBody(), type); - } - - private T _processRequest(String serviceUrl, ResponseExtractor extractor, Object... params) throws ContentProviderException { + private T _processRequest(String serviceUrl, Class type, Object... params) throws ContentProviderException { try { - return restTemplate.execute(serviceUrl, HttpMethod.GET, request -> { - processClaimValue(WebClaims.REQUEST_HEADERS, X_PREVIEW_SESSION_TOKEN, claim -> { - //noinspection unchecked - List list = (List) claim; - request.getHeaders().put(X_PREVIEW_SESSION_TOKEN, list); - }); - - processClaimValue(WebClaims.REQUEST_COOKIES, PREVIEW_SESSION_TOKEN, claim -> { - String value = (String) claim; - List cookies = request.getHeaders().get(COOKIE); - if (cookies == null) { - cookies = new ArrayList<>(); - } - cookies.add(value); - request.getHeaders().put(COOKIE, cookies); - }); - }, extractor, params); + HttpHeaders headers = new HttpHeaders(); + + //noinspection unchecked + String previewToken = _getClaimValue(WebClaims.REQUEST_HEADERS, X_PREVIEW_SESSION_TOKEN, + claim -> Optional.of(((List) claim).get(0))) + .orElseGet(() -> _getClaimValue(WebClaims.REQUEST_COOKIES, PREVIEW_SESSION_TOKEN, + claim -> Optional.of(claim.toString())) + .orElse(null)); + + if (previewToken != null) { + // commented because of bug in CIS https://jira.sdl.com/browse/CRQ-3935 + // headers.add(X_PREVIEW_SESSION_TOKEN, previewToken); + headers.add(HttpHeaders.COOKIE, String.format("%s=%s", PREVIEW_SESSION_TOKEN, previewToken)); + } + + ResponseEntity response = restTemplate.exchange(serviceUrl, HttpMethod.GET, new HttpEntity<>(headers), type, params); + return response.getBody(); } catch (HttpStatusCodeException e) { HttpStatus statusCode = e.getStatusCode(); log.info("Got response with a status code {}", statusCode); @@ -166,14 +154,16 @@ private T _processRequest(String serviceUrl, ResponseExtractor extractor, } } - private void processClaimValue(URI uri, String key, Consumer consumer) { + @NotNull + private Optional _getClaimValue(URI uri, String key, Function> deriveValue) { ClaimStore claimStore = AmbientDataContext.getCurrentClaimStore(); if (claimStore != null) { Map claims = claimStore.get(uri, Map.class); if (claims != null && claims.containsKey(key)) { - consumer.accept(claims.get(key)); + return deriveValue.apply(claims.get(key)); } } + return Optional.empty(); } @NotNull @@ -181,7 +171,7 @@ private void processClaimValue(URI uri, String key, Consumer consumer) { @Cacheable(value = "default") public String loadPageContent(PageRequestDto pageRequest) throws ContentProviderException { String serviceUrl = UriComponentsBuilder.fromUriString(pageModelUrl).queryParam("raw").build().toUriString(); - return _loadPage(serviceUrl, response -> StreamUtils.copyToString(response.getBody(), defaultCharset()), pageRequest); + return _loadPage(serviceUrl, String.class, pageRequest); } @NotNull @@ -197,7 +187,7 @@ public EntityModelData loadEntity(@NotNull String entityId) throws ContentProvid public EntityModelData loadEntity(EntityRequestDto entityRequest) throws ContentProviderException { Localization localization = webRequestContext.getLocalization(); - EntityModelData modelData = _processRequest(entityModelUrl, _defaultExtractor(EntityModelData.class), + EntityModelData modelData = _processRequest(entityModelUrl, EntityModelData.class, entityRequest.getUriType(), entityRequest.getPublicationId() != 0 ? entityRequest.getPublicationId() : localization.getId(), entityRequest.getComponentId(), From ee4a00889aac290278b4b6107df909fb4266172e Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Mon, 27 Mar 2017 10:46:34 +0200 Subject: [PATCH 06/15] TSI-2384 settings of default mapping is not set during build (TSI-2375) --- .../src/main/java/com/sdl/webapp/Legacy.java | 47 ------------------- .../BrokerComponentPresentationProvider.java | 7 +-- .../tridion/SpringContextConfiguration.java | 3 +- .../fields/FieldConverterRegistry.java | 2 - .../ComponentLinkFieldConverter.java | 3 +- .../fields/converters/DateFieldConverter.java | 2 - .../converters/EmbeddedFieldConverter.java | 2 - .../ExternalLinkFieldConverter.java | 2 - .../converters/KeywordFieldConverter.java | 2 - .../MultiLineTextFieldConverter.java | 2 - .../converters/MultimediaFieldConverter.java | 2 - .../converters/NumberFieldConverter.java | 2 - .../fields/converters/TextFieldConverter.java | 2 - .../converters/XhtmlFieldConverter.java | 2 - .../mapping/DefaultContentProvider.java | 2 - .../mapping/DefaultRichTextProcessor.java | 3 +- .../tridion/mapping/EntityBuilderImpl.java | 2 - .../mapping/ModelBuilderPipelineImpl.java | 2 - .../tridion/mapping/PageBuilderImpl.java | 2 - .../navigation/StaticNavigationProvider.java | 2 - .../navigation/StaticNavigationProvider.java | 2 - dxa-webapp/pom.xml | 42 +++++++++++++---- 22 files changed, 39 insertions(+), 98 deletions(-) delete mode 100644 dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java deleted file mode 100644 index a0545e8d3..000000000 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/Legacy.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.sdl.webapp; - -import org.springframework.context.annotation.Primary; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation/shortcut for Legacy pipeline profile. This annotation should be put on {@link Component}s and subclasses - * to conditionally enable them in case of presence of {@code legacy.provider} Spring profile. - *

Pay attention that this also makes a bean {@code @Primary}. This means that in case you have 2+ - * beans of the same time, this potentially won't work, solution is simple (without double use of {@code @Primary}):

- *

- * interface Interface {}
- *
- * interface MoreConcreteInterface extends Interface {}
- *
- * @Profile("!special")
- * @Service
- * class Bean1_NotSpecial implements MoreConcreteInterface { }
- *
- * @Profile("special")
- * @Service
- * class Bean2_Special implements MoreConcreteInterface { }
- *
- * @Primary
- * @Profile("special")
- * @Service
- * class Bean3_Special implements interface Interface {
- *      @Autowired MoreConcreteInterface dependency;
- * }
- * 
- * - * @see Primary - * @see Profile - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.METHOD}) -@Profile("legacy.provider") -@Primary -public @interface Legacy { - -} diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java index 86dfbc70a..06696be72 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/BrokerComponentPresentationProvider.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.sdl.web.api.broker.WebComponentPresentationFactoryImpl; import com.sdl.web.api.dynamic.WebComponentPresentationFactory; -import com.sdl.webapp.Legacy; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.dd4t.contentmodel.ComponentPresentation; @@ -29,7 +28,6 @@ */ @Service @Slf4j -@Legacy public class BrokerComponentPresentationProvider extends BaseBrokerProvider implements ComponentPresentationProvider { private static final Logger LOG = LoggerFactory.getLogger(BrokerComponentPresentationProvider.class); @@ -59,6 +57,7 @@ protected ComponentPresentation getDynamicComponentPresentationInternal(int comp return getComponentPresentation(result.getContent()); } + /** * {@inheritDoc} */ @@ -77,7 +76,9 @@ public ComponentPresentation getDynamicComponentPresentation(int componentId, in return getDynamicComponentPresentationInternal(componentId, templateId, publicationId); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public List getDynamicComponentPresentations(final String[] itemUris, final int templateId, final int publicationId) throws ItemNotFoundException, SerializationException { diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java index c7dd532a1..6f703b501 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java @@ -1,7 +1,6 @@ package com.sdl.webapp.tridion; import com.sdl.web.api.taxonomies.TaxonomyRelationManager; -import com.sdl.webapp.Legacy; import com.tridion.taxonomies.TaxonomyFactory; import org.dd4t.contentmodel.impl.BaseField; import org.dd4t.contentmodel.impl.ComponentImpl; @@ -29,7 +28,6 @@ import org.springframework.context.annotation.Profile; @Configuration -@Legacy @ComponentScan("com.sdl.webapp.tridion") public class SpringContextConfiguration { @@ -159,6 +157,7 @@ public DataBindFactory databindFactory() { @Configuration @Profile("dxa.no-cache") public static class NoCacheConfiguration { + @Bean public PayloadCacheProvider cacheProvider() { return new NoCacheProvider(); diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java index 1f4a08cb5..1c96b3a0e 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/FieldConverterRegistry.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.converters.FieldConverter; import com.sdl.webapp.tridion.fields.exceptions.UnsupportedFieldTypeException; import org.dd4t.contentmodel.FieldType; @@ -12,7 +11,6 @@ import java.util.Map; @Component -@Legacy public class FieldConverterRegistry { private final Map fieldConverters = new HashMap<>(); diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java index a212721ca..17c4822ba 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ComponentLinkFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.content.LinkResolver; @@ -24,12 +23,12 @@ import static com.sdl.webapp.common.util.StringUtils.toStrings; @Component -@Legacy public class ComponentLinkFieldConverter extends AbstractFieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.COMPONENTLINK}; private final LinkResolver linkResolver; + private final WebRequestContext webRequestContext; @Autowired diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java index 7615949e9..364a54c9b 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/DateFieldConverter.java @@ -1,7 +1,6 @@ package com.sdl.webapp.tridion.fields.converters; import com.google.common.base.Strings; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; import org.dd4t.contentmodel.FieldType; @@ -15,7 +14,6 @@ import static com.sdl.webapp.common.util.StringUtils.toStrings; @Component -@Legacy public class DateFieldConverter extends AbstractFieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.DATE}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java index 1cb1324fc..cbad155db 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/EmbeddedFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.mapping.semantic.SemanticMapper; import com.sdl.webapp.common.api.mapping.semantic.SemanticMappingException; import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField; @@ -20,7 +19,6 @@ import java.util.List; @Component -@Legacy public class EmbeddedFieldConverter implements FieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.EMBEDDED}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java index df1269fb2..408950fcb 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/ExternalLinkFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; import org.dd4t.contentmodel.FieldType; @@ -10,7 +9,6 @@ import java.util.List; @Component -@Legacy public class ExternalLinkFieldConverter extends AbstractFieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.EXTERNALLINK}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java index ce659eb37..bc11ad288 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/KeywordFieldConverter.java @@ -1,7 +1,6 @@ package com.sdl.webapp.tridion.fields.converters; import com.sdl.dxa.tridion.mapping.converter.source.keyword.Converter; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.mapping.semantic.SemanticFieldDataProvider; import com.sdl.webapp.common.api.mapping.semantic.config.SemanticField; import com.sdl.webapp.common.api.model.entity.Tag; @@ -32,7 +31,6 @@ */ @Component @Slf4j -@Legacy public class KeywordFieldConverter implements FieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.KEYWORD}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java index cb22686e3..08ef0d622 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultiLineTextFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; import org.dd4t.contentmodel.FieldType; @@ -10,7 +9,6 @@ import java.util.List; @Component -@Legacy public class MultiLineTextFieldConverter extends AbstractFieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.MULTILINETEXT}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java index b2a239eef..436a306db 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/MultimediaFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.LinkResolver; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; @@ -13,7 +12,6 @@ import java.util.List; @Component -@Legacy public class MultimediaFieldConverter extends ComponentLinkFieldConverter { @Autowired diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java index e342e4933..9d420ab62 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/NumberFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.fields.exceptions.UnsupportedTargetTypeException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; @@ -13,7 +12,6 @@ import static com.sdl.webapp.common.util.StringUtils.toStrings; -@Legacy @Component public class NumberFieldConverter extends AbstractFieldConverter { diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java index 935735dc7..475e53044 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/TextFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.tridion.fields.exceptions.FieldConverterException; import com.sdl.webapp.tridion.mapping.ModelBuilderPipeline; import org.dd4t.contentmodel.FieldType; @@ -10,7 +9,6 @@ import java.util.List; @Component -@Legacy public class TextFieldConverter extends AbstractFieldConverter { private static final FieldType[] SUPPORTED_FIELD_TYPES = {FieldType.TEXT}; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java index a87234b82..a23cd6e84 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/fields/converters/XhtmlFieldConverter.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.fields.converters; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.RichTextProcessor; import com.sdl.webapp.common.api.model.RichText; @@ -16,7 +15,6 @@ import static com.sdl.webapp.common.util.StringUtils.toStrings; -@Legacy @Component public class XhtmlFieldConverter extends AbstractFieldConverter { diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java index 715edb1d1..01bb012db 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java @@ -2,7 +2,6 @@ import com.sdl.web.api.content.BinaryContentRetriever; import com.sdl.web.api.dynamic.DynamicMetaRetriever; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.content.LinkResolver; @@ -54,7 +53,6 @@ */ @Slf4j @Service -@Legacy public class DefaultContentProvider extends AbstractDefaultContentProvider { private static final Object LOCK = new Object(); diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java index 85cf2158f..3a75c128a 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultRichTextProcessor.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.mapping; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.LinkResolver; import com.sdl.webapp.common.api.content.RichTextProcessor; @@ -55,13 +54,13 @@ import static org.apache.commons.lang3.StringUtils.isEmpty; @Component -@Legacy public class DefaultRichTextProcessor implements RichTextProcessor { /** * Constant EMBEDDED_ENTITY="EmbeddedEntity" */ public static final String EMBEDDED_ENTITY = "EmbeddedEntity"; + private static final Logger LOG = LoggerFactory.getLogger(DefaultRichTextProcessor.class); @Autowired diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java index be78c7937..8542befae 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/EntityBuilderImpl.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.mapping; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.localization.Localization; import com.sdl.webapp.common.api.mapping.semantic.SemanticMapper; @@ -41,7 +40,6 @@ @Slf4j @Service -@Legacy public final class EntityBuilderImpl implements EntityBuilder { @Autowired diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java index 23842b002..d178a3054 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/ModelBuilderPipelineImpl.java @@ -1,6 +1,5 @@ package com.sdl.webapp.tridion.mapping; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.content.ContentProvider; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.localization.Localization; @@ -24,7 +23,6 @@ */ @org.springframework.stereotype.Component @Slf4j -@Legacy public class ModelBuilderPipelineImpl implements ModelBuilderPipeline { private List pageBuilderHandlers; diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java index 8c8e2195a..40e75dc49 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/PageBuilderImpl.java @@ -1,7 +1,6 @@ package com.sdl.webapp.tridion.mapping; import com.google.common.base.Joiner; -import com.sdl.webapp.Legacy; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.ContentProvider; import com.sdl.webapp.common.api.content.ContentProviderException; @@ -65,7 +64,6 @@ import static com.sdl.webapp.util.dd4t.MvcDataHelper.createRegionMvcData; import static com.sdl.webapp.util.dd4t.MvcDataHelper.getRegionName; -@Legacy @Component public final class PageBuilderImpl implements PageBuilder { diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java index 59d2b7706..cec8cc3e3 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/navigation/StaticNavigationProvider.java @@ -10,7 +10,6 @@ import org.dd4t.core.exceptions.ItemNotFoundException; import org.dd4t.core.factories.PageFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; import java.io.ByteArrayInputStream; @@ -19,7 +18,6 @@ @Service @Slf4j -@Profile("legacy.provider") public class StaticNavigationProvider extends AbstractStaticNavigationProvider { private static final Object $LOCK = new Object(); diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java index f0546d950..bed127da0 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/navigation/StaticNavigationProvider.java @@ -8,14 +8,12 @@ import com.sdl.webapp.common.api.localization.Localization; import com.sdl.webapp.tridion.navigation.AbstractStaticNavigationProvider; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; -@Profile("!legacy.provider") @Service("r2StaticNavigationProvider") public class StaticNavigationProvider extends AbstractStaticNavigationProvider { diff --git a/dxa-webapp/pom.xml b/dxa-webapp/pom.xml index 61a0af55c..462a2b6e1 100644 --- a/dxa-webapp/pom.xml +++ b/dxa-webapp/pom.xml @@ -183,6 +183,38 @@ + + + + internal-legacy + + + legacy + + + + + com.sdl.dxa + dxa-dd4t-provider + + + + + + + internal-r2 + + + !legacy + + + + + com.sdl.dxa + dxa-r2-provider + + + @@ -209,16 +241,6 @@ dxa-common-impl - - com.sdl.dxa - dxa-r2-provider - - - - com.sdl.dxa - dxa-dd4t-provider - - org.springframework spring-beans From 54bc0ec336af6fd7cf037437ee7d8cc741b211fe Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Mon, 27 Mar 2017 18:08:17 +0200 Subject: [PATCH 07/15] TSI-2384 Separated CX and XO modules on two implementations (TSI-2375) --- dxa-bom/pom.xml | 22 +++++++++- dxa-framework/dxa-r2-provider/pom.xml | 5 --- dxa-framework/dxa-tridion-provider/pom.xml | 5 +++ dxa-webapp/pom.xml | 48 +++++++++++++++------- 4 files changed, 59 insertions(+), 21 deletions(-) diff --git a/dxa-bom/pom.xml b/dxa-bom/pom.xml index e42035f42..93a4432fb 100644 --- a/dxa-bom/pom.xml +++ b/dxa-bom/pom.xml @@ -186,13 +186,31 @@ com.sdl.dxa.modules dxa-module-context-expressions ${dxa-module-context-expressions} - compile + + + com.sdl.dxa.modules + dxa-module-context-expressions-abstract + ${dxa-module-context-expressions} + + + com.sdl.dxa.modules + dxa-module-context-expressions-legacy + ${dxa-module-context-expressions} com.sdl.dxa.modules dxa-module-smarttarget ${dxa-module-smarttarget.version} - runtime + + + com.sdl.dxa.modules + dxa-module-smarttarget-abstract + ${dxa-module-smarttarget.version} + + + com.sdl.dxa.modules + dxa-module-smarttarget-legacy + ${dxa-module-smarttarget.version} com.sdl.dxa.modules diff --git a/dxa-framework/dxa-r2-provider/pom.xml b/dxa-framework/dxa-r2-provider/pom.xml index 8ffb8f72a..40e0bbda9 100644 --- a/dxa-framework/dxa-r2-provider/pom.xml +++ b/dxa-framework/dxa-r2-provider/pom.xml @@ -64,11 +64,6 @@ pom - - xalan - xalan - - com.fasterxml.jackson.core jackson-annotations diff --git a/dxa-framework/dxa-tridion-provider/pom.xml b/dxa-framework/dxa-tridion-provider/pom.xml index 19c03c5fc..5c1442a17 100644 --- a/dxa-framework/dxa-tridion-provider/pom.xml +++ b/dxa-framework/dxa-tridion-provider/pom.xml @@ -68,6 +68,11 @@ commons-lang3 + + xalan + xalan + + org.jsoup jsoup diff --git a/dxa-webapp/pom.xml b/dxa-webapp/pom.xml index 462a2b6e1..3218d16f5 100644 --- a/dxa-webapp/pom.xml +++ b/dxa-webapp/pom.xml @@ -121,65 +121,85 @@ - context-expressions-module + googleanalytics-module - dxa-module-context-expressions com.sdl.dxa.modules + dxa-module-googleanalytics - googleanalytics-module + mediamanager-module com.sdl.dxa.modules - dxa-module-googleanalytics + dxa-module-mediamanager - mediamanager-module + 51degrees-module com.sdl.dxa.modules - dxa-module-mediamanager + dxa-module-51degrees - smarttarget-module + audience-manager-module com.sdl.dxa.modules - dxa-module-smarttarget + dxa-module-audience-manager - 51degrees-module + test-module com.sdl.dxa.modules - dxa-module-51degrees + dxa-module-test + - audience-manager-module + context-expressions-module com.sdl.dxa.modules - dxa-module-audience-manager + dxa-module-context-expressions - test-module + context-expressions-legacy-module com.sdl.dxa.modules - dxa-module-test + dxa-module-context-expressions-legacy + + + + + + smarttarget-module + + + com.sdl.dxa.modules + dxa-module-smarttarget + + + + + smarttarget-legacy-module + + + com.sdl.dxa.modules + dxa-module-smarttarget-legacy From bee1caffb5167e9b2df1878901e886f73d7b5e59 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Wed, 29 Mar 2017 10:09:01 +0200 Subject: [PATCH 08/15] TSI-2384 Taxonomy factory initialized in tridion-provider (TSI-2375) --- .../webapp/tridion/SpringContextConfiguration.java | 12 ------------ .../webapp/config/TridionSpringConfiguration.java | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java index 6f703b501..4eca1907a 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/SpringContextConfiguration.java @@ -1,7 +1,5 @@ package com.sdl.webapp.tridion; -import com.sdl.web.api.taxonomies.TaxonomyRelationManager; -import com.tridion.taxonomies.TaxonomyFactory; import org.dd4t.contentmodel.impl.BaseField; import org.dd4t.contentmodel.impl.ComponentImpl; import org.dd4t.core.factories.ComponentPresentationFactory; @@ -31,16 +29,6 @@ @ComponentScan("com.sdl.webapp.tridion") public class SpringContextConfiguration { - @Bean - public TaxonomyFactory webTaxonomyFactory() { - return new TaxonomyFactory(); - } - - @Bean - public TaxonomyRelationManager taxonomyRelationManager() { - return new TaxonomyRelationManager(); - } - @Bean public BrokerLinkProvider linkProvider() { BrokerLinkProvider linkProvider = new BrokerLinkProvider(); diff --git a/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java index c36fe3a6c..ea2da745b 100644 --- a/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java +++ b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/config/TridionSpringConfiguration.java @@ -4,7 +4,9 @@ import com.sdl.web.api.dynamic.BinaryContentRetrieverImpl; import com.sdl.web.api.dynamic.DynamicMappingsRetriever; import com.sdl.web.api.dynamic.DynamicMappingsRetrieverImpl; +import com.sdl.web.api.taxonomies.TaxonomyRelationManager; import com.tridion.dynamiccontent.DynamicMetaRetriever; +import com.tridion.taxonomies.TaxonomyFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -27,4 +29,14 @@ public BinaryContentRetriever binaryContentRetriever() { public DynamicMappingsRetriever dynamicMappingsRetriever() { return new DynamicMappingsRetrieverImpl(); } + + @Bean + public TaxonomyFactory webTaxonomyFactory() { + return new TaxonomyFactory(); + } + + @Bean + public TaxonomyRelationManager taxonomyRelationManager() { + return new TaxonomyRelationManager(); + } } From 4e19501633094d1ab32c2070c5e23b2ea9d4317a Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Wed, 29 Mar 2017 17:59:05 +0200 Subject: [PATCH 09/15] Request Discovery Service with full set of required properties --- .../dxa/tridion/rest/DefaultModelService.java | 61 ++-------------- .../rest/ModelServiceConfiguration.java | 70 +++++++++++++++++++ .../main/resources/dxa.modules.r2.properties | 1 - 3 files changed, 77 insertions(+), 55 deletions(-) create mode 100644 dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/ModelServiceConfiguration.java diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java index 1a203b1e2..d5807ebed 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java @@ -4,12 +4,6 @@ import com.sdl.dxa.api.datamodel.model.PageModelData; import com.sdl.dxa.common.dto.EntityRequestDto; import com.sdl.dxa.common.dto.PageRequestDto; -import com.sdl.web.client.configuration.XMLConfigurationHolder; -import com.sdl.web.client.configuration.XMLConfigurationReaderImpl; -import com.sdl.web.client.configuration.api.ConfigurationException; -import com.sdl.web.client.impl.DefaultDiscoveryClient; -import com.sdl.web.discovery.datalayer.model.ContentServiceCapability; -import com.sdl.web.discovery.datalayer.model.KeyValuePair; import com.sdl.webapp.common.api.WebRequestContext; import com.sdl.webapp.common.api.content.ContentProviderException; import com.sdl.webapp.common.api.content.PageNotFoundException; @@ -21,7 +15,6 @@ import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.Cacheable; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -33,14 +26,11 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; -import javax.annotation.PostConstruct; import java.net.URI; import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; -import java.util.Properties; import java.util.function.Function; @Slf4j @@ -53,61 +43,24 @@ public class DefaultModelService implements ModelService { private final RestTemplate restTemplate; - @Value("${cil.cd.client.conf}") - private String configurationFileName; - - @Value("${dxa.model.service.key}") - private String modelServiceKey; - - @Value("${dxa.model.service.url:#{null}}") - private String modelServiceUrl; - - @Value("${dxa.model.service.url.page.model}") - private String pageModelUrl; - - @Value("${dxa.model.service.url.entity.model}") - private String entityModelUrl; + private final ModelServiceConfiguration configuration; @SuppressWarnings("SpringAutowiredFieldsWarningInspection") @Autowired private WebRequestContext webRequestContext; @Autowired - public DefaultModelService(RestTemplate restTemplate) { + public DefaultModelService(RestTemplate restTemplate, + ModelServiceConfiguration configuration) { this.restTemplate = restTemplate; - } - - @PostConstruct - public void initService() throws ConfigurationException { - if (modelServiceUrl != null) { - log.debug("Using model service URL from properties, don't ask Discovery, {}", modelServiceUrl); - } else { - XMLConfigurationHolder configuration = (new XMLConfigurationReaderImpl()).readConfiguration(configurationFileName); - String serviceUri = configuration.getConfiguration("/DiscoveryService").getValue("ServiceUri"); - - Properties properties = new Properties(); - properties.put("ServiceUri", serviceUri); - - modelServiceUrl = new DefaultDiscoveryClient(properties).getCapability(ContentServiceCapability.class) - .orElseThrow(() -> new ConfigurationException("ContentServiceCapability is not available on Discovery " + serviceUri)) - .getExtensionProperties().stream() - .filter(keyValuePair -> Objects.equals(keyValuePair.getKey(), modelServiceKey)) - .map(KeyValuePair::getValue) - .findFirst() - .orElseThrow(() -> new ConfigurationException("DXA Model Service URL is not available on Discovery")); - - log.debug("Using model service from Discovery, {}", modelServiceUrl); - } - - this.pageModelUrl = modelServiceUrl + pageModelUrl; - this.entityModelUrl = modelServiceUrl + entityModelUrl; + this.configuration = configuration; } @NotNull @Override @Cacheable(value = "default") public PageModelData loadPageModel(PageRequestDto pageRequest) throws ContentProviderException { - return _loadPage(pageModelUrl, PageModelData.class, pageRequest); + return _loadPage(configuration.getPageModelUrl(), PageModelData.class, pageRequest); } private T _loadPage(String serviceUrl, Class type, PageRequestDto pageRequest) throws ContentProviderException { @@ -170,7 +123,7 @@ private Optional _getClaimValue(URI uri, String key, Function capability = getCapabilityFromDiscoveryService(ContentServiceCapability.class); + if (capability.isPresent()) { + this.serviceUrl = capability.get().getExtensionProperties().stream() + .filter(keyValuePair -> Objects.equals(keyValuePair.getKey(), modelServiceKey)) + .map(KeyValuePair::getValue) + .findFirst() + .orElseThrow(() -> new ConfigurationException("DXA Model Service URL is not available on Discovery")); + } else + throw new ConfigurationException("ContentServiceCapability is not available, cannot get Model Service url"); + } + + @Override + protected String getServiceUrl() { + return this.serviceUrl; + } + } +} diff --git a/dxa-framework/dxa-r2-provider/src/main/resources/dxa.modules.r2.properties b/dxa-framework/dxa-r2-provider/src/main/resources/dxa.modules.r2.properties index ef7ffb455..8f6e24ef4 100644 --- a/dxa-framework/dxa-r2-provider/src/main/resources/dxa.modules.r2.properties +++ b/dxa-framework/dxa-r2-provider/src/main/resources/dxa.modules.r2.properties @@ -1,4 +1,3 @@ -cil.cd.client.conf=cd_client_conf.xml dxa.model.service.key=dxa-model-service dxa.model.service.url.entity.model=/EntityModel/{uriType}/{localizationId}/{componentId}-{templateId} dxa.model.service.url.page.model=/PageModel/{uriType}/{localizationId}/{pageUrl}?includes={pageInclusion} \ No newline at end of file From 2475fabfb24cdd7fd121d580ba393d5e944533bf Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Tue, 4 Apr 2017 11:36:18 +0200 Subject: [PATCH 10/15] Fix caching in Model Service --- .../sdl/dxa/common/dto/PageRequestDto.java | 2 ++ .../dxa/common/dto/PageRequestDtoTest.java | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 dxa-framework/dxa-common/src/test/java/com/sdl/dxa/common/dto/PageRequestDtoTest.java diff --git a/dxa-framework/dxa-common/src/main/java/com/sdl/dxa/common/dto/PageRequestDto.java b/dxa-framework/dxa-common/src/main/java/com/sdl/dxa/common/dto/PageRequestDto.java index 30b3ba91a..17c44c373 100644 --- a/dxa-framework/dxa-common/src/main/java/com/sdl/dxa/common/dto/PageRequestDto.java +++ b/dxa-framework/dxa-common/src/main/java/com/sdl/dxa/common/dto/PageRequestDto.java @@ -2,6 +2,7 @@ import lombok.AllArgsConstructor; import lombok.Builder; +import lombok.EqualsAndHashCode; import lombok.Value; import org.springframework.util.Assert; @@ -10,6 +11,7 @@ */ @Builder @Value +@EqualsAndHashCode(exclude = "depthCounter") public class PageRequestDto { private int publicationId; diff --git a/dxa-framework/dxa-common/src/test/java/com/sdl/dxa/common/dto/PageRequestDtoTest.java b/dxa-framework/dxa-common/src/test/java/com/sdl/dxa/common/dto/PageRequestDtoTest.java new file mode 100644 index 000000000..5b3df6485 --- /dev/null +++ b/dxa-framework/dxa-common/src/test/java/com/sdl/dxa/common/dto/PageRequestDtoTest.java @@ -0,0 +1,27 @@ +package com.sdl.dxa.common.dto; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class PageRequestDtoTest { + + @Test + public void shouldIgnoreDepthCounter_InEqualsAndHashCodeCheck() { + //given + PageRequestDto dto1 = PageRequestDto.builder() + .includePages(PageRequestDto.PageInclusion.INCLUDE) + .path("/").build(); + + PageRequestDto dto2 = PageRequestDto.builder() + .includePages(PageRequestDto.PageInclusion.INCLUDE) + .path("/").build(); + + //when + dto2.depthIncreaseAndCheckIfSafe(); + + //then + assertEquals(dto2, dto1); + assertEquals(dto2.hashCode(), dto1.hashCode()); + } +} \ No newline at end of file From 5e25832f52ae287bae7ec0170d3e6c5f00954ba5 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Thu, 6 Apr 2017 11:49:21 +0200 Subject: [PATCH 11/15] TSI-2395 prepend edit XPM buttons with include prefix if needed --- .../sdl/webapp/common/impl/taglib/xpm/XpmButtonTag.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dxa-framework/dxa-common-impl/src/main/java/com/sdl/webapp/common/impl/taglib/xpm/XpmButtonTag.java b/dxa-framework/dxa-common-impl/src/main/java/com/sdl/webapp/common/impl/taglib/xpm/XpmButtonTag.java index b924c49c0..8531f1de9 100644 --- a/dxa-framework/dxa-common-impl/src/main/java/com/sdl/webapp/common/impl/taglib/xpm/XpmButtonTag.java +++ b/dxa-framework/dxa-common-impl/src/main/java/com/sdl/webapp/common/impl/taglib/xpm/XpmButtonTag.java @@ -45,8 +45,12 @@ protected HtmlNode generateXpmMarkup() { .build(); } else { String title = "Edit " + this.region.getXpmMetadata().get(INCLUDED_FROM_PAGE_TITLE_XPM_METADATA_KEY); - String editUrl = ApplicationContextHolder.getContext().getBean(WebRequestContext.class).getLocalization().localizePath( - this.region.getXpmMetadata().get(INCLUDED_FROM_PAGE_FILE_NAME_XPM_METADATA_KEY).toString()); + String urlOfInclude = this.region.getXpmMetadata().get(INCLUDED_FROM_PAGE_FILE_NAME_XPM_METADATA_KEY).toString(); + if (!urlOfInclude.matches("/?system/include.*")) { + urlOfInclude = String.format("system/include/%s", urlOfInclude.startsWith("/") ? urlOfInclude.substring(1) : urlOfInclude); + } + String editUrl = ApplicationContextHolder.getContext().getBean(WebRequestContext.class) + .getLocalization().localizePath(urlOfInclude); return HtmlBuilders.div() .withClass("xpm-button" + (cssClass == null ? "" : " " + cssClass)) .withNode(HtmlBuilders.a(editUrl) From ac2d81d92b2b1ecc30418e7b8867c67c89b3dbdb Mon Sep 17 00:00:00 2001 From: Rick Pannekoek Date: Thu, 6 Apr 2017 12:01:52 +0200 Subject: [PATCH 12/15] TSI-2250 Updated doc link in README.md to point to DXA 2.0 CTP docs (TSI-2399) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a7fec7b9..41e1af72e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If you encounter any issues with the Digital Experience Accelerator, please reac Documentation ------------- -Documentation can be found online in the SDL documentation portal: http://docs.sdl.com/sdldxa +Documentation can be found online in the SDL documentation portal: http://docs.sdl.com/sdldxa2-ctp Repositories From 8d97e3cf9cb45df82d26dfb7ef158b5ecd87f46a Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Thu, 6 Apr 2017 12:16:49 +0200 Subject: [PATCH 13/15] TSI-2396 no need to url escape page url for r2 rest requests --- .../sdl/webapp/tridion/mapping/DefaultContentProvider.java | 6 +++++- .../tridion/mapping/AbstractDefaultContentProvider.java | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java index 01bb012db..724dc2d5f 100644 --- a/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java +++ b/dxa-framework/dxa-dd4t-provider/src/main/java/com/sdl/webapp/tridion/mapping/DefaultContentProvider.java @@ -13,6 +13,7 @@ import com.sdl.webapp.common.exceptions.DxaItemNotFoundException; import com.sdl.webapp.common.util.LocalizationUtils; import com.sdl.webapp.common.util.TcmUtils; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.dd4t.contentmodel.Component; import org.dd4t.contentmodel.ComponentPresentation; @@ -37,7 +38,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.util.UriUtils; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -82,8 +85,9 @@ public DefaultContentProvider(WebRequestContext webRequestContext, } @Override + @SneakyThrows(UnsupportedEncodingException.class) protected PageModel _loadPage(String _path, Localization localization) throws ContentProviderException { - return LocalizationUtils.findPageByPath(_path, localization, (path, publicationId) -> { + return LocalizationUtils.findPageByPath(UriUtils.encodePath(_path, "UTF-8"), localization, (path, publicationId) -> { final org.dd4t.contentmodel.Page genericPage; try { synchronized (LOCK) { diff --git a/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/tridion/mapping/AbstractDefaultContentProvider.java b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/tridion/mapping/AbstractDefaultContentProvider.java index 4b07f0d67..f0df635ad 100644 --- a/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/tridion/mapping/AbstractDefaultContentProvider.java +++ b/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/webapp/tridion/mapping/AbstractDefaultContentProvider.java @@ -101,9 +101,8 @@ public AbstractDefaultContentProvider(WebRequestContext webRequestContext, } @Override - @SneakyThrows(UnsupportedEncodingException.class) public PageModel getPageModel(String path, Localization localization) throws ContentProviderException { - return _loadPage(UriUtils.encodePath(path, "UTF-8"), localization); + return _loadPage(path, localization); } protected abstract PageModel _loadPage(String path, Localization localization) throws ContentProviderException; From c959058fd2379152b4a7c2c40685ae7acc0d8710 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Thu, 6 Apr 2017 17:33:09 +0200 Subject: [PATCH 14/15] Set 2.0.0-CTP1 version --- build.gradle | 2 +- dxa-bom/pom.xml | 2 +- dxa-builder/gradle.properties | 2 +- dxa-framework/dxa-common-api/pom.xml | 2 +- dxa-framework/dxa-common-impl/pom.xml | 2 +- dxa-framework/dxa-common/pom.xml | 2 +- dxa-framework/dxa-compatible/pom.xml | 2 +- dxa-framework/dxa-data-model/pom.xml | 2 +- dxa-framework/dxa-dd4t-provider/pom.xml | 2 +- dxa-framework/dxa-r2-provider/pom.xml | 2 +- .../java/com/sdl/dxa/tridion/rest/DefaultModelService.java | 6 +++--- dxa-framework/dxa-tridion-provider/pom.xml | 2 +- dxa-framework/pom.xml | 4 ++-- dxa-webapp/pom.xml | 4 ++-- gradle.properties | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 1d67a77d9..8628b9122 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ task help(type: MavenHelpTask) task buildFramework(type: MavenBuildTask) { configurations = [ - ["dxa-bom"], + //["dxa-bom"], ["dxa-framework"], ["> dxa-webapp > clean org.apache.maven.plugins:maven-archetype-plugin:2.4:create-from-project -Darchetype.properties=archetype.properties"] ] diff --git a/dxa-bom/pom.xml b/dxa-bom/pom.xml index 93a4432fb..ac7a1470c 100644 --- a/dxa-bom/pom.xml +++ b/dxa-bom/pom.xml @@ -12,7 +12,7 @@ com.sdl.dxa dxa-bom - 2.0.0-SNAPSHOT + 2.0.0-CTP1 pom DXA - Bill of Materials diff --git a/dxa-builder/gradle.properties b/dxa-builder/gradle.properties index 09bc09788..20e409a50 100644 --- a/dxa-builder/gradle.properties +++ b/dxa-builder/gradle.properties @@ -1 +1 @@ -version=2.0.0-SNAPSHOT \ No newline at end of file +version=2.0.0-CTP1 \ No newline at end of file diff --git a/dxa-framework/dxa-common-api/pom.xml b/dxa-framework/dxa-common-api/pom.xml index 8086d9c54..60bea8854 100644 --- a/dxa-framework/dxa-common-api/pom.xml +++ b/dxa-framework/dxa-common-api/pom.xml @@ -6,7 +6,7 @@ com.sdl.dxa dxa-framework - 2.0.0-SNAPSHOT + 2.0.0-CTP1 dxa-common-api diff --git a/dxa-framework/dxa-common-impl/pom.xml b/dxa-framework/dxa-common-impl/pom.xml index 3901c98cd..e4f670fa0 100644 --- a/dxa-framework/dxa-common-impl/pom.xml +++ b/dxa-framework/dxa-common-impl/pom.xml @@ -7,7 +7,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 dxa-common-impl diff --git a/dxa-framework/dxa-common/pom.xml b/dxa-framework/dxa-common/pom.xml index 2ed3a26cd..ad6285d49 100644 --- a/dxa-framework/dxa-common/pom.xml +++ b/dxa-framework/dxa-common/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 4.0.0 diff --git a/dxa-framework/dxa-compatible/pom.xml b/dxa-framework/dxa-compatible/pom.xml index 707ab23db..330cc368b 100644 --- a/dxa-framework/dxa-compatible/pom.xml +++ b/dxa-framework/dxa-compatible/pom.xml @@ -6,7 +6,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 dxa-compatible diff --git a/dxa-framework/dxa-data-model/pom.xml b/dxa-framework/dxa-data-model/pom.xml index 157141325..b1b3ccc55 100644 --- a/dxa-framework/dxa-data-model/pom.xml +++ b/dxa-framework/dxa-data-model/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 4.0.0 diff --git a/dxa-framework/dxa-dd4t-provider/pom.xml b/dxa-framework/dxa-dd4t-provider/pom.xml index cf9930f37..ac102f55f 100644 --- a/dxa-framework/dxa-dd4t-provider/pom.xml +++ b/dxa-framework/dxa-dd4t-provider/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 4.0.0 diff --git a/dxa-framework/dxa-r2-provider/pom.xml b/dxa-framework/dxa-r2-provider/pom.xml index 40e0bbda9..0232e0983 100644 --- a/dxa-framework/dxa-r2-provider/pom.xml +++ b/dxa-framework/dxa-r2-provider/pom.xml @@ -4,7 +4,7 @@ dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 ../../dxa-framework 4.0.0 diff --git a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java index d5807ebed..4f4c7f5ee 100644 --- a/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java +++ b/dxa-framework/dxa-r2-provider/src/main/java/com/sdl/dxa/tridion/rest/DefaultModelService.java @@ -58,7 +58,7 @@ public DefaultModelService(RestTemplate restTemplate, @NotNull @Override - @Cacheable(value = "default") +// @Cacheable(value = "default") public PageModelData loadPageModel(PageRequestDto pageRequest) throws ContentProviderException { return _loadPage(configuration.getPageModelUrl(), PageModelData.class, pageRequest); } @@ -121,7 +121,7 @@ private Optional _getClaimValue(URI uri, String key, Function dxa-framework com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 dxa-tridion-provider diff --git a/dxa-framework/pom.xml b/dxa-framework/pom.xml index 07a0fb2cd..70ed477a3 100644 --- a/dxa-framework/pom.xml +++ b/dxa-framework/pom.xml @@ -11,7 +11,7 @@ com.sdl.dxa - 2.0.0-SNAPSHOT + 2.0.0-CTP1 dxa-framework pom @@ -65,7 +65,7 @@ UTF-8 UTF-8 - 2.0.0-SNAPSHOT + 2.0.0-CTP1 1.8 diff --git a/dxa-webapp/pom.xml b/dxa-webapp/pom.xml index 3218d16f5..699a028e6 100644 --- a/dxa-webapp/pom.xml +++ b/dxa-webapp/pom.xml @@ -10,7 +10,7 @@ 1.0.3 - 2.0.0-SNAPSHOT + 2.0.0-CTP1 com.sdl.dxa dxa-webapp war @@ -19,7 +19,7 @@ http://www.sdl.com/cxc/digital-experience/web-experience-management/digital-experience-accelerator.html - 2.0.0-SNAPSHOT + 2.0.0-CTP1 release/2.0 1.8 diff --git a/gradle.properties b/gradle.properties index 09bc09788..20e409a50 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.0.0-SNAPSHOT \ No newline at end of file +version=2.0.0-CTP1 \ No newline at end of file From e6a9410050366bdd05eb4c5d7bff8ec384bd2734 Mon Sep 17 00:00:00 2001 From: Alexey Zarakovskiy Date: Thu, 6 Apr 2017 17:35:22 +0200 Subject: [PATCH 15/15] Set 2.0.0-SNAPSHOT version --- dxa-bom/pom.xml | 2 +- dxa-builder/gradle.properties | 2 +- dxa-framework/dxa-common-api/pom.xml | 2 +- dxa-framework/dxa-common-impl/pom.xml | 2 +- dxa-framework/dxa-common/pom.xml | 2 +- dxa-framework/dxa-compatible/pom.xml | 2 +- dxa-framework/dxa-data-model/pom.xml | 2 +- dxa-framework/dxa-dd4t-provider/pom.xml | 2 +- dxa-framework/dxa-r2-provider/pom.xml | 2 +- dxa-framework/dxa-tridion-provider/pom.xml | 2 +- dxa-framework/pom.xml | 4 ++-- dxa-webapp/pom.xml | 4 ++-- gradle.properties | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dxa-bom/pom.xml b/dxa-bom/pom.xml index ac7a1470c..93a4432fb 100644 --- a/dxa-bom/pom.xml +++ b/dxa-bom/pom.xml @@ -12,7 +12,7 @@ com.sdl.dxa dxa-bom - 2.0.0-CTP1 + 2.0.0-SNAPSHOT pom DXA - Bill of Materials diff --git a/dxa-builder/gradle.properties b/dxa-builder/gradle.properties index 20e409a50..09bc09788 100644 --- a/dxa-builder/gradle.properties +++ b/dxa-builder/gradle.properties @@ -1 +1 @@ -version=2.0.0-CTP1 \ No newline at end of file +version=2.0.0-SNAPSHOT \ No newline at end of file diff --git a/dxa-framework/dxa-common-api/pom.xml b/dxa-framework/dxa-common-api/pom.xml index 60bea8854..8086d9c54 100644 --- a/dxa-framework/dxa-common-api/pom.xml +++ b/dxa-framework/dxa-common-api/pom.xml @@ -6,7 +6,7 @@ com.sdl.dxa dxa-framework - 2.0.0-CTP1 + 2.0.0-SNAPSHOT dxa-common-api diff --git a/dxa-framework/dxa-common-impl/pom.xml b/dxa-framework/dxa-common-impl/pom.xml index e4f670fa0..3901c98cd 100644 --- a/dxa-framework/dxa-common-impl/pom.xml +++ b/dxa-framework/dxa-common-impl/pom.xml @@ -7,7 +7,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT dxa-common-impl diff --git a/dxa-framework/dxa-common/pom.xml b/dxa-framework/dxa-common/pom.xml index ad6285d49..2ed3a26cd 100644 --- a/dxa-framework/dxa-common/pom.xml +++ b/dxa-framework/dxa-common/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT 4.0.0 diff --git a/dxa-framework/dxa-compatible/pom.xml b/dxa-framework/dxa-compatible/pom.xml index 330cc368b..707ab23db 100644 --- a/dxa-framework/dxa-compatible/pom.xml +++ b/dxa-framework/dxa-compatible/pom.xml @@ -6,7 +6,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT dxa-compatible diff --git a/dxa-framework/dxa-data-model/pom.xml b/dxa-framework/dxa-data-model/pom.xml index b1b3ccc55..157141325 100644 --- a/dxa-framework/dxa-data-model/pom.xml +++ b/dxa-framework/dxa-data-model/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT 4.0.0 diff --git a/dxa-framework/dxa-dd4t-provider/pom.xml b/dxa-framework/dxa-dd4t-provider/pom.xml index ac102f55f..cf9930f37 100644 --- a/dxa-framework/dxa-dd4t-provider/pom.xml +++ b/dxa-framework/dxa-dd4t-provider/pom.xml @@ -5,7 +5,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT 4.0.0 diff --git a/dxa-framework/dxa-r2-provider/pom.xml b/dxa-framework/dxa-r2-provider/pom.xml index 0232e0983..40e0bbda9 100644 --- a/dxa-framework/dxa-r2-provider/pom.xml +++ b/dxa-framework/dxa-r2-provider/pom.xml @@ -4,7 +4,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT ../../dxa-framework 4.0.0 diff --git a/dxa-framework/dxa-tridion-provider/pom.xml b/dxa-framework/dxa-tridion-provider/pom.xml index 14a36c957..5c1442a17 100644 --- a/dxa-framework/dxa-tridion-provider/pom.xml +++ b/dxa-framework/dxa-tridion-provider/pom.xml @@ -6,7 +6,7 @@ dxa-framework com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT dxa-tridion-provider diff --git a/dxa-framework/pom.xml b/dxa-framework/pom.xml index 70ed477a3..07a0fb2cd 100644 --- a/dxa-framework/pom.xml +++ b/dxa-framework/pom.xml @@ -11,7 +11,7 @@ com.sdl.dxa - 2.0.0-CTP1 + 2.0.0-SNAPSHOT dxa-framework pom @@ -65,7 +65,7 @@ UTF-8 UTF-8 - 2.0.0-CTP1 + 2.0.0-SNAPSHOT 1.8 diff --git a/dxa-webapp/pom.xml b/dxa-webapp/pom.xml index 699a028e6..3218d16f5 100644 --- a/dxa-webapp/pom.xml +++ b/dxa-webapp/pom.xml @@ -10,7 +10,7 @@ 1.0.3 - 2.0.0-CTP1 + 2.0.0-SNAPSHOT com.sdl.dxa dxa-webapp war @@ -19,7 +19,7 @@ http://www.sdl.com/cxc/digital-experience/web-experience-management/digital-experience-accelerator.html - 2.0.0-CTP1 + 2.0.0-SNAPSHOT release/2.0 1.8 diff --git a/gradle.properties b/gradle.properties index 20e409a50..09bc09788 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.0.0-CTP1 \ No newline at end of file +version=2.0.0-SNAPSHOT \ No newline at end of file