diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java index 15678e86..385aa53f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java @@ -181,6 +181,8 @@ public class ActivitiesPane implements TemplateComposer { sebAdmin.dispose(); } + + // ---- SEB ADMIN ---------------------------------------------------------------------- //-------------------------------------------------------------------------------------- @@ -445,6 +447,9 @@ public class ActivitiesPane implements TemplateComposer { private TreeItem getDefaultSelectionFor(final Tree navigation, final CurrentUser currentUser2) { try { if (this.currentUser.get().hasAnyRole(UserRole.SEB_SERVER_ADMIN, UserRole.INSTITUTIONAL_ADMIN)) { + if (pageService.isSEBServerLightSetup()) { + return navigation.getItem(0).getItem(1); + } return navigation.getItem(0); } else if (this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)) { return findItemByActionDefinition( diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/InstitutionList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/InstitutionList.java index ef355cf4..27e3f04c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/InstitutionList.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/InstitutionList.java @@ -94,6 +94,12 @@ public class InstitutionList implements TemplateComposer { pageContext.getParent(), TITLE_TEXT_KEY); + if (pageService.isSEBServerLightSetup()) { + pageService.applyFullVersionNote(content, pageContext); + return; + } + + final PageActionBuilder pageActionBuilder = this.pageService.pageActionBuilder(pageContext.clearEntityKeys()); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageContext.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageContext.java index cd62014c..0034bddb 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageContext.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageContext.java @@ -27,6 +27,7 @@ public interface PageContext { Logger log = LoggerFactory.getLogger(PageContext.class); + /** Defines attribute keys that can be used to store attribute values within the page context state */ interface AttributeKeys { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageService.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageService.java index 1d4c33f1..05ef5125 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageService.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/PageService.java @@ -127,6 +127,13 @@ public interface PageService { * @return the configured tooltip mode for input forms */ FormTooltipMode getFormTooltipMode(); + /** Indicates if SEB Server runs with SEB Server light setup + * + * @return true if this is a SEB Server light setup*/ + boolean isSEBServerLightSetup(); + + void applyFullVersionNote(Composite content, PageContext pageContext); + /** Get a PageAction function to go back to the current state. * * @return a PageAction function to go back to the current state. */ diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/impl/PageServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/impl/PageServiceImpl.java index 6db5224a..c3294045 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/page/impl/PageServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/page/impl/PageServiceImpl.java @@ -20,7 +20,9 @@ import java.util.function.Supplier; import javax.servlet.http.HttpSession; +import ch.ethz.seb.sebserver.gui.GuiServiceInfo; import org.eclipse.rap.rwt.RWT; +import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.TreeItem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,6 +90,7 @@ public class PageServiceImpl implements PageService { private final ResourceService resourceService; private final CurrentUser currentUser; private final ServerPushService serverPushService; + private final GuiServiceInfo guiServiceInfo; public PageServiceImpl( final Cryptor cryptor, @@ -96,7 +99,8 @@ public class PageServiceImpl implements PageService { final PolyglotPageService polyglotPageService, final ResourceService resourceService, final CurrentUser currentUser, - final ServerPushService serverPushService) { + final ServerPushService serverPushService, + final GuiServiceInfo guiServiceInfo) { this.cryptor = cryptor; this.jsonMapper = jsonMapper; @@ -105,6 +109,7 @@ public class PageServiceImpl implements PageService { this.resourceService = resourceService; this.currentUser = currentUser; this.serverPushService = serverPushService; + this.guiServiceInfo = guiServiceInfo; } @Override @@ -182,6 +187,19 @@ public class PageServiceImpl implements PageService { return FormTooltipMode.INPUT; } + @Override + public boolean isSEBServerLightSetup() { + return this.guiServiceInfo.isLightSetup(); + } + + private static final LocTextKey FULL_VERSION_NOTE = new LocTextKey("sebserver.features.lightsetup.fullversion.message"); + @Override + public void applyFullVersionNote(final Composite content, final PageContext pageContext) { + final Composite warningPanel = this.widgetFactory.createWarningPanel(content); + warningPanel.setData(RWT.CUSTOM_VARIANT, WidgetFactory.CustomVariant.NOTE.key); + this.widgetFactory.labelLocalizedNote(warningPanel, FULL_VERSION_NOTE); + } + @SuppressWarnings("unchecked") @Override public void firePageEvent(final T event, final PageContext pageContext) { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java index 2cfedb57..fef69655 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java @@ -220,6 +220,7 @@ public class WidgetFactory { MESSAGE("message"), ERROR("error"), WARNING("warning"), + NOTE("note"), DISABLED("disabled"), CONFIG_INPUT_READONLY("inputreadonly"), @@ -507,6 +508,14 @@ public class WidgetFactory { labelLocalized.setLayoutData(gridData); return labelLocalized; } + public Label labelLocalizedNote(final Composite content, final LocTextKey locTextKey) { + final Label labelLocalized = labelLocalized(content, CustomVariant.NOTE, locTextKey); + labelLocalized.setData(RWT.MARKUP_ENABLED, true); + final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); + labelLocalized.setLayoutData(gridData); + return labelLocalized; + } + public Text textInput(final Composite content, final LocTextKey ariaLabel) { return textInput(content, false, false, ariaLabel.name, ariaLabel); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java index d7169516..60be47b5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java @@ -114,11 +114,19 @@ public class WebserviceInit implements ApplicationListener JDBC connection pool max size: {}", this.environment.getProperty("spring.datasource.hikari.maximumPoolSize")); + + if (this.webserviceInfo.isDistributed()) { + if (this.webserviceInfo.isLightSetup()) { + throw new IllegalStateException("Illegal invalid setup configuration detected, SEB Serer light and distributed setup cannot be applied within the same setup."); + } SEBServerInit.INIT_LOGGER.info("----> "); SEBServerInit.INIT_LOGGER.info("----> Distributed Setup: {}", this.webserviceInfo.getWebserviceUUID()); SEBServerInit.INIT_LOGGER.info("----> Connection update time: {}", this.environment.getProperty("sebserver.webservice.distributed.connectionUpdate", "2000")); + } else if (this.webserviceInfo.isLightSetup()) { + SEBServerInit.INIT_LOGGER.info("----> "); + SEBServerInit.INIT_LOGGER.info("----> SEB Server light setup enabled!"); } SEBServerInit.INIT_LOGGER.info("----> "); diff --git a/src/main/resources/config/application-dev-ws.properties b/src/main/resources/config/application-dev-ws.properties index 0854dc2c..927a17aa 100644 --- a/src/main/resources/config/application-dev-ws.properties +++ b/src/main/resources/config/application-dev-ws.properties @@ -25,7 +25,8 @@ sebserver.webservice.clean-db-on-startup=false # webservice setup configuration sebserver.init.adminaccount.gen-on-init=false -sebserver.webservice.distributed=true +sebserver.webservice.light.setup=true +sebserver.webservice.distributed=false #sebserver.webservice.master.delay.threshold=10000 sebserver.webservice.http.external.scheme=http sebserver.webservice.http.external.servername=localhost @@ -75,5 +76,5 @@ sebserver.feature.seb.screenProctoring.bundled.url=http://localhost:8090 sebserver.feature.seb.screenProctoring.bundled.clientId=sebserverClient sebserver.feature.seb.screenProctoring.bundled.sebserveraccount.username=SEBServerAPIAccount -sebserver.feature.admin.institution.enabled=false +sebserver.feature.admin.institution.enabled=true diff --git a/src/main/resources/config/application.properties b/src/main/resources/config/application.properties index 82bb865f..1879621e 100644 --- a/src/main/resources/config/application.properties +++ b/src/main/resources/config/application.properties @@ -20,8 +20,6 @@ server.tomcat.socket.soKeepAlive=true server.tomcat.socket.performanceConnectionTime=1 server.tomcat.socket.performanceLatency=2 server.tomcat.socket.performanceBandwidth=0 -server.tomcat.keepAliveTimeout(3000); -server.tomcat.maxKeepAliveRequests(3000); server.tomcat.uri-encoding=UTF-8 ### encoding diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 45aade87..f2f9921f 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -2572,4 +2572,4 @@ sebserver.seblogs.delete.action.delete=Delete All Logs sebserver.seblogs.delete.confirm.title=Deletion Successful sebserver.seblogs.delete.confirm.message={0} SEB client logs where successfully deleted.

