mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 13:20:57 +00:00
added a parameter 'withStatisticalData' to control the retreival of statistical event data of getEventById() in SailingService
removed unused getEventByName method
This commit is contained in:
1 parent
1c9b03d479
commit
da88e93057
5 files changed
+11
-32
No files matched your search
+1
-1
@@ -52,7 +52,7 @@ public class EventActivity extends AbstractActivity {
|
||||
public void start(final AcceptsOneWidget panel, final EventBus eventBus) {
|
||||
final long clientTimeWhenRequestWasSent = System.currentTimeMillis();
|
||||
UUID eventUUID = UUID.fromString(eventPlace.getEventUuidAsString());
|
||||
clientFactory.getSailingService().getEventById(eventUUID, new AsyncCallback<EventDTO>() {
|
||||
clientFactory.getSailingService().getEventById(eventUUID, true, new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventDTO event) {
|
||||
if(event.getLeaderboardGroups().size() > 0) {
|
||||
|
||||
+1
-3
@@ -294,9 +294,7 @@ public interface SailingService extends RemoteService {
|
||||
|
||||
void renameEvent(UUID eventId, String newName);
|
||||
|
||||
EventDTO getEventByName(String eventName);
|
||||
|
||||
EventDTO getEventById(UUID id);
|
||||
EventDTO getEventById(UUID id, boolean withStatisticalData);
|
||||
|
||||
Iterable<String> getScoreCorrectionProviderNames();
|
||||
|
||||
|
||||
+1
-8
@@ -333,13 +333,6 @@ public interface SailingServiceAsync {
|
||||
|
||||
void getPublicEventsOfAllSailingServers(AsyncCallback<List<EventBaseDTO>> callback);
|
||||
|
||||
/**
|
||||
* Creates a {@link EventDTO} for the {@link com.sap.sailing.domain.base.Event} with the name <code>eventName</code>, which contains the
|
||||
* name, the description and a list with {@link RegattaDTO RegattaDTOs} contained in the event.<br />
|
||||
* If no event with the name <code>eventName</code> is known, an {@link IllegalArgumentException} is thrown.
|
||||
*/
|
||||
void getEventByName(String eventName, AsyncCallback<EventDTO> callback);
|
||||
|
||||
/**
|
||||
* Renames the event with the name <code>oldName</code> to the <code>newName</code>.<br />
|
||||
* If there's no event with the name <code>oldName</code> or there's already a event with the name
|
||||
@@ -550,7 +543,7 @@ public interface SailingServiceAsync {
|
||||
|
||||
void importWindFromIgtimi(List<RaceDTO> selectedRaces, boolean correctByDeclination, AsyncCallback<Map<RegattaAndRaceIdentifier, Integer>> asyncCallback);
|
||||
|
||||
void getEventById(UUID id, AsyncCallback<EventDTO> callback);
|
||||
void getEventById(UUID id, boolean withStatisticalData, AsyncCallback<EventDTO> callback);
|
||||
|
||||
void getLeaderboardsByEvent(EventDTO event, AsyncCallback<List<StrippedLeaderboardDTO>> callback);
|
||||
|
||||
|
||||
+1
-1
@@ -297,7 +297,7 @@ public class RegattaOverviewPanel extends SimplePanel {
|
||||
}
|
||||
|
||||
private void retrieveEvent() {
|
||||
sailingService.getEventById(eventId, new MarkedAsyncCallback<EventDTO>(
|
||||
sailingService.getEventById(eventId, false, new MarkedAsyncCallback<EventDTO>(
|
||||
new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable cause) {
|
||||
|
||||
+7
-19
@@ -3019,7 +3019,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
String requestBaseURL = getRequestBaseURL().toString();
|
||||
List<EventDTO> result = new ArrayList<EventDTO>();
|
||||
for (Event event : getService().getAllEvents()) {
|
||||
EventDTO eventDTO = convertToEventDTO(event);
|
||||
EventDTO eventDTO = convertToEventDTO(event, false);
|
||||
eventDTO.setBaseURL(requestBaseURL);
|
||||
eventDTO.setIsOnRemoteServer(false);
|
||||
result.add(eventDTO);
|
||||
@@ -3111,7 +3111,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
new UpdateEvent(eventId, eventName, eventDescription, startTimePoint, endTimePoint, venue.getName(),
|
||||
isPublic, leaderboardGroupIds, logoImageURL, officialWebsiteURL, imageURLs, videoURLs,
|
||||
sponsorimagieURLs));
|
||||
return getEventById(eventId);
|
||||
return getEventById(eventId, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3139,7 +3139,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
for (String courseAreaName : courseAreaNames) {
|
||||
createCourseArea(eventUuid, courseAreaName);
|
||||
}
|
||||
return getEventById(eventUuid);
|
||||
return getEventById(eventUuid, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3166,23 +3166,11 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventDTO getEventByName(String eventName) {
|
||||
EventDTO result = null;
|
||||
for (Event event : getService().getAllEvents()) {
|
||||
if(event.getName().equals(eventName)) {
|
||||
result = convertToEventDTO(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventDTO getEventById(UUID id) {
|
||||
public EventDTO getEventById(UUID id, boolean withStatisticalData) {
|
||||
EventDTO result = null;
|
||||
Event event = getService().getEvent(id);
|
||||
if (event != null) {
|
||||
result = convertToEventDTO(event);
|
||||
result = convertToEventDTO(event, withStatisticalData);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -3231,7 +3219,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
}
|
||||
|
||||
private EventDTO convertToEventDTO(Event event) {
|
||||
private EventDTO convertToEventDTO(Event event, boolean withStatisticalData) {
|
||||
EventDTO eventDTO = new EventDTO(event.getName());
|
||||
copyEventBaseFieldsToDTO(event, eventDTO);
|
||||
eventDTO.regattas = new ArrayList<RegattaDTO>();
|
||||
@@ -3247,7 +3235,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
eventDTO.venue.getCourseAreas().add(courseAreaDTO);
|
||||
}
|
||||
for (LeaderboardGroup lg : event.getLeaderboardGroups()) {
|
||||
eventDTO.addLeaderboardGroup(convertToLeaderboardGroupDTO(lg, /* withGeoLocationData */false, /* withStatisticalData */ true));
|
||||
eventDTO.addLeaderboardGroup(convertToLeaderboardGroupDTO(lg, /* withGeoLocationData */false, withStatisticalData));
|
||||
}
|
||||
return eventDTO;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user