use of edu.stanford.bmir.protege.web.shared.app.ApplicationSettings in project webprotege by protegeproject.
the class ApplicationSettingsPresenter method applySettings.
private void applySettings() {
ApplicationSettings applicationSettings = new ApplicationSettings(view.getApplicationName(), new EmailAddress(view.getSystemNotificationEmailAddress()), new ApplicationLocation(view.getScheme().name().toLowerCase(), getHostNameFromView(), getPathFromView(), getPortFromView()), view.isAccountCreationAllowed() ? ACCOUNT_CREATION_ALLOWED : ACCOUNT_CREATION_NOT_ALLOWED, Collections.emptyList(), view.isProjectCreationAllowed() ? EMPTY_PROJECT_CREATION_ALLOWED : EMPTY_PROJECT_CREATION_NOT_ALLOWED, Collections.emptyList(), view.isProjectUploadAllowed() ? PROJECT_UPLOAD_ALLOWED : PROJECT_UPLOAD_NOT_ALLOWED, Collections.emptyList(), view.isNotificationEmailsEnabled() ? SEND_NOTIFICATION_EMAILS : DO_NOT_SEND_NOTIFICATION_EMAILS, parseMaxUploadSize());
dispatchServiceManager.execute(new SetApplicationSettingsAction(applicationSettings), result -> MessageBox.showMessage("Settings applied", "The application settings have successfully been applied"));
}
use of edu.stanford.bmir.protege.web.shared.app.ApplicationSettings in project webprotege by protegeproject.
the class ApplicationPreferencesManager_TestCase method shouldGetProjectCreationAllowed.
@Test
public void shouldGetProjectCreationAllowed() {
when(accessManager.hasPermission(forAnySignedInUser(), ApplicationResource.get(), BuiltInAction.CREATE_EMPTY_PROJECT)).thenReturn(true);
ApplicationSettings applicationSettings = manager.getApplicationSettings();
assertThat(applicationSettings.getProjectCreationSetting(), is(EMPTY_PROJECT_CREATION_ALLOWED));
}
use of edu.stanford.bmir.protege.web.shared.app.ApplicationSettings in project webprotege by protegeproject.
the class ApplicationPreferencesManager_TestCase method shouldGetApplicationSettings.
@Test
public void shouldGetApplicationSettings() {
ApplicationSettings applicationSettings = manager.getApplicationSettings();
assertThat(applicationSettings.getApplicationName(), is(THE_APP_NAME));
assertThat(applicationSettings.getSystemNotificationEmailAddress().getEmailAddress(), is(THE_SYSTEM_NOTIFICATION_EMAIL_ADDRESS));
assertThat(applicationSettings.getApplicationLocation(), is(applicationLocation));
}
use of edu.stanford.bmir.protege.web.shared.app.ApplicationSettings in project webprotege by protegeproject.
the class ApplicationPreferencesManager_TestCase method shouldGetProjectUploadNotAllowed.
@Test
public void shouldGetProjectUploadNotAllowed() {
ApplicationSettings applicationSettings = manager.getApplicationSettings();
assertThat(applicationSettings.getProjectUploadSetting(), is(PROJECT_UPLOAD_NOT_ALLOWED));
}
use of edu.stanford.bmir.protege.web.shared.app.ApplicationSettings in project webprotege by protegeproject.
the class ApplicationPreferencesManager_TestCase method shouldGetAccountCreationAllowed.
@Test
public void shouldGetAccountCreationAllowed() {
when(accessManager.hasPermission(forGuestUser(), ApplicationResource.get(), BuiltInAction.CREATE_ACCOUNT)).thenReturn(true);
ApplicationSettings applicationSettings = manager.getApplicationSettings();
assertThat(applicationSettings.getAccountCreationSetting(), is(ACCOUNT_CREATION_ALLOWED));
}
Aggregations