And there where {1} errors. -sebserver.features.lightsetup.fullversion.message=MOCKUP_TEXT: This feature is not available within this SEB Server (light) setup. To use this feature you need a full version SEB Server setup. Please read more about SEB Server setups in the SEB Server installation guide +sebserver.features.lightsetup.fullversion.message=MOCKUP-TEXT:

[Specific feature description here!?]

Note that this feature is not available within the SEB Server Light setup.
To use this feature you will need a full version SEB Server setup.

Please read more about SEB Server setups in the SEB Server installation guide diff --git a/src/main/resources/static/css/sebserver.css b/src/main/resources/static/css/sebserver.css index 0e49f26a..e0e55fd7 100644 --- a/src/main/resources/static/css/sebserver.css +++ b/src/main/resources/static/css/sebserver.css @@ -80,6 +80,8 @@ Label.h2 { color: #1f407a; } + + Label.h3 { font: bold 14px Arial, Helvetica, sans-serif; height: 20px; @@ -93,6 +95,13 @@ Label.subtitle { color: #4a4a4a; } +Label.note { + font: 18px Arial, Helvetica, sans-serif; + height: 22px; + padding: 0 0 6px 0; + color: #4a4a4a; +} + Label.error { font: 10px Arial, Helvetica, sans-serif; color: #aa0000; @@ -252,6 +261,15 @@ Composite.warning { opacity: 1; } +Composite.note { + background-gradient-color: rgba( 31, 64, 122, 0.2 ); + background-image: gradient( linear, left top, left bottom, from(rgba( 31, 64, 122, 0.2 ) ), to( rgba( 31, 64, 122, 0.2 ) ) ); + background-repeat: repeat; + background-position: left top; + font: bold 18px Arial, Helvetica, sans-serif; + opacity: 1; +} + *.header { font: bold 12px Arial, Helvetica, sans-serif; color: #FFFFFF;