Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ To avoid the escaping issues while building a predicate string we advice to use

The ApiHttpResponse is the abstraction atop the HTTP transfer and doesn't know about the internal semantics of the HTTP body. The ApiHttpResponse::getMessage() method in this case returns the HTTP header message like OK, CONTINUE, BAD REQUEST. In case of an error the ErrorMiddleware will throw an exception. The HTTP body will be added as exception message string.

As the thrown exceptions are derived from the ApiHttpException class which has a getBodyAs helper method which is capable of deserializing the body string to the given specified class. For the Composable Commerce API this would be the ErrorResponse class. In case of a BadRequestException or ConcurrentModification the error response will be automatically deserialized.
As the thrown exceptions are derived from the ApiHttpException class which has a getBodyAs helper method which is capable of deserializing the body string to the given specified class. For commercetools APIs, this would be the ErrorResponse class. In case of a BadRequestException or ConcurrentModification the error response will be automatically deserialized.

```java
apiRoot.products().post(draft).execute()
.exceptionally(throwable -> {
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# commercetools Composable Commerce Java SDK

# commercetools Java SDK

[![][maven img]][maven]
[![][snyk img]][snyk]
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Version {

allprojects {
apply from: "$rootDir/gradle-scripts/repositories.gradle"
description = "The e-commerce SDK from commercetools Composable Commerce for Java"
description = "The e-commerce SDK from commercetools for Java"

configurations {
taglet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* <p>JSON serializing and deserializing problems throw {@link io.vrap.rmf.base.client.utils.json.JsonException}.</p>
*
* <p>{@link io.vrap.rmf.base.client.ApiHttpException} is a base exception for all error responses from Composable Commerce (HTTP status code {@code >= 400}).</p>
* <p>{@link io.vrap.rmf.base.client.ApiHttpException} is a base exception for all error responses from commercetools (HTTP status code {@code >= 400}).</p>
*
* <p>{@link io.vrap.rmf.base.client.error.ApiClientException} expresses errors which can be recovered by the client side (HTTP status code {@code >= 400 and < 500}).
* {@link io.vrap.rmf.base.client.error.ApiServerException} is for server errors.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* {@include.toc}
* <h2 id=general-concept>General concept of the SDK</h2>
*
* The SDK provides classes and interfaces to interact with the commercetools Composable Commerce APIs in an object-oriented way.
* The SDK provides classes and interfaces to interact with the commercetools APIs in an object-oriented way.
*
* <h3>ApiHttpClient</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* {@include.toc}
* <h2 id=about-clients>About the client</h2>
*
* <p>The commercetools Composable Commerce client communicates asynchronously with the API via HTTPS
* <p>The commercetools client communicates asynchronously with the API via HTTPS
* and it takes care about authentication.</p>
*
* <p>The client uses Java objects to formulate an HTTP request, performs the request and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* {@include.toc}
* <h2 id=logging>Logging</h2>
*
* <p>Internal logging used by the commercetools Composable Commerce client itself. Uses slf4j logger named {@code commercetools}.</p>
* <p>Internal logging used by the commercetools client itself. Uses slf4j logger named {@code commercetools}.</p>
*
* <h3 id=logger-configuration>Logger configuration</h3>
*
Expand Down Expand Up @@ -54,9 +54,9 @@
*
* <p>The loggers form a hierarchy separated by a dot. The root logger is {@code commercetools}.</p>
*
* <p>The child loggers of commercetools Composable Commerce correspond with the names of the API endpoints, so for example {@code commercetools.categories} for Categories and {@code commercetools.product-types} for Product Types.</p>
* <p>The child loggers of commercetools correspond with the names of the API endpoints, so for example {@code commercetools.categories} for Categories and {@code commercetools.product-types} for Product Types.</p>
*
* <p>The grandchild loggers refer to actions. For example, {@code commercetools.categories.request} refers to performing requests via HTTPs to commercetools Composable Commerce for Categories and {@code commercetools.categories.response} refers to the response for Categories. </p>
* <p>The grandchild loggers refer to actions. For example, {@code commercetools.categories.request} refers to performing requests via HTTPs to commercetools for Categories and {@code commercetools.categories.response} refers to the response for Categories. </p>
*
* <p>The logger makes use of different log levels, so for example {@code commercetools.categories.response} logs on debug level the http response from the platform (abbreviated example):</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<h3 id="OAuthMiddleware">OAuthMiddleware</h3>

<p>An {@link io.vrap.rmf.base.client.http.OAuthMiddleware} is used to authenticate a request against the commercetools Composable Commerce
<p>An {@link io.vrap.rmf.base.client.http.OAuthMiddleware} is used to authenticate a request against the commercetools
APIs. The default implementation adds an auth header to the request instance. In case of an expired token it will try to
reauthenticate automatically. To retrieve an {@link io.vrap.rmf.base.client.AuthenticationToken} the
{@link io.vrap.rmf.base.client.http.OAuthHandler} is called.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* <h3>Request DSL</h3>
*
* <p>Building request can be done with the help of an ApiRoot, e.g. {@link com.commercetools.api.client.ProjectApiRoot}.
* The DSL mirrors the directory structure and HTTP methods of the API and allows navigating and discovering the commercetools Composable Commerce
* The DSL mirrors the directory structure and HTTP methods of the API and allows navigating and discovering the commercetools
* API while typing. The HTTP method builders includes methods for every query parameter. Additionally there are
* the {@link ApiMethod#execute()} and {@link ApiMethod#executeBlocking()} methods which are sending the request using the
* configured {@link io.vrap.rmf.base.client.ApiHttpClient} and mapping the result to the correct response class. In case
Expand Down
2 changes: 1 addition & 1 deletion examples/spring-datadog-statsd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example to show how Java SDK can be used in a Spring Boot application with Datad

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `manage_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot MVC environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot MVC environment.</p>
</section>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/spring-datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example to show how Java SDK can be used in a Spring Boot application with Datad

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `manage_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot MVC environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot MVC environment.</p>
</section>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/spring-dynatrace-oneagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example to show how Java SDK can be used in a Spring Boot application with Dynat

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `manage_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot MVC environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot MVC environment.</p>
</section>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/spring-newrelic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example to show how Java SDK can be used in a Spring Boot application with NewRe

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `manage_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot MVC environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot MVC environment.</p>
</section>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/spring-otel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OpenTelemetry auto instrumentation.

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `manage_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot MVC environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot MVC environment.</p>
</section>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example to show how the ME endpoints can be used with the Java SDK in a Spring B

