Search in sources :

Example 1 with IRemoteGitManagerRestricted

use of de.catma.repository.git.interfaces.IRemoteGitManagerRestricted in project catma by forTEXT.

the class Vaadin8InitializationService method newEntryPage.

@Override
public Component newEntryPage(EventBus eventBus, LoginService loginService, HazelCastService hazelcastService, SqliteService sqliteService) throws IOException {
    IRemoteGitManagerRestricted api = loginService.getAPI();
    if (api != null) {
        GitProjectManager projectManager = new GitProjectManager(CATMAPropertyKey.GitBasedRepositoryBasePath.getValue(), api, // noop deletion handler
        (projectId) -> {
        }, acquireBackgroundService(), eventBus);
        hazelcastService.start();
        GitlabManagerPrivileged gitlabManagerPrivileged = new GitlabManagerPrivileged();
        boolean termsOfUseConsentGiven = gitlabManagerPrivileged.updateLastLoginAndGetTermsOfUseConsent(api.getUser());
        return new MainView(projectManager, new CatmaHeader(eventBus, loginService, gitlabManagerPrivileged), eventBus, api, loginService, termsOfUseConsentGiven, consent -> gitlabManagerPrivileged.setTermsOfUseConsentGiven(api.getUser(), consent));
    } else {
        return new NotLoggedInMainView(this, loginService, hazelcastService, sqliteService, eventBus);
    }
}
Also used : CatmaHeader(de.catma.ui.module.main.CatmaHeader) GitProjectManager(de.catma.repository.git.GitProjectManager) IRemoteGitManagerRestricted(de.catma.repository.git.interfaces.IRemoteGitManagerRestricted) GitlabManagerPrivileged(de.catma.repository.git.managers.GitlabManagerPrivileged) NotLoggedInMainView(de.catma.ui.module.main.NotLoggedInMainView) MainView(de.catma.ui.module.main.MainView) NotLoggedInMainView(de.catma.ui.module.main.NotLoggedInMainView)

Example 2 with IRemoteGitManagerRestricted

use of de.catma.repository.git.interfaces.IRemoteGitManagerRestricted in project catma by forTEXT.

the class CatmaApplication method showAndLogError.

@Override
public void showAndLogError(String message, Throwable e) {
    IRemoteGitManagerRestricted api = null;
    try {
        api = loginservice.getAPI();
    } catch (Exception notOfInterest) {
    }
    // $NON-NLS-1$ //$NON-NLS-2$
    logger.log(Level.SEVERE, "[" + (api == null ? "not logged in" : api.getUsername()) + "]" + message, e);
    if (message == null) {
        message = "Internal Error";
    }
    if (Page.getCurrent() != null) {
        HTMLNotification.show("Error", MessageFormat.format("An error has occurred!<br />" + "The error has been logged " + "but you can help us by sending an email with a more detailed description.<br />" + "Or you open an issue at <a href=\"https://github.com/mpetris/catma\">GitHub</a>.<br />" + "<br />The underlying error message is:<br /> {0} <br /> {1}", message, e.getMessage() == null ? "" : e.getMessage()), Type.ERROR_MESSAGE);
    }
}
Also used : IRemoteGitManagerRestricted(de.catma.repository.git.interfaces.IRemoteGitManagerRestricted) IOException(java.io.IOException)

Aggregations

IRemoteGitManagerRestricted (de.catma.repository.git.interfaces.IRemoteGitManagerRestricted)2 GitProjectManager (de.catma.repository.git.GitProjectManager)1 GitlabManagerPrivileged (de.catma.repository.git.managers.GitlabManagerPrivileged)1 CatmaHeader (de.catma.ui.module.main.CatmaHeader)1 MainView (de.catma.ui.module.main.MainView)1 NotLoggedInMainView (de.catma.ui.module.main.NotLoggedInMainView)1 IOException (java.io.IOException)1