Merge branch 'master' into bug2825

This commit is contained in:
Axel Uhl committed 2016-06-13 10:56:47 +02:00
commit b199375825
30 files changed
+516 -376

No files matched your search

@@ -2632,7 +2632,8 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList());
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, id,
/* officialWebsiteURLAsString */null, /* sailorsInfoWebsiteURLAsString */null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(),
/* leaderboardGroupIds */ Collections.<UUID> emptyList()));
return result;
}
@@ -1,11 +1,14 @@
package com.sap.sailing.server.operationaltransformation;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import com.sap.sailing.domain.base.Event;
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
import com.sap.sailing.server.RacingEventService;
import com.sap.sailing.server.RacingEventServiceOperation;
import com.sap.sse.common.TimePoint;
@@ -31,9 +34,10 @@ public class CreateEvent extends AbstractEventOperation<Event> {
private final Iterable<VideoDescriptor> videos;
private final URL officialWebsiteURL;
private final Map<Locale, URL> sailorsInfoWebsiteURLs;
private final Iterable<UUID> leaderboardGroupIds;
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
boolean isPublic, UUID id, URL officialWebsiteURL, Map<Locale, URL> sailorsInfoWebsiteURLs, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos, Iterable<UUID> leaderboardGroupIds) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
@@ -45,6 +49,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
this.sailorsInfoWebsiteURLs = sailorsInfoWebsiteURLs;
this.images = images;
this.videos = videos;
this.leaderboardGroupIds = leaderboardGroupIds;
}
@Override
@@ -65,8 +70,17 @@ public class CreateEvent extends AbstractEventOperation<Event> {
@Override
public Event internalApplyTo(RacingEventService toState) {
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
final Event result = toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
getId(), officialWebsiteURL, sailorsInfoWebsiteURLs, images, videos);
List<LeaderboardGroup> lgl = new ArrayList<>();
for (final UUID lgid : leaderboardGroupIds) {
final LeaderboardGroup lg = toState.getLeaderboardGroupByID(lgid);
if (lg != null) {
lgl.add(lg);
}
}
result.setLeaderboardGroups(lgl);
return result;
}
}