set description when creating an event

This commit is contained in:
Axel Uhl committed 2014-08-27 15:23:11 +02:00
1 parent 683f6ab2b6
commit 00ba9172b3
14 files changed
+73 -69

No files matched your search

@@ -340,6 +340,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
*
* @param eventName
* The name of the new event
* @param eventDescription TODO
* @param startDate
* The start date of the event
* @param endDate
@@ -352,7 +353,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
* The name of the venue of the new event
* @return The new event
*/
Event addEvent(String eventName, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, UUID id);
Event addEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, UUID id);
/**
* Updates a sailing event with the name <code>eventName</code>, the venue<code>venue</code> and the regattas with
@@ -459,8 +460,8 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
*/
ConcurrentHashMap<String, Regatta> getPersistentRegattasForRaceIDs();
Event createEventWithoutReplication(String eventName, TimePoint startDate, TimePoint endDate, String venue, boolean isPublic,
UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL);
Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL);
void setRegattaForRace(Regatta regatta, String raceIdAsString);
@@ -2294,14 +2294,14 @@ public class RacingEventServiceImpl implements RacingEventServiceWithTestSupport
// Used for TESTING only
@Override
public Event addEvent(String eventName, TimePoint startDate, TimePoint endDate, String venue, boolean isPublic, UUID id) {
Event result = createEventWithoutReplication(eventName, startDate, endDate, venue, isPublic, id,
/* imageURLs */ Collections.<URL>emptyList(), /* videoURLs */ Collections.<URL>emptyList(),
/* sponsorImageURLs */ Collections.<URL>emptyList(), /* logoImageURL */ null, /* officialWebsiteURL */ null);
replicate(new CreateEvent(eventName, startDate, endDate, venue, isPublic, id, /* imageURLs */
Collections.<URL> emptyList(), /* videoURLs */Collections.<URL> emptyList(),
/* sponsorImageURLs */ Collections.<URL> emptyList(), /* logoimageURL */ null,
/* officialWebsiteURLAsString */ null));
public Event addEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue, boolean isPublic, UUID id) {
Event result = createEventWithoutReplication(eventName, eventDescription, startDate, endDate, venue, isPublic,
id, /* imageURLs */ Collections.<URL>emptyList(),
/* videoURLs */ Collections.<URL>emptyList(), /* sponsorImageURLs */ Collections.<URL>emptyList(), /* logoImageURL */ null, /* officialWebsiteURL */ null);
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, /* imageURLs */
id, Collections.<URL> emptyList(),
/* videoURLs */Collections.<URL> emptyList(), /* sponsorImageURLs */ Collections.<URL> emptyList(),
/* logoimageURL */ null, /* officialWebsiteURLAsString */ null));
return result;
}
@@ -2311,11 +2311,12 @@ public class RacingEventServiceImpl implements RacingEventServiceWithTestSupport
}
@Override
public Event createEventWithoutReplication(String eventName, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs,
Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL) {
public Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venue, boolean isPublic, UUID id, Iterable<URL> imageURLs,
Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL) {
Event result = new EventImpl(eventName, startDate, endDate, venue, isPublic, id);
addEvent(result);
result.setDescription(eventDescription);
result.setImageURLs(imageURLs);
result.setVideoURLs(videoURLs);
result.setSponsorImageURLs(sponsorImageURLs);
@@ -22,16 +22,18 @@ public class CreateEvent extends AbstractEventOperation<Event> {
private final TimePoint endDate;
private final boolean isPublic;
private final String eventName;
private final String eventDescription;
private final Iterable<URL> videoURLs;
private final Iterable<URL> imageURLs;
private final Iterable<URL> sponsorImageURLs;
private final URL logoImageURL;
private final URL officialWebsiteURL;
public CreateEvent(String eventName, TimePoint startDate, TimePoint endDate, String venue, boolean isPublic,
UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL) {
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, Iterable<URL> imageURLs, Iterable<URL> videoURLs, Iterable<URL> sponsorImageURLs, URL logoImageURL, URL officialWebsiteURL) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
this.startDate = startDate;
this.endDate = endDate;
this.venue = venue;
@@ -61,8 +63,8 @@ public class CreateEvent extends AbstractEventOperation<Event> {
@Override
public Event internalApplyTo(RacingEventService toState) {
return toState.createEventWithoutReplication(getEventName(), startDate, endDate, venue, isPublic, getId(),
imageURLs, videoURLs, sponsorImageURLs, logoImageURL, officialWebsiteURL);
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
getId(), imageURLs, videoURLs, sponsorImageURLs, logoImageURL, officialWebsiteURL);
}
}