Package com.art.anette.client.controller

Examples of com.art.anette.client.controller.BasicController


            logger.severe("SSL Failure", ex);
            ProgressUtils.errorMessage("SSLFailed");
            System.exit(1);
        }

        final BasicController basicControl = BasicController.getInstance();

        // nicht registriert oder eingeloggt
        if ("".equals(config.getProperty("user.email")) || "".equals(config.getProperty("user.password"))) {
            showWelcomeDialog(config, basicControl, "", "");
        } else {
            try {
                final ProgressUtils.Monitor monitor = ProgressUtils.createProgress(lang.getString("ProgressLoggingIn"));
                basicControl.login(new LoginRequest(config.getProperty("user.email"), config.getProperty("user.password")));
                monitor.finish();
            } catch (NetworkException ex) {
                logger.warning("Connection Failure", ex);
                ProgressUtils.errorMessage(lang.getString("ConnectionFailed"), ex.getMessage());
                showWelcomeDialog(config, basicControl, config.getProperty("user.email"), config.getProperty("user.password"));
            } catch (LoginFailedException ex) {
                ProgressUtils.errorMessage(String.format(lang.getString("LoginFailed"), ex.getMessage()));
                logger.info("Login Failure", ex);
                showWelcomeDialog(config, basicControl, config.getProperty("user.email"), config.getProperty("user.password"));
            }
        }

        // nun eingeloggt; starte Hauptfenster
        if (basicControl.isLoggedIn()) {
            try {
                final ProgressUtils.Monitor progress = ProgressUtils.createProgress(lang.getString("ProgressLogicDatabase"));
                final Logic logic = Logic.getInstance(config, basicControl.getLoggedInEmployee());
                NetworkControl.getInstance().setLoginData(basicControl.getLoginData(), logic.getDBControl());
                NetworkControl.getInstance().start();
                ClientConfiguration.getInstance().setProperty("db.dirty", "true");
                ClientConfiguration.getInstance().writeConfiguration();
                progress.finish();
                SwingUtilities.invokeLater(new Runnable() {
View Full Code Here


            logger.severe("SSL Failure", ex);
            ProgressUtils.errorMessage("SSLFailed");
            throw new Exception("SSL-problem");
        }

        final BasicController basicControl = BasicController.getInstance();

        // nicht registriert oder eingeloggt
        assert !("".equals(config.getProperty("user.email")) || "".equals(config.getProperty("user.password")));

        try {
            final ProgressUtils.Monitor monitor = ProgressUtils.createProgress(lang.getString("ProgressLoggingIn"));
            basicControl.login(new LoginRequest(config.getProperty("user.email"), config.getProperty("user.password")));
            monitor.finish();
        } catch (NetworkException ex) {
            logger.severe("Connection Failure", ex);
            return;
        } catch (LoginFailedException ex) {
            logger.severe("Login Failure", ex);
            return;
        }

        // nun eingeloggt; starte Hauptfenster
        assert basicControl.isLoggedIn();

        final Logic logic;
        try {
            logic = Logic.getInstance(config, basicControl.getLoggedInEmployee());
        } catch (LogicInitFailedException e) {
            logger.severe("Can't create logic");
            return;
        }
        network.setLoginData(basicControl.getLoginData(), logic.getDBControl());
        network.start();
        ClientConfiguration.getInstance().setProperty("db.dirty", "true");
        ClientConfiguration.getInstance().writeConfiguration();

        if (sleepTime == 0) {
View Full Code Here

TOP

Related Classes of com.art.anette.client.controller.BasicController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.