Search in sources :

Example 6 with WindowInfo

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));
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WindowManager(com.haulmont.cuba.gui.WindowManager) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 7 with WindowInfo

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);
                }
            });
        }
    }
}
Also used : App(com.haulmont.cuba.web.App) Window(com.haulmont.cuba.gui.components.Window) User(com.haulmont.cuba.security.entity.User) WebWindowManager(com.haulmont.cuba.web.WebWindowManager) Connection(com.haulmont.cuba.web.Connection) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 8 with WindowInfo

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);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WebWindowManager(com.haulmont.cuba.web.WebWindowManager) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 9 with WindowInfo

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);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WebWindowManager(com.haulmont.cuba.web.WebWindowManager) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 10 with WindowInfo

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);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WebWindowManager(com.haulmont.cuba.web.WebWindowManager) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Aggregations

WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)33 WindowConfig (com.haulmont.cuba.gui.config.WindowConfig)21 WebWindowManager (com.haulmont.cuba.web.WebWindowManager)16 Window (com.haulmont.cuba.gui.components.Window)3 HashMap (java.util.HashMap)3 Element (org.dom4j.Element)3 DetachedFrame (com.haulmont.cuba.desktop.DetachedFrame)2 WindowManager (com.haulmont.cuba.gui.WindowManager)2 Filter (com.haulmont.cuba.gui.components.Filter)2 RelatedAction (com.haulmont.cuba.gui.components.actions.RelatedAction)2 AddConditionWindow (com.haulmont.cuba.gui.components.filter.addcondition.AddConditionWindow)2 ConditionDescriptorsTreeBuilderAPI (com.haulmont.cuba.gui.components.filter.addcondition.ConditionDescriptorsTreeBuilderAPI)2 AbstractConditionDescriptor (com.haulmont.cuba.gui.components.filter.descriptor.AbstractConditionDescriptor)2 FilterEntity (com.haulmont.cuba.security.entity.FilterEntity)2 User (com.haulmont.cuba.security.entity.User)2 App (com.haulmont.cuba.web.App)2 Tree (com.haulmont.bali.datastruct.Tree)1 AbstractSearchFolder (com.haulmont.cuba.core.entity.AbstractSearchFolder)1 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)1 AppBeans (com.haulmont.cuba.core.global.AppBeans)1