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.

Figure 23. Web Client Infrastructure Classes
  • App - the central class of the application infrastructure. Contains links to Connection, AppWindow and other infrastructure objects. Only one instance of App exists for a given HTTP-session.

    Each application typically has its own App class class inherited from the DefaultApp and thus from the basic abstract App class of the platform. It allows you to override createAppWindow() and createLoginWindow() methods to create custom implementations of the main window and the login window.

    The App class of an application should be registered in the application parameter of the app_servlet in the web.xml file of the web module.

  • Connection is the interface providing functionality of connecting to middleware and storing user sessions. DefaultConnection is a standard implementation of this interface.

  • AppUI is a platform class inherited from com.vaadin.ui.UI class. There is one instance of this class for each open tab of a web browser. Contains a link to the UIView object – either a LoginWindow or AppWindow.

    AppUI application class should be registered in the UI parameter of the app_servlet in 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 LoginWindow and redefine the createLoginWindow() method of the App class to use it.

  • AppWindow – main application window displayed after a user logs in. In your application, you can create an inheritor of AppWindow and override the createAppWindow() method of the App class 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 AppWindow inheritor, 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.foldersPaneEnabled - enables creation of folders pane by AppWindow.createFoldersPane() method.

    • cuba.web.appWindowMode – sets default mode for the main window: tabbed or single screen (TABBED or 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. openWindow(), openEditor(), showMessageDialog() and other methods of the Frame interface implemented by screen controllers delegate to the window manager. WindowManager class is located in the platform’s common gui module and is abstract. The web module has a dedicated WebWindowManager class that implements web client specifics.

    Normally, the WindowManager is not used in the application code directly.

  • ExceptionHandlers - contains a collection of client-level exception handlers.