The components, their behavior, and layout of the Application User Interface is defined by the LspsUI
class: Hence to change these, you need to modify the implementation or implement your own LspsUI class. In the LSPS Application, the resources are located in the vaadin.core package of the <YOUR_APP>-vaadin project.
Note: The content of the Documents and To-Dos is defined in Modules using forms: to modify these, you need to change the design of their forms or related Module resources.
The underlying default component tree of the Application User Interface is as follows:
applayout extends CustomComponent and implements ViewDisplay
It holds the following layout components of the default Application User Interface:
To change the components of the application, you will be mostly editing the initLayout()
method of the AppConnector class.
If you decide to implement the LspsUI class, make sure it meets the following requirements:
@Widgetset("com.whitestein.lsps.vaadin.widgets.WidgetSet")
public class LspsUI extends UI implements ErrorHandler { ...
login.jsp
and in the WEB-INF/web.xml
of the webapp project.To add a custom item to the navigation menu or remove existing items, do the following:
Locate the //Examples:
comment in the buildMenu()
method.
The examples demonstrate how to add custom items to the Navigation menu: to preview them, set the if condition to true, compile and run the application.
if
statement with the respective navigation menu item above the example or add an if
statement which will be check if the user has the required permissions.To add your items to the menu, call the addDocumentItem()
or addRunModelItem()
method calls as appropriate.
When adding custom items, consider whether the user permissions need to be taken into account: if this is required, use the respective methods, such as:
hasRight()
hasRightToOpenDocument()
(false if user has no right to access given document as defined by the document access expression)To add a footer or header to the content area of the application by modifying the Vaadin component tree, do the following:
//example header defined as member variable of the AppLayout class:
Component header = new Label("header");
//example footer defined as member variable of the AppLayout class:
Component footer = new Label("footer");
VerticalLayout contentAreaWithHeaderAndFooter = new VerticalLayout(header, contentArea, footer);
contentAreaWithHeaderAndFooter.setHeight("100%");
contentAreaWithHeaderAndFooter.setExpandRatio(contentArea, 1);
mainLayout.addComponents(menuArea, contentAreaWithHeaderAndFooter);
mainLayout.setExpandRatio(contentAreaWithHeaderAndFooter, 1);
To modify the login page, logout page, and the page displayed when login action failed, modify the login.jsp
, login_failed.jsp
, and logout.jsp
in the <app>-vaadin-war project of your application.
To change the logo of the area where you enter your credentials, proceed as follows:
...
var storage = window.localStorage;
var theme = "my-theme";
&.login-page form table
.Example login customization
@mixin _login {
&.login-page #loginHeader{
background: white url(../img/splashscreen.png) !important;
background-position: center !important;
background-size: 400px auto !important;
background-repeat: no-repeat !important;
}
&.login-page form table {
background-color: white !important;
background-image: none !important;
}
&.login-page input {
border: 1px solid #c9c9c9 !important;
}
&.login-page .v-button .v-button-caption {
color: #c9c9c9 !important;
}
}
The information for the dialog is pulled from the app-version.properties file which is bound to the maven build properties.
Note: On SDK Embedded Server the properties are not resolved since the application is not deployed as an EAR.
To provide a new localization setting and sources, do the following:
<YOUR_APP>-vaadin/src/main/resources/com/whitestein/lsps/vaadin/webapp/localization.properties
file as a template for your properties file.<YOUR_APP>-vaadin/src/main/resources/com/whitestein/lsps/vaadin/webapp/
directory.<YOUR_APP>-vaadin/src/main/java/org/<YOUR_APP>/<>/vaadin/page/AppSettingsView.java
and add the definition to the createSettingsSection()
method. The language code is based on the java.util.Locale class. private VerticalLayout createSettingsSection(LspsUI ui) {
VerticalLayout settings = new VerticalLayout();
settings.setSpacing(true);
Label settingsHeader = new Label("<h2>" + ui.getMessage("settings.applicationSection") + "</h2>", ContentMode.HTML);
settings.addComponent(settingsHeader);
this.languages = new OptionGroup(ui.getMessage("settings.language"));
languages.addStyleName("ui-spacing");
languages.addItem("en_US");
languages.setItemCaption("en_US", English);
languages.addItem("de_DE");
languages.setItemCaption("de_DE", Deutsch);
languages.addItem("sk_SK");
languages.setItemCaption("sk_SK", Slovensky);
//Italian localization setting:
languages.addItem("it_IT");
languages.setItemCaption("it_IT", Italiano);
languages.setValue(ui.getLocale().toString());
settings.addComponent(languages);
return settings;
}
Important: We instruct you to use the forms Module to implement the GUI of your page in the examples. However, this feature is experimental and the resulting form is not compatible with the ui Modules, which is the previous and supported forms implementation.
To create a page that will be always available to front-end users, do the following: