Overview

This document highlights major changes in CUBA Platform and Studio version 7.0.

Platform

Known Issues And Limitations

  1. CUBA 7.0 does not support the desktop client. You should not migrate your project to this release if you depend on Desktop module.

  2. Hot-deploy mechanism for UI screens is limited to changes in the existing screens only. If you create a new screen while your application is running this screen will not be hot-deployed. See GitHub issue for details.

  3. Tree UI component has been reworked using TreeDataGrid. For now it does not have borders and padding and looks different than old Tree.

Breaking Changes

  1. Internet Explorer 8-10 is not supported anymore. Supported web browsers are: Chrome, Firefox 45+, Safari 4.1+, Internet Explorer 11, Microsoft Edge.

  2. IntelliJ IDEA / Eclipse project files generation (idea and eclipse Gradle tasks) is not required anymore.

    The framework does not use idea / eclipse Gradle plugins and you must import the project using the standard IDE mechanisms. In the simplest case you just open build.gradle file as a project. See Studio User Guide for detailed instructions.

  3. CUBA and add-ons (BPM, Charts, FTS, Reports) configuration files have been moved from the classpath root to the root packages of the appropriate application components. For example, /cuba-persistence.xml became /com/haulmont/cuba/persistence.xml. These changes do not affect properly configured application projects, except in one case: in the test containers, there is a reference to the test-app.properties file which is now at com/haulmont/cuba/testsupport/test-app.properties. So if you are using middleware integration tests, edit your test container class and replace the reference:

    public class MyProjectTestContainer extends TestContainer {
    
        public MyProjectTestContainer() {
            super();
            // ...
            appPropertiesFiles = Arrays.asList(
                    "com/company/myproject/app.properties",
                    "com/haulmont/cuba/testsupport/test-app.properties");
  4. Old commons-lang dependency has been removed, the platform depends on new commons-lang3 library. You can either migrate usages to commons-lang3 (simply change imports to use org.apache.commons.lang3 package) or add explicit dependency compile('commons-lang:commons-lang:2.6') to your global module in build.gradle.

  5. Dependency on groovy-all package has been removed. Now the framework depends only on groovy, groovy-templates and groovy-sql modules. Add required Groovy modules to your project dependencies if needed.

  6. Dependency on MyBatis and com.haulmont.cuba.core.sys.mybatis.UUIDTypeHandler class have been removed. If you need MyBatis in your project, see the Integration with MyBatis section for instructions.

  7. Interfaces Component.Container, Component.HasValue, Component.HasFormatter and others have been extracted from Component and moved to com.haulmont.cuba.gui.components package. See GitHub issue for details. Imports of those interfaces must be changed, e.g. instead of com.haulmont.cuba.gui.components.Component.HasValue import com.haulmont.cuba.gui.components.HasValue directly.

  8. Deprecated methods addListener and removeListener of Instance have been removed. Use addPropertyChangeListener and removePropertyChangeListener instead.

  9. All addSomeListener and removeSomeListener methods in UI components now receive Consumer<E> where E is a type of event object. If you use those methods with a lambda parameter then your code will not require migration. If you implement one of the old listener interfaces (e.g. ValueChangeListener) with a standalone class you will need to implement Consumer<E> (e.g. ValueChangeEvent) instead. See GitHub issue for details.

  10. Regular screens cannot be used in the frame element anymore. Previously, such usage generated a warning in the server log. Now only frames/fragments with controllers inherited from AbstractFrame or ScreenFragment can be used as frames inside another screens.

  11. WebWindowManager class has been replaced with WebScreens. If you have extended WebWindowManager in your code you will need to migrate your improvements manually.

  12. Behavior of Component methods isVisible and isEnabled has been changed. Now methods return only value of the component visibility / enabled without taking parent value into consideration. New isVisibleRecursive and isEnabledRecursive methods are introduced.

  13. Interface HasValue now has type parameter V - type of the corresponding value of UI component. Old code that uses untyped UI components, for instance TextField or LookupField might be broken. You can find default type of the UI component in its interface in TYPE_DEFAULT constant. For example (here TextField has default type String):

    TypeToken<TextField<String>> TYPE_DEFAULT = new TypeToken<TextField<String>>(){};

    It is highly recommended to set type parameter for UI components explicitly, even default type parameter should be set. For example:

    @Inject
    protected LookupField<User> userField;
    @Inject
    protected TextField<Long> countField;
    @Inject
    protected Label<String> defaultTypedLabel;
  14. Method HasValue.getValue() does not support auto cast of the return value anymore. You should either cast value manually or use typed UI Component, e.g. TextField<String>.

  15. Widget set file location has been changed. If you have web-toolkit module in your project you will need to change references to widget sets in AppWidgetSet.gwt.xml file:

    cuba: com.haulmont.cuba.web.toolkit.ui.WidgetSet changed to com.haulmont.cuba.web.widgets.WidgetSet.

    charts: com.haulmont.charts.web.toolkit.ui.ChartsWidgetSet changed to com.haulmont.charts.web.widgets.ChartsWidgetSet.

  16. JQuery is not loaded by default on first page rendering anymore. Add jquery.js to dependencies of your UI component class explicitly if it requires JQuery.

  17. FreeMarker templates are not supported in caption and description attributes of a window. Now values loaded from XML are treated as simple String values. If you want to use templates in those attributes you can call com.haulmont.cuba.core.global.TemplateHelper methods manually from a screen controller.

  18. Screens declared in screens.xml file with class attribute do not support Runnable interface anymore. You can register only UI controllers that extend Screen class. The old behaviour is considered dangerous because a caller that opens such a screen receives null from openWindow call. Those screens must be changed: you can convert them into Spring beans or if you need to call them only from the menu - use class attribute of a menu item.

  19. Screen agent support has been removed without replacement. You can get DeviceInfo using the DeviceInfoProvider bean and either create different screens for each device type or open fragments in a screen.

  20. Old Havana UI theme completely reimplemented on the basis of Halo theme. If you have extended Havana you will need to migrate your SCSS styles accordingly. See GitHub issue for details.

  21. Property wordwrap of TextArea has been renamed to wordWrap. XML definitions still work, but wordwrap is removed from XSD and should not be used anymore.

  22. ComponentPalette has been removed. Use the standard mechanism with cuba.web.componentsConfig application property if your application component provides UI components.

  23. Deprecated ObjectsCache classes have been removed as a legacy and undocumented feature.

  24. Deprecated classes from charts com.haulmont.charts.gui.amcharts.model.data package have been removed. Use data items classes from com.haulmont.charts.gui.data package instead.

  25. Charts UI palette - the ChartComponentPalette class have been removed. Use the standard application component mechanism or include charts-web-components.xml into cuba.web.componentsConfig application property explicitly. If you did not use ChartComponentPalette then migration actions are not required.

  26. Class com.haulmont.cuba.core.app.DataServiceQueryBuilder has been renamed to RdbmsQueryBuilder.

  27. com.haulmont.cuba.gui.components.RowsCount.BeforeRefreshEvent does not have reference to a datasource anymore.

  28. Validators of UI components are triggered even if the value of UI component is empty.

  29. If you have defined own password encryption module (not SHA1), set cuba.legacyPasswordEncryptionModule = <your encryption module> in the app.properties files for all modules. It is necessary to authenticate existing users having empty SEC_USER.PASSWORD_ENCRYPTION field in the database.

  30. By default, the UI components description property isn’t processed as HTML markup. This can be changed by setting descriptionAsHtml=true.

  31. BaseAction does not set caption implicitly (using id as message key) anymore. Now it must be set explicitly.

  32. WidgetsTree UI component has been removed as legacy and undocumented feature.

  33. Removed multiSelect attribute of the TwinColumn UI component.

  34. TextArea and ResizableTextArea are now different UI components with own XML elements: <textArea> and <resizableTextArea>. The <textArea> element still has resizableDirection and resizable attributes for backward compatibility, but if you inject the component with resizable="true" in a controller, the type of the field must be ResizableTextArea, otherwise you will get ClassCastException.

  35. A password storage format for the cuba.rest.client.secret application property has been changed. The password encoder should be defined and the default property value is now {noop}secret instead of secret. If you explicitly defined the cuba.rest.client.secret property value in your project you should change its value according to the new format (add {noop} before the value. See GitHub issue for details.

  36. Since version 7.0.8 cookies which set programmatically with AppCookies are httpOnly by default. It potentially can break some client-side code accessing cookies.

Former Premium Add-ons

The former premium add-ons (BPM, Charts, Full-Text Search, Reports) - are free and open-source since version 7.0. The source code projects have been moved to GitHub:

The binary artifacts of the addons version 7.0 are published in the main repositories: https://dl.bintray.com/cuba-platform/main and https://repo.cuba-platform.com/content/groups/work, so there is no need to add premium repositories to your build.gradle to use the add-ons.

Generic UI

  1. Generic UI now uses Vaadin 8.

  2. New API:

  3. New UI components - Form, TreeDataGrid, RadioButtonGroup, CheckBoxGroup.

  4. Implemented JavaScriptComponent - a simplified way of integration with JavaScript UI components.

  5. Data aware UI components that implement HasValue interface provide typed API. Now you can use them as: LookupField<User>, TextField<Integer>, DateField<LocalDate> etc.

  6. Introduced new UI components factory - UiComponents bean.

  7. Implemented URL browser history and navigation.

  8. Implemented single BeforeCloseEvent for Window with CloseOriginType.

  9. All UI components now support context help.

  10. All UI component events have the userOriginated attribute that indicates whether this event was triggered by user interaction on the client side, or programmatically, on the server side.

  11. CSS rules for UI components can be set in screen XML using the css attribute.

  12. Button supports ClickEvent and can be used without an action.

IDP Single Sign-On

IDP functionality has been extracted to the separate application component that must be added explicitly.

Miscellaneous

  1. Java 8, 9, 10 and 11 can be used to build and run applications.

  2. It is recommended to use underscore instead of "$" to separate namespace and class in entity names, for example sales_Customer.

  3. BCrypt algorithm is used for password hashing for newly created users. See cuba.passwordEncryptionModule app property.

  4. LoginPasswordLoginProvider of the client blocks sends user’s password to the middleware as is (i.e. not hashed as in previous versions). See cuba.checkPasswordOnClient app property for recommendations.

  5. Web client exception handlers have new base classes, see Client-Level Exception Handlers. The old classes have been deprecated and kept for backward compatibility.

Updated Dependencies

Core framework:

com.google.guava = 26.0-jre
com.sun.mail/javax.mail = 1.6.0
com.vaadin = 8.6.4-2-cuba
de.javakaffee/kryo-serializers = 0.42
javax/javaee-api = 8.0
org.codehaus.groovy = 2.5.4
org.dom4j/dom4j = 2.1.0
org.eclipse.persistence/org.eclipse.persistence.jpa = 2.7.3-1-cuba
org.eclipse.persistence/org.eclipse.persistence.oracle = 2.7.3
org.freemarker/freemarker = 2.3.23
org.glassfish/javax.el = 3.0.1-b10
org.hibernate.validator/hibernate-validator = 6.0.13.Final
org.javassist/javassist = 3.24.0-GA
org.jmockit/jmockit = 1.39
org.springframework = 5.1.2.RELEASE
org.springframework.security = 5.1.1.RELEASE
org.springframework.security.oauth/spring-security-oauth2 = 2.3.4.RELEASE
org.webjars.bower/jquery-file-upload = 9.22.0.cuba.0
org.webjars/jquery = 3.3.1

Full-Text Search add-on:

org.apache.lucene = 7.5.0

Reports add-on:

com.haulmont.yarg = 2.1.3

Studio

All Studio functionality has been moved to the plugin for IntelliJ IDEA. It supports projects based on CUBA 6.10 and 7.0, so you can open an existing project in the new Studio and migrate it to the new framework version. See CUBA Studio User Guide for details.

If you need premium add-ons (Reports, BPM, etc.) for a project based on CUBA 6.10 and you have a subscription, you should set the premium repository access credentials in ~/.gradle/gradle.properties as described in the documentation. Studio does not pass the credentials to Gradle.

. . .