Skip to content

Releases: commercetools/commercetools-sunrise-java

v1.0.0-M2

25 Mar 21:35
Compare
Choose a tag to compare
  • Replaced Template terminology for Content when it referred to the content for an HTTP response. For example, TemplateRenderer was renamed to ContentRenderer, or WithTemplate to WithContent. Also the templateName in TemplateRenderer is now nullable to allow having content non-related to templates.
  • Removed injectable Http.Context, which was a source of problems on production mode. This injection can be easily replaced in your code with Http.Context.current(). As it was removed from our code, you might need to adjust some code only if you extended one of the affected classes.
  • PaginationSettings contains Long as option type instead of Integer, to use the same type as the JVM SDK uses for pagination.

v1.0.0-M1.1

21 Mar 01:37
Compare
Choose a tag to compare
  • Apply fix for bug, which crashed the application on production mode at start up, due to missing HTTP Context.

v0.19.0

20 Mar 19:41
Compare
Choose a tag to compare
  • JVM SDK updated to v1.13.0

v0.18.0

20 Mar 18:44
Compare
Choose a tag to compare
  • Now facets use counting products option to show the number of products (instead of variants) matching the term or within range.
  • Fixed bug #571, the computation executed by hooks was not waited for completion on redirection.

v0.17.0

22 Feb 17:57
Compare
Choose a tag to compare

Features

  • Fixed bug that generated unencoded query strings when using pagination.

Technical

  • The dynamic fields in the view models are following now the same access and modifier pattern as a Map. When used together with SunriseJavaBeanValueResolver for Handlebars (by default enabled) it allows to directly access them as if they were simple fields of the corresponding ViewModel subclass, without needing to access dynamic field in the template. This way you can extend your view model directly by using this feature without having to actually create your own class and extending the corresponding ViewModel class.
  • Using SunriseJavaBeanValueResolver allows LocalizedString instances to be processed by the Handlebars template engine directly.
  • RequestScopedSphereClientProvider renamed to MetricSphereClientProvider to better reflect what kind of SphereClient it generates.
  • JVM SDK updated to v1.9.0.

v0.16.0

06 Dec 18:03
Compare
Choose a tag to compare

Configuration

  • sbt-tasks artefact does no longer depend on the default Sunrise Theme, which made it impossible to replace it with another theme while having this dependency.

Technical

  • HandlebarsContextFactory#create method additionally expects now the template name as well as the Handlebars instance to create the HandlebarsContext. This data was already available before calling this method and it might be necessary information for certain use cases.
  • HandlebarsContextFactory class has been refactored, so if you extended this class in your project please check the current implementation and adapt your code accordingly.
  • Extracted handleFoundCategory in SunriseProductOverviewController for an easy overriding of this controller.
  • Removed the root subproject from the Javadoc and disabled its release. This subproject serves only for testing purposes and should not be used as part of the Sunrise Framework.

v0.15.0

25 Nov 13:31
Compare
Choose a tag to compare

Features

  • Always keeps the customer information in cart updated, even when assigning an anonymous cart to a customer (see #546).

Configuration

  • Fixed Webjars files copier SBT task, which now works with folder names containing white spaces.

v0.14.0

14 Nov 12:52
Compare
Choose a tag to compare

Features

  • Limited the amount of line items listed in mini cart to 5 in order to avoid #518. This is a soft solution to the problem that does not require any further configuration from the developers. A more elegant solution can be achieved by caching the cart using a unique identifier per customer (enabled with class CacheableObjectStoringSessionCookieStrategy), but requires some special configuration of the cache according to your web server cluster setup, hence the reason why this was not the chosen implementation. Nonetheless, this behaviour can be easily changed in CartInSession by changing the way the mini cart is created or injecting a different kind of SessionStrategy.
  • Fixed generation of product suggestions on a product without categories, which caused an exception.

Technical

  • It is possible now to inject Http.Session directly (before you had to inject Http.Context and call the session from it). Classes that depend on session can simplify some tests this way.
  • SessionHandler and its related classes have been reworked. Most of the projects will not be affected by these changes unless they used directly CustomerSessionHandler, CartSessionHandler or OrderSessionHandler, or implemented their own SessionHandler. Browse directly the affected classes to find out more about them. A brief description of the changes are listed below:
    • Interface split into ResourceStoringOperations and SessionStrategy.
    • CustomerSessionHandler, CartSessionHandler and OrderSessionHandler:
      • have been renamed to CustomerInSession, CartInSession and OrderInSession respectively.
      • methods overwriteInSession(Http.Session session, T object) and removeFromSession(Http.Session session) have been changed to store(T object) and remove(), to abstract the way the data is stored.
      • all their other methods have dropped the Http.Session parameter as well.
    • Due to the previous changes,CustomerFinderBySession and CartFinderBySession do not require any parameter anymore.
    • Provided SessionCookieStrategy, SerializableObjectStoringSessionCookieStrategy and CacheableObjectStoringSessionCookieStrategy classes to allow different strategies on storing information to the user's session.

v0.13.0

04 Nov 11:34
Compare
Choose a tag to compare

Features

  • Fixed bug that prevented the application from providing a CSRF Token on empty session data.

Technical

  • Deprecated method getCsrfToken from SunriseFrameworkController in favor of CSRF.getToken from Play Framework's CSRFFilter.
  • MoneyContext used in bean factories are easier to override. They are always used by calling a protected method getMoneyContext, which can be overridden as needed. This is a temporary solution before the injected version is available.
  • PageMetaFactory class is adapted to the standard bean factory structure.
  • PageMetaFactory is no longer injected via field injection to SunriseFrameworkController, but injected under demand. This makes testing easier with less required bindings.
  • HTTP Context is now kept when triggering PageDataReadyHook in SunriseFrameworkController and when rendering the template in SunriseHomeController. This could have raised under certain circumstances a No HTTP Context available error when implementing new features.

v0.12.1

18 Oct 10:02
Compare
Choose a tag to compare

Configuration

  • Removed "Demo Info Modal" configuration option and related templates.
  • Removed DI Modules left in conf/application.conf from previous release, now only SunriseModule is required. You can check Sunrise Starter Project's default Module class and conf/application.conf as an example of how they should look like in your project.

Technical

  • Changed the way session is handled with Carts, Customers and Orders:
  • Provided HandlebarsContextFactory class to allow changing the Handlebars Context, for example to change the ValueResolvers or to add context data.
  • Created an ErrorFormatter interface with some default implementation to easily override the way Sunrise formats the errors, e.g. form errors.
  • Enabled some new Hooks: CartLoadedActionHook, CartCreatedHook, CustomerSignInResultLoadedHook, CustomerUpdatedHook and CartCreateCommandHook.
  • Renamed SunriseFrameworkCartController to SunriseFrameworkShoppingCartController and added a shopping-cart framework tag to it.
  • Renamed methods:
    • requiringExistingCart() -> requireExistingCart()
    • requiringNonEmptyCart() -> requireNonEmptyCart()
  • Removed method getOrCreateCart(), use directly findCart() or createCart() methods.
  • Renamed UserBean to UserInfoBean and provided a Factory class for its creation.
  • Added email field to UserInfoBean.
  • Updated to commercetools JVM SDK 1.5.0.