mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Removed the additional data from the leaderboard group sailing services
This commit is contained in:
1 parent
646c7d1f46
commit
b4459c940a
8 files changed
+16
-38
No files matched your search
+2
-2
@@ -478,7 +478,7 @@ public class LeaderboardGroupConfigPanel extends AbstractEventPanel {
|
||||
}
|
||||
|
||||
private void loadGroups() {
|
||||
sailingService.getLeaderboardGroups(false, new AsyncCallback<List<LeaderboardGroupDTO>>() {
|
||||
sailingService.getLeaderboardGroups(new AsyncCallback<List<LeaderboardGroupDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LeaderboardGroupDTO> groups) {
|
||||
availableLeaderboardGroups.clear();
|
||||
@@ -637,7 +637,7 @@ public class LeaderboardGroupConfigPanel extends AbstractEventPanel {
|
||||
final LeaderboardGroupDTO selectedGroup = groupsSelectionModel.getSelectedObject();
|
||||
splitPanel.setVisible(selectedGroup != null);
|
||||
if (selectedGroup != null) {
|
||||
sailingService.getLeaderboardGroupByName(selectedGroup.name, false, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
sailingService.getLeaderboardGroupByName(selectedGroup.name, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
errorReporter.reportError("Error trying to obtain the leaderboard group " + selectedGroup.name + ": " + t.getMessage());
|
||||
|
||||
+2
-2
@@ -153,9 +153,9 @@ public interface SailingService extends RemoteService {
|
||||
|
||||
List<LeaderboardDTO> getLeaderboardsByRace(RaceDTO race);
|
||||
|
||||
List<LeaderboardGroupDTO> getLeaderboardGroups(boolean withAdditionalInformation);
|
||||
List<LeaderboardGroupDTO> getLeaderboardGroups();
|
||||
|
||||
LeaderboardGroupDTO getLeaderboardGroupByName(String groupName, boolean withAdditionalInformation);
|
||||
LeaderboardGroupDTO getLeaderboardGroupByName(String groupName);
|
||||
|
||||
void renameLeaderboardGroup(String oldName, String newName);
|
||||
|
||||
|
||||
+2
-2
@@ -264,14 +264,14 @@ public interface SailingServiceAsync {
|
||||
* Creates a {@link LeaderboardGroupDTO} for each {@link LeaderboardGroup} known by the server, which contains the
|
||||
* name, the description and a list with {@link LeaderboardDTO LeaderboardDTOs} contained by the group.
|
||||
*/
|
||||
void getLeaderboardGroups(boolean withAdditionalInformation, AsyncCallback<List<LeaderboardGroupDTO>> callback);
|
||||
void getLeaderboardGroups(AsyncCallback<List<LeaderboardGroupDTO>> callback);
|
||||
|
||||
/**
|
||||
* Creates a {@link LeaderboardGroupDTO} for the {@link LeaderboardGroup} with the name <code>groupName</code>, which contains the
|
||||
* name, the description and a list with {@link LeaderboardDTO LeaderboardDTOs} contained by the group.<br />
|
||||
* If no group with the name <code>groupName</code> is known, an {@link IllegalArgumentException} is thrown.
|
||||
*/
|
||||
void getLeaderboardGroupByName(String groupName, boolean withAdditionalInformation, AsyncCallback<LeaderboardGroupDTO> callback);
|
||||
void getLeaderboardGroupByName(String groupName, AsyncCallback<LeaderboardGroupDTO> callback);
|
||||
|
||||
/**
|
||||
* Renames the group with the name <code>oldName</code> to the <code>newName</code>.<br />
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ public class RaceBoardEntryPoint extends AbstractEntryPoint {
|
||||
sailingService.listEvents(listEventsCallback);
|
||||
sailingService.getLeaderboardNames(getLeaderboardNamesCallback);
|
||||
if(leaderboardGroupName != null) {
|
||||
sailingService.getLeaderboardGroupByName(leaderboardGroupNameParamValue, false, getLeaderboardGroupByNameCallback);
|
||||
sailingService.getLeaderboardGroupByName(leaderboardGroupNameParamValue, getLeaderboardGroupByNameCallback);
|
||||
}
|
||||
userManagementService.getUser(getUserCallback);
|
||||
}
|
||||
|
||||
+6
-28
@@ -1595,50 +1595,28 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LeaderboardGroupDTO> getLeaderboardGroups(boolean withAdditionalInformation) {
|
||||
public List<LeaderboardGroupDTO> getLeaderboardGroups() {
|
||||
ArrayList<LeaderboardGroupDTO> leaderboardGroupDTOs = new ArrayList<LeaderboardGroupDTO>();
|
||||
Map<String, LeaderboardGroup> leaderboardGroups = getService().getLeaderboardGroups();
|
||||
|
||||
for (LeaderboardGroup leaderboardGroup : leaderboardGroups.values()) {
|
||||
leaderboardGroupDTOs.add(convertToLeaderboardGroupDTO(leaderboardGroup, withAdditionalInformation));
|
||||
leaderboardGroupDTOs.add(convertToLeaderboardGroupDTO(leaderboardGroup));
|
||||
}
|
||||
|
||||
return leaderboardGroupDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeaderboardGroupDTO getLeaderboardGroupByName(String groupName, boolean withAdditionalInformation) {
|
||||
return convertToLeaderboardGroupDTO(getService().getLeaderboardGroupByName(groupName), withAdditionalInformation);
|
||||
public LeaderboardGroupDTO getLeaderboardGroupByName(String groupName) {
|
||||
return convertToLeaderboardGroupDTO(getService().getLeaderboardGroupByName(groupName));
|
||||
}
|
||||
|
||||
private LeaderboardGroupDTO convertToLeaderboardGroupDTO(LeaderboardGroup leaderboardGroup, boolean withAdditionalInformation) {
|
||||
private LeaderboardGroupDTO convertToLeaderboardGroupDTO(LeaderboardGroup leaderboardGroup) {
|
||||
LeaderboardGroupDTO groupDTO = new LeaderboardGroupDTO();
|
||||
groupDTO.name = leaderboardGroup.getName();
|
||||
groupDTO.description = leaderboardGroup.getDescription();
|
||||
for (Leaderboard leaderboard : leaderboardGroup.getLeaderboards()) {
|
||||
groupDTO.leaderboards.add(createStrippedLeaderboardDTO(leaderboard));
|
||||
if (withAdditionalInformation) {
|
||||
for (RaceInLeaderboard raceInLeaderboard : leaderboard.getRaceColumns()) {
|
||||
TrackedRace trackedRace = raceInLeaderboard.getTrackedRace();
|
||||
|
||||
if (trackedRace != null) {
|
||||
RaceIdentifier trackedRaceId = trackedRace.getRaceIdentifier();
|
||||
groupDTO.setRaceStartDate(trackedRaceId, trackedRace.getStart().asDate());
|
||||
|
||||
Pair<Placemark, Placemark> startAndFinish = trackedRace.getStartFinishPlacemarks();
|
||||
PlacemarkOrderDTO racePlaces = new PlacemarkOrderDTO();
|
||||
if (startAndFinish.getA() != null) {
|
||||
racePlaces.getPlacemarks().add(convertToPlacemarkDTO(startAndFinish.getA()));
|
||||
}
|
||||
if (startAndFinish.getB() != null) {
|
||||
racePlaces.getPlacemarks().add(convertToPlacemarkDTO(startAndFinish.getB()));
|
||||
}
|
||||
if (!racePlaces.isEmpty()) {
|
||||
groupDTO.setRacePlaces(trackedRaceId, racePlaces);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return groupDTO;
|
||||
}
|
||||
@@ -1661,7 +1639,7 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
|
||||
@Override
|
||||
public LeaderboardGroupDTO createLeaderboardGroup(String groupName, String description) {
|
||||
return convertToLeaderboardGroupDTO(getService().addLeaderboardGroup(groupName, description, new ArrayList<String>()), false);
|
||||
return convertToLeaderboardGroupDTO(getService().addLeaderboardGroup(groupName, description, new ArrayList<String>()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -269,7 +269,7 @@ public class LeaderboardGroupOverviewPanel extends FormPanel {
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
sailingService.getLeaderboardGroups(true, new AsyncCallback<List<LeaderboardGroupDTO>>() {
|
||||
sailingService.getLeaderboardGroups(new AsyncCallback<List<LeaderboardGroupDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LeaderboardGroupDTO> result) {
|
||||
availableGroups = result == null ? new ArrayList<LeaderboardGroupDTO>() : result;
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
|
||||
}
|
||||
|
||||
private void loadGroup(final String groupName) {
|
||||
sailingService.getLeaderboardGroupByName(groupName, false, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
sailingService.getLeaderboardGroupByName(groupName, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void onSuccess(LeaderboardGroupDTO group) {
|
||||
if (group != null) {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements EventRefr
|
||||
groupName = null;
|
||||
} else {
|
||||
groupName = groupParamValue;
|
||||
sailingService.getLeaderboardGroupByName(groupName, false, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
sailingService.getLeaderboardGroupByName(groupName, new AsyncCallback<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
reportError(stringMessages.noLeaderboardGroupWithNameFound(groupName));
|
||||
|
||||
Reference in new issue
Block a user