Merge branch 'master' into bug3027

This commit is contained in:
Axel Uhl committed 2015-07-13 16:50:47 +02:00
commit 88aa14504c
50 files changed
+207 -211

No files matched your search

@@ -17,6 +17,8 @@ public enum BoatClassMasterdata {
A_CAT ("A-Catamaran", true, 5.49, 2.30, BoatHullType.CATAMARAN, false, "A-Cat", "ACat", "A-Class Catamaran"),
ALBIN_EXPRESS ("Albin Express", true, 7.77, 2.50, BoatHullType.MONOHULL, false),
ALBIN_BALLAD ("Albin Ballad", true, 9.12, 2.95, BoatHullType.MONOHULL, false),
CANOE_IC ("International Canoe", true, 5.20, 1.01, BoatHullType.MONOHULL, true, "Canoe IC", "Canoe-IC", "IC", "Kanu IC", "International Canoe", "International 10 Sq.m. Sailing Canoe"),
CANOE_TAIFUN ("Canoe Taifun", true, 5.20, 1.32, BoatHullType.MONOHULL, false, "Taifun", "Taifun Kanu", "Kanu Taifun"),
B_ONE ("B/ONE", true, 7.80, 2.49, BoatHullType.MONOHULL, true, "B-ONE"),
D_ONE ("D-One", true, 4.23, 2.31, BoatHullType.MONOHULL, true, "Devoti D-One", "DOne", "D_One"),
DRAGON_INT ("Dragon Int.", true, 8.89, 1.96, BoatHullType.MONOHULL, true, "Drachen", "Dragon"),
@@ -29,6 +31,7 @@ public enum BoatClassMasterdata {
FINN ("Finn", true, 4.50, 1.51, BoatHullType.MONOHULL, false),
FLYING_PHANTOM ("Flying Phantom", true, 5.52, 3.00, BoatHullType.CATAMARAN, true),
FOLKBOAT ("Folkboat", true, 7.68, 2.20, BoatHullType.MONOHULL, false, "Folke", "Folkeboot"),
FUN ("FUN", true, 7.20, 2.45, BoatHullType.MONOHULL, true, "FUN O.D.", "FUN OD"),
F_16 ("Formula 16", true, 5.00, 2.50, BoatHullType.CATAMARAN, true, "F16", "F-16"),
HOBIE_16 ("Hobie 16", true, 5.05, 2.41, BoatHullType.CATAMARAN, false, "H16"),
H_BOAT ("H-Boat", true, 8.28, 2.18, BoatHullType.MONOHULL, true, "HB"),
@@ -1047,6 +1047,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
logger.severe("Error parsing official website URL "+officialWebSiteURLAsString+" for event "+name+". Ignoring this URL.");
}
}
String sailorsInfoWebSiteURLAsString = (String) eventDBObject.get(FieldNames.EVENT_SAILORS_INFO_WEBSITE_URL.name());
if (sailorsInfoWebSiteURLAsString != null) {
try {
result.setSailorsInfoWebsiteURL(new URL(sailorsInfoWebSiteURLAsString));
} catch (MalformedURLException e) {
logger.severe("Error parsing sailors info website URL "+sailorsInfoWebSiteURLAsString+" for event "+name+". Ignoring this URL.");
}
}
BasicDBList images = (BasicDBList) eventDBObject.get(FieldNames.EVENT_IMAGES.name());
if (images != null) {
for (Object imageObject : images) {
@@ -22,6 +22,7 @@ public enum FieldNames {
EVENT_IMAGES,
EVENT_VIDEOS,
EVENT_OFFICIAL_WEBSITE_URL,
EVENT_SAILORS_INFO_WEBSITE_URL,
EVENT_LOGO_IMAGE_URL,
REGATTA_NAME,
@@ -536,6 +536,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
eventDBObject.put(FieldNames.EVENT_ID.name(), event.getId());
eventDBObject.put(FieldNames.EVENT_LOGO_IMAGE_URL.name(), event.getLogoImageURL() != null ? event.getLogoImageURL().toString() : null);
eventDBObject.put(FieldNames.EVENT_OFFICIAL_WEBSITE_URL.name(), event.getOfficialWebsiteURL() != null ? event.getOfficialWebsiteURL().toString() : null);
eventDBObject.put(FieldNames.EVENT_SAILORS_INFO_WEBSITE_URL.name(), event.getSailorsInfoWebsiteURL() != null ? event.getSailorsInfoWebsiteURL().toString() : null);
storeTimePoint(event.getStartDate(), eventDBObject, FieldNames.EVENT_START_DATE);
storeTimePoint(event.getEndDate(), eventDBObject, FieldNames.EVENT_END_DATE);
eventDBObject.put(FieldNames.EVENT_IS_PUBLIC.name(), event.isPublic());
@@ -81,6 +81,14 @@ public interface EventBase extends Named, WithDescription, Renamable, WithID, Wi
void setOfficialWebsiteURL(URL officialWebsiteURL);
/**
* @return the URL of an external web site containing sailor related information like protests, official results, etc.
* or <code>null</code> if such a site does not exist or its URL is not known.
*/
URL getSailorsInfoWebsiteURL();
void setSailorsInfoWebsiteURL(URL sailorsInfoWebsiteURL);
Iterable<? extends LeaderboardGroupBase> getLeaderboardGroups();
/**
@@ -36,6 +36,7 @@ public abstract class EventBaseImpl implements EventBase {
private TimePoint startDate;
private TimePoint endDate;
private URL officialWebsiteURL;
private URL sailorsInfoWebsiteURL;
private ConcurrentLinkedQueue<ImageDescriptor> images;
private ConcurrentLinkedQueue<VideoDescriptor> videos;
@@ -182,6 +183,16 @@ public abstract class EventBaseImpl implements EventBase {
this.officialWebsiteURL = officialWebsiteURL;
}
@Override
public URL getSailorsInfoWebsiteURL() {
return sailorsInfoWebsiteURL;
}
@Override
public void setSailorsInfoWebsiteURL(URL sailorsInfoWebsiteURL) {
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
}
@Override
public Iterable<ImageDescriptor> getImages() {
return Collections.unmodifiableCollection(images);
@@ -60,7 +60,7 @@ public class DirectGapCalculationVersusOneDesignRankingMetricTest extends Abstra
ReceiverType.MARKPOSITIONS, ReceiverType.RACECOURSE, ReceiverType.RAWPOSITIONS });
getTrackedRace().recordWind(
new WindImpl(/* position */null, new MillisecondsTimePoint(dateFormat.parse("06/21/2014-13:03:35")),
new KnotSpeedWithBearingImpl(18, new DegreeBearingImpl(296))),
new KnotSpeedWithBearingImpl(18, new DegreeBearingImpl(90))),
new WindSourceImpl(WindSourceType.WEB));
}
@@ -105,13 +105,13 @@ public class TrackedRegattaImpl implements TrackedRegatta {
@Override
public void addTrackedRace(TrackedRace trackedRace) {
final TrackedRace oldTrackedRace;
LockUtil.lockForWrite(trackedRacesLock);
lockTrackedRacesForWrite();
try {
logger.info("adding tracked race for "+trackedRace.getRace()+" to tracked regatta "+getRegatta().getName()+
" with regatta hash code "+getRegatta().hashCode());
oldTrackedRace = trackedRaces.put(trackedRace.getRace(), trackedRace);
} finally {
LockUtil.unlockAfterWrite(trackedRacesLock);
unlockTrackedRacesAfterWrite();
}
if (oldTrackedRace != trackedRace) {
for (RaceListener listener : raceListeners.keySet()) {
@@ -159,43 +159,38 @@ public class TrackedRegattaImpl implements TrackedRegatta {
@Override
public TrackedRace getTrackedRace(RaceDefinition race) {
boolean interrupted = false;
lockTrackedRacesForRead();
try {
TrackedRace result = trackedRaces.get(race);
if (!interrupted && result == null) {
final Object mutex = new Object();
final RaceListener listener = new RaceListener() {
@Override
public void raceRemoved(TrackedRace trackedRace) {}
@Override
public void raceAdded(TrackedRace trackedRace) {
synchronized (mutex) {
mutex.notifyAll();
}
}
};
addRaceListener(listener);
try {
TrackedRace result = getExistingTrackedRace(race);
if (!interrupted && result == null) {
final Object mutex = new Object();
final RaceListener listener = new RaceListener() {
@Override
public void raceRemoved(TrackedRace trackedRace) {}
@Override
public void raceAdded(TrackedRace trackedRace) {
synchronized (mutex) {
result = trackedRaces.get(race);
while (!interrupted && result == null) {
try {
mutex.wait();
result = trackedRaces.get(race);
} catch (InterruptedException e) {
interrupted = true;
}
mutex.notifyAll();
}
}
};
addRaceListener(listener);
try {
synchronized (mutex) {
result = getExistingTrackedRace(race);
while (!interrupted && result == null) {
try {
mutex.wait();
result = getExistingTrackedRace(race);
} catch (InterruptedException e) {
interrupted = true;
}
}
} finally {
removeRaceListener(listener);
}
} finally {
removeRaceListener(listener);
}
return result;
} finally {
unlockTrackedRacesAfterRead();
}
return result;
}
@Override
@@ -5,19 +5,19 @@
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.gwt.regattaoverview.RegattaOverview"/>
<listEntry value="com.sap.sailing.gwt.ui.RaceBoard"/>
<listEntry value="com.sap.sailing.gwt.Home"/>
<listEntry value="com.sap.sailing.gwt.ui.DataMining"/>
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
<listEntry value="com.sap.sailing.gwt.ui.LeaderboardEditing"/>
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
<listEntry value="com.sap.sailing.gwt.ui.Spectator"/>
<listEntry value="com.sap.sailing.gwt.AutoPlay"/>
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
<listEntry value="com.sap.sailing.gwt.regattaoverview.RegattaOverview"/>
<listEntry value="com.sap.sailing.gwt.ui.PolarSheets"/>
<listEntry value="com.sap.sailing.gwt.ui.Leaderboard"/>
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
<listEntry value="com.sap.sailing.gwt.AutoPlay"/>
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
<listEntry value="com.sap.sailing.gwt.home.Home"/>
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -30,6 +30,7 @@
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;com.sap.sailing.gwt.ui&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
@@ -69,7 +70,7 @@
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto -startupUrl /gwt/Home.html com.sap.sailing.gwt.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.Home com.sap.sailing.gwt.ui.RaceBoard com.sap.sailing.gwt.regattaoverview.RegattaOverview"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Desktop com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -Dgwt-usearchives=false -Dgwt.persistentunitcache=false"/>
</launchConfiguration>
@@ -25,6 +25,7 @@ public class BoatClassImageResolver {
boatClassIconsMap.put(BoatClassMasterdata.ORC_INTERNATIONAL.getDisplayName(), imageResources.ORCIcon());
boatClassIconsMap.put(BoatClassMasterdata._12M.getDisplayName(), imageResources._12mRIcon());
boatClassIconsMap.put(BoatClassMasterdata._18Footer.getDisplayName(), imageResources._18FooterIcon());
boatClassIconsMap.put(BoatClassMasterdata._2_4M.getDisplayName(), imageResources._2_4mIcon());
boatClassIconsMap.put(BoatClassMasterdata._29ER.getDisplayName(), imageResources._29erIcon());
boatClassIconsMap.put(BoatClassMasterdata._420.getDisplayName(), imageResources._420Icon());
@@ -35,6 +36,8 @@ public class BoatClassImageResolver {
boatClassIconsMap.put(BoatClassMasterdata.A_CAT.getDisplayName(), imageResources.A_CatIcon());
boatClassIconsMap.put(BoatClassMasterdata.ALBIN_EXPRESS.getDisplayName(), imageResources.AlbinExpressIcon());
boatClassIconsMap.put(BoatClassMasterdata.B_ONE.getDisplayName(), imageResources.BOne());
boatClassIconsMap.put(BoatClassMasterdata.CANOE_IC.getDisplayName(), imageResources.CanoeICIcon());
boatClassIconsMap.put(BoatClassMasterdata.CANOE_TAIFUN.getDisplayName(), imageResources.CanoeTaifunIcon());
boatClassIconsMap.put(BoatClassMasterdata.CONTENDER.getDisplayName(), imageResources.ContenderIcon());
boatClassIconsMap.put(BoatClassMasterdata.DRAGON_INT.getDisplayName(), imageResources.DragonIcon());
boatClassIconsMap.put(BoatClassMasterdata.EUROPE_INT.getDisplayName(), imageResources.EuropeIcon());
@@ -47,10 +50,12 @@ public class BoatClassImageResolver {
boatClassIconsMap.put(BoatClassMasterdata.FINN.getDisplayName(), imageResources.FinnIcon());
boatClassIconsMap.put(BoatClassMasterdata.FLYING_DUTCHMAN.getDisplayName(), imageResources.FlyingDutchmanIcon());
boatClassIconsMap.put(BoatClassMasterdata.FOLKBOAT.getDisplayName(), imageResources.FolkBoatIcon());
boatClassIconsMap.put(BoatClassMasterdata.FUN.getDisplayName(), imageResources.FUNIcon());
boatClassIconsMap.put(BoatClassMasterdata.H_BOAT.getDisplayName(), imageResources.H_BoatIcon());
boatClassIconsMap.put(BoatClassMasterdata.HOBIE_16.getDisplayName(), imageResources.HobieIcon());
boatClassIconsMap.put(BoatClassMasterdata.HOBIE_TIGER.getDisplayName(), imageResources.HobieIcon());
boatClassIconsMap.put(BoatClassMasterdata.HOBIE_WILD_CAT.getDisplayName(), imageResources.HobieIcon());
boatClassIconsMap.put(BoatClassMasterdata.J22.getDisplayName(), imageResources.J22Icon());
boatClassIconsMap.put(BoatClassMasterdata.J24.getDisplayName(), imageResources.J24Icon());
boatClassIconsMap.put(BoatClassMasterdata.J70.getDisplayName(), imageResources.J70Icon());
boatClassIconsMap.put(BoatClassMasterdata.J80.getDisplayName(), imageResources.J80Icon());
@@ -13,6 +13,9 @@ public interface BoatClassImageResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/12MR.png")
ImageResource _12mRIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/18Footer.png")
ImageResource _18FooterIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/2_4M.png")
ImageResource _2_4mIcon();
@@ -25,7 +28,7 @@ public interface BoatClassImageResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/470.png")
ImageResource _470Icon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/49ER_FX.jpg")
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/49ER_FX.png")
ImageResource _49erFXIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/49ER.png")
@@ -43,6 +46,12 @@ public interface BoatClassImageResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/B_ONE.png")
ImageResource BOne();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/CANOE_IC.png")
ImageResource CanoeICIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/CANOE_TAIFUN.png")
ImageResource CanoeTaifunIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/CONTENDER.png")
ImageResource ContenderIcon();
@@ -76,12 +85,18 @@ public interface BoatClassImageResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/FOLKBOAT.png")
ImageResource FolkBoatIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/FUN.png")
ImageResource FUNIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/H_BOAT.png")
ImageResource H_BoatIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/HOBIE.png")
ImageResource HobieIcon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/J22.png")
ImageResource J22Icon();
@Source("com/sap/sailing/gwt/ui/client/images/boatclass/J24.png")
ImageResource J24Icon();
@@ -58,7 +58,7 @@ public class TabletAndDesktopEventView extends Composite implements EventMultire
initBreadCrumbs();
String sailorsInfoURL = currentPresenter.getCtx().getEventDTO().getSailorsInfoURL();
String sailorsInfoURL = currentPresenter.getCtx().getEventDTO().getSailorsInfoWebsiteURL();
if(sailorsInfoURL != null && ! sailorsInfoURL.isEmpty()) {
Label label = new Label();
label.getElement().setInnerHTML(i18n.sailorInfoLongText().replace("\n", "<br />"));
@@ -57,15 +57,6 @@ public class Regatta extends Composite {
@UiField SpanElement racesCount;
@UiField SpanElement trackedRacesCount;
@UiField DivElement isLiveDiv;
// @UiField TableElement isLiveDiv2;
// @UiField DivElement isFinishedDiv;
// @UiField DivElement isFinishedDiv2;
// @UiField DivElement isScheduledDiv;
// @UiField AnchorElement leaderboardLink;
// @UiField DivElement liveRaceInfosPerFleetPanel;
// @UiField(provided=true) RegattaCompetitor competitorWithRank1;
// @UiField(provided=true) RegattaCompetitor competitorWithRank2;
// @UiField(provided=true) RegattaCompetitor competitorWithRank3;
@UiField Anchor regattaDetailsLink;
@@ -60,13 +60,13 @@ public class EventRegattaList extends Composite {
leaderboardGroupFilterAnchors = new ArrayList<AnchorElement>();
boolean hasMultipleLeaderboardGroups = presenter.getCtx().getLeaderboardGroups().size() > 1;
if(event.getType() == EventType.SERIES_EVENT) {
if (event.getType() == EventType.SERIES_EVENT) {
regattaListNavigationDiv.getStyle().setDisplay(Display.NONE);
} else {
if(hasMultipleLeaderboardGroups) {
if (hasMultipleLeaderboardGroups) {
// fill the navigation panel
registerFilterLeaderboardGroupEvent(filterNoLeaderboardGroupsAnchor, null);
for(LeaderboardGroupDTO leaderboardGroup: presenter.getCtx().getLeaderboardGroups()) {
for (LeaderboardGroupDTO leaderboardGroup: presenter.getCtx().getLeaderboardGroups()) {
AnchorElement filterLeaderboardGroupAnchor = Document.get().createAnchorElement();
filterLeaderboardGroupAnchor.addClassName(EventRegattaListResources.INSTANCE.css().item());
filterLeaderboardGroupAnchor.setHref("javascript:;");
@@ -126,8 +126,10 @@ public class EventRegattaList extends Composite {
for (LeaderboardGroupDTO lg : presenter.getCtx().getLeaderboardGroups()) {
boolean isVisible = leaderboardGroup.getName().equals(lg.getName());
List<Regatta> regattaElements = regattaElementsByLeaderboardGroup.get(lg.getName());
for (Regatta regatta : regattaElements) {
regatta.setVisible(isVisible);
if (regattaElements != null) {
for (Regatta regatta : regattaElements) {
regatta.setVisible(isVisible);
}
}
}
} else {
@@ -135,8 +137,10 @@ public class EventRegattaList extends Composite {
filterNoLeaderboardGroupsAnchor.addClassName(EventRegattaListResources.INSTANCE.css().selectedItem());
for (LeaderboardGroupDTO lg : presenter.getCtx().getLeaderboardGroups()) {
List<Regatta> regattaElements = regattaElementsByLeaderboardGroup.get(lg.getName());
for (Regatta regatta : regattaElements) {
regatta.setVisible(true);
if (regattaElements != null) {
for (Regatta regatta : regattaElements) {
regatta.setVisible(true);
}
}
}
}
@@ -31,6 +31,8 @@ public class EventCreateDialog extends EventDialog {
endDateBox.setFormat("dd/mm/yyyy hh:ii");
officialWebsiteURLEntryField = createTextBox(null);
officialWebsiteURLEntryField.setVisibleLength(50);
sailorsInfoWebsiteURLEntryField = createTextBox(null);
sailorsInfoWebsiteURLEntryField.setVisibleLength(50);
isPublicCheckBox = createCheckbox("");
isPublicCheckBox.setValue(false);
imagesListComposite.fillImages(Collections.<ImageDTO>emptyList());
@@ -38,6 +38,7 @@ public class EventDetailsComposite extends Composite {
private final Label endDate;
private final Label isPublic;
private final Anchor officialWebsiteURL;
private final Anchor sailorsInfoWebsiteURL;
private final Anchor eventOverviewURL;
private final SimpleStringListComposite courseAreaNamesList;
private final SimpleStringListComposite imageURLList;
@@ -55,7 +56,7 @@ public class EventDetailsComposite extends Composite {
VerticalPanel vPanel = new VerticalPanel();
mainPanel.add(vPanel);
int rows = 15;
int rows = 16;
Grid grid = new Grid(rows, 2);
vPanel.add(grid);
@@ -68,6 +69,7 @@ public class EventDetailsComposite extends Composite {
endDate = createLabelAndValueWidget(grid, currentRow++, stringMessages.endDate(), "EndDateLabel");
isPublic = createLabelAndValueWidget(grid, currentRow++, stringMessages.isPublic(), "IsPublicLabel");
officialWebsiteURL = createAnchorAndValueWidget(grid, currentRow++, stringMessages.eventOfficialWebsiteURL(), "OfficialWebsiteURLLabel");
sailorsInfoWebsiteURL = createAnchorAndValueWidget(grid, currentRow++, stringMessages.eventSailorsInfoWebsiteURL(), "SailorsInfoWebsiteURLLabel");
eventOverviewURL = createAnchorAndValueWidget(grid, currentRow++, stringMessages.eventOverviewURL(), "EventOverviewURLLabel");
courseAreaNamesList = createLableAndValueListWidget(grid, currentRow++, stringMessages.courseAreas(), "CourseAreaValueList");
imageURLList = createLableAndValueListWidget(grid, currentRow++, stringMessages.images(), "ImageURLValueList");
@@ -128,6 +130,8 @@ public class EventDetailsComposite extends Composite {
isPublic.setText(String.valueOf(event.isPublic));
officialWebsiteURL.setText(event.getOfficialWebsiteURL());
officialWebsiteURL.setHref(event.getOfficialWebsiteURL());
sailorsInfoWebsiteURL.setText(event.getSailorsInfoWebsiteURL());
sailorsInfoWebsiteURL.setHref(event.getSailorsInfoWebsiteURL());
Map<String, String> regattaOverviewURLParameters = new HashMap<String, String>();
regattaOverviewURLParameters.put("event", event.id.toString());
String regattaOverviewLink = EntryPointLinkFactory.createRegattaOverviewLink(regattaOverviewURLParameters);
@@ -42,6 +42,7 @@ public abstract class EventDialog extends DataEntryDialogWithBootstrap<EventDTO>
protected CheckBox isPublicCheckBox;
protected UUID id;
protected TextBox officialWebsiteURLEntryField;
protected TextBox sailorsInfoWebsiteURLEntryField;
protected StringListInlineEditorComposite courseAreaNameList;
protected StringConstantsListEditorComposite leaderboardGroupList;
protected List<LeaderboardGroupDTO> availableLeaderboardGroups;
@@ -157,6 +158,7 @@ public abstract class EventDialog extends DataEntryDialogWithBootstrap<EventDTO>
result.setName(nameEntryField.getText());
result.setDescription(descriptionEntryField.getText());
result.setOfficialWebsiteURL(officialWebsiteURLEntryField.getText().trim().isEmpty() ? null : officialWebsiteURLEntryField.getText().trim());
result.setSailorsInfoWebsiteURL(sailorsInfoWebsiteURLEntryField.getText().trim().isEmpty() ? null : sailorsInfoWebsiteURLEntryField.getText().trim());
result.startDate = startDateBox.getValue();
result.endDate = endDateBox.getValue();
result.isPublic = isPublicCheckBox.getValue();
@@ -187,7 +189,7 @@ public abstract class EventDialog extends DataEntryDialogWithBootstrap<EventDTO>
panel.add(additionalWidget);
}
Grid formGrid = new Grid(7, 2);
Grid formGrid = new Grid(8, 2);
panel.add(formGrid);
formGrid.setWidget(0, 0, new Label(stringMessages.name() + ":"));
@@ -204,6 +206,8 @@ public abstract class EventDialog extends DataEntryDialogWithBootstrap<EventDTO>
formGrid.setWidget(5, 1, isPublicCheckBox);
formGrid.setWidget(6, 0, new Label(stringMessages.eventOfficialWebsiteURL() + ":"));
formGrid.setWidget(6, 1, officialWebsiteURLEntryField);
formGrid.setWidget(7, 0, new Label(stringMessages.eventSailorsInfoWebsiteURL() + ":"));
formGrid.setWidget(7, 1, sailorsInfoWebsiteURLEntryField);
TabLayoutPanel tabPanel = new TabLayoutPanel(30, Unit.PX);
tabPanel.setHeight("250px");
@@ -36,6 +36,8 @@ public class EventEditDialog extends EventDialog {
}
officialWebsiteURLEntryField = createTextBox(event.getOfficialWebsiteURL());
officialWebsiteURLEntryField.setVisibleLength(50);
sailorsInfoWebsiteURLEntryField = createTextBox(event.getSailorsInfoWebsiteURL());
sailorsInfoWebsiteURLEntryField.setVisibleLength(50);
courseAreaNameList.setValue(courseAreaNames);
List<String> leaderboardGroupNames = new ArrayList<>();
for(LeaderboardGroupDTO leaderboardGroupDTO: event.getLeaderboardGroups()) {
@@ -491,7 +491,8 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
sailingService.updateEvent(oldEvent.id, oldEvent.getName(), updatedEvent.getDescription(),
updatedEvent.startDate, updatedEvent.endDate, updatedEvent.venue,
updatedEvent.isPublic, updatedEventLeaderboardGroupIds,
updatedEvent.getOfficialWebsiteURL(), updatedEvent.getImages(), updatedEvent.getVideos(),
updatedEvent.getOfficialWebsiteURL(), updatedEvent.getSailorsInfoWebsiteURL(),
updatedEvent.getImages(), updatedEvent.getVideos(),
new AsyncCallback<EventDTO>() {
@Override
public void onFailure(Throwable t) {
@@ -562,7 +563,7 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
courseAreaNames.add(courseAreaDTO.getName());
}
sailingService.createEvent(newEvent.getName(), newEvent.getDescription(), newEvent.startDate, newEvent.endDate,
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(),
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(), newEvent.getSailorsInfoWebsiteURL(),
newEvent.getImages(), newEvent.getVideos(), new AsyncCallback<EventDTO>() {
@Override
public void onFailure(Throwable t) {
@@ -697,6 +697,11 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
for (int i = 0; i < availableLeaderboardGroups.size(); i++) {
LeaderboardGroupDTO group = availableLeaderboardGroups.get(i);
if (oldGroupName.equals(group.getName())) {
// if the leaderboard is selected, de-select equality/hashCode may change) and select again when done
final boolean wasSelected = Util.equalsWithNull(groupToUpdate, getSelectedGroup());
if (wasSelected) {
groupsSelectionModel.setSelected(groupToUpdate, false);
}
groupToUpdate.setName(updateDescriptor.getName());
groupToUpdate.description = updateDescriptor.getDescription();
groupToUpdate.setDisplayName(updateDescriptor.getDisplayName());
@@ -708,6 +713,9 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel implements
if (displayedIndex != -1) {
groupsProvider.getList().set(displayedIndex, groupToUpdate);
}
if (wasSelected) {
groupsSelectionModel.setSelected(groupToUpdate, true);
}
}
}
groupsFilterablePanel.updateAll(availableLeaderboardGroups);
@@ -1,107 +0,0 @@
package com.sap.sailing.gwt.ui.adminconsole;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.BetterDateTimeBox;
import com.sap.sailing.gwt.ui.shared.CourseAreaDTO;
import com.sap.sailing.gwt.ui.shared.EventDTO;
import com.sap.sailing.gwt.ui.shared.VenueDTO;
import com.sap.sse.gwt.client.controls.listedit.StringListInlineEditorComposite;
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
public class RegattaImportDialog extends DataEntryDialog<String>{
protected StringMessages stringMessages;
protected TextBox nameEntryField;
protected TextArea descriptionEntryField;
protected TextBox venueEntryField;
protected BetterDateTimeBox startDateBox;
protected BetterDateTimeBox endDateBox;
protected CheckBox isPublicCheckBox;
protected UUID id;
protected TextBox officialWebsiteURLEntryField;
protected StringListInlineEditorComposite courseAreaNameList;
protected StringListInlineEditorComposite imageURLList;
protected StringListInlineEditorComposite videoURLList;
protected StringListInlineEditorComposite sponsorImageURLList;
public RegattaImportDialog(StringMessages stringMessages, String message,
com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator<String> validator,
com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback<String> callback) {
super("Regattas"/*title*/, null/*message*/, stringMessages.ok(), stringMessages.cancel(), validator, false/*animationEnables; raus?*/, callback);
this.stringMessages = stringMessages;
}
@Override
protected Widget getAdditionalWidget() {
final VerticalPanel panel = new VerticalPanel();
Widget additionalWidget = super.getAdditionalWidget();
if (additionalWidget != null) {
panel.add(additionalWidget);
}
Grid formGrid = new Grid(7, 2);
panel.add(formGrid);
formGrid.setWidget(0, 0, new Label(stringMessages.name() + ":"));
formGrid.setWidget(0, 1, nameEntryField);
formGrid.setWidget(1, 0, new Label(stringMessages.description() + ":"));
formGrid.setWidget(1, 1, descriptionEntryField);
formGrid.setWidget(2, 0, new Label(stringMessages.venue() + ":"));
formGrid.setWidget(2, 1, venueEntryField);
formGrid.setWidget(3, 0, new Label(stringMessages.startDate() + ":"));
formGrid.setWidget(3, 1, startDateBox);
formGrid.setWidget(4, 0, new Label(stringMessages.endDate() + ":"));
formGrid.setWidget(4, 1, endDateBox);
formGrid.setWidget(5, 0, new Label(stringMessages.isPublic() + ":"));
formGrid.setWidget(5, 1, isPublicCheckBox);
formGrid.setWidget(6, 0, new Label(stringMessages.eventOfficialWebsiteURL() + ":"));
formGrid.setWidget(6, 1, officialWebsiteURLEntryField);
panel.add(createHeadlineLabel(stringMessages.courseAreas()));
panel.add(courseAreaNameList);
panel.add(createHeadlineLabel(stringMessages.imageURLs()));
panel.add(imageURLList);
panel.add(createHeadlineLabel(stringMessages.videoURLs()));
panel.add(videoURLList);
panel.add(createHeadlineLabel(stringMessages.sponsorImageURLs()));
panel.add(sponsorImageURLList);
return panel;
}
protected String getResult() {
EventDTO result = new EventDTO();
result.setName(nameEntryField.getText());
result.setDescription(descriptionEntryField.getText());
result.setOfficialWebsiteURL(officialWebsiteURLEntryField.getText().trim().isEmpty() ? null : officialWebsiteURLEntryField.getText().trim());
result.startDate = startDateBox.getValue();
result.endDate = endDateBox.getValue();
result.isPublic = isPublicCheckBox.getValue();
result.id = id;
List<CourseAreaDTO> courseAreas = new ArrayList<CourseAreaDTO>();
for (String courseAreaName : courseAreaNameList.getValue()) {
CourseAreaDTO courseAreaDTO = new CourseAreaDTO();
courseAreaDTO.setName(courseAreaName);
courseAreas.add(courseAreaDTO);
}
result.venue = new VenueDTO(venueEntryField.getText(), courseAreas);
return "OK";
}
@Override
public void show() {
super.show();
nameEntryField.setFocus(true);
}
}
@@ -257,7 +257,7 @@ public class StructureImportManagementPanel extends SimplePanel implements Regat
courseAreaNames.add(courseAreaDTO.getName());
}
sailingService.createEvent(newEvent.getName(), newEvent.getDescription(), newEvent.startDate, newEvent.endDate,
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(),
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(), newEvent.getSailorsInfoWebsiteURL(),
newEvent.getImages(), newEvent.getVideos(),
new AsyncCallback<EventDTO>() {
@Override
@@ -295,11 +295,11 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
void updateRacesDelayToLive(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers, long delayToLiveInMs);
EventDTO updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURL,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURL, String sailorsInfoWebsiteURL,
Iterable<ImageDTO> images, Iterable<VideoDTO> videos) throws Exception;
EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURL, Iterable<ImageDTO> images, Iterable<VideoDTO> videos) throws Exception;
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURL, String sailorsInfoWebsiteURL, Iterable<ImageDTO> images, Iterable<VideoDTO> videos) throws Exception;
void removeEvent(UUID eventId);
@@ -367,11 +367,11 @@ public interface SailingServiceAsync extends BuildVersionRetriever, FileStorageM
void removeEvents(Collection<UUID> eventIds, AsyncCallback<Void> asyncCallback);
void createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue, boolean isPublic,
List<String> courseAreaNames, String officialWebsiteURL, Iterable<ImageDTO> images, Iterable<VideoDTO> videos,
List<String> courseAreaNames, String officialWebsiteURL, String sailorsInfoWebsiteURL, Iterable<ImageDTO> images, Iterable<VideoDTO> videos,
AsyncCallback<EventDTO> callback);
void updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURL,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURL, String sailorsInfoWebsiteURL,
Iterable<ImageDTO> images, Iterable<VideoDTO> videos, AsyncCallback<EventDTO> callback);
void createCourseArea(UUID eventId, String courseAreaName, AsyncCallback<Void> callback);
@@ -1093,6 +1093,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String advancePassId();
String pleaseSelectAScoringResult();
String eventOfficialWebsiteURL();
String eventSailorsInfoWebsiteURL();
String eventOverviewURL();
String eventLogoImageURL();
String showPingMarkMappings();
@@ -1067,6 +1067,7 @@ invalidSelection=The current selection isn''t valid.
advancePassId=Advance Pass ID
pleaseSelectAScoringResult=Please select a scoring result...
eventOfficialWebsiteURL=Official Website URL
eventSailorsInfoWebsiteURL=Sailors Info Website URL
eventOverviewURL=Event Overview URL
eventLogoImageURL=Logo Image URL
showPingMarkMappings=Show Mappings for pinged Marks
@@ -1060,9 +1060,10 @@ sponsorImageURLs=Sponsorenlogo-URLs
invalidSelection=Die aktuelle Selektion ist nicht gültig.
advancePassId=Pass ID erhöhen
pleaseSelectAScoringResult=Bitte ein Ergebnis auswählen...
eventOfficialWebsiteURL=URL der offiziellen Veranstaltungs-Website
eventOverviewURL=URL der Eventübersicht
eventLogoImageURL=URL des Veranstaltungs-Logos
eventOfficialWebsiteURL=URL der offiziellen Veranstaltungswebseite
eventSailorsInfoWebsiteURL=URL zur Webseite mit Seglerinfos
eventOverviewURL=URL der Veranstaltungsübersicht
eventLogoImageURL=URL des Veranstaltungslogos
showPingMarkMappings=Mappings für gepingte Marks zeigen
errorFetchingWindStreamletData=Fehler beim Empfang der Streamlet-Winddaten: {0}
showWindStreamletOverlay=Wind als Streamlets überlagern
@@ -1019,6 +1019,7 @@ videoURLs=Video URLs
sponsorImageURLs=Sponsor Image URLs
pleaseSelectAScoringResult=Please select a scoring result...
eventOfficialWebsiteURL=Official Website URL
eventSailorsInfoWebsiteURL=Sailors Info Website URL
eventOverviewURL=Event Overview URL
eventLogoImageURL=Logo Image URL
showPingMarkMappings=Show Mappings for pinged Marks
@@ -8,6 +8,7 @@ pleaseSelectARace=Please select a race
columnMoveUp=Up
enterCarryValueFor=Enter carried points for competitor {0}
eventOfficialWebsiteURL=Official Website URL
eventSailorsInfoWebsiteURL=Sailors Info Website URL
polarSheetOutlierDetectionMinimumPercTooltip=The percentage of neighborhood datapoints / overall datapoints\nneeds to be at less than the given value for the point to be considered an outlier.
errorTryingToCreateNewEvent=Error trying to create new event {0}: {1}
xyDiagram=x-y-Diagram
@@ -3300,22 +3300,24 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
@Override
public EventDTO updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURLString,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURLString, String sailorsInfoWebsiteURLString,
Iterable<ImageDTO> images, Iterable<VideoDTO> videos) throws MalformedURLException {
TimePoint startTimePoint = startDate != null ? new MillisecondsTimePoint(startDate) : null;
TimePoint endTimePoint = endDate != null ? new MillisecondsTimePoint(endDate) : null;
URL officialWebsiteURL = officialWebsiteURLString != null ? new URL(officialWebsiteURLString) : null;
URL sailorsInfoWebsiteURL = sailorsInfoWebsiteURLString != null ? new URL(sailorsInfoWebsiteURLString) : null;
List<ImageDescriptor> eventImages = convertToImages(images);
List<VideoDescriptor> eventVideos = convertToVideos(videos);
getService().apply(
new UpdateEvent(eventId, eventName, eventDescription, startTimePoint, endTimePoint, venue.getName(),
isPublic, leaderboardGroupIds, officialWebsiteURL, eventImages, eventVideos));
isPublic, leaderboardGroupIds, officialWebsiteURL, sailorsInfoWebsiteURL, eventImages, eventVideos));
return getEventById(eventId, false);
}
@Override
public EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURLAsString, Iterable<ImageDTO> images, Iterable<VideoDTO> videos)
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURLAsString, String sailorsInfoWebsiteURLAsString,
Iterable<ImageDTO> images, Iterable<VideoDTO> videos)
throws MalformedURLException {
UUID eventUuid = UUID.randomUUID();
TimePoint startTimePoint = startDate != null ? new MillisecondsTimePoint(startDate) : null;
@@ -3324,7 +3326,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
List<VideoDescriptor> eventVideos = convertToVideos(videos);
getService().apply(
new CreateEvent(eventName, eventDescription, startTimePoint, endTimePoint, venue, isPublic, eventUuid,
officialWebsiteURLAsString == null ? null : new URL(officialWebsiteURLAsString), eventImages, eventVideos));
officialWebsiteURLAsString == null ? null : new URL(officialWebsiteURLAsString), new URL(sailorsInfoWebsiteURLAsString), eventImages, eventVideos));
for (String courseAreaName : courseAreaNames) {
createCourseArea(eventUuid, courseAreaName);
}
@@ -3403,6 +3405,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
eventDTO.id = (UUID) event.getId();
eventDTO.setDescription(event.getDescription());
eventDTO.setOfficialWebsiteURL(event.getOfficialWebsiteURL() != null ? event.getOfficialWebsiteURL().toString() : null);
eventDTO.setSailorsInfoWebsiteURL(event.getSailorsInfoWebsiteURL() != null ? event.getSailorsInfoWebsiteURL().toString() : null);
for(ImageDescriptor image: event.getImages()) {
eventDTO.addImage(convertToImageDTO(image));
}
@@ -4143,7 +4146,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
eventLeaderboardGroupUUIDs.add(lg.getId());
}
updateEvent(newEvent.id, newEvent.getName(), description, newEvent.startDate, newEvent.endDate, newEvent.venue,
newEvent.isPublic, eventLeaderboardGroupUUIDs, newEvent.getOfficialWebsiteURL(),
newEvent.isPublic, eventLeaderboardGroupUUIDs, newEvent.getOfficialWebsiteURL(), newEvent.getSailorsInfoWebsiteURL(),
newEvent.getImages(), newEvent.getVideos());
}
@@ -26,6 +26,7 @@ public class EventBaseDTO extends NamedDTO implements IsSerializable {
private String description;
private List<? extends LeaderboardGroupBaseDTO> leaderboardGroups;
private String officialWebsiteURL;
private String sailorsInfoWebsiteURL;
private List<ImageDTO> images = new ArrayList<>();
private List<VideoDTO> videos = new ArrayList<>();
@@ -98,6 +99,14 @@ public class EventBaseDTO extends NamedDTO implements IsSerializable {
this.officialWebsiteURL = officialWebsiteURL;
}
public String getSailorsInfoWebsiteURL() {
return sailorsInfoWebsiteURL;
}
public void setSailorsInfoWebsiteURL(String sailorsInfoWebsiteURL) {
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
}
/**
* If not {@link #setBaseURL(String) set}, defaults to <code>http://sapsailing.com</code>. Meant to describe the
* base URL that maps to the server instance at which this event can be found, such as
@@ -52,6 +52,7 @@ public class GetEventViewAction implements Action<EventViewDTO> {
ImageDescriptor logoImage = event.findImageWithTag(MediaTagConstants.LOGO);
dto.setLogoImage(logoImage != null ? HomeServiceUtil.convertToImageDTO(logoImage) : null);
dto.setOfficialWebsiteURL(event.getOfficialWebsiteURL() == null ? null : event.getOfficialWebsiteURL().toString());
dto.setSailorsInfoWebsiteURL(event.getSailorsInfoWebsiteURL() == null ? null : event.getSailorsInfoWebsiteURL().toString());
dto.setHasMedia(HomeServiceUtil.hasMedia(event));
dto.setState(HomeServiceUtil.calculateEventState(event));
@@ -118,9 +119,14 @@ public class GetEventViewAction implements Action<EventViewDTO> {
dto.setType(dto.getRegattas().size() == 1 ? EventType.SINGLE_REGATTA: EventType.MULTI_REGATTA);
}
// Special solution for Kieler Woche 2015
if("a9d6c5d5-cac3-47f2-9b5c-506e441819a1".equals(event.getId().toString())) {
dto.setSailorsInfoURL(Locale.GERMAN.equals(context.getClientLocale()) ? "http://sailorsinfo.kieler-woche.de/" : "http://sailorsinfo.kieler-woche.de/en");
// Special solution for localization of SailorsInfo URL
if(dto.getSailorsInfoWebsiteURL() != null && !Locale.GERMAN.equals(context.getClientLocale())) {
String localizedURL = dto.getSailorsInfoWebsiteURL();
if(!localizedURL.endsWith("/")) {
localizedURL += "/";
}
localizedURL += "en";
dto.setSailorsInfoWebsiteURL(localizedURL);
}
return dto;
@@ -23,7 +23,7 @@ public class EventViewDTO extends EventMetadataDTO implements Result {
private String seriesName;
private ImageDTO logoImage;
private String officialWebsiteURL;
private String sailorsInfoURL;
private String sailorsInfoWebsiteURL;
public EventViewDTO() {
}
@@ -105,11 +105,11 @@ public class EventViewDTO extends EventMetadataDTO implements Result {
return officialWebsiteURL;
}
public String getSailorsInfoURL() {
return sailorsInfoURL;
public String getSailorsInfoWebsiteURL() {
return sailorsInfoWebsiteURL;
}
public void setSailorsInfoURL(String sailorsInfoURL) {
this.sailorsInfoURL = sailorsInfoURL;
public void setSailorsInfoWebsiteURL(String sailorsInfoWebsiteURL) {
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

@@ -131,6 +131,8 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
final String eventDescription = "Event Description";
final String venueName = "Venue Name";
final String[] courseAreaNames = new String[] { "Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrott" };
final URL officialWebsiteURL = new URL("http://official.website.com");
final URL sailorsInfoWebsiteURL = new URL("http://sailorsinfo.website.com");
final Venue venue = new VenueImpl(venueName);
for (String courseAreaName : courseAreaNames) {
@@ -144,7 +146,8 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
event.addLeaderboardGroup(lg1);
event.addLeaderboardGroup(lg2);
event.setDescription(eventDescription);
event.setOfficialWebsiteURL(new URL("http://official.website.com"));
event.setOfficialWebsiteURL(officialWebsiteURL);
event.setSailorsInfoWebsiteURL(sailorsInfoWebsiteURL);
mof.storeEvent(event);
DomainObjectFactory dof = PersistenceFactory.INSTANCE.getDomainObjectFactory(getMongoService(), DomainFactory.INSTANCE);
@@ -169,6 +172,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
assertEquals(eventName, loadedEvent.getName());
assertEquals(eventDescription, loadedEvent.getDescription());
assertEquals(event.getOfficialWebsiteURL(), loadedEvent.getOfficialWebsiteURL());
assertEquals(event.getSailorsInfoWebsiteURL(), loadedEvent.getSailorsInfoWebsiteURL());
assertEquals(2, Util.size(loadedEvent.getLeaderboardGroups()));
Iterator<LeaderboardGroup> lgIter = loadedEvent.getLeaderboardGroups().iterator();
assertSame(lg1, lgIter.next());
@@ -44,7 +44,7 @@ import com.sap.sailing.selenium.core.SeleniumFieldDecorator;
* D049941
*/
public class PageObject {
public static final int DEFAULT_WAIT_TIMEOUT_SECONDS = 60;
public static final int DEFAULT_WAIT_TIMEOUT_SECONDS = 120;
public static final int DEFAULT_POLLING_INTERVAL = 5;
@@ -29,6 +29,7 @@ public class EventBaseJsonSerializer implements JsonSerializer<EventBase> {
public static final String FIELD_IMAGE_HEIGHT = "imageHeight";
public static final String FIELD_VIDEO_URL = "videoURL";
public static final String FIELD_OFFICIAL_WEBSITE_URL = "officialWebsiteURL";
public static final String FIELD_SAILORS_INFO_WEBSITE_URL = "sailorsInfoWebsiteURL";
public static final String FIELDS_LEADERBOARD_GROUPS = "leaderboardGroups";
public static final String FIELD_SOURCE_URL = "sourceURL";
@@ -63,6 +64,7 @@ public class EventBaseJsonSerializer implements JsonSerializer<EventBase> {
result.put(FIELD_NAME, event.getName());
result.put(FIELD_DESCRIPTION, event.getDescription());
result.put(FIELD_OFFICIAL_WEBSITE_URL, event.getOfficialWebsiteURL() != null ? event.getOfficialWebsiteURL().toString() : null);
result.put(FIELD_SAILORS_INFO_WEBSITE_URL, event.getSailorsInfoWebsiteURL() != null ? event.getSailorsInfoWebsiteURL().toString() : null);
result.put(FIELD_START_DATE, event.getStartDate() != null ? event.getStartDate().asMillis() : null);
result.put(FIELD_END_DATE, event.getStartDate() != null ? event.getEndDate().asMillis() : null);
result.put(FIELD_VENUE, venueSerializer.serialize(event.getVenue()));
@@ -1329,8 +1329,8 @@ public class MasterDataImportTest {
Event event = sourceService.createEventWithoutReplication("Test Event", /* eventDescription */ null,
new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(),
/* officialWebsiteURL */ null, /* images */Collections.<ImageDescriptor> emptyList(),
/* videos */Collections.<VideoDescriptor> emptyList());
/* officialWebsiteURL */ null, /* sailorsInfoWebsiteURL */ null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList());
CourseArea defaultCourseArea = sourceService.addCourseArea(event.getId(), "ECHO", UUID.randomUUID());
Regatta regatta = sourceService.createRegatta(
@@ -1394,8 +1394,8 @@ public class MasterDataImportTest {
Event event = sourceService.createEventWithoutReplication("Test Event", /* eventDescription */ null,
new MillisecondsTimePoint(0), new MillisecondsTimePoint(10), "testvenue", false, UUID.randomUUID(),
/* officialWebsiteURL */ null, /* images */Collections.<ImageDescriptor> emptyList(),
/* videos */Collections.<VideoDescriptor> emptyList());
/* officialWebsiteURL */ null, /* sailorsInfoWebsiteURL */ null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList());
CourseArea defaultCourseArea = sourceService.addCourseArea(event.getId(), "ECHO", UUID.randomUUID());
List<String> raceColumnNames = new ArrayList<String>();
@@ -120,7 +120,8 @@ 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(), /* officialWebsiteURLAsString */ null, /* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
"Kiel", true, UUID.randomUUID(), /* officialWebsiteURLAsString */ null, /* sailorsInfoWebsiteURLAsString */ null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
kiel = pfingstbusch.getVenue();
final CourseAreaImpl kielAlpha = new CourseAreaImpl("Alpha", UUID.randomUUID());
kiel.addCourseArea(kielAlpha);
@@ -153,7 +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(), /* officialWebsiteURLAsString */ null,
"Flensburg", true, UUID.randomUUID(), /* officialWebsiteURLAsString */ null, /*sailorsInfoWebsiteURLAsString */ null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
flensburg = aalEvent.getVenue();
final CourseAreaImpl flensburgStandard = new CourseAreaImpl("Standard", UUID.randomUUID());
@@ -371,7 +371,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
* @return The new event
*/
void updateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL, URL sailorsInfoWebsiteURL,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos);
/**
@@ -467,7 +467,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
ConcurrentHashMap<String, Regatta> getPersistentRegattasForRaceIDs();
Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, URL officialWebsiteURL, Iterable<ImageDescriptor> images,
boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL, Iterable<ImageDescriptor> images,
Iterable<VideoDescriptor> videos);
void setRegattaForRace(Regatta regatta, String raceIdAsString);
@@ -2607,10 +2607,11 @@ 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, /* officialWebsiteURL */null, /* images */Collections.<ImageDescriptor> emptyList(),
/* videos */Collections.<VideoDescriptor> emptyList());
id, /* officialWebsiteURL */null, /* sailorsInfoWebsiteURLAsString */null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList());
replicate(new CreateEvent(eventName, eventDescription, startDate, endDate, venue, isPublic, id,
/* officialWebsiteURLAsString */null, /* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
/* officialWebsiteURLAsString */null, /* sailorsInfoWebsiteURLAsString */null,
/* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList()));
return result;
}
@@ -2621,8 +2622,8 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public Event createEventWithoutReplication(String eventName, String eventDescription, TimePoint startDate,
TimePoint endDate, String venue, boolean isPublic, UUID id, URL officialWebsiteURL, Iterable<ImageDescriptor> images,
Iterable<VideoDescriptor> videos) {
TimePoint endDate, String venue, boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
Event result = new EventImpl(eventName, startDate, endDate, venue, isPublic, id);
addEvent(result);
result.setDescription(eventDescription);
@@ -2643,7 +2644,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<UUID> leaderboardGroupIds, URL officialWebsiteURL,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL, URL sailorsInfoWebsiteURL,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
final Event event = eventsById.get(id);
if (event == null) {
@@ -2667,6 +2668,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
}
event.setLeaderboardGroups(leaderboardGroups);
event.setOfficialWebsiteURL(officialWebsiteURL);
event.setSailorsInfoWebsiteURL(sailorsInfoWebsiteURL);
event.setImages(images);
event.setVideos(videos);
// TODO consider use diffutils to compute diff between old and new leaderboard groups list and apply the patch
@@ -28,9 +28,10 @@ public class CreateEvent extends AbstractEventOperation<Event> {
private final Iterable<ImageDescriptor> images;
private final Iterable<VideoDescriptor> videos;
private final URL officialWebsiteURL;
private final URL sailorsInfoWebsiteURL;
public CreateEvent(String eventName, String eventDescription, TimePoint startDate, TimePoint endDate, String venue,
boolean isPublic, UUID id, URL officialWebsiteURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
boolean isPublic, UUID id, URL officialWebsiteURL, URL sailorsInfoWebsiteURL, Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
super(id);
this.eventName = eventName;
this.eventDescription = eventDescription;
@@ -39,6 +40,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
this.venue = venue;
this.isPublic = isPublic;
this.officialWebsiteURL = officialWebsiteURL;
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
this.images = images;
this.videos = videos;
}
@@ -62,7 +64,7 @@ public class CreateEvent extends AbstractEventOperation<Event> {
@Override
public Event internalApplyTo(RacingEventService toState) {
return toState.createEventWithoutReplication(getEventName(), eventDescription, startDate, endDate, venue, isPublic,
getId(), officialWebsiteURL, images, videos);
getId(), officialWebsiteURL, sailorsInfoWebsiteURL, images, videos);
}
}
@@ -19,11 +19,12 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
private final String eventName;
private final String eventDescription;
private final URL officialWebsiteURL;
private final URL sailorsInfoWebsiteURL;
private final Iterable<ImageDescriptor> images;
private final Iterable<VideoDescriptor> videos;
public UpdateEvent(UUID id, String eventName, String eventDescription, TimePoint startDate, TimePoint endDate,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL,
String venueName, boolean isPublic, Iterable<UUID> leaderboardGroupIds, URL officialWebsiteURL, URL sailorsInfoWebsiteURL,
Iterable<ImageDescriptor> images, Iterable<VideoDescriptor> videos) {
super(id);
this.eventName = eventName;
@@ -34,6 +35,7 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
this.isPublic = isPublic;
this.leaderboardGroupIds = leaderboardGroupIds;
this.officialWebsiteURL = officialWebsiteURL;
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
this.images = images;
this.videos = videos;
}
@@ -53,7 +55,7 @@ public class UpdateEvent extends AbstractEventOperation<Void> {
@Override
public Void internalApplyTo(RacingEventService toState) {
toState.updateEvent(getId(), eventName, eventDescription, startDate, endDate, venueName, isPublic,
leaderboardGroupIds, officialWebsiteURL, images, videos);
leaderboardGroupIds, officialWebsiteURL, sailorsInfoWebsiteURL, images, videos);
return null;
}
}
+3
View File
@@ -6,6 +6,9 @@ The term itself should be revised at some point, and currently refers to the tec
## Server Architecture
[Server Architecture](racelog-tracking/server)
## Setting Up
[Smartphone Tracking](wiki/smartphone-tracking)
## App Architecture
- [current Tracking App](tracking-app)
- [old prototype](racelog-tracking/app)