From 97d988fa6dd0de498a342eafefee2ea2d3f11e57 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 08:19:26 +0200 Subject: [PATCH 01/59] Added JavaDocs to EntryPoint classes that depend on SwitchingEntryPoint --- .../com/sap/sailing/gwt/home/desktop/DesktopEntryPoint.java | 5 +++++ .../com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/DesktopEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/DesktopEntryPoint.java index cee4048cbe4..10fbe5ab7d1 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/DesktopEntryPoint.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/DesktopEntryPoint.java @@ -11,6 +11,7 @@ import com.sap.sailing.gwt.home.desktop.app.DesktopActivityManager; import com.sap.sailing.gwt.home.desktop.app.DesktopActivityMapper; import com.sap.sailing.gwt.home.desktop.app.DesktopClientFactory; import com.sap.sailing.gwt.home.desktop.app.TabletAndDesktopApplicationClientFactory; +import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint; import com.sap.sailing.gwt.home.shared.app.ApplicationHistoryMapper; import com.sap.sailing.gwt.ui.client.RemoteServiceMappingConstants; import com.sap.sailing.gwt.ui.client.ServerConfigurationService; @@ -21,6 +22,10 @@ import com.sap.sse.gwt.client.mvp.AbstractMvpEntryPoint; import com.sap.sse.gwt.resources.CommonControlsCSS; import com.sap.sse.gwt.resources.Highcharts; +/** + * Desktop/tablet EntryPoint for the Home module. Be aware that this EntryPoint isn't directly started but instead the + * {@link SwitchingEntryPoint} decides about which version of the application will be shown. + */ public class DesktopEntryPoint extends AbstractMvpEntryPoint { diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java index 164aa0175e4..ea5a9c00fe3 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java @@ -9,6 +9,7 @@ import com.google.gwt.user.client.rpc.ServiceDefTarget; import com.sap.sailing.gwt.common.client.SharedResources; import com.sap.sailing.gwt.home.mobile.app.MobileActivityMapper; import com.sap.sailing.gwt.home.mobile.app.MobileApplicationClientFactory; +import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint; import com.sap.sailing.gwt.home.shared.app.ApplicationHistoryMapper; import com.sap.sailing.gwt.home.shared.app.ResettableNavigationPathDisplay; import com.sap.sailing.gwt.home.shared.app.SailingActivityManager; @@ -20,6 +21,10 @@ import com.sap.sse.gwt.client.EntryPointHelper; import com.sap.sse.gwt.client.mvp.AbstractMvpEntryPoint; import com.sap.sse.gwt.resources.CommonControlsCSS; +/** + * Smartphone EntryPoint for the Home module. Be aware that this EntryPoint isn't directly started but instead the + * {@link SwitchingEntryPoint} decides about which version of the application will be shown. + */ public class MobileEntryPoint extends AbstractMvpEntryPoint { From 5e20f02a961f442fc402f56e6c529dad8fafd9c1 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 08:19:54 +0200 Subject: [PATCH 02/59] Added JavaDocs to DeviceDetector --- .../gwt/common/client/formfactor/DeviceDetector.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java index 5569893e62b..0ed6625c92c 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java @@ -5,6 +5,16 @@ import java.util.logging.Logger; import com.google.gwt.regexp.shared.RegExp; import com.google.gwt.user.client.Window.Navigator; +/** + * Helps to detect different form factors/device categories by analyzing the browser's user agent string. Based on the + * browser itself or the name of the operating system it's easy to detect mobile OSes as iOS or Android. Distinguishing + * smartphones and tablets is a little bit more complex because you need to analyze common device ID patterns for known + * tablets of various companies as Samsung or Sony. + * + * By now, it's not possible to ask the browser about the device or even the physical size of the device or browser + * window. It's also not possible to render an element with CSS size "1cm" or "1in" and read its pixel size in order to + * calculate the real size of the screen. This is caused by the fact that at least mobile browsers always fake 96 dpi. + */ public class DeviceDetector { private static Logger LOG = Logger.getLogger(DeviceDetector.class.getName()); From cbdb4f4e61126dbd96f023746ac80c68400f4abe Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 08:29:01 +0200 Subject: [PATCH 03/59] Extended regex for tablet identification --- .../sap/sailing/gwt/common/client/formfactor/DeviceDetector.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java index 0ed6625c92c..608455d68d8 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java @@ -23,6 +23,7 @@ public class DeviceDetector { private static final RegExp tabletBlacklistRegExp = RegExp.compile( "iPad|" // Apple ;-) + "Nexus 7|Nexus 10|Nexus 9|" // Google Tablets + + "Ryu|" // Google Pixel C + "PlayBook|" // Blackberry + "KFAPWI|" // Kindle Fire HD + "FZ-B|" // Panasonic ToughPad From a68b85b5de4b8f2cc863ebffb41457ad0556a15f Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 08:45:28 +0200 Subject: [PATCH 04/59] Added JavaDocs to GWTLocaleUtil --- .../gwt/common/client/GWTLocaleUtil.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java index 848aa76eba2..d9265b0c6b1 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java @@ -7,12 +7,21 @@ import java.util.List; import com.google.gwt.i18n.client.LocaleInfo; import com.sap.sse.common.Util; +/** + * Utilities for working with GWT client locales. + */ public final class GWTLocaleUtil { private static final String NO_LOCALE_TEXT = "---"; private GWTLocaleUtil() { } + /** + * Returns all available client locales. As GWT works with a placeholder locale "default", this ensures that only + * real locales are returned. + * + * @return all available client locales + */ public static Iterable getAvailableLocales() { List result = new ArrayList<>(); result.addAll(Arrays.asList(LocaleInfo.getAvailableLocaleNames())); @@ -20,6 +29,12 @@ public final class GWTLocaleUtil { return result; } + /** + * Returns all available client locales plus a null entry. This is useful where you need to populate UI elements for + * all locales plus a fallback entry. + * + * @return all available client locales plus a null entry + */ public static Iterable getAvailableLocalesAndDefault() { List result = new ArrayList<>(); result.add(null); @@ -27,10 +42,20 @@ public final class GWTLocaleUtil { return result; } + /** + * @return the count of available client locales (including a default entry) + */ public static int getLanguageCountWithDefault() { return Util.size(getAvailableLocalesAndDefault()); } + /** + * Renders a locale with it's name in the language itself plus the technical locale name. + * For the fallback entry (null) a placeholder is returned instead + * + * @param localeNameOrNull the locale's name or null for the fallback entry + * @return a decorated representation of the locale to be shown on the UI + */ public static String getDecoratedLanguageDisplayNameWithDefaultLocaleSupport(String localeNameOrNull) { if (localeNameOrNull == null || localeNameOrNull.isEmpty()) { return NO_LOCALE_TEXT; From 2b6d04e5259db1f9aeb51b30064263305daf30b7 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 10:09:27 +0200 Subject: [PATCH 05/59] Added JavaDoc to AbstractEventActivity --- .../home/desktop/places/event/AbstractEventActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java index e19a7d188be..a7134b42b08 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java @@ -40,6 +40,12 @@ import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveSettings; import com.sap.sse.gwt.client.player.Timer; import com.sap.sse.gwt.client.player.Timer.PlayModes; +/** + * Base Activity for all desktop event pages. This includes the event page itself for multi-regatta events as well as + * regatta/single-regatta-event pages. + * + * @param The concrete {@link AbstractEventPlace} subclass, this instance is bound to. + */ public abstract class AbstractEventActivity extends AbstractActivity implements EventView.Presenter { From 2e21829b1b0a940e6f33033549f8d07e4238a62e Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 10:22:37 +0200 Subject: [PATCH 06/59] Added more JavaDocs to AbstractEventActivity and subclasses --- .../desktop/places/event/AbstractEventActivity.java | 6 ++++++ .../multiregatta/EventMultiregattaActivity.java | 5 +++++ .../places/event/regatta/EventRegattaActivity.java | 13 ++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java index a7134b42b08..ef7f47ba72b 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java @@ -63,6 +63,12 @@ public abstract class AbstractEventActivity ex protected final EventViewDTO eventDTO; + /** + * @param place the place of the tab to be activated + * @param eventDTO the basic event data + * @param clientFactory the {@link EventClientFactory} to use + * @param homePlacesNavigator the {@link DesktopPlacesNavigator} to use to navigate to other places in the application + */ public AbstractEventActivity(PLACE place, EventViewDTO eventDTO, EventClientFactory clientFactory, DesktopPlacesNavigator homePlacesNavigator) { this.currentPlace = place; this.eventDTO = eventDTO; diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java index 07ee5a3edeb..7e47928bfcf 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java @@ -12,6 +12,11 @@ import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay; import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem; import com.sap.sailing.gwt.ui.client.StringMessages; +/** + * Base Activity for all desktop multi-regatta-event pages. + * + * @param The concrete {@link AbstractMultiregattaEventPlace} subclass, this instance is bound to. + */ public class EventMultiregattaActivity extends AbstractEventActivity implements EventMultiregattaView.Presenter { private EventMultiregattaView currentView = new TabletAndDesktopMultiRegattaEventView(); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java index 04598a7de12..07b77da5c7e 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java @@ -8,11 +8,11 @@ import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.sap.sailing.gwt.home.communication.event.EventReferenceDTO; import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO; +import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO.EventType; import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata; +import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata.RegattaState; import com.sap.sailing.gwt.home.communication.eventview.RegattaMetadataDTO; import com.sap.sailing.gwt.home.communication.eventview.RegattaReferenceDTO; -import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO.EventType; -import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata.RegattaState; import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator; import com.sap.sailing.gwt.home.desktop.places.event.AbstractEventActivity; import com.sap.sailing.gwt.home.desktop.places.event.EventClientFactory; @@ -20,8 +20,8 @@ import com.sap.sailing.gwt.home.desktop.places.event.EventView; import com.sap.sailing.gwt.home.desktop.places.event.EventView.PlaceCallback; import com.sap.sailing.gwt.home.desktop.places.event.regatta.overviewtab.RegattaOverviewPlace; import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay; -import com.sap.sailing.gwt.home.shared.app.PlaceNavigation; import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem; +import com.sap.sailing.gwt.home.shared.app.PlaceNavigation; import com.sap.sailing.gwt.home.shared.places.event.EventContext; import com.sap.sailing.gwt.ui.client.StringMessages; import com.sap.sse.gwt.client.async.AsyncActionsExecutor; @@ -30,6 +30,13 @@ import com.sap.sse.gwt.client.player.Timer.PlayModes; import com.sap.sse.gwt.client.player.Timer.PlayStates; import com.sap.sse.gwt.client.useragent.UserAgentDetails; +/** + * Base Activity for all desktop single-regatta-event/series-event pages as well as the pages for one regatta of a + * multi-regatta-event. + * + * @param + * The concrete {@link AbstractEventRegattaPlace} subclass, this instance is bound to. + */ public class EventRegattaActivity extends AbstractEventActivity implements EventRegattaView.Presenter { private EventRegattaView currentView = new TabletAndDesktopRegattaEventView(); private final UserAgentDetails userAgent = new UserAgentDetails(Window.Navigator.getUserAgent()); From 5bdb03ad4fd0377b25e8a783f6337bb2724a06c7 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 10:50:06 +0200 Subject: [PATCH 07/59] Added JavaDoc to NavigationPathDisplay --- .../gwt/home/shared/app/NavigationPathDisplay.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java index a93ff9eeef9..fd5ca8d454e 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java @@ -1,5 +1,18 @@ package com.sap.sailing.gwt.home.shared.app; +/** + * Abstraction of a hierarchy regarding navigation. This concept is introduced to allow activities to define its + * navigation path/hierarchy using a UI element that is not part of the activity itself. This allows the central + * definition of the navigation UI without losing the ability to control the concrete navigation path for an activity in + * a fine grained way. + * + * {@link NavigationPathDisplay} uses a async mechanism to let activities set their concrete navigation path because + * some parts of the navigation path can rely on dynamic information (e.g. event/series names) that isn't available on + * construction of the activity. + * + * The abtraction also allows different implementations/visualizations. So it's possible to render breadcrumbs on + * desktop, while on mobile devices a popup menu is used. + */ public interface NavigationPathDisplay { void showNavigationPath(NavigationItem... navigationPath); From d9ac2a5c9a46250206e2f52d1917c2f910aa4a5b Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 10:52:09 +0200 Subject: [PATCH 08/59] Added JavaDoc to HasLocationTitle --- .../com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java index 4fc85964603..07cd4a3f11f 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java @@ -1,5 +1,9 @@ package com.sap.sailing.gwt.home.shared.app; +/** + * Allows places to define a custom page title. This title is shown as page title on desktop and in the header on + * mobile. + */ public interface HasLocationTitle { String getLocationTitle(); } From 4869899a61d7de8e128286b9136aed8b53aea421 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 10:58:23 +0200 Subject: [PATCH 09/59] Added JavaDocs for basic places stuff --- .../sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java | 3 +-- .../sap/sailing/gwt/home/shared/app/HasMobileVersion.java | 4 ++++ .../com/sap/sailing/gwt/home/shared/app/MobileSupport.java | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java index a9bce22ac0f..ca9b53885da 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java @@ -21,8 +21,7 @@ import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesContext; import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesDefaultPlace; /** - * Helper class to support converting old places to new ones. - * + * Helper class to support converting old places to new ones and relace inconsistent places with working ones. */ public class ApplicationPlaceUpdater { diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java index 47458ea4d43..e8b9236d97c 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java @@ -1,5 +1,9 @@ package com.sap.sailing.gwt.home.shared.app; +/** + * Marker for Places that have a mobile version. This is used to decide which page version has to be shown for a + * specific place. + */ public interface HasMobileVersion { } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java index 90eb7e158d4..595df413452 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java @@ -1,5 +1,10 @@ package com.sap.sailing.gwt.home.shared.app; +/** + * Marker for Places that have a mobile version depending on some place state. This is commonly uses in combination with + * {@link com.sap.sailing.gwt.home.shared.ExperimentalFeatures} for new mobile places that should be able to be + * deactivated during active development. + */ public interface MobileSupport { boolean hasMobileVersion(); From 036cb1626dc2d85004c02a2980e82ac85338f34b Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 11:24:18 +0200 Subject: [PATCH 10/59] Added JavaDocs to NavigationPathDisplay subclasses --- .../desktop/app/DesktopResettableNavigationPathDisplay.java | 6 ++++++ .../home/shared/app/ResettableNavigationPathDisplay.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java index f34d6fe0a9c..f2429a9e5da 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java @@ -1,7 +1,13 @@ package com.sap.sailing.gwt.home.desktop.app; +import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay; import com.sap.sailing.gwt.home.shared.app.ResettableNavigationPathDisplay; +/** + * In sailing there are two kinds of activities: Ones with header and ones without. Because the header has a gray + * background, the {@link NavigationPathDisplay} needs to be set to the exact same background. Activities without header + * have white background, so we need to switch this based on the Activity type. + */ public interface DesktopResettableNavigationPathDisplay extends ResettableNavigationPathDisplay { void setWithHeader(boolean withHeader); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java index e6f39c027aa..511fed30a2e 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java @@ -1,5 +1,8 @@ package com.sap.sailing.gwt.home.shared.app; +/** + * {@link NavigationPathDisplay} that can be reset to clear the currently shown navigation path. + */ public interface ResettableNavigationPathDisplay extends NavigationPathDisplay { void reset(); From b6422c3d04d8e43e3bf872b7d64b1f383bf5cf2b Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 11:25:17 +0200 Subject: [PATCH 11/59] Added JavaDocs to our custom ActivityManager implementations --- .../home/desktop/app/DesktopActivityManager.java | 4 ++++ .../home/shared/app/SailingActivityManager.java | 7 +++++++ .../sse/gwt/client/mvp/CustomActivityManager.java | 5 +++++ .../gwt/client/mvp/DelegatingActivityManager.java | 14 ++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java index db887a2371b..d428c72cc30 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java @@ -5,6 +5,10 @@ import com.google.gwt.activity.shared.ActivityMapper; import com.google.web.bindery.event.shared.EventBus; import com.sap.sailing.gwt.home.shared.app.SailingActivityManager; +/** + * Ensures that {@link DesktopResettableNavigationPathDisplay} will be correcly informed about the Activity type when + * the current activity changes. + */ public class DesktopActivityManager extends SailingActivityManager { public DesktopActivityManager(ActivityMapper mapper, EventBus eventBus) { diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java index fb7e03f84a7..b5d20b68c10 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java @@ -5,6 +5,13 @@ import com.google.gwt.activity.shared.ActivityMapper; import com.google.web.bindery.event.shared.EventBus; import com.sap.sse.gwt.client.mvp.CustomActivityManager; +/** + * Specific {@link CustomActivityManager} that controls a {@link ResettableNavigationPathDisplay} by resetting the + * navigation path before activation of an activity. With that, there is no wrong path in the navigation path if an + * acitivity defines a navigation path by itself. + * + * @param the concrete {@link ResettableNavigationPathDisplay} used by this ActivityManager. + */ public class SailingActivityManager extends CustomActivityManager { private NPD navigationPathDisplay; diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java index c4c04330643..777b25ab86c 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java @@ -1,9 +1,14 @@ package com.sap.sse.gwt.client.mvp; +import com.google.gwt.activity.shared.ActivityManager; import com.google.gwt.activity.shared.ActivityMapper; import com.google.gwt.place.shared.Place; import com.google.web.bindery.event.shared.EventBus; +/** + * Custom {@link ActivityManager} implementation that fires a {@link PlaceChangedEvent} on the given {@link EventBus} + * whenever the current place changed. + */ public class CustomActivityManager extends DelegatingActivityManager { private EventBus eventBus; diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java index 10816047fa2..d17e384e9f7 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java @@ -10,6 +10,10 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.SimpleEventBus; +/** + * Custom {@link ActivityManager} implementation that allows hooking into the lifecycle. + * + */ public class DelegatingActivityManager extends ActivityManager { private final ActivityManager realActivityManager; @@ -35,9 +39,19 @@ public class DelegatingActivityManager extends ActivityManager { realActivityManager.setDisplay(display); } + /** + * To be overwritten by sublcasses to hook into the lifecycle. + * + * @param activity the activity to be started + */ protected void beforeActivityStart(Activity activity) { } + /** + * To be overwritten by sublcasses to hook into the lifecycle. + * + * @param activity the place that has been started + */ protected void afterPlaceActivation(Place place) { } From 2fa6c5b3db7d555668c482559408cbc1fc9442cc Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 11:34:42 +0200 Subject: [PATCH 12/59] Added TODO --- .../src/com/sap/sse/gwt/client/JavaScriptInjector.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java index 0daa7e73839..31e512b1784 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java @@ -13,6 +13,7 @@ import com.google.gwt.dom.client.ScriptElement; * D049941 */ public class JavaScriptInjector { + // TODO: why not simply use com.google.gwt.core.client.ScriptInjector? Is there specific functionality that isn't provided by the GWT class? private static HeadElement head; /** From ef252f4d03707397af3b6faf210b81437aab40f8 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 11:57:38 +0200 Subject: [PATCH 13/59] Added JavaDocs to AbstractDispatchServlet --- .../sse/gwt/dispatch/servlets/AbstractDispatchServlet.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java index a1ca8f24acd..8a8173f6c68 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java @@ -12,6 +12,12 @@ import com.sap.sse.gwt.dispatch.shared.commands.Result; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; import com.sap.sse.gwt.dispatch.shared.exceptions.ServerDispatchException; +/** + * Abstract server-side part of the dispatch functionality. Needs to be subclassed in modules that want to use dispatch + * along with a custom DispatchContext. + * + * @param the concrete {@link DispatchContext} used by dispatch. + */ public abstract class AbstractDispatchServlet extends ProxiedRemoteServiceServlet implements DispatchRPC { private static final long serialVersionUID = -4279307111608131857L; From fd0feae6e3bb2b2afdba68526fdbb899f9ba6b37 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 12:07:54 +0200 Subject: [PATCH 14/59] Added JavaDocs to Header related classes --- .../sap/sailing/gwt/home/mobile/partials/header/Header.java | 3 +++ .../gwt/home/mobile/partials/header/HeaderNavigationItem.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java index bdc4b894e95..19e1aaa45ee 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java @@ -26,6 +26,9 @@ import com.sap.sse.gwt.client.LinkUtil; import com.sap.sse.security.ui.authentication.AuthenticationContextEvent; import com.sap.sse.security.ui.authentication.AuthenticationSignOutRequestEvent; +/** + * Mobile page header with SAP logo title and a dropdown menu (burger button) on the right. + */ public class Header extends Composite { // @UiField TextBox searchText; diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java index c435e005ca5..5eeeb84c3a6 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java @@ -11,6 +11,9 @@ import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Widget; +/** + * Represents an entry in the header's popup menu. + */ public class HeaderNavigationItem extends Widget implements HasClickHandlers { @UiField From 7c13844d598c9ba9b4521dbae30d76e6459a8f2a Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 12:09:16 +0200 Subject: [PATCH 15/59] Added JavaDocs to mobile Footer --- .../sap/sailing/gwt/home/mobile/partials/footer/Footer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java index 0f950aeedaf..a07f9cbce7d 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java @@ -30,6 +30,9 @@ import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator; import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint; import com.sap.sse.common.Util.Pair; +/** + * Mobile page footer with several links and the ability to switch the language. + */ public class Footer extends Composite { private static FooterPanelUiBinder uiBinder = GWT.create(FooterPanelUiBinder.class); From 8d4f72db2092f22809fb05d7a953cbdc94cb1d32 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 12:26:52 +0200 Subject: [PATCH 16/59] Removed unused widget that originated from the theme project but was never really styled --- .../theme/component/sapfooter/SAPFooter.gss | 55 --------------- .../theme/component/sapfooter/SAPFooter.java | 68 ------------------- .../component/sapfooter/SAPFooter.ui.xml | 47 ------------- .../sapfooter/SAPFooterResources.java | 21 ------ 4 files changed, 191 deletions(-) delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss deleted file mode 100644 index 05a39fd654a..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Website footer styling - */ -.sitefooter { - font-size: 1rem; - background: #333; - border-top: 5px solid #fff; - color: #fff; - line-height: 5em; - width: 100%; - padding: 0 1.333333333333333em; -} -.sitefooter_copyright { - font-weight: 600; - margin-right: 2em; -} -@media (min-width: 45em) { - .sitefooter_copyright { - float: left; - } -} -.sitefooter_links { - text-align: left; - font-size: 1em; - font-weight: 600; - text-transform: uppercase; -} -.sitefooter_links_link { - display: block; - color: #fff; - text-decoration: none; - margin-right: 2em; -} -.sitefooter_links_link:last-child { - margin-right: 0; -} -@media (min-width: 45em) { - .sitefooter_links_link { - display: inline-block; - } -} -.sitefooter_language { - text-align: left; -} -@media (min-width: 45em) { - .sitefooter_language { - text-align: right; - } -} -.sitefooter_language_link { - color: #f0ab00; - display: inline-block; - cursor: pointer; - margin-left: 0.666666666666667em; -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java deleted file mode 100644 index 2eb17b06120..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.sapfooter; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.http.client.UrlBuilder; -import com.google.gwt.i18n.client.LocaleInfo; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.Window.Location; -import com.google.gwt.user.client.ui.Anchor; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; - -public class SAPFooter extends Composite { - private static SAPFooterPanelUiBinder uiBinder = GWT.create(SAPFooterPanelUiBinder.class); - - interface SAPFooterPanelUiBinder extends UiBinder { - } - - @UiField Anchor changeLanguageLink; - @UiField DivElement languageSelectionDiv; - - private final Map localeAndLanguages; - - public SAPFooter() { - localeAndLanguages = new HashMap(); - localeAndLanguages.put("default", "English"); - localeAndLanguages.put("de", "Deutsch"); - - SAPFooterResources.INSTANCE.css().ensureInjected(); - - initWidget(uiBinder.createAndBindUi(this)); - - updateUI(); - } - - @UiHandler("changeLanguageLink") - public void changeLanguage(ClickEvent e) { - String selectedLanguage = changeLanguageLink.getText(); - String selectedLocale = null; - for (Entry entry: localeAndLanguages.entrySet()) { - if (entry.getValue().equals(selectedLanguage)) { - selectedLocale = entry.getKey(); - } - } - if(selectedLocale != null) { - UrlBuilder builder = Location.createUrlBuilder().setParameter("locale", selectedLocale); - Window.Location.replace(builder.buildString()); - } - } - - private void updateUI() { - LocaleInfo currentLocale = LocaleInfo.getCurrentLocale(); - HashMap languagesToSelectFrom = new HashMap(localeAndLanguages); - languagesToSelectFrom.remove(currentLocale.getLocaleName()); - - if(languagesToSelectFrom.size() == 1) { - changeLanguageLink.setText(languagesToSelectFrom.values().iterator().next()); - } - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml deleted file mode 100644 index b3aadc99bb2..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java deleted file mode 100644 index 68f9a4a0459..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.sapfooter; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.CssResource; - -public interface SAPFooterResources extends ClientBundle { - public static final SAPFooterResources INSTANCE = GWT.create(SAPFooterResources.class); - - @Source("SAPFooter.gss") - LocalCss css(); - - public interface LocalCss extends CssResource { - String sitefooter(); - String sitefooter_copyright(); - String sitefooter_links(); - String sitefooter_links_link(); - String sitefooter_language(); - String sitefooter_language_link(); - } -} From 639ac36a24370b45ec124f74aa788f581f72c03d Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 13:33:57 +0200 Subject: [PATCH 17/59] Removed unused widgets that originated from the theme project but were never really styled and finalized --- .../theme/component/imagegallery/Image.java | 32 ------ .../theme/component/imagegallery/Image.ui.xml | 12 --- .../imagegallery/ImageDescriptor.java | 102 ------------------ .../component/imagegallery/ImageGallery.gss | 2 - .../component/imagegallery/ImageGallery.java | 42 -------- .../imagegallery/ImageGallery.ui.xml | 10 -- .../imagegallery/ImageGalleryData.java | 38 ------- .../imagegallery/ImageGalleryResources.java | 16 --- .../videogallery/VideoDescriptor.java | 102 ------------------ .../component/videogallery/VideoGallery.gss | 2 - .../component/videogallery/VideoGallery.java | 36 ------- .../videogallery/VideoGallery.ui.xml | 14 --- .../videogallery/VideoGalleryData.java | 38 ------- .../videogallery/VideoGalleryResources.java | 16 --- 14 files changed, 462 deletions(-) delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java delete mode 100644 java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java deleted file mode 100644 index e56f312e13a..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.imagegallery; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.ImageElement; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; - -public class Image extends Composite { - private static ImageUiBinder uiBinder = GWT.create(ImageUiBinder.class); - - interface ImageUiBinder extends UiBinder { - } - - private final ImageDescriptor imageDescriptor; - - @UiField DivElement title; - @UiField ImageElement image; - - public Image(ImageDescriptor imageDescriptor) { - this.imageDescriptor = imageDescriptor; - - ImageGalleryResources.INSTANCE.css().ensureInjected(); - - initWidget(uiBinder.createAndBindUi(this)); - - title.setInnerText(this.imageDescriptor.getTitle()); - image.setSrc(this.imageDescriptor.getImageURL()); - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml deleted file mode 100644 index 03c905c2a93..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -
- -
-
-
-
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java deleted file mode 100644 index fdd0f4c0d83..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.imagegallery; - -import java.util.Date; - -public class ImageDescriptor { - private String title; - private String subtitle; - private Date createdAtDate; - private String author; - - private int widthInPx; - private int heightInPx; - private String imageURL; - - private String thumbnailURL; - private int thumbnailWidthInPx; - private int thumbnailHeightInPx; - - public ImageDescriptor(String imageURL) { - this.imageURL = imageURL; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Date getCreatedAtDate() { - return createdAtDate; - } - - public void setCreatedAtDate(Date createdAtDate) { - this.createdAtDate = createdAtDate; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public int getWidthInPx() { - return widthInPx; - } - - public void setWidthInPx(int widthInPx) { - this.widthInPx = widthInPx; - } - - public int getHeightInPx() { - return heightInPx; - } - - public void setHeightInPx(int heightInPx) { - this.heightInPx = heightInPx; - } - - public String getThumbnailURL() { - return thumbnailURL; - } - - public void setThumbnailURL(String thumbnailURL) { - this.thumbnailURL = thumbnailURL; - } - - public String getImageURL() { - return imageURL; - } - - public void setImageURL(String imageURL) { - this.imageURL = imageURL; - } - - public int getThumbnailWidthInPx() { - return thumbnailWidthInPx; - } - - public void setThumbnailWidthInPx(int thumbnailWidthInPx) { - this.thumbnailWidthInPx = thumbnailWidthInPx; - } - - public int getThumbnailHeightInPx() { - return thumbnailHeightInPx; - } - - public void setThumbnailHeightInPx(int thumbnailHeightInPx) { - this.thumbnailHeightInPx = thumbnailHeightInPx; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss deleted file mode 100644 index e46fdf65acd..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss +++ /dev/null @@ -1,2 +0,0 @@ -.sampleCssClass { -} \ No newline at end of file diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java deleted file mode 100644 index 5b33a7d7982..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.imagegallery; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.HTMLPanel; -import com.google.gwt.user.client.ui.Widget; - -public class ImageGallery extends Composite { - private static ImageGalleryUiBinder uiBinder = GWT.create(ImageGalleryUiBinder.class); - - interface ImageGalleryUiBinder extends UiBinder { - } - - private ImageGalleryData imageGalleryData; - - @UiField DivElement titleUi; - @UiField HTMLPanel imagesPanel; - - public ImageGallery() { - ImageGalleryResources.INSTANCE.css().ensureInjected(); - - initWidget(uiBinder.createAndBindUi(this)); - } - - public ImageGallery(ImageGalleryData data) { - this(); - setData(data); - } - - public void setData(ImageGalleryData data) { - this.imageGalleryData = data; - titleUi.setInnerText(this.imageGalleryData.getName() != null ? this.imageGalleryData.getName() : ""); - - for(ImageDescriptor imageDesc: imageGalleryData.getImages()) { - Image image = new Image(imageDesc); - imagesPanel.add(image); - } - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml deleted file mode 100644 index 41e8f10894f..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -
- - - diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java deleted file mode 100644 index 6d95f941b78..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.imagegallery; - -import java.util.ArrayList; -import java.util.List; - -public class ImageGalleryData { - private String name; - private List images; - - public ImageGalleryData() { - this("", new ArrayList()); - } - - public ImageGalleryData(String name) { - this(name, new ArrayList()); - } - - public ImageGalleryData(String name, List images) { - this.name = name; - this.images = images; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getImages() { - return images; - } - - public void setImages(List images) { - this.images = images; - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java deleted file mode 100644 index b4e3a49fc6e..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.imagegallery; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.CssResource; - -public interface ImageGalleryResources extends ClientBundle { - public static final ImageGalleryResources INSTANCE = GWT.create(ImageGalleryResources.class); - - @Source("ImageGallery.gss") - LocalCss css(); - - public interface LocalCss extends CssResource { - String sampleCssClass(); - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java deleted file mode 100644 index 7fc38369f17..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.videogallery; - -import java.util.Date; - -public class VideoDescriptor { - private String title; - private String subtitle; - private Date createdAtDate; - private String author; - - private int widthInPx; - private int heightInPx; - private String videoURL; - - private String thumbnailURL; - private int thumbnailWidthInPx; - private int thumbnailHeightInPx; - - public VideoDescriptor(String videoURL) { - this.videoURL = videoURL; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Date getCreatedAtDate() { - return createdAtDate; - } - - public void setCreatedAtDate(Date createdAtDate) { - this.createdAtDate = createdAtDate; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public int getWidthInPx() { - return widthInPx; - } - - public void setWidthInPx(int widthInPx) { - this.widthInPx = widthInPx; - } - - public int getHeightInPx() { - return heightInPx; - } - - public void setHeightInPx(int heightInPx) { - this.heightInPx = heightInPx; - } - - public String getThumbnailURL() { - return thumbnailURL; - } - - public void setThumbnailURL(String thumbnailURL) { - this.thumbnailURL = thumbnailURL; - } - - public String getVideoURL() { - return videoURL; - } - - public void setVideoURL(String videoURL) { - this.videoURL = videoURL; - } - - public int getThumbnailWidthInPx() { - return thumbnailWidthInPx; - } - - public void setThumbnailWidthInPx(int thumbnailWidthInPx) { - this.thumbnailWidthInPx = thumbnailWidthInPx; - } - - public int getThumbnailHeightInPx() { - return thumbnailHeightInPx; - } - - public void setThumbnailHeightInPx(int thumbnailHeightInPx) { - this.thumbnailHeightInPx = thumbnailHeightInPx; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss deleted file mode 100644 index e46fdf65acd..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss +++ /dev/null @@ -1,2 +0,0 @@ -.sampleCssClass { -} \ No newline at end of file diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java deleted file mode 100644 index aef4331a35e..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.videogallery; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; - -public class VideoGallery extends Composite { - private static VideoGalleryUiBinder uiBinder = GWT.create(VideoGalleryUiBinder.class); - - interface VideoGalleryUiBinder extends UiBinder { - } - - private VideoGalleryData videoGalleryData; - - @UiField DivElement galleryTitle; - - public VideoGallery() { - VideoGalleryResources.INSTANCE.css().ensureInjected(); - - initWidget(uiBinder.createAndBindUi(this)); - } - - public VideoGallery(VideoGalleryData data) { - this(); - setData(data); - } - - public void setData(VideoGalleryData data) { - this.videoGalleryData = data; - - galleryTitle.setInnerText(this.videoGalleryData.getName() != null ? this.videoGalleryData.getName() : ""); - } -} diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml deleted file mode 100644 index 2e3e7024591..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Video gallery... -
-
-
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java deleted file mode 100644 index 28e4e8106e3..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.videogallery; - -import java.util.ArrayList; -import java.util.List; - -public class VideoGalleryData { - private String name; - private List videos; - - public VideoGalleryData() { - this("", new ArrayList()); - } - - public VideoGalleryData(String name) { - this(name, new ArrayList()); - } - - public VideoGalleryData(String name, List videos) { - this.name = name; - this.videos = videos; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getVideos() { - return videos; - } - - public void setVideos(List videos) { - this.videos = videos; - } -} \ No newline at end of file diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java deleted file mode 100644 index 2bea511ecd9..00000000000 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.sap.sailing.gwt.common.theme.component.videogallery; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.CssResource; - -public interface VideoGalleryResources extends ClientBundle { - public static final VideoGalleryResources INSTANCE = GWT.create(VideoGalleryResources.class); - - @Source("VideoGallery.gss") - LocalCss css(); - - public interface LocalCss extends CssResource { - String sampleCssClass(); - } -} From 7f1030403d606facb0f61179befdf60770749fb3 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 13:47:27 +0200 Subject: [PATCH 18/59] Added JavaDocs to MediaPage related classes --- .../desktop/partials/media/MediaPage.java | 3 +++ .../media/SailingFullscreenViewer.java | 4 ++++ .../fullscreen/FullscreenContainer.java | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java index 9a29ccccc9c..155bf466166 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java @@ -22,6 +22,9 @@ import com.sap.sailing.gwt.ui.client.StringMessages; import com.sap.sailing.gwt.ui.client.media.GalleryImageHolder; import com.sap.sailing.gwt.ui.client.media.VideoThumbnail; +/** + * Desktop page to show videos and images as a gallery. + */ public class MediaPage extends Composite { private static MediaPageUiBinder uiBinder = GWT.create(MediaPageUiBinder.class); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java index 158540ea0b2..f41d6dd02fa 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java @@ -9,6 +9,10 @@ import com.sap.sailing.gwt.home.communication.media.SailingImageDTO; import com.sap.sailing.gwt.home.shared.partials.fullscreen.FullscreenContainer; import com.sap.sse.gwt.client.controls.carousel.ImageCarousel.FullscreenViewer; +/** + * Fullscreen viewer for the image gallery that shows the current image in a big view and lists all images on the bottom + * as small slider. + */ public class SailingFullscreenViewer extends FullscreenContainer implements FullscreenViewer { diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java index 8315428bfd4..b34d249b5a8 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java @@ -26,6 +26,12 @@ import com.google.gwt.user.client.ui.SimpleLayoutPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; +/** + * Base class for fullscreen viewer UIs. This viewer has an extensible header area with a close button and a content + * area that takes the rest of the available space. + * + * @param The type of the content widget. + */ public class FullscreenContainer { private static FullscreenContainerUiBinder uiBinder = GWT.create(FullscreenContainerUiBinder.class); @@ -56,9 +62,15 @@ public class FullscreenContainer { popup.addStyleName(style.popup()); } + /** + * To be overwritten by subclasses to hook into the fullscreen viewer's lifecycle. + */ protected void onShow() { } + /** + * To be overwritten by subclasses to hook into the fullscreen viewer's lifecycle. + */ protected void onClose() { } @@ -72,6 +84,9 @@ public class FullscreenContainer { headerContentUi.getElement().getStyle().setMarginLeft(5, Unit.EM); } + /** + * Should be called by subclasses if the content needs a border as optical guidance for the user. + */ protected void showBorder() { contentUi.addStyleName(style.contentBorder()); } @@ -85,6 +100,11 @@ public class FullscreenContainer { return popup.addCloseHandler(handler); } + /** + * To be called by subclasses to add more actions (in addition to the close button) to the upper right corner of the fullscreen veiwer. + * + * @param widget the action widget to add to the toolbar in the upper right corner. + */ public void addToolbarAction(Widget widget) { widget.addStyleName(style.toolbarAction()); toolbarUi.add(widget); From db3cff26bdef62e230145f78557b2f29f664667d Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 13:54:20 +0200 Subject: [PATCH 19/59] Added more documentation to MediaPage --- .../gwt/home/desktop/partials/media/MediaPage.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java index 155bf466166..634745d1de2 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java @@ -68,6 +68,8 @@ public class MediaPage extends Composite { photoSectionUi.getStyle().clearDisplay(); String photoCss = null; + // To make the image gallery look good, we use different styling if there are only few (<7) images + // available. If there are more images, always 4 images are shown in a row. switch (photosCount) { case 1: photoCss = res.mediaCss().medium12(); @@ -142,6 +144,12 @@ public class MediaPage extends Composite { } } + /** + * Shows a selected video in the big viewer. + * + * @param video the video to show in the big viewer + * @param autoplay true, if the video should play automatically, false otherwise + */ private void putVideoOnDisplay(final SailingVideoDTO video, boolean autoplay) { videoDisplayUi = new VideoWithLowerThird(true, autoplay); videoDisplayUi.setVideo(video); From db9906a85f999fe1339f4c9fde4512a283e23e28 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 14:03:44 +0200 Subject: [PATCH 20/59] Added JavaDocs to VideoPlayer related classes --- .../gwt/home/shared/partials/videoplayer/VideoPlayer.java | 3 +++ .../home/shared/partials/videoplayer/VideoWithLowerThird.java | 3 +++ .../com/sap/sailing/gwt/ui/client/media/VideoJSPlayer.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java index 9a6706e01e5..32ac8f59f2f 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java @@ -10,6 +10,9 @@ import com.sap.sailing.gwt.ui.client.media.PlayEvent; import com.sap.sailing.gwt.ui.client.media.VideoJSPlayer; import com.sap.sse.gwt.client.media.VideoDTO; +/** + * Video player with custom play button. + */ public class VideoPlayer extends Composite { private final VideoPlayerResources.LocalCss style = VideoPlayerResources.INSTANCE.css(); private VideoJSPlayer videoJSPlayer; diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java index 77275ab7b09..b26fd8e6984 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java @@ -4,6 +4,9 @@ import com.sap.sailing.gwt.home.communication.event.LabelType; import com.sap.sailing.gwt.home.shared.partials.lowerthird.LowerThird; import com.sap.sse.gwt.client.media.VideoDTO; +/** + * Video player with a lower third containing title, subtitle and an optional {@link LabelType}. + */ public class VideoWithLowerThird extends VideoPlayer { private final LowerThird lowerThird = new LowerThird(); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/VideoJSPlayer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/VideoJSPlayer.java index 701deff890d..49df2b779be 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/VideoJSPlayer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/VideoJSPlayer.java @@ -14,6 +14,9 @@ import com.sap.sse.common.media.MediaSubType; import com.sap.sse.common.media.MediaType; import com.sap.sse.common.media.MimeType; +/** + * video.js (http://videojs.com/) wrapper as GWT widget. + */ public class VideoJSPlayer extends Widget { private static VideoJSPlayerUiBinder uiBinder = GWT.create(VideoJSPlayerUiBinder.class); From 2ce5c676bf58018d3e30be8a7f7b805ba39c1646 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 14:57:59 +0200 Subject: [PATCH 21/59] Added JavaDocs to BusyView and ErrorView --- .../java/com/sap/sailing/gwt/ui/client/refresh/BusyView.java | 4 ++++ .../src/com/sap/sse/gwt/client/mvp/ErrorView.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/BusyView.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/BusyView.java index 94d18d37239..25700dd0a1a 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/BusyView.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/BusyView.java @@ -2,5 +2,9 @@ package com.sap.sailing.gwt.ui.client.refresh; import com.google.gwt.user.client.ui.IsWidget; +/** + * View that shows a loading indicator. + * + */ public interface BusyView extends IsWidget { } diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java index 9783fe65282..8b820f2942c 100644 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java @@ -2,6 +2,9 @@ package com.sap.sse.gwt.client.mvp; import com.google.gwt.user.client.ui.IsWidget; +/** + * View that shows an application error. + */ public interface ErrorView extends IsWidget { } From 1a8bbaff9e3d35a1838642497332274468662f20 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 14:58:32 +0200 Subject: [PATCH 22/59] Added JavaDocs to ClientFactory extensions --- .../gwt/home/shared/app/ClientFactoryWithDispatch.java | 4 ++++ .../gwt/ui/client/refresh/ErrorAndBusyClientFactory.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java index 60873539a5d..fdd01d8bfce 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java @@ -2,6 +2,10 @@ package com.sap.sailing.gwt.home.shared.app; import com.sap.sailing.gwt.home.communication.SailingDispatchSystem; +/** + * Definition of ClientFactories that provide access to the dispatch based remote framework through + * {@link SailingDispatchSystem}. + */ public interface ClientFactoryWithDispatch { SailingDispatchSystem getDispatch(); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/ErrorAndBusyClientFactory.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/ErrorAndBusyClientFactory.java index a5e8ef45d50..7113927888d 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/ErrorAndBusyClientFactory.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/refresh/ErrorAndBusyClientFactory.java @@ -2,6 +2,9 @@ package com.sap.sailing.gwt.ui.client.refresh; import com.sap.sse.gwt.client.mvp.ErrorView; +/** + * ClientFactory definition to create error and busy (loading indicator) views. + */ public interface ErrorAndBusyClientFactory { BusyView createBusyView(); From 1d659fd4682346e174dcd1523232b5a67d201ab0 Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Tue, 21 Jun 2016 15:18:13 +0200 Subject: [PATCH 23/59] Added additional i18n messages to StringMessages --- .../java/com/sap/sailing/gwt/ui/client/StringMessages.java | 2 ++ .../com/sap/sailing/gwt/ui/client/StringMessages.properties | 4 +++- .../sap/sailing/gwt/ui/client/StringMessages_de.properties | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java index 4b8fdb771a5..644c4d01b94 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java @@ -1606,4 +1606,6 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, String loadingRegattasAndRaces(); String selectFromRacesWithOverlappingTimeRange(); String finishTime(String timeAsString); + String showCompetitorCharts(); + String showWindChart(); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties index 7a59cfa2d8b..08cf0ef6afd 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties @@ -1578,4 +1578,6 @@ noTracksFound=No tracks found noRacesAvailable=No races available loadingRegattasAndRaces=Loading Regattas and Races selectFromRacesWithOverlappingTimeRange=Select from the races whose time range overlaps with media track those to which the track shall be linked -finishTime=Finish at: {0} \ No newline at end of file +finishTime=Finish at: {0} +showCompetitorCharts=Show competitor chart +showWindChart=Show wind chart \ No newline at end of file diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties index 49447446d0a..dc5ae9682d0 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties @@ -1563,4 +1563,6 @@ noTracksFound=Keine Tracks gefunden noRacesAvailable=Keine Rennen verfügbar loadingRegattasAndRaces=Regatten und Rennen werden geladen selectFromRacesWithOverlappingTimeRange=Das oder die Rennen aus der Liste derer zum Verknüpfen auswählen, die zeitlich mit dem Medien-Track überlappen -finishTime=Ende um: {0} \ No newline at end of file +finishTime=Ende um: {0} +showCompetitorCharts=Teilnehmer-Diagramme zeigen +showWindChart=Windiagramm zeigen \ No newline at end of file From cda6e697250f99ac14d787f869f236f3108ad06a Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Tue, 21 Jun 2016 15:18:35 +0200 Subject: [PATCH 24/59] Used new i18n messages in RaceBoardPerspectiveSettingsDialogComponent --- .../RaceBoardPerspectiveSettingsDialogComponent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java index 521320e7fd1..4baf00f6dab 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java @@ -26,15 +26,15 @@ public class RaceBoardPerspectiveSettingsDialogComponent implements SettingsDial public Widget getAdditionalWidget(DataEntryDialog dialog) { VerticalPanel vp = new VerticalPanel(); - showLeaderboardCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.leaderboard()); + showLeaderboardCheckBox = dialog.createCheckbox(stringMessages.showLeaderboard()); showLeaderboardCheckBox.setValue(initialSettings.isShowLeaderboard()); vp.add(showLeaderboardCheckBox); - showWindChartCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.windChart()); + showWindChartCheckBox = dialog.createCheckbox(stringMessages.showWindChart()); showWindChartCheckBox.setValue(initialSettings.isShowWindChart()); vp.add(showWindChartCheckBox); - showCompetitorsChartCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.competitorCharts()); + showCompetitorsChartCheckBox = dialog.createCheckbox(stringMessages.showCompetitorCharts()); showCompetitorsChartCheckBox.setValue(initialSettings.isShowCompetitorsChart()); vp.add(showCompetitorsChartCheckBox); From fc42688d0fb583b31e80cbcb6a802d8e5d0af55c Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Tue, 21 Jun 2016 15:21:29 +0200 Subject: [PATCH 25/59] Added JavaDocs to DateAndTimeFormatterUtil --- .../gwt/ui/common/client/DateAndTimeFormatterUtil.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/common/client/DateAndTimeFormatterUtil.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/common/client/DateAndTimeFormatterUtil.java index 44b43feb9e6..e3e53c54506 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/common/client/DateAndTimeFormatterUtil.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/common/client/DateAndTimeFormatterUtil.java @@ -36,6 +36,16 @@ public class DateAndTimeFormatterUtil { return defaultDateFormatter.render(startDate) + " - " + defaultDateFormatter.render(endDate); } + /** + * Formats a duration in a compact format so that hours and minutes are only shown if the duration is >1h to avoid + * unnecessary 00:yy or 00:xx:yy values. + * + * Be aware that this method doesn't work for durations >= 24h. + * + * @param timeInMilliseconds + * the duration in milliseconds to format + * @return the formatted duration + */ public static String formatElapsedTime(long timeInMilliseconds) { String result = ""; int seconds = (int) (timeInMilliseconds / 1000) % 60 ; From 5caddd9e571ecd33ac8904fade39607a8a569641 Mon Sep 17 00:00:00 2001 From: fmittag Date: Tue, 21 Jun 2016 16:18:44 +0200 Subject: [PATCH 26/59] changed the /api/v1/regattas/{regattaname}/races/{racename}/wind webservice so that a fromTime and toTime is mandatory --- .../server/gateway/jaxrs/api/RegattasResource.java | 8 ++++++-- .../webservices/api/v1/raceWindGetDoc.html | 8 ++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java index 5f5a39c07ad..f276e5f3639 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java @@ -687,8 +687,12 @@ public class RegattasResource extends AbstractSailingServerResource { Regatta regatta = findRegattaByName(regattaName); if (regatta == null) { response = Response.status(Status.NOT_FOUND) - .entity("Could not find a regatta with name '" + StringEscapeUtils.escapeHtml(regattaName) + "'.").type(MediaType.TEXT_PLAIN) - .build(); + .entity("Could not find a regatta with name '" + StringEscapeUtils.escapeHtml(regattaName) + "'.").type(MediaType.TEXT_PLAIN) + .build(); + } else if (!((fromtime != null && totime != null) || (fromtimeasmillis != null && totimeasmillis != null))) { + response = Response.status(Status.NOT_FOUND) + .entity("Either the 'fromtime' and 'totime' or the 'fromtimeasmillis' and 'totimeasmillis' parameter must be set.").type(MediaType.TEXT_PLAIN) + .build(); } else { RaceDefinition race = findRaceByName(regatta, raceName); if (race == null) { diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html index 53aecc8b065..631748067ab 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html @@ -26,8 +26,8 @@ Mandatory parameters: -
regattaname
-
racename
+
fromtime (ISO format, such as 2014-02-14T10:12:03Z) or fromtimeasmillis (time in milliseconds)
+
totime (ISO format, such as 2014-02-14T10:12:03Z) or totimeasmillis (time in milliseconds)
@@ -35,10 +35,6 @@
windsource [COMBINED = Default, WEB, EXPEDITION, TRACK_BASED_ESTIMATION, COURSE_BASED, RACECOMMITTEE]
windsourceid (Id of a wind source. For example Igtimi wind sources will have the type=EXPEDITION but each of them has unique ids. If you want to filter by these then you can use this parameter)
-
fromtime (ISO format, such as 2014-02-14T10:12:03Z)
-
fromtimeasmillis
-
totime (ISO format, such as 2014-02-14T10:12:03Z)
-
totimeasmillis
From f592c2c56589e20aee4f3ec5d628d877c773ca2a Mon Sep 17 00:00:00 2001 From: fmittag Date: Tue, 21 Jun 2016 17:53:02 +0200 Subject: [PATCH 27/59] fixed passing of RaceboardPerspectiveSettings read from URL instead of using default settings --- .../sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java index bc141596896..1810aad54ac 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java @@ -25,6 +25,7 @@ import com.sap.sse.gwt.client.EntryPointHelper; import com.sap.sse.gwt.client.async.AsyncActionsExecutor; import com.sap.sse.gwt.client.player.Timer; import com.sap.sse.gwt.client.player.Timer.PlayModes; +import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings; import com.sap.sse.gwt.client.shared.perspective.PerspectiveLifecycleWithAllSettings; public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { @@ -128,8 +129,12 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { Collections.singletonList(selectedRace.getRaceIdentifier()), 5000l /* requestInterval*/); RaceBoardPerspectiveLifecycle raceboardPerspectiveLifecycle = new RaceBoardPerspectiveLifecycle(null, StringMessages.INSTANCE); + PerspectiveCompositeSettings defaultSettings = raceboardPerspectiveLifecycle.createDefaultSettings(); + PerspectiveCompositeSettings perspectiveCompositeSettings = + new PerspectiveCompositeSettings<>(perspectiveSettings, defaultSettings.getSettingsPerComponentId()); + PerspectiveLifecycleWithAllSettings raceboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(raceboardPerspectiveLifecycle, - raceboardPerspectiveLifecycle.createDefaultSettings()); + perspectiveCompositeSettings); RaceBoardPanel raceBoardPerspective = new RaceBoardPanel( raceboardPerspectiveLifecyclesAndSettings, sailingService, mediaService, getUserService(), From a04f5ea8bf6a316c709acbbf4016abd99689e0ed Mon Sep 17 00:00:00 2001 From: fmittag Date: Tue, 21 Jun 2016 18:07:41 +0200 Subject: [PATCH 28/59] fix for NPE --- .../sailing/gwt/ui/raceboard/SideBySideComponentViewer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/SideBySideComponentViewer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/SideBySideComponentViewer.java index caa2c45f13c..8926e512839 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/SideBySideComponentViewer.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/SideBySideComponentViewer.java @@ -91,7 +91,9 @@ public class SideBySideComponentViewer implements UserStatusEventHandler { this.mediaManagementButton = createMediaManagementButton(mediaPlayerManagerComponent); this.markPassingsPanel = markPassingsPanel; this.markPositionPanel = markPositionPanel; - markPositionPanel.setComponentViewer(this); + if (markPositionPanel != null) { + markPositionPanel.setComponentViewer(this); + } userService.addUserStatusEventHandler(this); mediaPlayerManagerComponent.setPlayerChangeListener(new PlayerChangeListener() { public void notifyStateChange() { From 8809b728c6c5d79fce34306a369e886bc01d981c Mon Sep 17 00:00:00 2001 From: fmittag Date: Tue, 21 Jun 2016 18:33:51 +0200 Subject: [PATCH 29/59] reverted a refactoring which tried to avoid the creation of invisible components --- .../gwt/ui/raceboard/RaceBoardPanel.java | 17 +++++++++++------ .../ui/raceboard/SideBySideComponentViewer.java | 4 +--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java index bdf895de019..7061dc89c8a 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java @@ -309,7 +309,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite> componentsForSideBySideViewer = new ArrayList>(); - if (getPerspectiveSettings().isChartSupportEnabled()) { + if (getPerspectiveSettings().isShowChartMarkEditMediaButtonsAndVideo()) { competitorChart = new MultiCompetitorRaceChart(multiCompetitorRaceChartLifecycle, sailingService, asyncActionsExecutor, competitorSelectionProvider, selectedRaceIdentifier, timer, timeRangeWithZoomModel, stringMessages, errorReporter, true, true, leaderboardGroupName, leaderboardName); @@ -324,18 +324,23 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite Date: Tue, 21 Jun 2016 18:48:55 +0200 Subject: [PATCH 30/59] Forgot to add this file; clarifying scoring scheme implemented --- .../com/sap/sailing/gwt/ui/client/StringMessages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties index 08cf0ef6afd..794deb9a603 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties @@ -444,7 +444,7 @@ scoringSchemeHighPointFirstGetsTen=High Point, winner gets 10 points scoringSchemeHighPointFirstGetsTenOrEight=High Point, winner gets 10 points (or 8) scoringSchemeHighPointFirstGetsTenOrEightDescription=Score in points. Winner scores 10 points, 2nd - 9 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored. scoringSchemeHighPointFirstGetsTwelveOrEight=High Point, winner gets 12 points (or 8) -scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored. +scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor with the highest score, if tie remains then tie is broken by the rank in the last race scored. scoringSystem=Scoring system createFlexibleLeaderboard=Create flexible leaderboard createRegattaLeaderboard=Create regatta leaderboard From 862e685756d44ecdf2c767c6c99dbf7a985aaf24 Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Wed, 22 Jun 2016 08:48:43 +0200 Subject: [PATCH 31/59] Using HasMobileVersion instead of MobileSupport for places that are always available on mobile but could formerly be deactivated by a ExperimentalFeatures flag --- .../multiregatta/mediatab/MultiregattaMediaPlace.java | 9 ++------- .../places/event/regatta/mediatab/RegattaMediaPlace.java | 9 ++------- .../places/event/regatta/racestab/RegattaRacesPlace.java | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java index d017f174be3..12188404b8f 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java @@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.multiregatta.mediatab; import com.google.gwt.place.shared.Prefix; import com.sap.sailing.gwt.home.desktop.places.event.multiregatta.AbstractMultiregattaEventPlace; -import com.sap.sailing.gwt.home.shared.app.MobileSupport; +import com.sap.sailing.gwt.home.shared.app.HasMobileVersion; import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes; import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace; import com.sap.sailing.gwt.home.shared.places.event.EventContext; -public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace implements MobileSupport { +public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace implements HasMobileVersion { public MultiregattaMediaPlace(String id) { super(id); } @@ -23,9 +23,4 @@ public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace imple return new MultiregattaMediaPlace(context); } } - - @Override - public boolean hasMobileVersion() { - return true; - } } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java index 7c08099a4af..4c8e7d1b04a 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java @@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.regatta.mediatab; import com.google.gwt.place.shared.Prefix; import com.sap.sailing.gwt.home.desktop.places.event.regatta.AbstractEventRegattaPlace; -import com.sap.sailing.gwt.home.shared.app.MobileSupport; +import com.sap.sailing.gwt.home.shared.app.HasMobileVersion; import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes; import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace; import com.sap.sailing.gwt.home.shared.places.event.EventContext; -public class RegattaMediaPlace extends AbstractEventRegattaPlace implements MobileSupport { +public class RegattaMediaPlace extends AbstractEventRegattaPlace implements HasMobileVersion { public RegattaMediaPlace(String id, String regattaId) { super(id, regattaId); } @@ -29,9 +29,4 @@ public class RegattaMediaPlace extends AbstractEventRegattaPlace implements Mobi return new RegattaMediaPlace(context); } } - - @Override - public boolean hasMobileVersion() { - return true; - } } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java index 05c2be9c32f..574760b72cb 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java @@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.regatta.racestab; import com.google.gwt.place.shared.Prefix; import com.sap.sailing.gwt.home.desktop.places.event.regatta.AbstractEventRegattaPlace; -import com.sap.sailing.gwt.home.shared.app.MobileSupport; +import com.sap.sailing.gwt.home.shared.app.HasMobileVersion; import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes; import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace; import com.sap.sailing.gwt.home.shared.places.event.EventContext; -public class RegattaRacesPlace extends AbstractEventRegattaPlace implements MobileSupport { +public class RegattaRacesPlace extends AbstractEventRegattaPlace implements HasMobileVersion { public RegattaRacesPlace(String id, String leaderboardName) { super(id, leaderboardName); } @@ -28,9 +28,4 @@ public class RegattaRacesPlace extends AbstractEventRegattaPlace implements Mobi return new RegattaRacesPlace(context); } } - - @Override - public boolean hasMobileVersion() { - return true; - } } From e0ce458f34924d432b37a0f3adcaa0a7944034f1 Mon Sep 17 00:00:00 2001 From: fmittag Date: Wed, 22 Jun 2016 10:13:30 +0200 Subject: [PATCH 32/59] another fix --- .../java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java index 7061dc89c8a..e8f7126cfb6 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java @@ -350,10 +350,6 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite Date: Wed, 22 Jun 2016 10:29:56 +0200 Subject: [PATCH 33/59] removed old setting 'isChartSupportEnabeled' --- .../gwt/ui/raceboard/RaceBoardPanel.java | 2 +- .../RaceBoardPerspectiveSettings.java | 22 +++---------------- ...ardPerspectiveSettingsDialogComponent.java | 2 +- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java index e8f7126cfb6..106aae4783d 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java @@ -264,7 +264,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite= 600; - final boolean chartSupportEnabled = GwtHttpRequestUtils.getBooleanParameter(PARAM_VIEW_CHART_SUPPORT_ENABLED, isScreenLargeEnoughToOfferChartSupport); - final Duration initialDurationAfterRaceStartInReplay = parseDuration(GwtHttpRequestUtils.getStringParameter( PARAM_TIME_AFTER_RACE_START_AS_HOURS_COLON_MILLIS_COLON_SECONDS, null /* default */)); return new RaceBoardPerspectiveSettings(activeCompetitorsFilterSetName, showLeaderboard, showWindChart, - showCompetitorsChart, simulationEnabled, canReplayWhileLiveIsPossible, chartSupportEnabled, + showCompetitorsChart, simulationEnabled, canReplayWhileLiveIsPossible, !DeviceDetector.isMobile(), initialDurationAfterRaceStartInReplay); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java index 4baf00f6dab..5a62259aabf 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java @@ -45,7 +45,7 @@ public class RaceBoardPerspectiveSettingsDialogComponent implements SettingsDial public RaceBoardPerspectiveSettings getResult() { RaceBoardPerspectiveSettings result = new RaceBoardPerspectiveSettings(initialSettings.getActiveCompetitorsFilterSetName(), showLeaderboardCheckBox.getValue(), showWindChartCheckBox.getValue(), showCompetitorsChartCheckBox.getValue(), - initialSettings.isSimulationEnabled(), initialSettings.isCanReplayDuringLiveRaces(), initialSettings.isChartSupportEnabled(), + initialSettings.isSimulationEnabled(), initialSettings.isCanReplayDuringLiveRaces(), initialSettings.isShowChartMarkEditMediaButtonsAndVideo(), initialSettings.getInitialDurationAfterRaceStartInReplay()); return result; From 0643cfc41f946bf571f6887c7e0b34c28db8d55f Mon Sep 17 00:00:00 2001 From: fmittag Date: Wed, 22 Jun 2016 10:38:13 +0200 Subject: [PATCH 34/59] fixed initial settings of autoSelectMedia in MediaPlayerSettings --- .../sailing/gwt/ui/client/media/MediaPlayerLifecycle.java | 2 +- .../sailing/gwt/ui/client/media/MediaPlayerSettings.java | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java index 0a349505ddf..cfcf70911c5 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java @@ -20,7 +20,7 @@ public class MediaPlayerLifecycle implements ComponentLifecycle Date: Wed, 22 Jun 2016 13:43:14 +0200 Subject: [PATCH 35/59] Removed flag showChartMarkEditMediaButtonsAndVideo from RaceBoardPerspectiveSettings because its determined at runtime --- .../place/player/AutoPlayController.java | 2 +- .../gwt/ui/raceboard/RaceBoardEntryPoint.java | 20 +++++++--- .../gwt/ui/raceboard/RaceBoardPanel.java | 37 ++++++++++++------- .../RaceBoardPerspectiveSettings.java | 20 ++-------- ...ardPerspectiveSettingsDialogComponent.java | 1 - 5 files changed, 41 insertions(+), 39 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java index 3bd593ab8ad..f980a4a7917 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java @@ -127,7 +127,7 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader sailingService, mediaService, userService, asyncActionsExecutor, result.getCompetitorAndTheirBoats(), raceboardTimer, currentLiveRace, autoPlayerConfiguration.getLeaderboardName(), /** leaderboardGroupName */ null, /** eventId */ null, errorReporter, - StringMessages.INSTANCE, userAgent, raceTimesInfoProvider); + StringMessages.INSTANCE, userAgent, raceTimesInfoProvider, true); playerView.setContent(raceboardPerspective); diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java index 1810aad54ac..40a28743b54 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java @@ -12,6 +12,7 @@ import com.google.gwt.user.client.rpc.ServiceDefTarget; import com.google.gwt.user.client.ui.DockLayoutPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootLayoutPanel; +import com.sap.sailing.gwt.common.client.formfactor.DeviceDetector; import com.sap.sailing.gwt.ui.client.AbstractSailingEntryPoint; import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel; import com.sap.sailing.gwt.ui.client.MediaService; @@ -75,6 +76,11 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { // read perspective settings parameters from URL final RaceBoardPerspectiveSettings perspectiveSettings = RaceBoardPerspectiveSettings.readSettingsFromURL(); + // Determine if the charts, such as the competitor chart or the wind chart, the edit marks + // panels, such as mark passing and mark position editors and manage media buttons should be shown. + // Automatic selection of attached video (if any) also depends on this flag. + // The decision is made once during initial page load based on the device type (mobile or not). + final boolean showChartMarkEditMediaButtonsAndVideo = !DeviceDetector.isMobile(); sailingService.getRaceboardData(regattaName, raceName, leaderboardName, leaderboardGroupName, eventId, new AsyncCallback() { @Override @@ -101,7 +107,7 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { return; } - createPerspectivePage(raceboardData, perspectiveSettings); + createPerspectivePage(raceboardData, perspectiveSettings, showChartMarkEditMediaButtonsAndVideo); } @Override @@ -120,7 +126,8 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { vp.add(new Label(message)); } - private void createPerspectivePage(RaceboardDataDTO raceboardData, RaceBoardPerspectiveSettings perspectiveSettings) { + private void createPerspectivePage(RaceboardDataDTO raceboardData, RaceBoardPerspectiveSettings perspectiveSettings, + boolean showChartMarkEditMediaButtonsAndVideo) { selectedRace = raceboardData.getRace(); Window.setTitle(selectedRace.getName()); Timer timer = new Timer(PlayModes.Replay, 1000l); @@ -136,10 +143,11 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint { PerspectiveLifecycleWithAllSettings raceboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(raceboardPerspectiveLifecycle, perspectiveCompositeSettings); - RaceBoardPanel raceBoardPerspective = new RaceBoardPanel( - raceboardPerspectiveLifecyclesAndSettings, sailingService, mediaService, getUserService(), - asyncActionsExecutor, raceboardData.getCompetitorAndTheirBoats(), timer, selectedRace.getRaceIdentifier(), leaderboardName, - leaderboardGroupName, eventId, RaceBoardEntryPoint.this, getStringMessages(), userAgent, raceTimesInfoProvider); + RaceBoardPanel raceBoardPerspective = new RaceBoardPanel(raceboardPerspectiveLifecyclesAndSettings, + sailingService, mediaService, getUserService(), asyncActionsExecutor, + raceboardData.getCompetitorAndTheirBoats(), timer, selectedRace.getRaceIdentifier(), leaderboardName, + leaderboardGroupName, eventId, RaceBoardEntryPoint.this, getStringMessages(), userAgent, + raceTimesInfoProvider, showChartMarkEditMediaButtonsAndVideo); RootLayoutPanel.get().add(raceBoardPerspective.getEntryWidget()); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java index 106aae4783d..0a38092c800 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java @@ -159,13 +159,18 @@ public class RaceBoardPanel extends AbstractPerspectiveCompositetrue charts, such as the competitor chart or the wind chart, (as well as edit mark + * panels and manage media buttons) are shown and a padding is provided for the RaceTimePanel that + * aligns its right border with that of the chart. Otherwise those components will be hidden. */ public RaceBoardPanel(PerspectiveLifecycleWithAllSettings perspectiveLifecycleWithAllSettings, - SailingServiceAsync sailingService, MediaServiceAsync mediaService, - UserService userService, AsyncActionsExecutor asyncActionsExecutor, Map competitorsAndTheirBoats, + SailingServiceAsync sailingService, MediaServiceAsync mediaService, UserService userService, + AsyncActionsExecutor asyncActionsExecutor, Map competitorsAndTheirBoats, Timer timer, RegattaAndRaceIdentifier selectedRaceIdentifier, String leaderboardName, String leaderboardGroupName, UUID eventId, ErrorReporter errorReporter, final StringMessages stringMessages, - UserAgentDetails userAgent, RaceTimesInfoProvider raceTimesInfoProvider) { + UserAgentDetails userAgent, RaceTimesInfoProvider raceTimesInfoProvider, + boolean showChartMarkEditMediaButtonsAndVideo) { super(perspectiveLifecycleWithAllSettings.getPerspectiveLifecycle(), perspectiveLifecycleWithAllSettings.getPerspectiveSettings()); this.perspectiveLifecycleWithAllSettings = perspectiveLifecycleWithAllSettings; this.sailingService = sailingService; @@ -250,7 +255,8 @@ public class RaceBoardPanel extends AbstractPerspectiveCompositenull or else can be used to show some context information in * the {@link GlobalNavigationPanel}. + * @param showChartMarkEditMediaButtonsAndVideo * @param isScreenLargeEnoughToOfferChartSupport * if the screen is large enough to display charts such as the competitor chart or the wind chart, a * padding is provided for the RaceTimePanel that aligns its right border with that of the charts, and * the charts are created. */ - private void createOneScreenView(String leaderboardName, String leaderboardGroupName, UUID event, FlowPanel mainPanel, - boolean isScreenLargeEnoughToInitiallyDisplayLeaderboard, RaceMap raceMap, UserService userService) { - + private void createOneScreenView(String leaderboardName, String leaderboardGroupName, UUID event, + FlowPanel mainPanel, boolean isScreenLargeEnoughToInitiallyDisplayLeaderboard, RaceMap raceMap, + UserService userService, boolean showChartMarkEditMediaButtonsAndVideo) { + MediaPlayerLifecycle mediaPlayerLifecycle = perspectiveLifecycleWithAllSettings.getPerspectiveLifecycle().getMediaPlayerLifecycle(); MediaPlayerSettings mediaPlayerSettings = perspectiveLifecycleWithAllSettings.findComponentSettingsByLifecycle(mediaPlayerLifecycle); @@ -309,7 +318,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite> componentsForSideBySideViewer = new ArrayList>(); - if (getPerspectiveSettings().isShowChartMarkEditMediaButtonsAndVideo()) { + if (showChartMarkEditMediaButtonsAndVideo) { competitorChart = new MultiCompetitorRaceChart(multiCompetitorRaceChartLifecycle, sailingService, asyncActionsExecutor, competitorSelectionProvider, selectedRaceIdentifier, timer, timeRangeWithZoomModel, stringMessages, errorReporter, true, true, leaderboardGroupName, leaderboardName); @@ -328,14 +337,14 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite Date: Thu, 23 Jun 2016 09:10:33 +0200 Subject: [PATCH 36/59] Added JavaDoc to SailingDispatchContext class --- .../gwt/home/communication/SailingDispatchContext.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java index a7233e60d5e..f17c2ba6bb3 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java @@ -8,7 +8,10 @@ import com.sap.sailing.news.EventNewsService; import com.sap.sailing.server.RacingEventService; import com.sap.sse.gwt.dispatch.client.system.DispatchContext; - +/** + * {@link DispatchContext} implementation, which is passed to backend-side {@link SailingAction} executions to provide + * access to the required services related to the sailing domain. + */ public interface SailingDispatchContext extends DispatchContext { @GwtIncompatible RacingEventService getRacingEventService(); From 5fd42e6d0ac5fa08157088cbf4cdeac2cd071439 Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 09:15:53 +0200 Subject: [PATCH 37/59] Added JavaDoc to SailingAction class --- .../sap/sailing/gwt/home/communication/SailingAction.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java index 6916c74c908..8ab40468887 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java @@ -5,9 +5,14 @@ import com.sap.sse.gwt.dispatch.shared.commands.Action; import com.sap.sse.gwt.dispatch.shared.commands.Result; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + * Extended {@link Action} interface, which requires a {@link SailingDispatchContext} for server-side execution. + * + * @param + * {@link Result} type provided by the actions {@link #execute(SailingDispatchContext)} method + */ public interface SailingAction extends Action { @GwtIncompatible R execute(SailingDispatchContext ctx) throws DispatchException; - } \ No newline at end of file From 66ddc67d2a55dde2ca3e7b1fa3dc429e51a152ee Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 11:26:46 +0200 Subject: [PATCH 38/59] Added JavaDoc to EventActionUtil class methods --- .../gwt/home/server/EventActionUtil.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java index 4b71d62d830..6e548372e1b 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java @@ -82,6 +82,19 @@ public final class EventActionUtil { return new LeaderboardContext(context, event, leaderboardGroups, leaderboard); } + /** + * Gets or calculates the time to live for the event with the given ID, depending on its + * {@link HomeServiceUtil#calculateEventState(com.sap.sailing.domain.base.EventBase) calculated state}. + * + * @param context + * {@link SailingDispatchContext} to retrieve {@link Event} + * @param eventId + * {@link UUID} of the {@link Event} to get/calculate the time to live for + * @param liveTTL + * the {@link Duration time to live} to use if the event is currently running + * @return the given liveTTL if the event is currently running, otherwise the + * {@link #calculateTtlForNonLiveEvent(Event, EventState) calculated TTL} + */ public static Duration getEventStateDependentTTL(SailingDispatchContext context, UUID eventId, Duration liveTTL) { Event event = context.getRacingEventService().getEvent(eventId); return getEventStateDependentTTL(event, liveTTL); @@ -104,6 +117,25 @@ public final class EventActionUtil { return callback.calculateWithEvent(event); } + /** + * Calculates the time to live based on the given {@link Event}'s {@link Event#getStartDate() start time} and the + * given {@link HomeServiceUtil#calculateEventState(com.sap.sailing.domain.base.EventBase) calculated state}: + *

+ * + * + * + * + * + * + * + *
Event state Start time TTL
UPMCOMING/PLANNED36 hours and more before=> 1 hour
less than 36 hours before=> 30 minutes
less than 3 hours before=> 15 minutes
less than 15 minutes before=> time till start
FINISHED any => 12 hours
RUNNING any => [0]

+ * + * @param event + * {@link Event} to calculate the time to live for + * @param eventState + * the {@link EventState} to calculate the time to live for + * @return The calculated {@link Duration time to live} + */ public static Duration calculateTtlForNonLiveEvent(Event event, EventState eventState) { TimePoint now = MillisecondsTimePoint.now(); if(eventState == EventState.UPCOMING || eventState == EventState.PLANNED) { From a314709c7d2f699d6ca43271f9c64e4670557486 Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 11:27:41 +0200 Subject: [PATCH 39/59] Added JavaDoc to GetCompetitionFormatRacesAction class --- .../event/GetCompetitionFormatRacesAction.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java index bfc213fe9dd..9e8d7dde98d 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java @@ -13,6 +13,18 @@ import com.sap.sse.gwt.dispatch.shared.commands.ListResult; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the competition format races view for the + * {@link #GetCompetitionFormatRacesAction(UUID, String) given event- and regatta-id}, using a + * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL results} time to live + * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's + * state} using a duration of 1 minute for currently running events. + *

+ */ public class GetCompetitionFormatRacesAction implements SailingAction>>, IsClientCacheable { From 451013814f2df2f8fe110032f2aa4f112f4092ba Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 11:38:30 +0200 Subject: [PATCH 40/59] Added JavaDoc to GetEventListViewAction class --- .../home/communication/event/GetEventListViewAction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java index 81741e5ad66..d33f1507d2c 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java @@ -8,6 +8,12 @@ import com.sap.sailing.gwt.server.EventListDataCalculator; import com.sap.sailing.gwt.server.HomeServiceUtil; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the events list overview, using a + * {@link EventListDataCalculator} to prepare the appropriate data structure. + *

+ */ public class GetEventListViewAction implements SailingAction, IsClientCacheable { @Override @GwtIncompatible From 99c75f592504f4c86f54f94bc0161619d4123d6f Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 12:00:13 +0200 Subject: [PATCH 41/59] Adjusted JavaDoc of GetCompetitionFormatRacesAction class --- .../event/GetCompetitionFormatRacesAction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java index 9e8d7dde98d..e515991e659 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java @@ -34,6 +34,12 @@ public class GetCompetitionFormatRacesAction implements protected GetCompetitionFormatRacesAction() { } + /** + * Creates a {@link GetCompetitionFormatRacesAction} instance for the given event and regatta-id. + * + * @param eventId {@link UUID} of the event to load races for + * @param regattaId {@link String id} of the regatta to load races for + */ public GetCompetitionFormatRacesAction(UUID eventId, String regattaId) { this.eventId = eventId; this.regattaId = regattaId; From c2e412d593222b977625154f7ac4478b1eb50d1c Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 12:02:54 +0200 Subject: [PATCH 42/59] Added JavaDoc to GetEventOverviewNewsAction class --- .../news/GetEventOverviewNewsAction.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java index b521a5780d1..04272c223d8 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java @@ -8,6 +8,7 @@ import com.google.gwt.core.shared.GwtIncompatible; import com.sap.sailing.domain.base.Event; import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; +import com.sap.sailing.gwt.home.communication.event.EventState; import com.sap.sailing.gwt.home.server.EventActionUtil; import com.sap.sailing.gwt.home.server.EventActionUtil.CalculationWithEvent; import com.sap.sailing.news.EventNewsItem; @@ -18,6 +19,21 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ListResult; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the news ticker section for the + * {@link #GetEventOverviewNewsAction(UUID) given event-id}, where the amount of loaded news entries can optionally be + * {@link #GetEventOverviewNewsAction(UUID, int) limited}. + *

+ *

+ * The {@link ResultWithTTL results} time to live is 2 minutes for currently running events. + *

+ *

+ * NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty + * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) + * state-dependent} time to live, if the {@link Event} for the given id is not currently runnning. + *

+ */ public class GetEventOverviewNewsAction implements SailingAction>>, IsClientCacheable { private UUID eventId; /** @@ -29,10 +45,26 @@ public class GetEventOverviewNewsAction implements SailingAction Date: Thu, 23 Jun 2016 12:13:03 +0200 Subject: [PATCH 43/59] Added JavaDoc to GetEventSeriesViewAction class --- .../fakeseries/GetEventSeriesViewAction.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/fakeseries/GetEventSeriesViewAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/fakeseries/GetEventSeriesViewAction.java index e0e43dbe0c6..ff8a5ffb569 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/fakeseries/GetEventSeriesViewAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/fakeseries/GetEventSeriesViewAction.java @@ -19,6 +19,12 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; import com.sap.sse.shared.media.ImageDescriptor; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the series list overview for the + * {@link #GetEventSeriesViewAction(UUID) given series-id}, preparing the appropriate data structure. + *

+ */ public class GetEventSeriesViewAction implements SailingAction, IsClientCacheable { private UUID id; @@ -27,6 +33,12 @@ public class GetEventSeriesViewAction implements SailingAction Date: Thu, 23 Jun 2016 13:18:34 +0200 Subject: [PATCH 44/59] Adjusted JavaDoc of Action classes --- .../communication/event/GetCompetitionFormatRacesAction.java | 2 +- .../communication/event/news/GetEventOverviewNewsAction.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java index e515991e659..7479b838571 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java @@ -20,7 +20,7 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure. *

*

- * The {@link ResultWithTTL results} time to live + * The {@link ResultWithTTL result's} time to live * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's * state} using a duration of 1 minute for currently running events. *

diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java index 04272c223d8..98ab881102a 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java @@ -26,7 +26,7 @@ import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; * {@link #GetEventOverviewNewsAction(UUID, int) limited}. *

*

- * The {@link ResultWithTTL results} time to live is 2 minutes for currently running events. + * The {@link ResultWithTTL result's} time to live is 2 minutes for currently running events. *

*

* NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty From d0b906f7696fce7fdf635814ffa04d7f144ed229 Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 13:19:20 +0200 Subject: [PATCH 45/59] Added JavaDoc to GetEventStatisticsAction class --- .../statistics/GetEventStatisticsAction.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java index 345c5dfe4df..0cf3d1ccbd2 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java @@ -11,6 +11,16 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the + * {@link #GetEventStatisticsAction(UUID) given event-id}, using a {@link StatisticsCalculator} to prepare the + * appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 5 minutes. + *

+ */ public class GetEventStatisticsAction implements SailingAction>, IsClientCacheable { private UUID eventId; @@ -18,6 +28,12 @@ public class GetEventStatisticsAction implements SailingAction Date: Thu, 23 Jun 2016 13:36:44 +0200 Subject: [PATCH 46/59] Added JavaDoc to GetLiveRacesForEventAction class --- .../event/GetLiveRacesForEventAction.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java index a8a33ee4bbc..a7e88c7bb85 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java @@ -7,12 +7,28 @@ import com.sap.sailing.domain.base.Event; import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.server.EventActionUtil; -import com.sap.sailing.gwt.home.server.LiveRaceCalculator; import com.sap.sailing.gwt.home.server.EventActionUtil.CalculationWithEvent; +import com.sap.sailing.gwt.home.server.LiveRaceCalculator; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the live races section for the + * {@link #GetLiveRacesForEventAction(UUID) given event-id}, using a {@link LiveRaceCalculator} to prepare the + * appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal + * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the event. + *

+ *

+ * NOTE: Because there can only be live races in currently running events, this action returns an empty + * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) + * state-dependent} time to live, if the {@link Event} for the given id is not currently running. + *

+ */ public class GetLiveRacesForEventAction implements SailingAction>>, IsClientCacheable { private UUID eventId; @@ -21,6 +37,12 @@ public class GetLiveRacesForEventAction implements SailingAction Date: Thu, 23 Jun 2016 13:41:55 +0200 Subject: [PATCH 47/59] Adjusted JavaDoc of GetEventOverviewNewsAction class --- .../communication/event/news/GetEventOverviewNewsAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java index 98ab881102a..c1a02e2ac47 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java @@ -31,7 +31,7 @@ import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; *

* NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) - * state-dependent} time to live, if the {@link Event} for the given id is not currently runnning. + * state-dependent} time to live, if the {@link Event} for the given id is not currently running. *

*/ public class GetEventOverviewNewsAction implements SailingAction>>, IsClientCacheable { From b1947fe7abda2c7a077d8c066df015fc3450607a Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 13:44:43 +0200 Subject: [PATCH 48/59] Adjusted JavaDoc to GetLiveRacesForEventAction class --- .../home/communication/event/GetLiveRacesForEventAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java index a7e88c7bb85..bf97c14c2b9 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java @@ -41,7 +41,7 @@ public class GetLiveRacesForEventAction implements SailingAction Date: Thu, 23 Jun 2016 13:44:56 +0200 Subject: [PATCH 49/59] Added JavaDoc to GetLiveRacesForRegattaAction class --- .../event/GetLiveRacesForRegattaAction.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java index a112a3ce858..ebee5ed0bf5 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java @@ -7,12 +7,28 @@ import com.sap.sailing.domain.base.Event; import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.server.EventActionUtil; -import com.sap.sailing.gwt.home.server.LiveRaceCalculator; import com.sap.sailing.gwt.home.server.EventActionUtil.CalculationWithEvent; +import com.sap.sailing.gwt.home.server.LiveRaceCalculator; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the live races section for the + * {@link #GetLiveRacesForRegattaAction(UUID, String) given event-id and regatta name}, using a + * {@link LiveRaceCalculator} to prepare the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal + * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the regatta. + *

+ *

+ * NOTE: Because there can only be live races in currently running events, this action returns an empty + * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) + * state-dependent} time to live, if the {@link Event} for the given id is not currently running. + *

+ */ public class GetLiveRacesForRegattaAction implements SailingAction>>, IsClientCacheable { private UUID eventId; @@ -21,7 +37,13 @@ public class GetLiveRacesForRegattaAction implements SailingAction Date: Thu, 23 Jun 2016 13:47:08 +0200 Subject: [PATCH 50/59] Added JavaDoc to GetSeriesStatisticsAction class --- .../event/GetSeriesStatisticsAction.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java index 798a0030ff6..cdf42083f65 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java @@ -6,12 +6,23 @@ import com.google.gwt.core.shared.GwtIncompatible; import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.communication.event.statistics.EventStatisticsDTO; +import com.sap.sailing.gwt.home.communication.event.statistics.GetEventStatisticsAction; import com.sap.sailing.gwt.home.server.EventActionUtil; import com.sap.sailing.gwt.home.server.StatisticsCalculator; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the + * {@link #GetSeriesStatisticsAction(UUID) given series-id}, using a {@link StatisticsCalculator} to prepare the + * appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 5 minutes. + *

+ */ public class GetSeriesStatisticsAction implements SailingAction>, IsClientCacheable { private UUID seriesId; @@ -19,6 +30,12 @@ public class GetSeriesStatisticsAction implements SailingAction Date: Thu, 23 Jun 2016 14:45:56 +0200 Subject: [PATCH 51/59] Added JavaDoc to GetRegattaStatisticsAction class --- .../event/GetRegattaStatisticsAction.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java index a535f468449..91bb37fb0ff 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java @@ -12,6 +12,16 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the + * {@link #GetRegattaStatisticsAction(UUID) given event- and regatta-id}, using a {@link StatisticsCalculator} to prepare + * the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 5 minutes. + *

+ */ public class GetRegattaStatisticsAction implements SailingAction>, IsClientCacheable { private UUID eventId; @@ -20,6 +30,12 @@ public class GetRegattaStatisticsAction implements SailingAction Date: Thu, 23 Jun 2016 15:12:33 +0200 Subject: [PATCH 52/59] Added JavaDoc to GetRegattaListViewAction class --- .../event/GetRegattaListViewAction.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java index 988f09cf788..5b2ab095212 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java @@ -9,13 +9,24 @@ import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.communication.regatta.RegattaWithProgressDTO; import com.sap.sailing.gwt.home.server.EventActionUtil; -import com.sap.sailing.gwt.home.server.LeaderboardContext; import com.sap.sailing.gwt.home.server.EventActionUtil.LeaderboardCallback; +import com.sap.sailing.gwt.home.server.LeaderboardContext; import com.sap.sse.common.Duration; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult; +/** + *

+ * {@link SailingAction} implementation to load data to be shown on the event overview or regattas page for the + * {@link #GetRegattaListViewAction(UUID) given event-id}, preparing the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live + * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's + * state} using a duration of 3 minutes for currently running events. + *

+ */ public class GetRegattaListViewAction implements SailingAction>>, IsClientCacheable { private UUID eventId; @@ -24,6 +35,12 @@ public class GetRegattaListViewAction implements SailingAction Date: Thu, 23 Jun 2016 15:24:15 +0200 Subject: [PATCH 53/59] Added JavaDoc to GetMediaForEventAction class --- .../communication/media/GetMediaForEventAction.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java index 1d8f165e52b..068c4662fad 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java @@ -15,6 +15,12 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; import com.sap.sse.shared.media.ImageDescriptor; import com.sap.sse.shared.media.VideoDescriptor; +/** + *

+ * {@link SailingAction} implementation to load images and videos to be shown on the media page for the + * {@link #GetMediaForEventAction(UUID) given event-id}, preparing the appropriate data structure. + *

+ */ public class GetMediaForEventAction implements SailingAction, IsClientCacheable { private UUID eventId; @@ -23,6 +29,12 @@ public class GetMediaForEventAction implements SailingAction, IsClient private GetMediaForEventAction() { } + /** + * Creates a {@link GetMediaForEventAction} instance for the given event-id. + * + * @param eventId + * {@link UUID} of the event to load media for + */ public GetMediaForEventAction(UUID eventId) { this.eventId = eventId; } From fae45d7b8d8cd97011802d49914595d8a3db3568 Mon Sep 17 00:00:00 2001 From: Benjamin Barth Date: Thu, 23 Jun 2016 15:26:46 +0200 Subject: [PATCH 54/59] Added JavaDoc to GetFinishedRacesAction class --- .../event/GetFinishedRacesAction.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java index ee5a8df3853..c172a7d24a1 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java @@ -12,6 +12,18 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in the finished races section for the + * {@link #GetFinishedRacesAction(UUID, String) given event- and regatta-id}, using a {@link RaceListDataCalculator} to + * prepare the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live + * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's + * state} using a duration of 5 minutes for currently running events. + *

+ */ public class GetFinishedRacesAction implements SailingAction>>, IsClientCacheable { @@ -22,6 +34,12 @@ public class GetFinishedRacesAction implements SailingAction Date: Thu, 23 Jun 2016 15:42:00 +0200 Subject: [PATCH 55/59] Added JavaDoc to GetMiniLeaderbordAction class --- .../GetMiniLeaderbordAction.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java index 5d52c29be34..63e3009e902 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java @@ -3,12 +3,24 @@ package com.sap.sailing.gwt.home.communication.event.minileaderboard; import java.util.UUID; import com.google.gwt.core.shared.GwtIncompatible; +import com.sap.sailing.domain.base.Event; import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.server.EventActionUtil; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the event overview + * page) for the {@link #GetMiniLeaderbordAction(UUID, String) given event-id and leaderboard name}, where the amount of + * loaded entries can optionally be {@link #GetMiniLeaderbordAction(UUID, String, int) limited}. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes + * otherwise. + *

+ */ public class GetMiniLeaderbordAction implements SailingAction>, IsClientCacheable { private UUID eventId; private String leaderboardName; @@ -18,10 +30,30 @@ public class GetMiniLeaderbordAction implements SailingAction Date: Thu, 23 Jun 2016 15:42:09 +0200 Subject: [PATCH 56/59] Added JavaDoc to GetMiniOverallLeaderbordAction class --- .../GetMiniOverallLeaderbordAction.java | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java index d45f934f47d..2cc74bd6d58 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java @@ -9,6 +9,17 @@ import com.sap.sailing.gwt.home.server.EventActionUtil; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; +/** + *

+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the series overview + * page) for the {@link #GetMiniOverallLeaderbordAction(UUID) given series-id}, where the amount of loaded entries can + * optionally be {@link #GetMiniOverallLeaderbordAction(UUID, int) limited}. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes + * otherwise. + *

+ */ public class GetMiniOverallLeaderbordAction implements SailingAction>, IsClientCacheable { private UUID seriesId; private int limit = 0; @@ -17,10 +28,26 @@ public class GetMiniOverallLeaderbordAction implements SailingAction Date: Thu, 23 Jun 2016 15:45:46 +0200 Subject: [PATCH 57/59] Added JavaDoc to GetRegattaWithProgressAction class --- .../event/GetRegattaWithProgressAction.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java index 6b461b9ee75..f8ac271c946 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java @@ -7,10 +7,23 @@ import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.communication.regatta.RegattaWithProgressDTO; import com.sap.sailing.gwt.home.server.EventActionUtil; +import com.sap.sailing.gwt.home.server.RaceCompetitionFormatDataCalculator; import com.sap.sse.common.Duration; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; +/** + *

+ * {@link SailingAction} implementation to load data to be shown on the regatta overview page for the + * {@link #GetRegattaWithProgressAction(UUID, String) given event- and regatta-id}, using a + * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live + * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's + * state} using a duration of 5 minutes for currently running events. + *

+ */ public class GetRegattaWithProgressAction implements SailingAction>, IsClientCacheable { private UUID eventId; @@ -20,6 +33,12 @@ public class GetRegattaWithProgressAction implements SailingAction Date: Thu, 23 Jun 2016 15:50:32 +0200 Subject: [PATCH 58/59] Added JavaDoc to GetRecentEventsAction class --- .../communication/start/GetRecentEventsAction.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java index 1084608c5ad..64cd78cb6d0 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java @@ -15,6 +15,12 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ListResult; import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException; +/** + *

+ * {@link SailingAction} implementation to load recent events to be shown in the event list overview, where + * the amount of loaded entries can be {@link #GetRecentEventsAction(int) limited}. + *

+ */ public class GetRecentEventsAction implements SailingAction>, IsClientCacheable { private int limit; @@ -22,6 +28,12 @@ public class GetRecentEventsAction implements SailingAction Date: Thu, 23 Jun 2016 15:58:35 +0200 Subject: [PATCH 59/59] Added JavaDoc to GetRegattasAndLiveRacesForEventAction class --- ...GetRegattasAndLiveRacesForEventAction.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java index bfdd248db4a..3a1c3acfff4 100644 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java @@ -13,15 +13,25 @@ import com.sap.sailing.gwt.home.communication.SailingAction; import com.sap.sailing.gwt.home.communication.SailingDispatchContext; import com.sap.sailing.gwt.home.communication.eventview.RegattaMetadataDTO; import com.sap.sailing.gwt.home.server.EventActionUtil; -import com.sap.sailing.gwt.home.server.LeaderboardContext; -import com.sap.sailing.gwt.home.server.RaceContext; import com.sap.sailing.gwt.home.server.EventActionUtil.LeaderboardCallback; import com.sap.sailing.gwt.home.server.EventActionUtil.RaceCallback; +import com.sap.sailing.gwt.home.server.LeaderboardContext; +import com.sap.sailing.gwt.home.server.RaceContext; import com.sap.sailing.gwt.server.HomeServiceUtil; import com.sap.sse.common.Duration; import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable; import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL; +/** + *

+ * {@link SailingAction} implementation to load data to be shown on the mobile event overview page for the + * {@link #GetRegattasAndLiveRacesForEventAction(UUID) given event-id}, preparing the appropriate data structure. + *

+ *

+ * The {@link ResultWithTTL result's} time to live is 2 minutes for upcoming and currently running events, + * otherwise it {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) depends on the event's state}. + *

+ */ public class GetRegattasAndLiveRacesForEventAction implements SailingAction>, IsClientCacheable { private UUID eventId; @@ -30,6 +40,12 @@ public class GetRegattasAndLiveRacesForEventAction implements SailingAction