mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 01:01:02 +00:00
removed old TvView entrypoint (replaced by new AutoPlay entrypoint)
This commit is contained in:
1 parent
762d765790
commit
c321fa1837
9 files changed
+3
-492
No files matched your search
@@ -51,9 +51,9 @@
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm7"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.ui.Search -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/TvView.html com.sap.sailing.gwt.ui.TvView -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.VideoPopup"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.ui.Search -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.VideoPopup"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -XX:MaxPermSize=512m -Xdebug -Xrunjdwp:transport=dt_socket,address=7999,server=y"/>
|
||||
</launchConfiguration>
|
||||
@@ -3,24 +3,6 @@
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.gwt.ui.RaceBoard"/>
|
||||
<listEntry value="com.sap.sailing.gwt.Home"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.DataMining"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.LeaderboardEditing"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Search"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.UserManagement"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.TvView"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Spectator"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.RegattaOverview"/>
|
||||
<listEntry value="com.sap.sailing.gwt.AutoPlay"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.PolarSheets"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Leaderboard"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.gwt.ui"/>
|
||||
@@ -69,7 +51,7 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/TvView.html com.sap.sailing.gwt.ui.TvView -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup -startupUrl /gwt/Search.html com.sap.sailing.gwt.ui.Search -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.TvView com.sap.sailing.gwt.ui.UserManagement com.sap.sailing.gwt.ui.Search com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.Home com.sap.sailing.gwt.ui.RaceBoard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup -startupUrl /gwt/Search.html com.sap.sailing.gwt.ui.Search -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.UserManagement com.sap.sailing.gwt.ui.Search com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.Home com.sap.sailing.gwt.ui.RaceBoard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m"/>
|
||||
</launchConfiguration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>SAP Sailing Analytics TV View</title>
|
||||
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
|
||||
<meta content='yes' name='apple-mobile-web-app-capable'>
|
||||
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
|
||||
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
|
||||
<link href='images/sap-sailing-app-icon.png' rel='apple-touch-icon'>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="images/sap.ico" />
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="highcharts/js/highcharts.js"></script>
|
||||
|
||||
<!-- Optionally, add a highcharts theme file -->
|
||||
<script type="text/javascript" src="highcharts/js/themes/grid.js"></script>
|
||||
|
||||
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.ui.TvView/com.sap.sailing.gwt.ui.TvView.nocache.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
|
||||
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
|
||||
<noscript>
|
||||
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
|
||||
Your web browser must have JavaScript enabled
|
||||
in order for this application to display correctly.
|
||||
</div>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
@@ -41,7 +41,6 @@ bin.includes = META-INF/,\
|
||||
VideoPopup.css,\
|
||||
com.sap.sailing.gwt.ui.YoutubePopup/,\
|
||||
YoutubePopup.html,\
|
||||
TvView.html,\
|
||||
com.sap.sailing.gwt.ui.TvView/,\
|
||||
BrowserUnsupported.html,\
|
||||
PolarSheets.css,\
|
||||
|
||||
@@ -127,7 +127,6 @@
|
||||
<module>com.sap.sailing.gwt.ui.RaceBoard</module>
|
||||
<module>com.sap.sailing.gwt.ui.Spectator</module>
|
||||
<module>com.sap.sailing.gwt.ui.DataMining</module>
|
||||
<module>com.sap.sailing.gwt.ui.TvView</module>
|
||||
<module>com.sap.sailing.gwt.ui.VideoPopup</module>
|
||||
<module>com.sap.sailing.gwt.ui.YoutubePopup</module>
|
||||
<module>com.sap.sailing.gwt.ui.Simulator</module>
|
||||
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.tv;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
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.google.gwt.user.client.ui.RootPanel;
|
||||
import com.sap.sailing.gwt.ui.client.AbstractSailingEntryPoint;
|
||||
import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel;
|
||||
import com.sap.sailing.gwt.ui.client.MediaService;
|
||||
import com.sap.sailing.gwt.ui.client.MediaServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.RemoteServiceMappingConstants;
|
||||
import com.sap.sailing.gwt.ui.client.SailingService;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardViewConfiguration;
|
||||
import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
public class TVEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
private static final String PARAM_LEADERBOARD_NAME = "name";
|
||||
private static final String PARAM_LEADERBOARD_GROUP_NAME = "leaderboardGroupName";
|
||||
private static final String PARAM_EMBEDDED = "embedded";
|
||||
private static final String PARAM_SHOW_RACE_DETAILS = "showRaceDetails";
|
||||
private static final String PARAM_DELAY_TO_LIVE_MILLIS = "delayToLiveMillis";
|
||||
private String leaderboardName;
|
||||
private String leaderboardGroupName;
|
||||
private TVViewController tvViewController;
|
||||
private RaceBoardViewConfiguration raceboardViewConfig;
|
||||
|
||||
private final SailingServiceAsync sailingService = GWT.create(SailingService.class);
|
||||
private final MediaServiceAsync mediaService = GWT.create(MediaService.class);
|
||||
|
||||
@Override
|
||||
public void doOnModuleLoad() {
|
||||
super.doOnModuleLoad();
|
||||
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) sailingService, RemoteServiceMappingConstants.sailingServiceRemotePath);
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) mediaService, RemoteServiceMappingConstants.mediaServiceRemotePath);
|
||||
|
||||
final boolean showRaceDetails = GwtHttpRequestUtils.getBooleanParameter(PARAM_SHOW_RACE_DETAILS, true);
|
||||
final boolean embedded = GwtHttpRequestUtils.getBooleanParameter(PARAM_EMBEDDED, false);
|
||||
final long delayToLiveMillis = Window.Location.getParameter(PARAM_DELAY_TO_LIVE_MILLIS) != null ? Long
|
||||
.valueOf(Window.Location.getParameter(PARAM_DELAY_TO_LIVE_MILLIS)) : 5000l; // default 5s
|
||||
final boolean showLeaderboard = GwtHttpRequestUtils.getBooleanParameter(
|
||||
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_LEADERBOARD, true /* default */);
|
||||
final boolean showWindChart = GwtHttpRequestUtils.getBooleanParameter(
|
||||
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_WINDCHART, false /* default */);
|
||||
final boolean showViewStreamlets = GwtHttpRequestUtils.getBooleanParameter(
|
||||
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_STREAMLETS, false /* default */);
|
||||
final boolean showViewSimulation = GwtHttpRequestUtils.getBooleanParameter(
|
||||
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_SIMULATION, false /* default */);
|
||||
final boolean showCompetitorsChart = GwtHttpRequestUtils.getBooleanParameter(
|
||||
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_COMPETITORSCHART, false /* default */);
|
||||
String activeCompetitorsFilterSetName = GwtHttpRequestUtils.getStringParameter(RaceBoardViewConfiguration.PARAM_VIEW_COMPETITOR_FILTER, null /* default*/);
|
||||
final String defaultMedia = GwtHttpRequestUtils.getStringParameter(RaceBoardViewConfiguration.PARAM_DEFAULT_MEDIA, null /* default */);
|
||||
final boolean autoSelectMedia = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_AUTOSELECT_MEDIA, false);
|
||||
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName, showLeaderboard,
|
||||
showWindChart, showCompetitorsChart, showViewStreamlets, showViewSimulation, /* canReplayWhileLiveIsPossible */false, autoSelectMedia, defaultMedia);
|
||||
|
||||
sailingService.getLeaderboardNames(new AsyncCallback<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(List<String> leaderboardNames) {
|
||||
leaderboardName = Window.Location.getParameter(PARAM_LEADERBOARD_NAME);
|
||||
leaderboardGroupName = Window.Location.getParameter(PARAM_LEADERBOARD_GROUP_NAME);
|
||||
if (leaderboardNames.contains(leaderboardName)) {
|
||||
createUI(showRaceDetails, embedded, delayToLiveMillis);
|
||||
} else {
|
||||
RootPanel.get().add(new Label(getStringMessages().noSuchLeaderboard()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
reportError("Error trying to obtain list of leaderboard names: " + t.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createUI(boolean showRaceDetails, boolean embedded, long delayToLiveMillis) {
|
||||
DockLayoutPanel mainPanel = new DockLayoutPanel(Unit.PX);
|
||||
RootLayoutPanel.get().add(mainPanel);
|
||||
LogoAndTitlePanel logoAndTitlePanel = null;
|
||||
if (!embedded) {
|
||||
String leaderboardDisplayName = Window.Location.getParameter("displayName");
|
||||
if(leaderboardDisplayName == null || leaderboardDisplayName.isEmpty()) {
|
||||
leaderboardDisplayName = leaderboardName;
|
||||
}
|
||||
logoAndTitlePanel = new LogoAndTitlePanel(leaderboardGroupName, leaderboardDisplayName, getStringMessages(), this, getUserService());
|
||||
logoAndTitlePanel.addStyleName("LogoAndTitlePanel");
|
||||
mainPanel.addNorth(logoAndTitlePanel, 68);
|
||||
}
|
||||
|
||||
tvViewController = new TVViewController(sailingService, mediaService, getUserService(), getStringMessages(),
|
||||
this, leaderboardGroupName, leaderboardName, userAgent, logoAndTitlePanel, mainPanel,
|
||||
delayToLiveMillis, showRaceDetails, raceboardViewConfig);
|
||||
tvViewController.updateTvView(TVViews.Leaderboard);
|
||||
}
|
||||
}
|
||||
-276
@@ -1,276 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.tv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.user.client.ui.DockLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel;
|
||||
import com.sap.sailing.gwt.ui.client.MediaServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.RaceSelectionModel;
|
||||
import com.sap.sailing.gwt.ui.client.RaceTimesInfoProvider;
|
||||
import com.sap.sailing.gwt.ui.client.RaceTimesInfoProviderListener;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettingsFactory;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPanel;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardViewConfiguration;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceTimesInfoDTO;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
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.useragent.UserAgentDetails;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
public class TVViewController implements RaceTimesInfoProviderListener {
|
||||
private static final int REFRESH_INTERVAL_IN_MILLIS_LEADERBOARD = 10000;
|
||||
private static final long REFRESH_INTERVAL_IN_MILLIS_RACEBOARD = 1000;
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final MediaServiceAsync mediaService;
|
||||
private final StringMessages stringMessages;
|
||||
private final ErrorReporter errorReporter;
|
||||
private final UserAgentDetails userAgent;
|
||||
private final LogoAndTitlePanel logoAndTitlePanel;
|
||||
private final DockLayoutPanel dockPanel;
|
||||
private final AsyncActionsExecutor asyncActionsExecutor;
|
||||
|
||||
/**
|
||||
* We use two timers: one for the leaderboard, one for the race board. This way, we can stop one while the other continues.
|
||||
* This way, the other component stops its auto-updates.
|
||||
*/
|
||||
private final Timer leaderboardTimer;
|
||||
private final Timer raceboardTimer;
|
||||
private final RaceTimesInfoProvider raceTimesInfoProvider;
|
||||
private TVViews activeTvView;
|
||||
|
||||
// leaderboard related attributes
|
||||
private LeaderboardDTO leaderboard;
|
||||
private final String leaderboardName;
|
||||
private final String leaderboardGroupName;
|
||||
private LeaderboardSettings leaderboardSettings;
|
||||
|
||||
// raceboard related attributes
|
||||
private RegattaAndRaceIdentifier currentLiveRace;
|
||||
private boolean showRaceDetails;
|
||||
private boolean showWindChart;
|
||||
private final RaceBoardViewConfiguration raceboardViewConfig;
|
||||
private final UserService userService;
|
||||
|
||||
/**
|
||||
* @param userService TODO
|
||||
* @param logoAndTitlePanel
|
||||
* allowed to be <code>null</code>
|
||||
* @param showNavigationPanel
|
||||
* tells whether to show the navigation panel for the race board which allows users to turn on and off
|
||||
* the various components and lets them configure them; makes sense to use only if intended for "manned" mode.
|
||||
*/
|
||||
public TVViewController(SailingServiceAsync sailingService, MediaServiceAsync mediaService,
|
||||
UserService userService, StringMessages stringMessages, ErrorReporter errorReporter,
|
||||
String leaderboardGroupName, String leaderboardName, UserAgentDetails userAgent,
|
||||
LogoAndTitlePanel logoAndTitlePanel, DockLayoutPanel dockPanel, long delayToLiveInMillis,
|
||||
boolean showRaceDetails, RaceBoardViewConfiguration raceboardViewConfig) {
|
||||
this.userService = userService;
|
||||
this.raceboardViewConfig = raceboardViewConfig;
|
||||
this.sailingService = sailingService;
|
||||
this.mediaService = mediaService;
|
||||
this.stringMessages = stringMessages;
|
||||
this.errorReporter = errorReporter;
|
||||
this.leaderboardName = leaderboardName;
|
||||
this.leaderboardGroupName = leaderboardGroupName;
|
||||
this.userAgent = userAgent;
|
||||
this.logoAndTitlePanel = logoAndTitlePanel;
|
||||
this.dockPanel = dockPanel;
|
||||
this.showRaceDetails = showRaceDetails;
|
||||
|
||||
asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
showWindChart = false;
|
||||
leaderboard = null;
|
||||
leaderboardSettings = LeaderboardSettingsFactory.getInstance().createNewDefaultSettings(null, null, null, /* autoExpandFirstRace */ false, /* showRegattaRank */ true);
|
||||
|
||||
leaderboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
|
||||
leaderboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
|
||||
leaderboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_LEADERBOARD);
|
||||
leaderboardTimer.play();
|
||||
raceboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
|
||||
raceboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
|
||||
raceboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_RACEBOARD);
|
||||
raceboardTimer.play();
|
||||
|
||||
raceTimesInfoProvider = new RaceTimesInfoProvider(sailingService, asyncActionsExecutor, errorReporter, new ArrayList<RegattaAndRaceIdentifier>(), 3000l);
|
||||
raceTimesInfoProvider.addRaceTimesInfoProviderListener(this);
|
||||
}
|
||||
|
||||
private LeaderboardPanel createLeaderboardPanel(String leaderboardGroupName, String leaderboardName, boolean showRaceDetails) {
|
||||
CompetitorSelectionModel selectionModel = new CompetitorSelectionModel(/* hasMultiSelection */ true);
|
||||
LeaderboardPanel leaderboardPanel = new LeaderboardPanel(sailingService, asyncActionsExecutor,
|
||||
leaderboardSettings, false,
|
||||
/* preSelectedRace */null, selectionModel, leaderboardTimer, leaderboardGroupName, leaderboardName,
|
||||
errorReporter, stringMessages, userAgent, showRaceDetails, /* competitorSearchTextBox */ null, /* showRegattaRank */
|
||||
/* showSelectionCheckbox */false, /* raceTimesInfoProvider */null, false, /* autoExpandLastRaceColumn */
|
||||
/* adjustTimerDelay */true, /*autoApplyTopNFilter*/ false, false) {
|
||||
@Override
|
||||
protected void setLeaderboard(LeaderboardDTO leaderboard) {
|
||||
super.setLeaderboard(leaderboard);
|
||||
TVViewController.this.leaderboard = leaderboard;
|
||||
updateRaceTimesInfoProvider();
|
||||
}
|
||||
};
|
||||
leaderboardPanel.getElement().getStyle().setMargin(5, Unit.PX);
|
||||
return leaderboardPanel;
|
||||
}
|
||||
|
||||
private void updateRaceTimesInfoProvider() {
|
||||
boolean addedRaces = false;
|
||||
for (RaceColumnDTO race : leaderboard.getRaceList()) {
|
||||
for (FleetDTO fleet : race.getFleets()) {
|
||||
RegattaAndRaceIdentifier raceIdentifier = race.getRaceIdentifier(fleet);
|
||||
if (raceIdentifier != null && !raceTimesInfoProvider.containsRaceIdentifier(raceIdentifier)) {
|
||||
raceTimesInfoProvider.addRaceIdentifier(raceIdentifier, false);
|
||||
addedRaces = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addedRaces) {
|
||||
raceTimesInfoProvider.forceTimesInfosUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private RaceBoardPanel createRaceBoardPanel(String leaderboardName, RegattaAndRaceIdentifier raceToShow) {
|
||||
RaceSelectionModel raceSelectionModel = new RaceSelectionModel();
|
||||
List<RegattaAndRaceIdentifier> singletonList = Collections.singletonList(raceToShow);
|
||||
raceSelectionModel.setSelection(singletonList);
|
||||
RaceBoardPanel raceBoardPanel = new RaceBoardPanel(sailingService, mediaService, userService,
|
||||
asyncActionsExecutor, raceboardTimer, raceSelectionModel, leaderboardName, null, /* event */null,
|
||||
raceboardViewConfig, errorReporter, stringMessages, userAgent, raceTimesInfoProvider, /* showMapControls */false);
|
||||
return raceBoardPanel;
|
||||
}
|
||||
|
||||
private void clearContentPanels() {
|
||||
int childWidgetCount = dockPanel.getWidgetCount();
|
||||
for(int i = childWidgetCount-1; i >=0; i--) {
|
||||
Widget widget = dockPanel.getWidget(i);
|
||||
// don't remove the logoAndTitlePanel if exist
|
||||
if(logoAndTitlePanel == null || widget != logoAndTitlePanel) {
|
||||
dockPanel.remove(widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showLeaderboard() {
|
||||
if (activeTvView != TVViews.Leaderboard) {
|
||||
clearContentPanels();
|
||||
LeaderboardPanel leaderboardPanel = createLeaderboardPanel(leaderboardGroupName, leaderboardName, showRaceDetails);
|
||||
ScrollPanel leaderboardContentPanel = new ScrollPanel();
|
||||
leaderboardContentPanel.add(leaderboardPanel);
|
||||
dockPanel.add(leaderboardContentPanel);
|
||||
if (logoAndTitlePanel != null) {
|
||||
logoAndTitlePanel.setSubTitle(leaderboardName);
|
||||
}
|
||||
currentLiveRace = null;
|
||||
activeTvView = TVViews.Leaderboard;
|
||||
raceboardTimer.pause();
|
||||
leaderboardTimer.setPlayMode(PlayModes.Live);
|
||||
}
|
||||
}
|
||||
|
||||
private void showRaceBoard() {
|
||||
if (activeTvView != TVViews.Raceboard) {
|
||||
clearContentPanels();
|
||||
RaceBoardPanel raceBoardPanel = createRaceBoardPanel(leaderboardName, currentLiveRace);
|
||||
raceBoardPanel.setSize("100%", "100%");
|
||||
if (showWindChart) {
|
||||
raceBoardPanel.setWindChartVisible(true);
|
||||
}
|
||||
FlowPanel timePanel = createTimePanel(raceBoardPanel);
|
||||
dockPanel.addSouth(timePanel, 90);
|
||||
dockPanel.add(raceBoardPanel);
|
||||
if (logoAndTitlePanel != null) {
|
||||
logoAndTitlePanel.setSubTitle(currentLiveRace.getRaceName());
|
||||
}
|
||||
activeTvView = TVViews.Raceboard;
|
||||
leaderboardTimer.pause();
|
||||
raceboardTimer.setPlayMode(PlayModes.Live);
|
||||
}
|
||||
}
|
||||
|
||||
private FlowPanel createTimePanel(RaceBoardPanel raceBoardPanel) {
|
||||
FlowPanel timeLineInnerBgPanel = new FlowPanel();
|
||||
timeLineInnerBgPanel.addStyleName("timeLineInnerBgPanel");
|
||||
timeLineInnerBgPanel.add(raceBoardPanel.getTimePanel());
|
||||
|
||||
FlowPanel timeLineInnerPanel = new FlowPanel();
|
||||
timeLineInnerPanel.add(timeLineInnerBgPanel);
|
||||
timeLineInnerPanel.addStyleName("timeLineInnerPanel");
|
||||
|
||||
FlowPanel timelinePanel = new FlowPanel();
|
||||
timelinePanel.add(timeLineInnerPanel);
|
||||
timelinePanel.addStyleName("timeLinePanel");
|
||||
|
||||
return timelinePanel;
|
||||
}
|
||||
|
||||
public void updateTvView(TVViews tvView) {
|
||||
switch (tvView) {
|
||||
case Leaderboard:
|
||||
showLeaderboard();
|
||||
break;
|
||||
case Raceboard:
|
||||
showRaceBoard();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void raceTimesInfosReceived(Map<RegattaAndRaceIdentifier, RaceTimesInfoDTO> raceTimesInfo, long clientTimeWhenRequestWasSent, Date serverTimeDuringRequest, long clientTimeWhenResponseWasReceived) {
|
||||
raceboardTimer.adjustClientServerOffset(clientTimeWhenRequestWasSent, serverTimeDuringRequest, clientTimeWhenResponseWasReceived);
|
||||
leaderboardTimer.adjustClientServerOffset(clientTimeWhenRequestWasSent, serverTimeDuringRequest, clientTimeWhenResponseWasReceived);
|
||||
if (currentLiveRace != null) {
|
||||
RaceTimesInfoDTO currentRaceTimes = raceTimesInfo.get(currentLiveRace);
|
||||
|
||||
Date endOfRace = currentRaceTimes.endOfRace;
|
||||
long waitTimeAfterEndOfRace = 60 * 1000; // 1 min
|
||||
if (endOfRace != null && raceboardTimer.getTime().getTime() > endOfRace.getTime() + waitTimeAfterEndOfRace
|
||||
&& raceboardTimer.getPlayMode() == PlayModes.Live) {
|
||||
updateTvView(TVViews.Leaderboard);
|
||||
}
|
||||
} else {
|
||||
currentLiveRace = checkForLiveRace();
|
||||
if (currentLiveRace != null) {
|
||||
updateTvView(TVViews.Raceboard);
|
||||
} else {
|
||||
updateTvView(TVViews.Leaderboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RegattaAndRaceIdentifier checkForLiveRace() {
|
||||
RegattaAndRaceIdentifier result = null;
|
||||
Map<RegattaAndRaceIdentifier, RaceTimesInfoDTO> raceTimesInfos = raceTimesInfoProvider.getRaceTimesInfos();
|
||||
for (RaceColumnDTO race : leaderboard.getRaceList()) {
|
||||
for (FleetDTO fleet : race.getFleets()) {
|
||||
RegattaAndRaceIdentifier raceIdentifier = race.getRaceIdentifier(fleet);
|
||||
if (raceIdentifier != null) {
|
||||
RaceTimesInfoDTO raceTimes = raceTimesInfos.get(raceIdentifier);
|
||||
if (raceTimes != null && raceTimes.startOfTracking != null && raceTimes.endOfRace == null) {
|
||||
return raceIdentifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.tv;
|
||||
|
||||
public enum TVViews {
|
||||
Leaderboard, Raceboard;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Could not determine the version of your GWT SDK; using the module DTD from GWT 1.6.4. You may want to change this. -->
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
|
||||
<module>
|
||||
|
||||
<stylesheet src="../reset.css" />
|
||||
|
||||
<!-- Inherit the core Web Toolkit stuff. -->
|
||||
<inherits name='com.google.gwt.user.User'/>
|
||||
|
||||
<stylesheet src="../Leaderboard.css" />
|
||||
<stylesheet src="../RaceBoard.css" />
|
||||
|
||||
<!-- Other module inherits -->
|
||||
<inherits name="com.sap.sailing.gwt.ui.EmulatedJRE" />
|
||||
<inherits name="com.sap.sse.gwt.SSESharedGWT" />
|
||||
<inherits name="com.sap.sse.SSECommon" />
|
||||
<inherits name="com.sap.sailing.domain.SailingDomain" />
|
||||
<inherits name="com.sap.sse.security.ui.LoginPanel" />
|
||||
|
||||
<!-- Highcharts API -->
|
||||
<inherits name="org.moxieapps.gwt.highcharts.Highcharts" />
|
||||
|
||||
<!-- Google Maps API -->
|
||||
<inherits name='com.google.gwt.ajaxloader.AjaxLoader' />
|
||||
<inherits name='com.google.gwt.maps.Maps' />
|
||||
|
||||
<!-- Bootstrap API -->
|
||||
<inherits name="com.github.gwtbootstrap.BootstrapNoResources" />
|
||||
<inherits name='com.github.gwtbootstrap.datetimepicker.DatetimepickerNoResources' />
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='com.sap.sailing.gwt.ui.tv.TVEntryPoint'/>
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<extend-property name="locale" values="de"/>
|
||||
<extend-property name="locale" values="ru"/>
|
||||
|
||||
<source path='common'/>
|
||||
<source path='client'/>
|
||||
<source path='tv'/>
|
||||
<source path='leaderboard'/>
|
||||
<source path='raceboard'/>
|
||||
<source path='adminconsole'/>
|
||||
<source path='usermanagement'/>
|
||||
<source path='shared'/>
|
||||
<source path='actions'/>
|
||||
<source path='masterdataimport'/>
|
||||
<source path='simulator'/>
|
||||
</module>
|
||||
Reference in new issue
Block a user