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);
}
}
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);
}
}
Aggregations