Releases: commercetools/commercetools-sunrise-java
Releases · commercetools/commercetools-sunrise-java
v1.0.0-M2
- Replaced
Template
terminology forContent
when it referred to the content for an HTTP response. For example,TemplateRenderer
was renamed toContentRenderer
, orWithTemplate
toWithContent
. Also thetemplateName
inTemplateRenderer
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 withHttp.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
containsLong
as option type instead ofInteger
, to use the same type as the JVM SDK uses for pagination.
v1.0.0-M1.1
- Apply fix for bug, which crashed the application on production mode at start up, due to missing HTTP Context.
v0.19.0
v0.18.0
v0.17.0
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 correspondingViewModel
subclass, without needing to accessdynamic
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 correspondingViewModel
class. - Using
SunriseJavaBeanValueResolver
allowsLocalizedString
instances to be processed by the Handlebars template engine directly. RequestScopedSphereClientProvider
renamed toMetricSphereClientProvider
to better reflect what kind ofSphereClient
it generates.- JVM SDK updated to v1.9.0.
v0.16.0
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 theHandlebars
instance to create theHandlebarsContext
. 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
inSunriseProductOverviewController
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
v0.14.0
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 inCartInSession
by changing the way the mini cart is created or injecting a different kind ofSessionStrategy
. - 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 injectHttp.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 directlyCustomerSessionHandler
,CartSessionHandler
orOrderSessionHandler
, or implemented their ownSessionHandler
. Browse directly the affected classes to find out more about them. A brief description of the changes are listed below:- Interface split into
ResourceStoringOperations
andSessionStrategy
. CustomerSessionHandler
,CartSessionHandler
andOrderSessionHandler
:- have been renamed to
CustomerInSession
,CartInSession
andOrderInSession
respectively. - methods
overwriteInSession(Http.Session session, T object)
andremoveFromSession(Http.Session session)
have been changed tostore(T object)
andremove()
, to abstract the way the data is stored. - all their other methods have dropped the
Http.Session
parameter as well.
- have been renamed to
- Due to the previous changes,
CustomerFinderBySession
andCartFinderBySession
do not require any parameter anymore. - Provided
SessionCookieStrategy
,SerializableObjectStoringSessionCookieStrategy
andCacheableObjectStoringSessionCookieStrategy
classes to allow different strategies on storing information to the user's session.
- Interface split into
v0.13.0
Features
- Fixed bug that prevented the application from providing a CSRF Token on empty session data.
Technical
- Deprecated method
getCsrfToken
fromSunriseFrameworkController
in favor ofCSRF.getToken
from Play Framework'sCSRFFilter
. MoneyContext
used in bean factories are easier to override. They are always used by calling aprotected
methodgetMoneyContext
, 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 toSunriseFrameworkController
, but injected under demand. This makes testing easier with less required bindings.- HTTP Context is now kept when triggering
PageDataReadyHook
inSunriseFrameworkController
and when rendering the template inSunriseHomeController
. This could have raised under certain circumstances aNo HTTP Context available
error when implementing new features.
v0.12.1
Configuration
- Removed "Demo Info Modal" configuration option and related templates.
- Removed DI Modules left in
conf/application.conf
from previous release, now onlySunriseModule
is required. You can check Sunrise Starter Project's defaultModule
class andconf/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:
- Overwriting the data in session for Cart and Customer is triggered with Sunrise Components. Register to your Module.java both
CartComponent
andCustomerComponent
and enable it to the controllers you consider necessary in order to activate them. SessionHandler<T>
interface and abstract classSessionHandlerBase<T>
can be used to implement all the classes that take care of managing the data stored in session related to an elementT
(e.g. Carts, Customers, Orders).CartSessionHandler
,CustomerSessionHandler
andOrderSessionHandler
are already implemented classes offered and used in Sunrise. They can be obtained via injection and therefore their behaviour can be easily overridden.
- Overwriting the data in session for Cart and Customer is triggered with Sunrise Components. Register to your Module.java both
- Provided
HandlebarsContextFactory
class to allow changing the HandlebarsContext
, for example to change theValueResolvers
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
andCartCreateCommandHook
. - Renamed
SunriseFrameworkCartController
toSunriseFrameworkShoppingCartController
and added ashopping-cart
framework tag to it. - Renamed methods:
requiringExistingCart()
->requireExistingCart()
requiringNonEmptyCart()
->requireNonEmptyCart()
- Removed method
getOrCreateCart()
, use directlyfindCart()
orcreateCart()
methods. - Renamed
UserBean
toUserInfoBean
and provided a Factory class for its creation. - Added
email
field toUserInfoBean
. - Updated to commercetools JVM SDK 1.5.0.