mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
Merge branch 'master' into bug4254
This commit is contained in:
commit
e2abea1a37
17 files changed
+159
-75
No files matched your search
+5
-3
@@ -66,13 +66,15 @@ public class SwissTimingRaceConfigurationTest {
|
||||
SwissTimingRaceConfig config_446483 = new SwissTimingReplayServiceImpl(DomainFactory.INSTANCE).loadRaceConfig(configDataStream);
|
||||
assertNotNull(config_446483);
|
||||
assertEquals("GB", config_446483.country_code);
|
||||
assertEquals("London 2012 Olympic Games", config_446483.event_name);
|
||||
// TODO There used to be an attribute event_name in the "config" sub-element; around 2017-07-25 these things seem to have vanished;
|
||||
// Asked Radek Masnica <masnica.r@st-software.com> and Christian Sgodzay <Sgodzay.C@st-sportservice.com> about the changes.
|
||||
// Hopefully this can be re-enabled soon...
|
||||
// assertEquals("London 2012 Olympic Games", config_446483.event_name);
|
||||
// assertEquals("1343914800000", config_446483.race_start_ts);
|
||||
assertEquals("60", config_446483.gmt_offset);
|
||||
assertEquals("50,603424", config_446483.latitude);
|
||||
assertEquals("Nothe", config_446483.location);
|
||||
assertEquals("-2,442963", config_446483.longitude);
|
||||
assertEquals("1343914800000", config_446483.race_start_ts);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -35,7 +35,7 @@ public class ScoreCorrectionProviderImpl implements ScoreCorrectionProvider {
|
||||
private List<URL> getCsvUrls(String... actNames) throws MalformedURLException {
|
||||
List<URL> result = new ArrayList<URL>();
|
||||
for (String actName : actNames) {
|
||||
result.add(new URL("http://www.extremesailingseries.com/app/results/csv_uploads/"+actName+".csv"));
|
||||
result.add(new URL("https://www.extremesailingseries.com/app/results/csv_uploads/"+actName+".csv"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -99,10 +99,13 @@ public class ScoreCorrectionProviderImpl implements ScoreCorrectionProvider {
|
||||
|
||||
private Iterable<String> getAvailableActNames() throws IOException {
|
||||
List<String> result = new ArrayList<String>();
|
||||
URL url = new URL("http://www.extremesailingseries.com/app/results/csv_uploads/");
|
||||
URL url = new URL("https://www.extremesailingseries.com/app/results/csv_uploads/");
|
||||
Pattern p = Pattern.compile("<a href=\"([^\"]*)\\.csv\">");
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36");
|
||||
conn.setRequestProperty("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
|
||||
conn.setRequestProperty("accept-language", "en-US,en;q=0.8,de;q=0.6,da;q=0.4");
|
||||
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
String readLine;
|
||||
while ((readLine = br.readLine()) != null) {
|
||||
|
||||
+3
-19
@@ -1,10 +1,6 @@
|
||||
package com.sap.sailing.gwt.home.communication.event;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -93,27 +89,15 @@ public class GetEventViewAction implements SailingAction<EventViewDTO>, IsClient
|
||||
|
||||
LeaderboardGroup overallLeaderboardGroup = event.getLeaderboardGroups().iterator().next();
|
||||
dto.setSeriesName(HomeServiceUtil.getLeaderboardDisplayName(overallLeaderboardGroup));
|
||||
List<Event> fakeSeriesEvents = new ArrayList<Event>();
|
||||
|
||||
for (Event eventOfSeries : context.getRacingEventService().getAllEvents()) {
|
||||
for (LeaderboardGroup leaderboardGroup : eventOfSeries.getLeaderboardGroups()) {
|
||||
if (overallLeaderboardGroup.equals(leaderboardGroup)) {
|
||||
fakeSeriesEvents.add(eventOfSeries);
|
||||
}
|
||||
}
|
||||
}
|
||||
Collections.sort(fakeSeriesEvents, new Comparator<Event>() {
|
||||
public int compare(Event e1, Event e2) {
|
||||
return e1.getStartDate().compareTo(e2.getEndDate());
|
||||
}
|
||||
});
|
||||
for(Event eventInSeries: fakeSeriesEvents) {
|
||||
for (Event eventInSeries : HomeServiceUtil.getEventsForSeriesInDescendingOrder(overallLeaderboardGroup,
|
||||
context.getRacingEventService())) {
|
||||
String displayName = HomeServiceUtil.getLocation(eventInSeries, context.getRacingEventService());
|
||||
if(displayName == null) {
|
||||
displayName = eventInSeries.getName();
|
||||
}
|
||||
EventState eventState = HomeServiceUtil.calculateEventState(eventInSeries);
|
||||
dto.getEventsOfSeries().add(new EventReferenceWithStateDTO(eventInSeries.getId(), displayName, eventState));
|
||||
dto.addEventToSeries(new EventReferenceWithStateDTO(eventInSeries.getId(), displayName, eventState));
|
||||
}
|
||||
} else {
|
||||
dto.setType(dto.getRegattas().size() == 1 ? EventType.SINGLE_REGATTA: EventType.MULTI_REGATTA);
|
||||
|
||||
+5
-8
@@ -28,13 +28,6 @@ public class EventViewDTO extends EventMetadataDTO implements Result, HasLogo {
|
||||
private String officialWebsiteURL;
|
||||
private String sailorsInfoWebsiteURL;
|
||||
|
||||
public EventViewDTO() {
|
||||
}
|
||||
|
||||
public EventViewDTO(String name) {
|
||||
setDisplayName(name);
|
||||
}
|
||||
|
||||
public EventType getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -47,7 +40,11 @@ public class EventViewDTO extends EventMetadataDTO implements Result, HasLogo {
|
||||
return regattas;
|
||||
}
|
||||
|
||||
public List<EventReferenceWithStateDTO> getEventsOfSeries() {
|
||||
public void addEventToSeries(EventReferenceWithStateDTO eventRef) {
|
||||
eventsOfSeries.add(eventRef);
|
||||
}
|
||||
|
||||
public List<EventReferenceWithStateDTO> getEventsOfSeriesSorted() {
|
||||
return eventsOfSeries;
|
||||
}
|
||||
|
||||
|
||||
+11
-8
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.gwt.home.communication.fakeseries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -13,11 +14,10 @@ import com.sap.sse.gwt.dispatch.shared.commands.Result;
|
||||
public class EventSeriesViewDTO implements Result, HasLogo {
|
||||
private UUID id;
|
||||
private String displayName;
|
||||
private ArrayList<EventMetadataDTO> events = new ArrayList<>();
|
||||
private ArrayList<EventMetadataDTO> eventsAscending = new ArrayList<>();
|
||||
private ImageDTO logoImage;
|
||||
private boolean hasMedia;
|
||||
private boolean hasAnalytics;
|
||||
|
||||
private String leaderboardId;
|
||||
|
||||
public enum EventSeriesState {
|
||||
@@ -36,9 +36,6 @@ public class EventSeriesViewDTO implements Result, HasLogo {
|
||||
|
||||
public EventSeriesState state;
|
||||
|
||||
public EventSeriesViewDTO() {
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -55,12 +52,18 @@ public class EventSeriesViewDTO implements Result, HasLogo {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public List<EventMetadataDTO> getEvents() {
|
||||
return events;
|
||||
public List<EventMetadataDTO> getEventsAscending() {
|
||||
return eventsAscending;
|
||||
}
|
||||
|
||||
public List<EventMetadataDTO> getEventsDescending() {
|
||||
ArrayList<EventMetadataDTO> eventsDescending = new ArrayList<>(eventsAscending);
|
||||
Collections.reverse(eventsDescending);
|
||||
return eventsDescending;
|
||||
}
|
||||
|
||||
public void addEvent(EventMetadataDTO event) {
|
||||
this.events.add(event);
|
||||
this.eventsAscending.add(event);
|
||||
}
|
||||
|
||||
public ImageDTO getLogoImage() {
|
||||
|
||||
+2
-18
@@ -1,9 +1,5 @@
|
||||
package com.sap.sailing.gwt.home.communication.fakeseries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
@@ -70,20 +66,8 @@ public class GetEventSeriesViewAction implements SailingAction<EventSeriesViewDT
|
||||
dto.setLeaderboardId(overallLeaderboardGroup.getOverallLeaderboard().getName());
|
||||
}
|
||||
|
||||
List<Event> fakeSeriesEvents = new ArrayList<Event>();
|
||||
for (Event event : ctx.getRacingEventService().getAllEvents()) {
|
||||
for (LeaderboardGroup leaderboardGroup : event.getLeaderboardGroups()) {
|
||||
if (overallLeaderboardGroup.equals(leaderboardGroup)) {
|
||||
fakeSeriesEvents.add(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
Collections.sort(fakeSeriesEvents, new Comparator<Event>() {
|
||||
public int compare(Event e1, Event e2) {
|
||||
return e1.getStartDate().compareTo(e2.getEndDate());
|
||||
}
|
||||
});
|
||||
for(Event eventInSeries: fakeSeriesEvents) {
|
||||
for (Event eventInSeries : HomeServiceUtil.getEventsForSeriesOrdered(overallLeaderboardGroup,
|
||||
ctx.getRacingEventService())) {
|
||||
EventMetadataDTO eventOfSeries = HomeServiceUtil.convertToMetadataDTO(eventInSeries, ctx.getRacingEventService());
|
||||
dto.addEvent(eventOfSeries);
|
||||
|
||||
|
||||
+2
-2
@@ -78,8 +78,8 @@ public class SeriesHeader extends Composite {
|
||||
eventName.setInnerText(series.getDisplayName());
|
||||
LabelTypeUtil.renderLabelType(eventState, series.getState().getStateMarker());
|
||||
|
||||
for (EventMetadataDTO eventOfSeries : series.getEvents()) {
|
||||
if(eventOfSeries.getState() == EventState.PLANNED) {
|
||||
for (EventMetadataDTO eventOfSeries : series.getEventsAscending()) {
|
||||
if (eventOfSeries.getState() == EventState.PLANNED) {
|
||||
InlineLabel eventLabel = new InlineLabel(eventOfSeries.getLocationOrVenue());
|
||||
eventLabel.addStyleName(SeriesHeaderResources.INSTANCE.css().eventheader_intro_details_item());
|
||||
eventLabel.addStyleName(SeriesHeaderResources.INSTANCE.css().eventheader_intro_details_item_inactive());
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class EventRegattaActivity extends AbstractEventActivity<AbstractEventReg
|
||||
public void forPlaceSelection(PlaceCallback callback) {
|
||||
EventViewDTO event = eventDTO;
|
||||
if (event.getType() == EventType.SERIES_EVENT) {
|
||||
for(EventReferenceWithStateDTO seriesEvent : event.getEventsOfSeries()) {
|
||||
for(EventReferenceWithStateDTO seriesEvent : event.getEventsOfSeriesSorted()) {
|
||||
if(seriesEvent.getState() != EventState.PLANNED) {
|
||||
AbstractEventRegattaPlace place = currentPlace.newInstanceWithContext(new EventContext().withId(seriesEvent.getId().toString()));
|
||||
callback.forPlace(place, seriesEvent.getDisplayName(), (event.getId().equals(seriesEvent.getId())));
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class SeriesEventsTabView extends Composite implements SeriesTabView<Seri
|
||||
public void start(SeriesEventsPlace myPlace, AcceptsOneWidget contentArea) {
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
|
||||
for (EventMetadataDTO eventOfSeries : currentPresenter.getSeriesDTO().getEvents()) {
|
||||
for (EventMetadataDTO eventOfSeries : currentPresenter.getSeriesDTO().getEventsDescending()) {
|
||||
if(eventOfSeries.getState() == EventState.PLANNED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class SeriesHeader extends Composite {
|
||||
LabelTypeUtil.renderLabelType(eventStateUi, event.getState().getStateMarker());
|
||||
StringBuilder locationsBuilder = new StringBuilder();
|
||||
boolean first = true;
|
||||
for (EventMetadataDTO eventOfSeries : event.getEvents()) {
|
||||
for (EventMetadataDTO eventOfSeries : event.getEventsAscending()) {
|
||||
if(!first) {
|
||||
locationsBuilder.append(", ");
|
||||
}
|
||||
|
||||
+3
-2
@@ -96,8 +96,9 @@ public abstract class AbstractEventActivity<PLACE extends AbstractEventPlace> ex
|
||||
if(showQuickfinder && event.getType() == EventType.MULTI_REGATTA) {
|
||||
view.setQuickFinderValues(getRegattasByLeaderboardGroupName());
|
||||
} else if(showQuickfinder && event.getType() == EventType.SERIES_EVENT) {
|
||||
List<EventReferenceWithStateDTO> seriesEventToShow = new ArrayList<>(event.getEventsOfSeries().size());
|
||||
for (EventReferenceWithStateDTO seriesEvent : event.getEventsOfSeries()) {
|
||||
List<EventReferenceWithStateDTO> eventsOfSeriesSorted = event.getEventsOfSeriesSorted();
|
||||
List<EventReferenceWithStateDTO> seriesEventToShow = new ArrayList<>(eventsOfSeriesSorted.size());
|
||||
for (EventReferenceWithStateDTO seriesEvent : eventsOfSeriesSorted) {
|
||||
if(seriesEvent.getState() != EventState.PLANNED) {
|
||||
seriesEventToShow.add(seriesEvent);
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class SeriesActivity extends AbstractActivity implements SeriesView.Prese
|
||||
|
||||
private void initUi(final AcceptsOneWidget panel, EventBus eventBus, EventSeriesViewDTO series) {
|
||||
final SeriesView view = new SeriesViewImpl(this);
|
||||
view.setQuickFinderValues(series.getDisplayName(), series.getEvents());
|
||||
view.setQuickFinderValues(series.getDisplayName(), series.getEventsDescending());
|
||||
panel.setWidget(view.asWidget());
|
||||
|
||||
initNavigationPath();
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class SeriesViewImpl extends Composite implements SeriesView {
|
||||
|
||||
private void setupEventListContent(EventSeriesViewDTO series) {
|
||||
boolean first = true;
|
||||
for(EventMetadataDTO eventOfSeries : series.getEvents()) {
|
||||
for(EventMetadataDTO eventOfSeries : series.getEventsDescending()) {
|
||||
if(eventOfSeries.getState() == EventState.PLANNED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class SeriesMiniOverallLeaderboardActivity extends AbstractActivity imple
|
||||
|
||||
private void initUi(AcceptsOneWidget panel, EventBus eventBus, EventSeriesViewDTO series) {
|
||||
final SeriesMiniOverallLeaderboardView view = new SeriesMiniOverallLeaderboardViewImpl(this);
|
||||
view.setQuickFinderValues(series.getDisplayName(), series.getEvents());
|
||||
view.setQuickFinderValues(series.getDisplayName(), series.getEventsDescending());
|
||||
panel.setWidget(view.asWidget());
|
||||
|
||||
initNavigationPath();
|
||||
|
||||
+87
-1
@@ -4,12 +4,15 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -386,7 +389,7 @@ public final class HomeServiceUtil {
|
||||
mapToMetadataDTO(event, dto, service);
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
public static EventLinkDTO convertToEventLinkDTO(EventBase event, URL baseURL, boolean onRemoteServer,
|
||||
RacingEventService service) {
|
||||
EventLinkDTO dto = new EventLinkDTO();
|
||||
@@ -566,4 +569,87 @@ public final class HomeServiceUtil {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the list of {@link Event}s for a series based on the given overall {@link LeaderboardGroup} in a
|
||||
* descending order sorted by the {@link Event#getStartDate() event's start date}.
|
||||
*
|
||||
* @param overallLeaderboardGroup the series overall {@link LeaderboardGroup}
|
||||
* @param service {@link RacingEventService}
|
||||
* @return the {@link Event}s for the series in descending od
|
||||
*/
|
||||
public static List<Event> getEventsForSeriesInDescendingOrder(LeaderboardGroup overallLeaderboardGroup,
|
||||
RacingEventService service) {
|
||||
List<Event> eventsForSeriesOrdered = getEventsForSeriesOrdered(overallLeaderboardGroup, service);
|
||||
Collections.reverse(eventsForSeriesOrdered);
|
||||
return eventsForSeriesOrdered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the list of {@link Event}s for a series based on the given overall {@link LeaderboardGroup} in an
|
||||
* order that matches the order of {@link Leaderboard Leaderboards} in the {@link LeaderboardGroup}.
|
||||
*
|
||||
* @param overallLeaderboardGroup the series overall {@link LeaderboardGroup}
|
||||
* @param service {@link RacingEventService}
|
||||
* @return the {@link Event}s for the series
|
||||
*/
|
||||
public static List<Event> getEventsForSeriesOrdered(LeaderboardGroup overallLeaderboardGroup,
|
||||
RacingEventService service) {
|
||||
final Iterable<Event> eventsInSeries = getEventsInSeries(overallLeaderboardGroup, service);
|
||||
final Iterable<Leaderboard> orderedLeaderboards = getLeaderboardsForSeriesInOrder(overallLeaderboardGroup);
|
||||
final List<Event> orderedEventsInSeries = new ArrayList<>();
|
||||
for (Leaderboard leaderboard : orderedLeaderboards) {
|
||||
final Event associatedEvent = getAssociatedEventForLeaderboardInSeries(leaderboard, eventsInSeries);
|
||||
if (associatedEvent != null) {
|
||||
orderedEventsInSeries.add(associatedEvent);
|
||||
}
|
||||
}
|
||||
return orderedEventsInSeries;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link Leaderboard Leaderboards} referenced in the given {@link LeaderboardGroup} have a defined order. If
|
||||
* the displayGroupsInReverseOrder flag is set for the {@link LeaderboardGroup}, the order needs to change in the
|
||||
* UI. This methods sorts the {@link Leaderboard Leaderboards} using this flag.
|
||||
*/
|
||||
public static Iterable<Leaderboard> getLeaderboardsForSeriesInOrder(LeaderboardGroup overallLeaderboardGroup) {
|
||||
if (overallLeaderboardGroup.isDisplayGroupsInReverseOrder()) {
|
||||
List<Leaderboard> leaderboardsInSeries = new ArrayList<>();
|
||||
Util.addAll(overallLeaderboardGroup.getLeaderboards(), leaderboardsInSeries);
|
||||
Collections.reverse(leaderboardsInSeries);
|
||||
return leaderboardsInSeries;
|
||||
}
|
||||
return overallLeaderboardGroup.getLeaderboards();
|
||||
}
|
||||
|
||||
private static Event getAssociatedEventForLeaderboardInSeries(Leaderboard leaderboard,
|
||||
Iterable<Event> eventsInSeries) {
|
||||
final CourseArea defaultCourseArea = leaderboard.getDefaultCourseArea();
|
||||
if (defaultCourseArea != null) {
|
||||
for (Event event : eventsInSeries) {
|
||||
if (Util.contains(event.getVenue().getCourseAreas(), defaultCourseArea)) {
|
||||
return event;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The given {@link LeaderboardGroup} needs to be one that is used to define a {@link Event} series (e.g. ESS or
|
||||
* Bundesliga). In this case, multiple {@link Event Events} reference the same {@link LeaderboardGroup}. This method
|
||||
* calculates all Events that are associated to the given {@link LeaderboardGroup}.
|
||||
*/
|
||||
private static Iterable<Event> getEventsInSeries(LeaderboardGroup overallLeaderboardGroup,
|
||||
RacingEventService service) {
|
||||
Set<Event> eventsInSeries = new HashSet<>();
|
||||
for (Event event : service.getAllEvents()) {
|
||||
for (LeaderboardGroup leaderboardGroup : event.getLeaderboardGroups()) {
|
||||
if (overallLeaderboardGroup.equals(leaderboardGroup)) {
|
||||
eventsInSeries.add(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
return eventsInSeries;
|
||||
}
|
||||
}
|
||||
+19
-6
@@ -303,6 +303,7 @@ import com.sap.sailing.domain.tractracadapter.TracTracAdapter;
|
||||
import com.sap.sailing.domain.tractracadapter.TracTracAdapterFactory;
|
||||
import com.sap.sailing.domain.tractracadapter.TracTracConfiguration;
|
||||
import com.sap.sailing.domain.tractracadapter.TracTracConnectionConstants;
|
||||
import com.sap.sailing.gwt.server.HomeServiceUtil;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.RaceLogSetTrackingTimesDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingService;
|
||||
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTrackDTO;
|
||||
@@ -3161,19 +3162,31 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<com.sap.sse.common.Util.Pair<String, String>> getLeaderboardsNamesOfMetaLeaderboard(String metaLeaderboardName) {
|
||||
public List<com.sap.sse.common.Util.Pair<String, String>> getLeaderboardsNamesOfMetaLeaderboard(
|
||||
String metaLeaderboardName) {
|
||||
Leaderboard leaderboard = getService().getLeaderboardByName(metaLeaderboardName);
|
||||
if (leaderboard == null) {
|
||||
throw new IllegalArgumentException("Couldn't find leaderboard named "+metaLeaderboardName);
|
||||
throw new IllegalArgumentException("Couldn't find leaderboard named " + metaLeaderboardName);
|
||||
}
|
||||
if (!(leaderboard instanceof MetaLeaderboard)) {
|
||||
throw new IllegalArgumentException("The leaderboard "+metaLeaderboardName + " is not a metaleaderboard");
|
||||
throw new IllegalArgumentException("The leaderboard " + metaLeaderboardName + " is not a metaleaderboard");
|
||||
}
|
||||
List<com.sap.sse.common.Util.Pair<String, String>> result = new ArrayList<com.sap.sse.common.Util.Pair<String, String>>();
|
||||
MetaLeaderboard metaLeaderboard = (MetaLeaderboard) leaderboard;
|
||||
for (Leaderboard containedLeaderboard: metaLeaderboard.getLeaderboards()) {
|
||||
LeaderboardGroup groupOrNull = null;
|
||||
for (LeaderboardGroup lg : getService().getLeaderboardGroups().values()) {
|
||||
if (metaLeaderboard.equals(lg.getOverallLeaderboard())) {
|
||||
groupOrNull = lg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If we could identify the associated LeaderboardGroup the Leaderboards can be sorted based on that group
|
||||
Iterable<Leaderboard> leaderBoards = groupOrNull != null
|
||||
? HomeServiceUtil.getLeaderboardsForSeriesInOrder(groupOrNull) : metaLeaderboard.getLeaderboards();
|
||||
List<com.sap.sse.common.Util.Pair<String, String>> result = new ArrayList<com.sap.sse.common.Util.Pair<String, String>>();
|
||||
for (Leaderboard containedLeaderboard : leaderBoards) {
|
||||
result.add(new com.sap.sse.common.Util.Pair<String, String>(containedLeaderboard.getName(),
|
||||
containedLeaderboard.getDisplayName() != null ? containedLeaderboard.getDisplayName() : containedLeaderboard.getName()));
|
||||
containedLeaderboard.getDisplayName() != null ? containedLeaderboard.getDisplayName()
|
||||
: containedLeaderboard.getName()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,17 @@
|
||||
<h2 class="releaseHeadline">Release Notes - Administration Console</h2>
|
||||
<div class="innerContent">
|
||||
|
||||
<h2 class="articleSubheadline">July 2017</h2>
|
||||
<ul class="bulletList">
|
||||
<li>The sort order of Events/Leaderboards in event series in Home.html is now more consistent
|
||||
by using the declared sort order in the respective LeaderboardGroup. In addition, the flag
|
||||
"Display groups in reverse order" in the LeaderboardGroup dialog now affects all occurrences
|
||||
of Events/Leaderboards in event series in Home.html. If the flag is not set, the order is
|
||||
latest on top in vertical lists and latest right in horizontal lists. With this change,
|
||||
the operator is now fully responsible for the sort order.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2 class="articleSubheadline">May 2017</h2>
|
||||
<ul class="bulletList">
|
||||
<li>The logic of the "Control tracking from start and finish times" check box now behaves slightly
|
||||
|
||||
Reference in new issue
Block a user