use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class ChangePasswordLauncher method run.
@Override
public void run() {
WindowManager wm = App.getInstance().getMainFrame().getWindowManager();
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo("sec$User.changePassword");
wm.openWindow(windowInfo, OpenType.DIALOG, ParamsMap.of("currentPasswordRequired", true));
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class ChangePasswordAfterLoginListener method onApplicationEvent.
@Override
public void onApplicationEvent(AppLoggedInEvent event) {
App app = event.getApp();
Connection connection = app.getConnection();
if (connection.isAuthenticated() && !isLoggedInWithExternalAuth(connection.getSessionNN())) {
User user = connection.getSessionNN().getUser();
// Change password on logon
if (Boolean.TRUE.equals(user.getChangePasswordAtNextLogon())) {
WebWindowManager wm = app.getWindowManager();
for (Window window : wm.getOpenWindows()) {
window.setEnabled(false);
}
WindowInfo changePasswordDialog = windowConfig.getWindowInfo("sec$User.changePassword");
Window changePasswordWindow = wm.openWindow(changePasswordDialog, WindowManager.OpenType.DIALOG.closeable(false), ParamsMap.of("cancelEnabled", Boolean.FALSE));
changePasswordWindow.addCloseListener(actionId -> {
for (Window window : wm.getOpenWindows()) {
window.setEnabled(true);
}
});
}
}
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFrame method openWindow.
@Override
public Window openWindow(String windowAlias, WindowManager.OpenType openType, Map<String, Object> params) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
WebWindowManager wm = App.getInstance().getWindowManager();
return wm.openWindow(windowInfo, openType, params);
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFrame method openLookup.
@Override
public Window.Lookup openLookup(String windowAlias, Window.Lookup.Handler handler, WindowManager.OpenType openType) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
WebWindowManager wm = App.getInstance().getWindowManager();
return wm.openLookup(windowInfo, handler, openType);
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFrame method openWindow.
@Override
public Window openWindow(String windowAlias, WindowManager.OpenType openType) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
WebWindowManager wm = App.getInstance().getWindowManager();
return wm.openWindow(windowInfo, openType);
}
Aggregations