4.5.8. Web Client Specifics
Implementation of the generic user interface of the Web Client block is based on the Vaadin framework. The main classes available in the web client infrastructure are described below.
App- the central class of the application infrastructure. Contains links to
AppWindowand other infrastructure objects. Only one instance of
Appexists for a given HTTP-session.
Each application typically has its own
Appclass class inherited from the
DefaultAppand thus from the basic abstract
Appclass of the platform. It allows you to override
createLoginWindow()methods to create custom implementations of the main window and the login window.
Appclass of an application should be registered in the
applicationparameter of the
app_servletin the web.xml file of the web module.
Connectionis the interface providing functionality of connecting to middleware and storing user sessions.
DefaultConnectionis a standard implementation of this interface.
AppUIis a platform class inherited from
com.vaadin.ui.UIclass. There is one instance of this class for each open tab of a web browser. Contains a link to the
UIViewobject – either a
AppUIapplication class should be registered in the
UIparameter of the
app_servletin the web/WEB-INF/web.xml file of the web module. In most cases, standard platform class is used.
LoginWindow– the window displayed before a user logs in. In your application you can create an inheritor of
LoginWindowand redefine the
createLoginWindow()method of the
Appclass to use it.
AppWindow– main application window displayed after a user logs in. In your application, you can create an inheritor of
AppWindowand override the
createAppWindow()method of the
Appclass to use it.
onHistoryBackPerformed()method allows you to handle browser Back button. This method is invoked instead of standard browser behavior if cuba.web.allowHandleBrowserHistoryBack application property is true.
You can control certain main window parameters without creating
AppWindowinheritor, using the following application properties:
cuba.web.useLightHeader - switches on compact window header - logo, menu bar, user name and log out button in one line. When switched off,
AppWindow.createTitleLayout()method creates additional area at the top.
cuba.web.appWindowMode – sets default mode for the main window: tabbed or single screen (
SINGLE). Users can change the mode later using Help > Settings screen.
cuba.web.maxTabCount – when the main window is in the tabbed mode, this property sets the maximum number of tabs that a user can open. The default value is 7.
WindowManager- the central class implementing application screens management logic.
showMessageDialog()and other methods of the
Frameinterface implemented by screen controllers delegate to the window manager.
WindowManagerclass is located in the platform’s common gui module and is abstract. The web module has a dedicated
WebWindowManagerclass that implements web client specifics.
WindowManageris not used in the application code directly.
ExceptionHandlers- contains a collection of client-level exception handlers.