From 0e85f3c32ddfd133872d724df74fbb75107c804f Mon Sep 17 00:00:00 2001 From: fmittag Date: Fri, 12 Jun 2015 17:39:29 +0200 Subject: [PATCH] removed methods to add or remove imageURL, sponsorImageURL and videoURLs as they are now derived always from the corresponding images and videos --- .../impl/DomainObjectFactoryImpl.java | 30 ------- .../sap/sailing/domain/base/EventBase.java | 42 --------- .../domain/base/impl/EventBaseImpl.java | 87 ++++++++++--------- .../test/CalculateImageSizeFromUrlTest.java | 17 ---- .../sailing/domain/base/impl/EventImpl.java | 30 +------ .../gwt/ui/server/SailingServiceImpl.java | 31 +------ ...estStoringAndLoadingEventsAndRegattas.java | 50 +++++++++-- .../impl/EventBaseJsonDeserializer.java | 47 ---------- .../test/EventDataJsonSerializerTest.java | 4 + ...tDataJsonSerializerWithNullValuesTest.java | 4 + ...NullStartAndEndDataJsonSerializerTest.java | 4 + .../server/test/MasterDataImportTest.java | 13 +-- .../server/test/SearchServiceTest.java | 8 +- .../sailing/server/RacingEventService.java | 6 +- .../server/impl/RacingEventServiceImpl.java | 20 +---- .../CreateEvent.java | 11 +-- .../UpdateEvent.java | 11 +-- 17 files changed, 115 insertions(+), 300 deletions(-) diff --git a/java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/DomainObjectFactoryImpl.java b/java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/DomainObjectFactoryImpl.java index 79571ec4c37..ca1da867877 100644 --- a/java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/DomainObjectFactoryImpl.java +++ b/java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/impl/DomainObjectFactoryImpl.java @@ -1053,36 +1053,6 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory { logger.severe("Error parsing logo image URL "+logoImageURLAsString+" for event "+name+". Ignoring this URL."); } } - BasicDBList imageURLs = (BasicDBList) eventDBObject.get(FieldNames.EVENT_IMAGE_URLS.name()); - if (imageURLs != null) { - for (Object imageURL : imageURLs) { - try { - result.addImageURL(new URL((String) imageURL)); - } catch (MalformedURLException e) { - logger.severe("Error parsing image URL "+imageURL+" for event "+name+". Ignoring this image URL."); - } - } - } - BasicDBList videoURLs = (BasicDBList) eventDBObject.get(FieldNames.EVENT_VIDEO_URLS.name()); - if (videoURLs != null) { - for (Object videoURL : videoURLs) { - try { - result.addVideoURL(new URL((String) videoURL)); - } catch (MalformedURLException e) { - logger.severe("Error parsing video URL "+videoURL+" for event "+name+". Ignoring this video URL."); - } - } - } - BasicDBList sponsorImageURLs = (BasicDBList) eventDBObject.get(FieldNames.EVENT_SPONSOR_IMAGE_URLS.name()); - if (sponsorImageURLs != null) { - for (Object sponsorImageURL : sponsorImageURLs) { - try { - result.addSponsorImageURL(new URL((String) sponsorImageURL)); - } catch (MalformedURLException e) { - logger.severe("Error parsing sponsor image URL "+sponsorImageURL+" for event "+name+". Ignoring this sponsor image URL."); - } - } - } BasicDBList images = (BasicDBList) eventDBObject.get(FieldNames.EVENT_IMAGES.name()); if (images != null) { for (Object imageObject : images) { diff --git a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/EventBase.java b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/EventBase.java index a151375553a..a2a5668b5bf 100644 --- a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/EventBase.java +++ b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/EventBase.java @@ -49,10 +49,6 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi */ Iterable getImageURLs(); - void addImageURL(URL imageURL); - - void removeImageURL(URL imageURL); - /** * An event may have zero or more sponsors, each of which usually want to see their logo on the web page. * @@ -60,20 +56,6 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi */ Iterable getSponsorImageURLs(); - void addSponsorImageURL(URL sponsorImageURL); - - void removeSponsorImageURL(URL sponsorImageURL); - - /** - * Replaces the {@link #getSponsorImageURLs() current contents of the sponsorship image URL sequence} by the image URLs in - * sponsorImageURLs. - * - * @param sponsorImageURLs - * if null, the internal sequence of sponsorship image URLs is cleared but remains valid (non- - * null) - */ - void setSponsorImageURLs(Iterable sponsorImageURLs); - /** * An optional logo image; may return null. */ @@ -81,16 +63,6 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi void setLogoImageURL(URL logoImageURL); - /** - * Replaces the {@link #getImageURLs() current contents of the image URL sequence} by the image URLs in - * imageURLs. - * - * @param imageURLs - * if null, the internal sequence of image URLs is cleared but remains valid (non- - * null) - */ - void setImageURLs(Iterable imageURLs); - /** * Returns a non-null live but unmodifiable collection of URLs pointing to video resources that can be * used to represent the event, e.g., on a web page. @@ -98,21 +70,7 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi * @return a non-null value which may be empty */ Iterable getVideoURLs(); - - void addVideoURL(URL videoURL); - - void removeVideoURL(URL videoURL); - /** - * Replaces the {@link #getVideoURLs() current contents of the video URL sequence} by the video URLs in - * videoURLs. - * - * @param videoURLs - * if null, the internal sequence of image URLs is cleared but remains valid (non- - * null) - */ - void setVideoURLs(Iterable videoURLs); - /** * @return the URL of the event's official web site, or null if such a site does not exist or its URL * is not known diff --git a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/impl/EventBaseImpl.java b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/impl/EventBaseImpl.java index da81953006a..adcf351a5ac 100644 --- a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/impl/EventBaseImpl.java +++ b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/base/impl/EventBaseImpl.java @@ -3,7 +3,9 @@ package com.sap.sailing.domain.base.impl; import java.io.IOException; import java.io.ObjectInputStream; import java.net.URL; +import java.util.ArrayList; import java.util.Collections; +import java.util.List; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; @@ -12,6 +14,8 @@ import com.sap.sailing.domain.base.Venue; import com.sap.sse.common.TimePoint; import com.sap.sse.common.Util; import com.sap.sse.common.media.ImageDescriptor; +import com.sap.sse.common.media.MediaDescriptor; +import com.sap.sse.common.media.MediaTagConstants; import com.sap.sse.common.media.VideoDescriptor; public abstract class EventBaseImpl implements EventBase { @@ -52,6 +56,7 @@ public abstract class EventBaseImpl implements EventBase { this.sponsorImageURLs = new ConcurrentLinkedQueue(); this.images = new ConcurrentLinkedQueue(); this.videos = new ConcurrentLinkedQueue(); + syncImageAndVideoURLsForBackwardCompatibility(); } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { @@ -143,20 +148,7 @@ public abstract class EventBaseImpl implements EventBase { return Collections.unmodifiableCollection(imageURLs); } - @Override - public void addImageURL(URL imageURL) { - if (!imageURLs.contains(imageURL)) { - imageURLs.add(imageURL); - } - } - - @Override - public void removeImageURL(URL imageURL) { - imageURLs.remove(imageURL); - } - - @Override - public void setImageURLs(Iterable imageURLs) { + protected void setImageURLs(Iterable imageURLs) { this.imageURLs.clear(); if (imageURLs != null) { Util.addAll(imageURLs, this.imageURLs); @@ -168,20 +160,7 @@ public abstract class EventBaseImpl implements EventBase { return Collections.unmodifiableCollection(videoURLs); } - @Override - public void addVideoURL(URL videoURL) { - if (!videoURLs.contains(videoURL)) { - videoURLs.add(videoURL); - } - } - - @Override - public void removeVideoURL(URL videoURL) { - videoURLs.remove(videoURL); - } - - @Override - public void setVideoURLs(Iterable videoURLs) { + private void setVideoURLs(Iterable videoURLs) { this.videoURLs.clear(); if (videoURLs != null) { Util.addAll(videoURLs, this.videoURLs); @@ -193,20 +172,7 @@ public abstract class EventBaseImpl implements EventBase { return Collections.unmodifiableCollection(sponsorImageURLs); } - @Override - public void addSponsorImageURL(URL sponsorImageURL) { - if (!sponsorImageURLs.contains(sponsorImageURL)) { - sponsorImageURLs.add(sponsorImageURL); - } - } - - @Override - public void removeSponsorImageURL(URL sponsorImageURL) { - sponsorImageURLs.remove(sponsorImageURL); - } - - @Override - public void setSponsorImageURLs(Iterable sponsorImageURLs) { + protected void setSponsorImageURLs(Iterable sponsorImageURLs) { this.sponsorImageURLs.clear(); if (sponsorImageURLs != null) { Util.addAll(sponsorImageURLs, this.sponsorImageURLs); @@ -242,12 +208,14 @@ public abstract class EventBaseImpl implements EventBase { public void addImage(ImageDescriptor image) { if (!images.contains(image)) { images.add(image); + syncImageURLsFromImagesForBackwardCompatibility(); } } @Override public void removeImage(ImageDescriptor image) { images.remove(image); + syncImageURLsFromImagesForBackwardCompatibility(); } @Override @@ -255,6 +223,7 @@ public abstract class EventBaseImpl implements EventBase { this.images.clear(); if (images != null) { Util.addAll(images, this.images); + syncImageURLsFromImagesForBackwardCompatibility(); } } @@ -267,12 +236,14 @@ public abstract class EventBaseImpl implements EventBase { public void addVideo(VideoDescriptor video) { if (!videos.contains(video)) { videos.add(video); + syncVideoURLsFromVideosForBackwardCompatibility(); } } @Override public void removeVideo(VideoDescriptor video) { videos.remove(video); + syncVideoURLsFromVideosForBackwardCompatibility(); } @Override @@ -280,6 +251,38 @@ public abstract class EventBaseImpl implements EventBase { this.videos.clear(); if (videos != null) { Util.addAll(videos, this.videos); + syncVideoURLsFromVideosForBackwardCompatibility(); } } + + private void syncImageURLsFromImagesForBackwardCompatibility() { + List imageURLs = createURLsFromMedia(images, MediaTagConstants.SPONSOR, null); + List sponsorImageURLs = createURLsFromMedia(images, null, MediaTagConstants.SPONSOR); + setImageURLs(imageURLs); + setSponsorImageURLs(sponsorImageURLs); + } + + private void syncVideoURLsFromVideosForBackwardCompatibility() { + List videoURLs = createURLsFromMedia(videos, null, null); + setVideoURLs(videoURLs); + } + + private void syncImageAndVideoURLsForBackwardCompatibility() { + syncImageURLsFromImagesForBackwardCompatibility(); + syncVideoURLsFromVideosForBackwardCompatibility(); + } + + private List createURLsFromMedia(Iterable media, String blacklistTag, String whitelistTag) { + List result = new ArrayList<>(); + for (MediaDescriptor mediaEntry : media) { + if (blacklistTag != null && Util.contains(mediaEntry.getTags(), blacklistTag)) { + continue; + } + if (whitelistTag != null && !Util.contains(mediaEntry.getTags(), whitelistTag)) { + continue; + } + result.add(mediaEntry.getURL()); + } + return result; + } } diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CalculateImageSizeFromUrlTest.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CalculateImageSizeFromUrlTest.java index 189d2d08dcb..4612ea26bf5 100644 --- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CalculateImageSizeFromUrlTest.java +++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CalculateImageSizeFromUrlTest.java @@ -1,15 +1,11 @@ package com.sap.sailing.domain.test; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.Iterator; -import java.util.UUID; -import java.util.concurrent.ExecutionException; import javax.imageio.ImageIO; import javax.imageio.ImageReader; @@ -17,8 +13,6 @@ import javax.imageio.stream.ImageInputStream; import org.junit.Test; -import com.sap.sailing.domain.base.Event; -import com.sap.sailing.domain.base.impl.EventImpl; import com.sap.sailing.domain.common.impl.ImageSizeImpl; import com.sap.sse.common.media.ImageSize; @@ -56,15 +50,4 @@ public class CalculateImageSizeFromUrlTest { } return null; } - - @Test - public void testEventImageSize() throws MalformedURLException, InterruptedException, ExecutionException { - Event e = new EventImpl("Event Name", /* startDate */ null, /* endDate */ null, "Kiel", /* isPublic */ true, UUID.randomUUID()); - int width = Math.max(10, (int) (200. * Math.random())); - int height = Math.max(10, (int) (100. * Math.random())); - URL imageURL = new URL("http://placekitten.com/" + width + "/" + height); - e.addImageURL(imageURL); - ImageSize expectedSize = new ImageSizeImpl(width, height); - assertEquals(expectedSize, e.getImageSize(imageURL)); - } } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/impl/EventImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/impl/EventImpl.java index 19d1fa73ce0..156c317ffc6 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/impl/EventImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/impl/EventImpl.java @@ -150,12 +150,6 @@ public class EventImpl extends EventBaseImpl implements Event { return imageSizeCalculator.get(); } - @Override - public void addImageURL(URL imageURL) { - super.addImageURL(imageURL); - refreshImageSizeFetcher(imageURL); - } - private void refreshImageSizeFetcher(URL imageURL) { if (imageURL != null) { removeImageSizeFetcher(imageURL); @@ -163,20 +157,13 @@ public class EventImpl extends EventBaseImpl implements Event { } } - @Override - public void removeImageURL(URL imageURL) { - super.removeImageURL(imageURL); - removeImageSizeFetcher(imageURL); - } - private void removeImageSizeFetcher(URL imageURL) { if (imageURL != null) { imageSizeFetchers.remove(imageURL); } } - @Override - public void setImageURLs(Iterable imageURLs) { + protected void setImageURLs(Iterable imageURLs) { super.setImageURLs(imageURLs); if (imageURLs != null) { for (URL imageURL : imageURLs) { @@ -185,20 +172,7 @@ public class EventImpl extends EventBaseImpl implements Event { } } - @Override - public void addSponsorImageURL(URL sponsorImageURL) { - super.addSponsorImageURL(sponsorImageURL); - refreshImageSizeFetcher(sponsorImageURL); - } - - @Override - public void removeSponsorImageURL(URL sponsorImageURL) { - super.removeSponsorImageURL(sponsorImageURL); - removeImageSizeFetcher(sponsorImageURL); - } - - @Override - public void setSponsorImageURLs(Iterable sponsorImageURLs) { + protected void setSponsorImageURLs(Iterable sponsorImageURLs) { super.setSponsorImageURLs(sponsorImageURLs); if (sponsorImageURLs != null) { for (URL imageURL : sponsorImageURLs) { diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java index 9dd06f864a4..de926139f81 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java @@ -433,7 +433,6 @@ import com.sap.sse.common.impl.TimeRangeImpl; import com.sap.sse.common.mail.MailException; import com.sap.sse.common.media.ImageDescriptor; import com.sap.sse.common.media.ImageDescriptorImpl; -import com.sap.sse.common.media.MediaTagConstants; import com.sap.sse.common.media.MediaUtils; import com.sap.sse.common.media.MimeType; import com.sap.sse.common.media.VideoDescriptor; @@ -442,7 +441,6 @@ import com.sap.sse.common.search.KeywordQuery; import com.sap.sse.common.search.Result; import com.sap.sse.filestorage.FileStorageService; import com.sap.sse.filestorage.InvalidPropertiesException; -import com.sap.sse.gwt.client.media.AbstractMediaDTO; import com.sap.sse.gwt.client.media.ImageDTO; import com.sap.sse.gwt.client.media.VideoDTO; import com.sap.sse.gwt.server.filestorage.FileStorageServiceDTOUtils; @@ -3307,37 +3305,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S TimePoint endTimePoint = endDate != null ? new MillisecondsTimePoint(endDate) : null; URL officialWebsiteURL = officialWebsiteURLString != null ? new URL(officialWebsiteURLString) : null; URL logoImageURL = logoImageURLString != null ? new URL(logoImageURLString) : null; - List imageURLs = createURLsFromMedia(images, MediaTagConstants.SPONSOR, null); - List videoURLs = createURLsFromMedia(videos, null, null); - List sponsorImageURLs = createURLsFromMedia(images, null, MediaTagConstants.SPONSOR); List eventImages = convertToImages(images); List eventVideos = convertToVideos(videos); getService().apply( new UpdateEvent(eventId, eventName, eventDescription, startTimePoint, endTimePoint, venue.getName(), - isPublic, leaderboardGroupIds, logoImageURL, officialWebsiteURL, imageURLs, videoURLs, - sponsorImageURLs, eventImages, eventVideos)); + isPublic, leaderboardGroupIds, logoImageURL, officialWebsiteURL, eventImages, eventVideos)); return getEventById(eventId, false); } - /** - * @param urlStrings - * @return - * @throws MalformedURLException - */ - private List createURLsFromMedia(Iterable media, String blacklistTag, String whilelistTag) throws MalformedURLException { - List result = new ArrayList<>(); - for (AbstractMediaDTO mediaEntry : media) { - if(blacklistTag != null && mediaEntry.getTags().contains(blacklistTag)) { - continue; - } - if(whilelistTag != null && !mediaEntry.getTags().contains(whilelistTag)) { - continue; - } - result.add(new URL(mediaEntry.getSourceRef())); - } - return result; - } - @Override public EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue, boolean isPublic, List courseAreaNames, Iterable images, Iterable videos, @@ -3346,14 +3321,10 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S UUID eventUuid = UUID.randomUUID(); TimePoint startTimePoint = startDate != null ? new MillisecondsTimePoint(startDate) : null; TimePoint endTimePoint = endDate != null ? new MillisecondsTimePoint(endDate) : null; - List imageURLs = createURLsFromMedia(images, MediaTagConstants.SPONSOR, null); - List videoURLs = createURLsFromMedia(videos, null, null); - List sponsorImageURLs = createURLsFromMedia(images, null, MediaTagConstants.SPONSOR); List eventImages = convertToImages(images); List eventVideos = convertToVideos(videos); getService().apply( new CreateEvent(eventName, eventDescription, startTimePoint, endTimePoint, venue, isPublic, eventUuid, - imageURLs, videoURLs, sponsorImageURLs, eventImages, eventVideos, logoImageURLAsString == null ? null : new URL(logoImageURLAsString), officialWebsiteURLAsString == null ? null : new URL(officialWebsiteURLAsString))); diff --git a/java/com.sap.sailing.mongodb.test/src/com/sap/sailing/mongodb/test/TestStoringAndLoadingEventsAndRegattas.java b/java/com.sap.sailing.mongodb.test/src/com/sap/sailing/mongodb/test/TestStoringAndLoadingEventsAndRegattas.java index 7f300ad846d..376f92c6694 100755 --- a/java/com.sap.sailing.mongodb.test/src/com/sap/sailing/mongodb/test/TestStoringAndLoadingEventsAndRegattas.java +++ b/java/com.sap.sailing.mongodb.test/src/com/sap/sailing/mongodb/test/TestStoringAndLoadingEventsAndRegattas.java @@ -143,12 +143,6 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest event.addLeaderboardGroup(lg1); event.addLeaderboardGroup(lg2); event.setDescription(eventDescription); - event.addImageURL(new URL("http://some.host/with/some/file1.jpg")); - event.addImageURL(new URL("http://some.host/with/some/file2.jpg")); - event.addVideoURL(new URL("http://some.host/with/some/file1.mp4")); - event.addVideoURL(new URL("http://some.host/with/some/file2.mp4")); - event.addSponsorImageURL(new URL("http://some.host/with/some/file4.mp4")); - event.addSponsorImageURL(new URL("http://some.host/with/some/file5.mp4")); event.setOfficialWebsiteURL(new URL("http://official.website.com")); event.setLogoImageURL(new URL("http://official.logo.com")); mof.storeEvent(event); @@ -188,9 +182,6 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest for (CourseArea loadedCourseArea : loadedVenue.getCourseAreas()) { assertEquals(courseAreaNames[i++], loadedCourseArea.getName()); } - assertTrue("image URLs "+loadedEvent.getImageURLs()+" but expected "+event.getImageURLs(), Util.equals(event.getImageURLs(), loadedEvent.getImageURLs())); - assertTrue("video URLs "+loadedEvent.getVideoURLs()+" but expected "+event.getVideoURLs(), Util.equals(event.getVideoURLs(), loadedEvent.getVideoURLs())); - assertTrue("sponsor image URLs "+loadedEvent.getSponsorImageURLs()+" but expected "+event.getSponsorImageURLs(), Util.equals(event.getSponsorImageURLs(), loadedEvent.getSponsorImageURLs())); } @Test @@ -330,6 +321,47 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest assertEquals(3, Util.size(loadedVideo1.getTags())); } + @Test + /** + * We expected that the migration code creates also an image URL for each image we create. + * Images with the 'Sponsor' tag should create a corresponding sponsor image URL + * Videos should create a video URL. + */ + public void testLoadStoreSimpleEventWithImageAndVideoURLMigration() throws MalformedURLException { + final URL imageURL = new URL("http://some.host/with/some/bla.jpg"); + final URL sponsorImageURL = new URL("http://some.host/with/some/sponsor.jpg"); + final URL videoURL = new URL("http://some.host/with/some/video.mpg"); + final TimePoint createdAt = MillisecondsTimePoint.now(); + final String eventName = "Event Name"; + final Venue venue = new VenueImpl("My Venue"); + CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Alfa"); + venue.addCourseArea(courseArea); + + MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService()); + Event event = new EventImpl(eventName, eventStartDate, eventEndDate, venue, /*isPublic*/ true, UUID.randomUUID()); + + ImageDescriptor image1 = new ImageDescriptorImpl(imageURL, createdAt); + event.addImage(image1); + + ImageDescriptor image2 = new ImageDescriptorImpl(sponsorImageURL, createdAt); + event.addImage(image2); + image2.addTag("Sponsor"); + + VideoDescriptor video1 = new VideoDescriptorImpl(videoURL, MimeType.mp4, createdAt); + event.addVideo(video1); + + mof.storeEvent(event); + + DomainObjectFactory dof = PersistenceFactory.INSTANCE.getDomainObjectFactory(getMongoService(), DomainFactory.INSTANCE); + final Event loadedEvent = dof.loadEvent(eventName); + assertEquals(2, Util.size(loadedEvent.getImages())); + assertEquals(1, Util.size(loadedEvent.getImageURLs())); + assertEquals(1, Util.size(loadedEvent.getSponsorImageURLs())); + assertEquals(1, Util.size(loadedEvent.getVideos())); + assertEquals(1, Util.size(loadedEvent.getVideoURLs())); + } + + @Test public void testLoadStoreRegattaConfiguration() { diff --git a/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/deserialization/impl/EventBaseJsonDeserializer.java b/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/deserialization/impl/EventBaseJsonDeserializer.java index cd6b856b4c2..63938a54f22 100644 --- a/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/deserialization/impl/EventBaseJsonDeserializer.java +++ b/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/deserialization/impl/EventBaseJsonDeserializer.java @@ -14,7 +14,6 @@ import com.sap.sailing.domain.base.EventBase; import com.sap.sailing.domain.base.LeaderboardGroupBase; import com.sap.sailing.domain.base.Venue; import com.sap.sailing.domain.base.impl.StrippedEventImpl; -import com.sap.sailing.domain.common.impl.ImageSizeImpl; import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException; import com.sap.sailing.server.gateway.deserialization.JsonDeserializer; import com.sap.sailing.server.gateway.serialization.impl.EventBaseJsonSerializer; @@ -74,42 +73,6 @@ public class EventBaseJsonDeserializer implements JsonDeserializer { throw new JsonDeserializationException("Error deserializing logo image URL for event "+name, e); } } - if (eventJson.get(EventBaseJsonSerializer.FIELD_IMAGE_URLS) != null) { - try { - result.setImageURLs(getURLsFromStrings(Helpers.getNestedArraySafe(eventJson, EventBaseJsonSerializer.FIELD_IMAGE_URLS))); - } catch (MalformedURLException e) { - throw new JsonDeserializationException("Error deserializing image URLs for event "+name, e); - } - } - if (eventJson.get(EventBaseJsonSerializer.FIELD_VIDEO_URLS) != null) { - try { - result.setVideoURLs(getURLsFromStrings(Helpers.getNestedArraySafe(eventJson, EventBaseJsonSerializer.FIELD_VIDEO_URLS))); - } catch (MalformedURLException e) { - throw new JsonDeserializationException("Error deserializing video URLs for event "+name, e); - } - } - if (eventJson.get(EventBaseJsonSerializer.FIELD_SPONSOR_IMAGE_URLS) != null) { - try { - result.setSponsorImageURLs(getURLsFromStrings(Helpers.getNestedArraySafe(eventJson, EventBaseJsonSerializer.FIELD_SPONSOR_IMAGE_URLS))); - } catch (MalformedURLException e) { - throw new JsonDeserializationException("Error deserializing sponsor image URLs for event "+name, e); - } - } - JSONArray imageSizes = (JSONArray) eventJson.get(EventBaseJsonSerializer.FIELD_IMAGE_SIZES); - if (imageSizes != null) { - for (Object imageURLAndSizeObject : imageSizes) { - JSONObject imageURLAndSizeJson = (JSONObject) imageURLAndSizeObject; - try { - result.setImageSize( - new URL((String) imageURLAndSizeJson.get(EventBaseJsonSerializer.FIELD_IMAGE_URL)), - new ImageSizeImpl( - ((Number) imageURLAndSizeJson.get(EventBaseJsonSerializer.FIELD_IMAGE_WIDTH)).intValue(), - ((Number) imageURLAndSizeJson.get(EventBaseJsonSerializer.FIELD_IMAGE_HEIGHT)).intValue())); - } catch (MalformedURLException e) { - throw new JsonDeserializationException(e); - } - } - } JSONArray imagesJson = (JSONArray) eventJson.get(EventBaseJsonSerializer.FIELD_IMAGES); if (imagesJson != null) { for (Object imageJson : imagesJson) { @@ -198,14 +161,4 @@ public class EventBaseJsonDeserializer implements JsonDeserializer { } return video; } - - private Iterable getURLsFromStrings(JSONArray strings) throws MalformedURLException { - List result = new ArrayList(); - if (strings != null) { - for (Object string : strings) { - result.add(new URL(string.toString())); - } - } - return result; - } } diff --git a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerTest.java b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerTest.java index 9351a3dcd5b..04f590c68d3 100755 --- a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerTest.java +++ b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerTest.java @@ -32,6 +32,8 @@ import com.sap.sailing.server.gateway.serialization.impl.LeaderboardGroupBaseJso import com.sap.sailing.server.gateway.serialization.impl.VenueJsonSerializer; import com.sap.sse.common.TimePoint; import com.sap.sse.common.impl.MillisecondsTimePoint; +import com.sap.sse.common.media.ImageDescriptor; +import com.sap.sse.common.media.VideoDescriptor; public class EventDataJsonSerializerTest { protected final UUID expectedId = UUID.randomUUID(); @@ -70,6 +72,8 @@ public class EventDataJsonSerializerTest { when(event.getImageURLs()).thenReturn(Collections.emptySet()); when(event.getVideoURLs()).thenReturn(Collections.emptySet()); when(event.getSponsorImageURLs()).thenReturn(Collections.emptySet()); + when(event.getImages()).thenReturn(Collections.emptySet()); + when(event.getVideos()).thenReturn(Collections.emptySet()); // ... and the serializer itself. serializer = new EventBaseJsonSerializer(new VenueJsonSerializer(new CourseAreaJsonSerializer()), new LeaderboardGroupBaseJsonSerializer()); deserializer = new EventBaseJsonDeserializer(new VenueJsonDeserializer(new CourseAreaJsonDeserializer(DomainFactory.INSTANCE)), new LeaderboardGroupBaseJsonDeserializer()); diff --git a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerWithNullValuesTest.java b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerWithNullValuesTest.java index 3bee26cc81a..98e786ed6bb 100755 --- a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerWithNullValuesTest.java +++ b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventDataJsonSerializerWithNullValuesTest.java @@ -32,6 +32,8 @@ import com.sap.sailing.server.gateway.serialization.impl.LeaderboardGroupBaseJso import com.sap.sailing.server.gateway.serialization.impl.VenueJsonSerializer; import com.sap.sse.common.TimePoint; import com.sap.sse.common.impl.MillisecondsTimePoint; +import com.sap.sse.common.media.ImageDescriptor; +import com.sap.sse.common.media.VideoDescriptor; public class EventDataJsonSerializerWithNullValuesTest { protected final UUID expectedId = UUID.randomUUID(); @@ -65,6 +67,8 @@ public class EventDataJsonSerializerWithNullValuesTest { when(event.getImageURLs()).thenReturn(Collections.emptySet()); when(event.getVideoURLs()).thenReturn(Collections.emptySet()); when(event.getSponsorImageURLs()).thenReturn(Collections.emptySet()); + when(event.getImages()).thenReturn(Collections.emptySet()); + when(event.getVideos()).thenReturn(Collections.emptySet()); // ... and the serializer itself. serializer = new EventBaseJsonSerializer(new VenueJsonSerializer(new CourseAreaJsonSerializer()), new LeaderboardGroupBaseJsonSerializer()); deserializer = new EventBaseJsonDeserializer(new VenueJsonDeserializer(new CourseAreaJsonDeserializer(DomainFactory.INSTANCE)), new LeaderboardGroupBaseJsonDeserializer()); diff --git a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventWithNullStartAndEndDataJsonSerializerTest.java b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventWithNullStartAndEndDataJsonSerializerTest.java index ddfc72afdf7..0d4763a4c35 100755 --- a/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventWithNullStartAndEndDataJsonSerializerTest.java +++ b/java/com.sap.sailing.server.gateway.serialization.test/src/com/sap/sailing/server/gateway/serialization/test/EventWithNullStartAndEndDataJsonSerializerTest.java @@ -31,6 +31,8 @@ import com.sap.sailing.server.gateway.serialization.impl.EventBaseJsonSerializer import com.sap.sailing.server.gateway.serialization.impl.LeaderboardGroupBaseJsonSerializer; import com.sap.sailing.server.gateway.serialization.impl.VenueJsonSerializer; import com.sap.sse.common.TimePoint; +import com.sap.sse.common.media.ImageDescriptor; +import com.sap.sse.common.media.VideoDescriptor; public class EventWithNullStartAndEndDataJsonSerializerTest { @@ -74,6 +76,8 @@ public class EventWithNullStartAndEndDataJsonSerializerTest { when(event.getImageURLs()).thenReturn(Collections.emptySet()); when(event.getVideoURLs()).thenReturn(Collections.emptySet()); when(event.getSponsorImageURLs()).thenReturn(Collections.emptySet()); + when(event.getImages()).thenReturn(Collections.emptySet()); + when(event.getVideos()).thenReturn(Collections.emptySet()); doReturn(expectedLeaderboardGroups).when(event).getLeaderboardGroups(); // ... and the serializer itself. diff --git a/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/MasterDataImportTest.java b/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/MasterDataImportTest.java index 879448b4f33..98a87800c54 100755 --- a/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/MasterDataImportTest.java +++ b/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/MasterDataImportTest.java @@ -12,7 +12,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Serializable; import java.net.MalformedURLException; -import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -1328,12 +1327,8 @@ public class MasterDataImportTest { InterruptedException, ClassNotFoundException { RacingEventService sourceService = new RacingEventServiceImpl(); - Iterable imageURLs = new HashSet<>(); - Iterable videoURLs = new HashSet<>(); - Iterable sponsorImageURLs = new HashSet<>(); Event event = sourceService.createEventWithoutReplication("Test Event", /* eventDescription */ null, - new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(), imageURLs, - videoURLs, sponsorImageURLs, + new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(), /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoImageURL */ null, /* officialWebsiteURL */ null); CourseArea defaultCourseArea = sourceService.addCourseArea(event.getId(), "ECHO", UUID.randomUUID()); @@ -1397,12 +1392,8 @@ public class MasterDataImportTest { // Setup source service RacingEventService sourceService = new RacingEventServiceImpl(); - Iterable imageURLs = new HashSet<>(); - Iterable videoURLs = new HashSet<>(); - Iterable sponsorImageURLs = new HashSet<>(); Event event = sourceService.createEventWithoutReplication("Test Event", /* eventDescription */ null, - new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(), imageURLs, - videoURLs, sponsorImageURLs, + new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(), /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoImageURL */ null, /* officialWebsiteURL */ null); CourseArea defaultCourseArea = sourceService.addCourseArea(event.getId(), "ECHO", UUID.randomUUID()); diff --git a/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/SearchServiceTest.java b/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/SearchServiceTest.java index a1751a5fa21..0a580da67d7 100755 --- a/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/SearchServiceTest.java +++ b/java/com.sap.sailing.server.test/src/com/sap/sailing/server/test/SearchServiceTest.java @@ -5,7 +5,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -121,9 +120,7 @@ public class SearchServiceTest { cal.set(2014, 5, 8, 16, 00); final TimePoint pfingstbuschEndDate = new MillisecondsTimePoint(cal.getTime()); pfingstbusch = server.apply(new CreateEvent("Pfingsbusch", /* eventDescription */ null, pfingstbuschStartDate, pfingstbuschEndDate, /* isPublic */ - "Kiel", true, UUID.randomUUID(), Collections.emptySet(), - Collections.emptySet(), /* sponsorImageURLs */ Collections.emptySet(), - /* images */Collections. emptyList(), /* videos */Collections. emptyList(), + "Kiel", true, UUID.randomUUID(), /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoImageURLAsString */ null, /* officialWebsiteURLAsString */ null)); kiel = pfingstbusch.getVenue(); final CourseAreaImpl kielAlpha = new CourseAreaImpl("Alpha", UUID.randomUUID()); @@ -157,8 +154,7 @@ public class SearchServiceTest { cal.set(2014, 5, 8, 18, 00); final TimePoint aalEndDate = new MillisecondsTimePoint(cal.getTime()); aalEvent = server.apply(new CreateEvent("Aalregatta", /* eventDescription */ null, aalStartDate, aalEndDate, /* isPublic */ - "Flensburg", true, UUID.randomUUID(), Collections.emptySet(), - Collections.emptySet(), /* sponsorImageURLs */ Collections.emptySet(), + "Flensburg", true, UUID.randomUUID(), /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoimageURL */ null, /* officialWebsiteURLAsString */ null)); flensburg = aalEvent.getVenue(); diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/RacingEventService.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/RacingEventService.java index 55b20ed8323..c19f8dddd99 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/RacingEventService.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/RacingEventService.java @@ -371,8 +371,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch */ void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, Iterable leaderboardGroupIds, URL officialWebsiteURL, - URL logoImageURL, Iterable imageURLs, Iterable videoURLs, Iterable sponsorImageURLs, - Iterable images, Iterable videos); + URL logoImageURL, Iterable images, Iterable videos); /** * Renames a sailing event. If a sailing event by the name oldName does not exist in {@link #getEvents()}, @@ -467,8 +466,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch ConcurrentHashMap getPersistentRegattasForRaceIDs(); Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue, - boolean isPublic, UUID id, Iterable imageURLs, Iterable videoURLs, Iterable sponsorImageURLs, - Iterable images, Iterable videos, URL logoImageURL, URL officialWebsiteURL); + boolean isPublic, UUID id, Iterable images, Iterable videos, URL logoImageURL, URL officialWebsiteURL); void setRegattaForRace(Regatta regatta, String raceIdAsString); diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java index 94af6175092..6ac0281c953 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java @@ -2574,13 +2574,9 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes 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. emptyList(), - /* videoURLs */Collections. emptyList(), /* sponsorImageURLs */Collections. emptyList(), - /* images */Collections. emptyList(), /* videos */Collections. emptyList(), + id, /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoImageURL */ null, /* officialWebsiteURL */null); - replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, /* imageURLs */ - id, Collections. emptyList(), - /* videoURLs */Collections. emptyList(), /* sponsorImageURLs */Collections. emptyList(), + replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, id, /* images */Collections. emptyList(), /* videos */Collections. emptyList(), /* logoimageURL */null, /* officialWebsiteURLAsString */null)); return result; @@ -2593,15 +2589,11 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes @Override public Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, - TimePoint endDate, String venue, boolean isPublic, UUID id, Iterable imageURLs, - Iterable videoURLs, Iterable sponsorImageURLs, Iterable images, Iterable videos, + TimePoint endDate, String venue, boolean isPublic, UUID id, Iterable images, Iterable videos, 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); result.setLogoImageURL(logoImageURL); result.setOfficialWebsiteURL(officialWebsiteURL); result.setImages(images); @@ -2621,8 +2613,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes @Override public void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, Iterable leaderboardGroupIds, URL officialWebsiteURL, - URL logoImageURL, Iterable imageURLs, Iterable videoURLs, Iterable sponsorImageURLs, - Iterable images, Iterable videos) { + URL logoImageURL, Iterable images, Iterable videos) { final Event event = eventsById.get(id); if (event == null) { throw new IllegalArgumentException("Sailing event with ID " + id + " does not exist."); @@ -2646,9 +2637,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes event.setLeaderboardGroups(leaderboardGroups); event.setOfficialWebsiteURL(officialWebsiteURL); event.setLogoImageURL(logoImageURL); - event.setImageURLs(imageURLs); - event.setVideoURLs(videoURLs); - event.setSponsorImageURLs(sponsorImageURLs); event.setImages(images); event.setVideos(videos); // TODO consider use diffutils to compute diff between old and new leaderboard groups list and apply the patch diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/CreateEvent.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/CreateEvent.java index 7490157d029..9b5e369c10d 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/CreateEvent.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/CreateEvent.java @@ -25,17 +25,13 @@ public class CreateEvent extends AbstractEventOperation { private final boolean isPublic; private final String eventName; private final String eventDescription; - private final Iterable videoURLs; - private final Iterable imageURLs; - private final Iterable sponsorImageURLs; private final Iterable images; private final Iterable videos; private final URL logoImageURL; private final URL officialWebsiteURL; public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue, - boolean isPublic, UUID id, Iterable imageURLs, Iterable videoURLs, Iterable sponsorImageURLs, - Iterable images, Iterable videos, URL logoImageURL, URL officialWebsiteURL) { + boolean isPublic, UUID id, Iterable images, Iterable videos, URL logoImageURL, URL officialWebsiteURL) { super(id); this.eventName = eventName; this.eventDescription = eventDescription; @@ -43,9 +39,6 @@ public class CreateEvent extends AbstractEventOperation { this.endDate = endDate; this.venue = venue; this.isPublic = isPublic; - this.imageURLs = imageURLs; - this.videoURLs = videoURLs; - this.sponsorImageURLs = sponsorImageURLs; this.images = images; this.videos = videos; this.logoImageURL = logoImageURL; @@ -71,7 +64,7 @@ public class CreateEvent extends AbstractEventOperation { @Override public Event internalApplyTo(RacingEventService toState) { return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic, - getId(), imageURLs, videoURLs, sponsorImageURLs, images, videos, logoImageURL, officialWebsiteURL); + getId(), images, videos, logoImageURL, officialWebsiteURL); } } diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/UpdateEvent.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/UpdateEvent.java index c8c17174f0f..ebb953c9939 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/UpdateEvent.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/operationaltransformation/UpdateEvent.java @@ -20,16 +20,12 @@ public class UpdateEvent extends AbstractEventOperation { private final String eventDescription; private final URL officialWebsiteURL; private final URL logoImageURL; - private final Iterable imageURLs; - private final Iterable videoURLs; - private final Iterable sponsorImageURLs; private final Iterable images; private final Iterable videos; public UpdateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venueName, boolean isPublic, Iterable leaderboardGroupIds, URL logoImageURL, - URL officialWebsiteURL, Iterable imageURLs, Iterable videoURLs, Iterable sponsorImageURLs, - Iterable images, Iterable videos) { + URL officialWebsiteURL, Iterable images, Iterable videos) { super(id); this.eventName = eventName; this.eventDescription = eventDescription; @@ -40,9 +36,6 @@ public class UpdateEvent extends AbstractEventOperation { this.leaderboardGroupIds = leaderboardGroupIds; this.officialWebsiteURL = officialWebsiteURL; this.logoImageURL = logoImageURL; - this.imageURLs = imageURLs; - this.videoURLs = videoURLs; - this.sponsorImageURLs = sponsorImageURLs; this.images = images; this.videos = videos; } @@ -62,7 +55,7 @@ public class UpdateEvent extends AbstractEventOperation { @Override public Void internalApplyTo(RacingEventService toState) { toState.updateEvent(getId(), eventName, eventDescription, startDate, endDate, venueName, isPublic, - leaderboardGroupIds, officialWebsiteURL, logoImageURL, imageURLs, videoURLs, sponsorImageURLs, images, videos); + leaderboardGroupIds, officialWebsiteURL, logoImageURL, images, videos); return null; } }