## Requirements

- A Composable Commerce Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
- A commercetools Project with a configured [API Client](https://docs.commercetools.com/api/getting-started/create-api-client).
Necessary scopes: `view_published_products`, `view_categories`, `manage_my_profile`, `manage_my_shopping_lists`, `manage_my_payments`, `manage_my_orders`
- Your Project must have existing products containing variants with SKUs, and at least one customer, the storefront search endpoint must be active.
- If your Project is currently empty, you can install the [SUNRISE sample data](https://github.com/commercetools/commercetools-sunrise-data).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="~{shared/layout :: layout(~{::title}, ~{::section})}">
<head>
<title>commercetools Composable Commerce Spring example</title>
<title>commercetools Spring example</title>
</head>
<body>
<section>
<p>This is an example application showing the integration of commercetools Composable Commerce in a Spring Boot webflux environment.</p>
<p>This is an example application showing the integration of commercetools in a Spring Boot webflux environment.</p>
</section>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static <T> T fromJsonNode(final JsonNode jsonNode, final TypeReference<T>
}

/**
* Converts a commercetools Composable Commerce Java object to JSON as {@link JsonNode}.
* Converts a commercetools Java object to JSON as {@link JsonNode}.
* <p>If {@code value} is of type String and contains JSON data, that will be ignored, {@code value} will be treated as just any String.
* If you want to parse a JSON String to a JsonNode use {@link JsonUtils#parse(java.lang.String)} instead.</p>
* <p>
Expand Down
2 changes: 1 addition & 1 deletion src/main/javadoc/overview.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<body>
commercetools Composable Commerce Java SDK.
commercetools Java SDK.
<div class="pull-up">
<h1 class="toc-ignore">Pages about the SDK</h1>

Expand Down
Loading