mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 06:10:56 +00:00
Merge branch 'master' into polar-api
Conflicts: java/com.sap.sailing.gwt.ui/SailingGWT.launch
This commit is contained in:
commit
e5f0bb7f7c
16 files changed
+142
-749
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,8 +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,\
|
||||
PolarSheets.html,\
|
||||
|
||||
@@ -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>
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.search.KeywordQuery;
|
||||
import com.sap.sse.gwt.adminconsole.BuildVersionRetriever;
|
||||
import com.sap.sse.gwt.client.BuildVersionRetriever;
|
||||
|
||||
/**
|
||||
* The async counterpart of {@link SailingService}
|
||||
|
||||
-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,73 +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 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
|
||||
<module>
|
||||
|
||||
<!-- Inherit the core Web Toolkit stuff. -->
|
||||
<inherits name='com.google.gwt.user.User'/>
|
||||
|
||||
<!-- Inherit the default GWT style sheet. You can change -->
|
||||
<!-- the theme of your GWT application by uncommenting -->
|
||||
<!-- any one of the following lines. -->
|
||||
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
|
||||
<inherits name='com.google.gwt.debug.Debug'/>
|
||||
|
||||
<stylesheet src="../AdminConsole.css" />
|
||||
|
||||
<!-- 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' />
|
||||
|
||||
<inherits name="com.google.gwt.resources.Resources" />
|
||||
<inherits name="com.google.gwt.logging.Logging"/>
|
||||
|
||||
<!-- 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.sse.security.ui.LoginPanel" />
|
||||
<inherits name="com.sap.sailing.domain.SailingDomain" />
|
||||
|
||||
<!-- Fancy DateTimePicker (without the rest of Bootstrap!) -->
|
||||
<!-- GWT-Bootstrap License: Apache License, Version 2.0 -->
|
||||
<inherits name="com.github.gwtbootstrap.BootstrapNoResources" />
|
||||
<inherits name='com.github.gwtbootstrap.datetimepicker.DatetimepickerNoResources' />
|
||||
|
||||
<!-- Fancy Progressbar (without the rest of Bootstrap!) -->
|
||||
<!-- GWT-Bootstrap License: Apache License, Version 2.0 -->
|
||||
<stylesheet src="../AdminConsoleDateTimePicker.css" />
|
||||
<stylesheet src="../AdminConsoleProgressBar.css" />
|
||||
|
||||
<super-source path="jre" />
|
||||
|
||||
<entry-point class='com.sap.sailing.gwt.ui.client.search.SearchEntryPoint'/>
|
||||
|
||||
<set-property name="gwt.logging.enabled" value="TRUE"/>
|
||||
<set-property name="gwt.logging.logLevel" value="FINE"/>
|
||||
|
||||
<set-property name="gwt.logging.firebugHandler" value="ENABLED" />
|
||||
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
|
||||
<set-property name="gwt.logging.consoleHandler" value="ENABLED" />
|
||||
<set-property name="gwt.logging.developmentModeHandler" value="DISABLED" />
|
||||
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
|
||||
<set-property name="gwt.logging.systemHandler" value="ENABLED" />
|
||||
|
||||
<extend-property name="locale" values="de"/>
|
||||
<extend-property name="locale" values="ru"/>
|
||||
|
||||
<source path='common'/>
|
||||
<source path='client'/>
|
||||
<source path='controls'/>
|
||||
<source path='components'/>
|
||||
<source path='adminconsole'/>
|
||||
<source path='leaderboard'/>
|
||||
<source path='masterdataimport'/>
|
||||
<source path='usermanagement'/>
|
||||
<source path='shared'/>
|
||||
<source path='test'/>
|
||||
<source path='actions'/>
|
||||
<source path='simulator'/>
|
||||
</module>
|
||||
@@ -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>
|
||||
+1
@@ -18,6 +18,7 @@ import com.google.gwt.user.client.ui.TabLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.common.Util.Triple;
|
||||
import com.sap.sse.gwt.client.AbstractEntryPoint;
|
||||
import com.sap.sse.gwt.client.BuildVersionRetriever;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.panels.VerticalTabLayoutPanel;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
+1
@@ -5,6 +5,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.gwt.client.BuildVersionRetriever;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
|
||||
public class SystemInformationPanel extends FlowPanel {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.gwt.adminconsole;
|
||||
package com.sap.sse.gwt.client;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# mail configuration, e.g., for password recovery
|
||||
mail.enabled = false
|
||||
# For production:
|
||||
#mail.from = noreply@sapsailing.com
|
||||
mail.from = noreply@sapsailing.com
|
||||
# For testing:
|
||||
mail.from = uhl@homemp3.dyndns.org
|
||||
#mail.from = uhl@homemp3.dyndns.org
|
||||
mail.transport.protocol = smtp
|
||||
# For production:
|
||||
#mail.smtp.host = 127.0.0.1
|
||||
mail.smtp.host = 127.0.0.1
|
||||
# For testing internally:
|
||||
#mail.smtp.host = mail.sap.corp
|
||||
# For testing externally:
|
||||
mail.smtp.host = www.axel-uhl.de
|
||||
#mail.smtp.host = www.axel-uhl.de
|
||||
mail.smtp.port = 25
|
||||
mail.smtp.auth = true
|
||||
mail.smtp.user =
|
||||
|
||||
+131
-177
@@ -3,186 +3,144 @@
|
||||
## General
|
||||
|
||||
This is a design for the REST API to be used by the iOS and Android tracking apps.
|
||||
We have decided to handle checkins etc. at the level of ``Leaderboard``s instead of ``Regatta``s. For most cases, such a Leaderboard is based on a Regatta (a ``RegattaLeaderboard`` in our domain model).
|
||||
|
||||
This document supplements the [documentation of the existing REST API](http://www.sapsailing.com/sailingserver/webservices/api/v1/index.html), highlighting those resources necessary for the tracking app, and specifying such resources that are not yet present in the API.
|
||||
|
||||
### URL base
|
||||
```
|
||||
http://<host>/sailingserver/api/v1/
|
||||
```
|
||||
All relative URLs given below are relative to this base URL.
|
||||
|
||||
## Push Notifications
|
||||
|
||||
Event data can be updated via push notifications. These are limited on iOS to 256 bytes (not characters). For this reason, on receiving a push notification, the app must GET the event data.
|
||||
|
||||
|
||||
## Checkin Information
|
||||
|
||||
### Path
|
||||
### URL and QRCode
|
||||
|
||||
http://kielerwoche2015.sapsailing.com:8888/api/v1/checkin_info.json?leaderboard={unique_leaderboard_name}&competitor_id={competitor_id}
|
||||
We have the following structure of domain objects (look here for [API documentation](http://www.sapsailing.com/sailingserver/webservices/api/v1/index.html) in addition to the examples):
|
||||
* Event (e.g. [Kieler Woche 2013](http://www.sapsailing.com/sailingserver/api/v1/events/3e4145a7-5473-4670-83e6-fd5ee364f7eb))
|
||||
* LeaderboardGroup (e.g. [Kieler Woche 2013](http://www.sapsailing.com/sailingserver/api/v1/leaderboardgroups/Kieler%20Woche%202013))
|
||||
* Leaderboard (e.g. [KW 2013 Olympic (2.4M)](http://www.sapsailing.com/sailingserver/api/v1/leaderboards/KW%202013%20Olympic%20(2.4M%29))
|
||||
* Race (caution: this is over-simplified)
|
||||
|
||||
### Verb
|
||||
These resources have separate life cycles, the hierarchical presentation only denotes references between the resources (e.g. an Event references some LeaderboardGroups).
|
||||
|
||||
GET
|
||||
The app has to receive the following information:
|
||||
* ``event-id`` (for description, start- and end-date)
|
||||
* ``leaderboard-name`` (so that the user can checkin for the correct leaderboard)
|
||||
* ``competitor-id`` (so the app can register the device for the correct competitor)
|
||||
|
||||
### Response
|
||||
This information is represented in a URL with the following structure:
|
||||
```
|
||||
http://sapsailing.com/tracking/checkin
|
||||
?host=<server-for-tracking>
|
||||
&event_id=<event-id>
|
||||
&leaderboard_name=<leaderboard-name>
|
||||
&competitor_id=<competitor-id>
|
||||
```
|
||||
|
||||
{
|
||||
"serverUrl" : "http://kielerwoche2015.sapsailing.com:8888",
|
||||
"event" : {
|
||||
"id" : "957fab64e36d240dd07aeed2bd5a84b6",
|
||||
"title" : "Kieler Woche",
|
||||
"startDate" : 1414414481000,
|
||||
"endDate" : 1414609200000
|
||||
},
|
||||
"regatta": {
|
||||
"id": "237fab64e36d240dd07aeed2bd5a8426",
|
||||
"title": "49ers"
|
||||
},
|
||||
"competitor":{
|
||||
"id" : "e45fab64e36d240dd07aeed2bd5a8a21",
|
||||
"name" : "Alster Segel Club",
|
||||
"registration" : "GER 13"
|
||||
}
|
||||
}
|
||||
**Additional Notes:**
|
||||
* The URL is **only symbolic**. Requesting it will for now result in a 404. In the future, it might be used to redirect to the .apk, play store or app store in case the app is not installed.
|
||||
* The structure of the URL was chosen for the following reasons:
|
||||
* If presented to a user as text, it is immediately obvious that he is dealing with sapsailing.com
|
||||
* If we want to redirect to a server-version-specific .apk under Android, the sapsailing.com server can still simply redirect to the ``host``
|
||||
* The variable-length leaderboard name is problematic when thinking about length restrictions in QRCodes anyway. We will have to think about URL-shortening anyhow, so legible parameter names were chosen instead of short ones (e.g. ``e=`` instead of ``event_id=``)
|
||||
* The app has to get event and competitor data by performing additional REST API calls
|
||||
* The returned JSON-document for an event includes the names of the associated LeaderboardGroups. The JSON for the LeaderboardGroup in turn includes the names of the associated leaderboards. This structure of the returned resources does not follow the [REST constraints](http://en.wikipedia.org/wiki/Representational_state_transfer#Uniform_interface) in the sense that it does not use URIs to refer to associated resources. Instead, only the unique identifier is given, and one has to refer to the API documentation to construct the URI through which the related resource can be addressed.
|
||||
|
||||
### Event Information
|
||||
|
||||
see [events/{event_id}](http://www.sapsailing.com/sailingserver/webservices/api/v1/eventGetDoc.html)
|
||||
|
||||
### Leaderboard Information
|
||||
|
||||
see [leaderboards/{leaderboard_name}](http://www.sapsailing.com/sailingserver/webservices/api/v1/leaderboardGetDoc.html)
|
||||
|
||||
### Competitor Information
|
||||
|
||||
**Path:** ``competitors/{competitor-id}``
|
||||
|
||||
**Verb:** ``GET``
|
||||
|
||||
**Response:**
|
||||
```
|
||||
{
|
||||
"name": "Heiko KRÖGER",
|
||||
"displayName": "Heiko KRÖGER",
|
||||
"id": "af855a56-9726-4a9c-a77e-da955bd289be",
|
||||
"sailID": "GER 1",
|
||||
"nationality": "GER",
|
||||
"countryCode": "DE"
|
||||
}
|
||||
```
|
||||
|
||||
**Additional Notes:**
|
||||
* The semantics of ``displayName`` are explained in the JavaDoc of ``Leaderboard#getDisplayName()``.
|
||||
* Competitor profile image left out for now.
|
||||
* No flag image included. These images are present on the server in the GWT-context only as 16x11 pngs currently. How flags are displayed in the app should probably be independent. I would suggest resolving the appropriate image within the app based on the ``countryCode``.
|
||||
|
||||
**serverUrl** This is the endpoint to be used for all following REST requests.
|
||||
|
||||
## Check-In
|
||||
|
||||
After the user has received the event data with the short URL, the smartphone is mapped to a competitor.
|
||||
|
||||
Result: fixes transmitted after the time specified in the checkin request are added to such races within the leaderboard that have a start/end time matching the fixes timestamp.
|
||||
|
||||
_Question: What should be done if a second device is mapped to competitor?_
|
||||
* _Answer:_ For now, according to our internal logic, both devices are actually mapped. If they send fixes for the same timerange, we will see some weird behaviour.
|
||||
|
||||
### Path
|
||||
**Path:** ``/leaderboards/{leaderboard-name}/device_mappings/start``
|
||||
|
||||
{serverUrl}/api/v1/leaderboard/{unique_leaderboard_name}/competitor/{competitor_id}/checkin.json
|
||||
**Verb:** ``POST``
|
||||
|
||||
### Verb
|
||||
**Request:**
|
||||
```
|
||||
{
|
||||
"competitorId" : "af855a56-9726-4a9c-a77e-da955bd289bg",
|
||||
"deviceType" : "ios",
|
||||
"deviceUuid" : "af855a56-9726-4a9c-a77e-da955bd289bf",
|
||||
"pushDeviceId" : "0f744707bebcf74f9b7c25d48e3358945f6aa01da5ddb387462c7eaf61bbad78",
|
||||
"fromMillis" : 1415624564718
|
||||
}
|
||||
```
|
||||
* **competitorId** ID of the competitor to map the device to. For coming versions, using ``markId`` instead might also be valid to map the device to a mark.
|
||||
* **deviceType**: Either `android` or `ios`. Needed for selecting correct push notification service.
|
||||
* **deviceUuid**: **UUID** generated by the app on first run. **Not** an identifier that globally identifies the piece of hardware such UDID under iOS, IMEI, or other.
|
||||
* **pushDeviceId** On Android the GCM regId, on iOS the APNS push token. This is needed for sending push notifications to the device.
|
||||
* **fromMillis** Milliseconds timestamp from which to map the device to the competitor.
|
||||
|
||||
POST
|
||||
**Response:**
|
||||
``HTTP 200``, no response body
|
||||
|
||||
### Request
|
||||
|
||||
{
|
||||
"deviceUdid" : "202cb962ac59075b964b07152d234b70",
|
||||
"deviceType" : "ios",
|
||||
"pushDeviceId" : "0f744707bebcf74f9b7c25d48e3358945f6aa01da5ddb387462c7eaf61bbad78"
|
||||
}
|
||||
|
||||
**deviceUdid** A UDID generated by device, generated on first run.
|
||||
|
||||
**deviceType** Either `android` or `ios`. Needed for selecting correct push notification service.
|
||||
|
||||
**pushDeviceId** On Android the GCM regId, on iOS the APNS push token. This is needed for sending push notifications to the device.
|
||||
**Additional Notes:**
|
||||
For future versions, think about whether this is the right place to transmit the data for push notifications. Rather, this should ideally be done when installing the app (or starting it for the first time). Problem is, we don't know which server it will be used with then. So maybe, instead, whenever the user registers for a leaderboard on a _new_ server, the necessary information for push notifications ins transferrend _once_, instead of every time the user registers for a leaderboard on that server.
|
||||
|
||||
## Checkout
|
||||
|
||||
Needed to destroy a device coupling with leaderboard & competitor. AKA checkout.
|
||||
Ends the device to competitor coupling. Does not delete it, but rather marks the end timepoint. Fixes submitted for this device that have a timestamp which lies after the end timepoint specified in the checkout request are not added to races in the leaderboard.
|
||||
|
||||
### Path
|
||||
**Path:** ``/leaderboards/{leaderboard-name}/device_mappings/end``
|
||||
|
||||
{serverUrl}/api/v1/leaderboard/{unique_leaderboard_name}/competitor/{competitor_id}/device/{deviceUdid}.json
|
||||
**Verb:** ``POST``
|
||||
|
||||
### Verb
|
||||
|
||||
DELETE
|
||||
**Request:**
|
||||
```
|
||||
{
|
||||
"competitorId" : "af855a56-9726-4a9c-a77e-da955bd289bg",
|
||||
"deviceUuid" : "af855a56-9726-4a9c-a77e-da955bd289bf",
|
||||
"toMillis" : 1415624564719
|
||||
}
|
||||
```
|
||||
* **toMillis** Milliseconds timestamp up to which to map the device to the competitor.
|
||||
|
||||
**Response:**
|
||||
``HTTP 200``, no response body
|
||||
|
||||
## Regatta Info
|
||||
|
||||
Informations regarding a regatta. We need the list of (scheduled) races to remind the user to start tracking.
|
||||
|
||||
### Path
|
||||
|
||||
{serverUrl}/api/v1/leaderboard/{unique_leaderboard_name}/regatta.json
|
||||
|
||||
or
|
||||
|
||||
{serverUrl}/api/v1/event/{event_id}/regatta/{regatta_id}.json
|
||||
|
||||
### Verb
|
||||
|
||||
GET
|
||||
|
||||
### Response
|
||||
|
||||
{
|
||||
"id": "237fab64e36d240dd07aeed2bd5a8426",
|
||||
"title": "49ers",
|
||||
"event_id" : "237fab64e36d240dd07aeed2bd5a8426"
|
||||
"leaderboard" : "Leaderboard Identifier",
|
||||
"races":[
|
||||
{
|
||||
"startTime" : 1414414481000,
|
||||
"status" : "finished",
|
||||
"fleet" : "Blue"
|
||||
"phase" : "Qualification"
|
||||
"name" : "Q1"
|
||||
},
|
||||
{
|
||||
"startTime" : 1414414481005,
|
||||
"status" : "running",
|
||||
"fleet" : "Red"
|
||||
"phase" : "Qualification"
|
||||
"name" : "Q1"
|
||||
},
|
||||
{
|
||||
"startTime" : 1414414481010,
|
||||
"status" : "scheduled",
|
||||
"fleet" : "Blue"
|
||||
"phase" : "Qualification"
|
||||
"name" : "Q2"
|
||||
},
|
||||
{
|
||||
"startTime" : "",
|
||||
"status" : "unscheduled",
|
||||
"fleet" : "Red"
|
||||
"phase" : "Qualification"
|
||||
"name" : "Q2"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
## Competitor Info
|
||||
|
||||
Informations for a competitor can be requested.
|
||||
|
||||
### Path
|
||||
|
||||
{serverUrl}/api/v1/competitor/{competitor_id}.json
|
||||
|
||||
### Verb
|
||||
|
||||
GET
|
||||
|
||||
### Response
|
||||
|
||||
{
|
||||
"Id" : "250cf8b51c773f3f8dc8b4be867a9a02",
|
||||
"Name" : "Alster Segel Club",
|
||||
"ProfileImageUrl" : "http://s3.amazonaws.com/sapsailing/profile_images/68053af2923e00204c3ca7c6a3150cf7.jpeg"
|
||||
"Flag": {BASE64STRING or URL},
|
||||
"Registration": "GER 14"
|
||||
}
|
||||
|
||||
## Upload Profile Image
|
||||
|
||||
An image can be uploaded per competitor.
|
||||
|
||||
### Path
|
||||
|
||||
{serverUrl}/api/v1/competitor/{competitor_id}/profile_image.json
|
||||
|
||||
### Verb
|
||||
|
||||
POST
|
||||
|
||||
### Request
|
||||
|
||||
Multipart upload with part `image` containing JPEG image 80%, max dimension 1200px.
|
||||
|
||||
### Response
|
||||
|
||||
{
|
||||
"profileImageUrl" : "http://s3.amazonaws.com/sapsailing/profile_images/68053af2923e00204c3ca7c6a3150cf7.jpeg"
|
||||
}
|
||||
|
||||
**profileImageUrl** URL of uploaded image.
|
||||
|
||||
## Send Measurements (to the Fix Store)
|
||||
|
||||
@@ -192,36 +150,32 @@ Measurements should be sent live during an event. In case of missing network, me
|
||||
|
||||
GZIP compression is a must. Bulk uploads should be chunked, e.g. per 1,000 locations.
|
||||
|
||||
### Path
|
||||
**Path:** ``gps_fixes``
|
||||
|
||||
{serverUrl}/api/v1/fix_store.json
|
||||
|
||||
### Verb
|
||||
|
||||
POST
|
||||
|
||||
### Request
|
||||
**Verb:** ``POST``
|
||||
|
||||
**Request:**
|
||||
```
|
||||
{
|
||||
deviceUuid: "af855a56-9726-4a9c-a77e-da955bd289bf",
|
||||
fixes: [
|
||||
{
|
||||
"measurements" : [
|
||||
{
|
||||
"timestamp" : 14144160080000,
|
||||
"latitude" : 54.325246,
|
||||
"longitude" : 10.148556,
|
||||
"speed" : 3.61,
|
||||
"course" : 258.11,
|
||||
},
|
||||
{
|
||||
"timestamp" : 14144168490000,
|
||||
"latitude" : 55.12456,
|
||||
"longitude" : 8.03456,
|
||||
"speed" : 5.1,
|
||||
"course" : 14.2,
|
||||
},
|
||||
...
|
||||
]
|
||||
"timestamp" : 14144160080000,
|
||||
"latitude" : 54.325246,
|
||||
"longitude" : 10.148556,
|
||||
"speed" : 3.61,
|
||||
"course" : 258.11,
|
||||
},
|
||||
{
|
||||
"timestamp" : 14144168490000,
|
||||
"latitude" : 55.12456,
|
||||
"longitude" : 8.03456,
|
||||
"speed" : 5.1,
|
||||
"course" : 14.2,
|
||||
}
|
||||
|
||||
**speed** Speed over ground in meters per second.
|
||||
|
||||
**course** Heading in degrees.
|
||||
]
|
||||
}
|
||||
```
|
||||
* JSON array may contain one or several fixes
|
||||
* **speed** Speed over ground in meters per second.
|
||||
* **course** Heading in degrees.
|
||||
Reference in new issue
Block a user