mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
Merge branch 'bug5288' into 5288_bug5419
# Conflicts: # java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/adminconsole/places/AdminConsoleViewImpl.java # java/com.sap.sse.gwt.adminconsole/src/com/sap/sse/gwt/adminconsole/AdminConsolePanel.java
This commit is contained in:
commit
9e1ed2e69c
101 files changed
+1233
-624
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# mountnvmeswap Formats and mounts a yet unpartitioned NVMe volume as swap
|
||||
#
|
||||
# chkconfig: 2345 95 10
|
||||
# description: Formats and mounts a yet unpartitioned NVMe volume as swap
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mountnvmeswap
|
||||
# Required-Start: $local_fs $network
|
||||
# Should-Start:
|
||||
# Required-Stop:
|
||||
# Should-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Formats and mounts a yet unpartitioned NVMe volume as swap
|
||||
# Description: Formats and mounts a yet unpartitioned NVMe volume as swap
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
RETVAL=0
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
/usr/local/bin/mountnvmeswap
|
||||
;;
|
||||
stop)
|
||||
;;
|
||||
status)
|
||||
swapon -s | grep /dev/nvme0n1
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|status|stop}"
|
||||
RETVAL=3
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
@@ -281,7 +281,7 @@ if [[ "$@" == "release" ]]; then
|
||||
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-http.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deployer.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deploy.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/monitoring.properties configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/mail.properties configuration/
|
||||
@@ -811,7 +811,7 @@ if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
|
||||
cp -v $p2PluginRepository/configuration/config.ini configuration/
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-http.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deployer.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deploy.xml configuration/jetty/etc
|
||||
cp -v $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties configuration/jetty/etc
|
||||
|
||||
if [ ! -f "$ACDIR/env.sh" ]; then
|
||||
@@ -895,7 +895,7 @@ if [[ "$@" == "remote-deploy" ]]; then
|
||||
$SCP_CMD $p2PluginRepository/configuration/config.ini $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-http.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deployer.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/jetty-deploy.xml $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/jetty/etc/realm.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/jetty/etc
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/monitoring.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
$SCP_CMD $PROJECT_HOME/java/target/configuration/mail.properties $REMOTE_SERVER_LOGIN:$REMOTE_SERVER/configuration/
|
||||
|
||||
+1
-9
@@ -12,8 +12,6 @@ import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.eclipse.jetty.util.thread.ShutdownThread;
|
||||
import org.eclipse.jetty.websocket.api.RemoteEndpoint;
|
||||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketAdapter;
|
||||
@@ -297,13 +295,7 @@ public class WebSocketConnectionManager implements LiveDataConnection {
|
||||
try {
|
||||
if (uri.getScheme().equals("ws") || uri.getScheme().equals("wss")) {
|
||||
logger.log(Level.INFO, "Trying to connect to " + uri + " for " + this);
|
||||
client = new WebSocketClient(new SslContextFactory()) {
|
||||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
ShutdownThread.deregister(this); // this will make sure that after destroy() no reference is being held to this client
|
||||
}
|
||||
};
|
||||
client = new WebSocketClient();
|
||||
client.start();
|
||||
currentSocket = new WebSocket();
|
||||
igtimiServerTimepoint = null;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ package com.sap.sailing.domain.coursetemplate;
|
||||
*
|
||||
*/
|
||||
public interface FreestyleMarkConfiguration<P> extends MarkConfiguration<P> {
|
||||
CommonMarkProperties getFreestyleProperties();
|
||||
FreestyleMarkProperties getFreestyleProperties();
|
||||
|
||||
/**
|
||||
* @return a non-{@code null} object if this mark configuration originated from a {@link MarkProperties} object
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.sap.sailing.domain.coursetemplate;
|
||||
|
||||
/**
|
||||
* While sharing most of @{@link CommonMarkProperties}, {@link MarkProperties} do have the distinct
|
||||
* {@link FreestyleMarkConfiguration} property tags.
|
||||
*
|
||||
*/
|
||||
public interface FreestyleMarkProperties extends CommonMarkProperties, HasTags {
|
||||
void setTags(Iterable<String> tags);
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ import com.sap.sse.security.shared.WithQualifiedObjectIdentifier;
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface MarkProperties extends CommonMarkProperties, NamedWithUUID, HasTags, WithQualifiedObjectIdentifier {
|
||||
public interface MarkProperties extends FreestyleMarkProperties, NamedWithUUID, WithQualifiedObjectIdentifier {
|
||||
void setColor(Color color);
|
||||
|
||||
void setShape(String shape);
|
||||
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.domain.coursetemplate.impl;
|
||||
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkConfigurationVisitor;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkProperties;
|
||||
@@ -10,10 +11,10 @@ public class FreestyleMarkConfigurationImpl<P> extends MarkConfigurationImpl<P>
|
||||
private static final long serialVersionUID = 8167307943855869321L;
|
||||
|
||||
private final MarkProperties optionalMarkProperties;
|
||||
private final CommonMarkProperties freestyleProperties;
|
||||
private final FreestyleMarkProperties freestyleProperties;
|
||||
|
||||
public FreestyleMarkConfigurationImpl(MarkTemplate optionalMarkTemplate, MarkProperties optionalMarkProperties,
|
||||
CommonMarkProperties freestyleProperties, P annotation) {
|
||||
FreestyleMarkProperties freestyleProperties, P annotation) {
|
||||
super(optionalMarkTemplate, annotation);
|
||||
this.optionalMarkProperties = optionalMarkProperties;
|
||||
this.freestyleProperties = freestyleProperties;
|
||||
@@ -35,7 +36,7 @@ public class FreestyleMarkConfigurationImpl<P> extends MarkConfigurationImpl<P>
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonMarkProperties getFreestyleProperties() {
|
||||
public FreestyleMarkProperties getFreestyleProperties() {
|
||||
return freestyleProperties;
|
||||
}
|
||||
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.sap.sailing.domain.coursetemplate.impl;
|
||||
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sse.common.Color;
|
||||
|
||||
public class FreestyleMarkPropertiesImpl extends CommonMarkPropertiesImpl implements FreestyleMarkProperties {
|
||||
private static final long serialVersionUID = -925045903410189747L;
|
||||
private Iterable<String> tags;
|
||||
|
||||
public FreestyleMarkPropertiesImpl(String name, String shortName, Color color, String shape, String pattern, MarkType type, Iterable<String> tags) {
|
||||
super(name, shortName, color, shape, pattern, type);
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public FreestyleMarkPropertiesImpl(final CommonMarkProperties commonMarkProperties, Iterable<String> tags) {
|
||||
this(commonMarkProperties.getName(), commonMarkProperties.getShortName(), commonMarkProperties.getColor(),
|
||||
commonMarkProperties.getShape(), commonMarkProperties.getPattern(), commonMarkProperties.getType(), tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTags(Iterable<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
}
|
||||
+2
-18
@@ -6,7 +6,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkRole;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkTemplate;
|
||||
@@ -14,10 +13,9 @@ import com.sap.sailing.domain.coursetemplate.Positioning;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class MarkPropertiesImpl extends CommonMarkPropertiesImpl implements MarkProperties {
|
||||
public class MarkPropertiesImpl extends FreestyleMarkPropertiesImpl implements MarkProperties {
|
||||
private static final long serialVersionUID = -5588202720707030502L;
|
||||
private Positioning positioningInformation;
|
||||
private Iterable<String> tags;
|
||||
private UUID id;
|
||||
|
||||
private final ConcurrentHashMap<MarkTemplate, TimePoint> lastUsedMarkTemplate = new ConcurrentHashMap<>();
|
||||
@@ -29,12 +27,7 @@ public class MarkPropertiesImpl extends CommonMarkPropertiesImpl implements Mark
|
||||
|
||||
public MarkPropertiesImpl(UUID id, String name, String shortName, Color color, String shape, String pattern,
|
||||
MarkType type) {
|
||||
super(name, shortName, color, shape, pattern, type);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public MarkPropertiesImpl(UUID id, final CommonMarkProperties commonMarkProperties) {
|
||||
super(commonMarkProperties);
|
||||
super(name, shortName, color, shape, pattern, type, /* tags */ null);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -78,15 +71,6 @@ public class MarkPropertiesImpl extends CommonMarkPropertiesImpl implements Mark
|
||||
this.positioningInformation = positioningInformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getTags() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
public void setTags(Iterable<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<MarkTemplate, TimePoint> getLastUsedMarkTemplate() {
|
||||
return Collections.unmodifiableMap(lastUsedMarkTemplate);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
entryPointModules=
|
||||
filesCopiedToWebInfLib=
|
||||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy1sb2NhbFdvcmtlcnMgMTAgIC13YXIgLi9dXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDJnXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5BZG1pbkNvbnNvbGVQd2E8L2VudHJ5LXBvaW50LW1vZHVsZT48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\=
|
||||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy1sb2NhbFdvcmtlcnMgNyAtY29tcGlsZVJlcG9ydCAgLXdhciAuL11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14MmddXT48L3ZtLWFyZ3M+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLkFkbWluQ29uc29sZTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+
|
||||
+45
-40
@@ -4,80 +4,80 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.http.client.URL;
|
||||
import com.google.gwt.place.shared.Place;
|
||||
|
||||
/**
|
||||
* An abstract Place which is able to manage and parse place parameters.
|
||||
*
|
||||
* @author Frank
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractBasePlace extends Place {
|
||||
private static final Logger logger = Logger.getLogger(AbstractBasePlace.class.getName());
|
||||
private static final String VALIDATE_TOKENS_MESSAGE_PREFIX = "Missing token(s): ";
|
||||
|
||||
private String placeParametersAsToken;
|
||||
private Map<String, String> params = new HashMap<String, String>();
|
||||
private final String placeParametersAsToken;
|
||||
private final Map<String, String> params;
|
||||
|
||||
public AbstractBasePlace(String... paramKeysAndValues) {
|
||||
extractKeysAndValues(paramKeysAndValues);
|
||||
protected AbstractBasePlace(Map<String, String> params) {
|
||||
this.params = new HashMap<>();
|
||||
if (params != null) {
|
||||
this.params.putAll(params);
|
||||
}
|
||||
placeParametersAsToken = getTokenStringFromParameters(params);
|
||||
}
|
||||
|
||||
public AbstractBasePlace(String url) {
|
||||
extractUrlParams(url);
|
||||
protected AbstractBasePlace(String placeParamsFromUrlFragment) {
|
||||
this.params = extractUrlParams(placeParamsFromUrlFragment);
|
||||
placeParametersAsToken = getTokenStringFromParameters(this.params);
|
||||
}
|
||||
|
||||
protected void extractKeysAndValues(String... paramKeysAndValues) {
|
||||
if (paramKeysAndValues.length % 2 == 0) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < paramKeysAndValues.length; i++) {
|
||||
String paramName = paramKeysAndValues[i++];
|
||||
String paramValue = paramKeysAndValues[i];
|
||||
protected String getTokenStringFromParameters(Map<String, String> paramKeysAndValues) {
|
||||
final StringJoiner stringJoiner = new StringJoiner("&");
|
||||
if (paramKeysAndValues != null) {
|
||||
for (final Entry<String, String> e : paramKeysAndValues.entrySet()) {
|
||||
String paramName = e.getKey();
|
||||
String paramValue = e.getValue();
|
||||
// for now we don't add 'null' parameters
|
||||
if(paramValue != null) {
|
||||
params.put(paramName, paramValue);
|
||||
if(stringBuilder.length() > 0) {
|
||||
stringBuilder.append("&");
|
||||
}
|
||||
stringBuilder.append(paramName + "=" + paramValue);
|
||||
if (paramValue != null) {
|
||||
stringJoiner.add(paramName + "=" + paramValue);
|
||||
}
|
||||
}
|
||||
|
||||
placeParametersAsToken = stringBuilder.toString();
|
||||
} else {
|
||||
logger.warning("Invalid number of arguments received! Must be key,value,key,value ... ignoring arguments");
|
||||
}
|
||||
return stringJoiner.toString();
|
||||
}
|
||||
|
||||
protected void extractUrlParams(String url) {
|
||||
if (url != null && !url.isEmpty()) {
|
||||
this.placeParametersAsToken = url;
|
||||
List<String> list = Arrays.asList(placeParametersAsToken.split("&"));
|
||||
protected Map<String, String> extractUrlParams(String placeParamsFromUrlFragment) {
|
||||
final Map<String, String> result = new HashMap<>();
|
||||
if (placeParamsFromUrlFragment != null && !placeParamsFromUrlFragment.isEmpty()) {
|
||||
final List<String> list = Arrays.asList(placeParamsFromUrlFragment.split("&"));
|
||||
if (list == null || list.size() < 1) {
|
||||
logger.warning("Token empty, no-op");
|
||||
return;
|
||||
}
|
||||
for (String listItem : list) {
|
||||
List<String> nvPair = Arrays.asList(listItem.split("="));
|
||||
if (nvPair == null || nvPair.size() != 2) {
|
||||
logger.warning("Invalid parameters");
|
||||
continue;
|
||||
} else {
|
||||
for (String listItem : list) {
|
||||
final List<String> nvPair = Arrays.asList(listItem.split("="));
|
||||
if (nvPair == null || nvPair.size() != 2) {
|
||||
logger.warning("Invalid parameters");
|
||||
} else {
|
||||
result.put(nvPair.get(0), nvPair.get(1));
|
||||
}
|
||||
}
|
||||
params.put(nvPair.get(0), nvPair.get(1));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void validate(String... paramNames) {
|
||||
StringBuffer message = new StringBuffer(VALIDATE_TOKENS_MESSAGE_PREFIX);
|
||||
|
||||
final StringBuffer message = new StringBuffer(VALIDATE_TOKENS_MESSAGE_PREFIX);
|
||||
for (String name : paramNames) {
|
||||
if (!params.containsKey(name))
|
||||
if (!params.containsKey(name)) {
|
||||
message.append(name + " ");
|
||||
}
|
||||
}
|
||||
|
||||
if (!message.toString().equals(VALIDATE_TOKENS_MESSAGE_PREFIX)) {
|
||||
logger.warning(message.toString());
|
||||
}
|
||||
@@ -91,6 +91,11 @@ public abstract class AbstractBasePlace extends Place {
|
||||
return params.get(name);
|
||||
}
|
||||
|
||||
public String getParameterDecoded(String name) {
|
||||
String paramValue = params.get(name);
|
||||
return paramValue == null ? null : URL.decodeQueryString(paramValue);
|
||||
}
|
||||
|
||||
public boolean hasParameter(String name) {
|
||||
return params.containsKey(name);
|
||||
}
|
||||
|
||||
+6
-1
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.home.client.place.event.legacy;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.gwt.shared.ClientConfiguration;
|
||||
|
||||
public class EventPlace extends AbstractBasePlace {
|
||||
@@ -29,7 +30,11 @@ public class EventPlace extends AbstractBasePlace {
|
||||
}
|
||||
|
||||
public EventPlace(String eventUuidAsString, EventNavigationTabs navigationTab, String leaderboardIdAsNameString) {
|
||||
super(PARAM_EVENTID, eventUuidAsString, PARAM_NAVIGATION_TAB, navigationTab.name(), PARAM_LEADEROARD_NAME, leaderboardIdAsNameString);
|
||||
super(Util.<String, String>mapBuilder()
|
||||
.put(PARAM_EVENTID, eventUuidAsString)
|
||||
.put(PARAM_NAVIGATION_TAB, navigationTab.name())
|
||||
.put(PARAM_LEADEROARD_NAME, leaderboardIdAsNameString)
|
||||
.build());
|
||||
this.eventUuidAsString = eventUuidAsString;
|
||||
this.navigationTab = navigationTab;
|
||||
this.leaderboardIdAsNameString = leaderboardIdAsNameString;
|
||||
|
||||
+8
-2
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.home.client.place.event.legacy;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.gwt.shared.ClientConfiguration;
|
||||
|
||||
public class RegattaPlace extends AbstractBasePlace {
|
||||
@@ -35,8 +36,13 @@ public class RegattaPlace extends AbstractBasePlace {
|
||||
}
|
||||
|
||||
public RegattaPlace(String eventUuidAsString, RegattaNavigationTabs navigationTab, String leaderboardIdAsNameString, Boolean showRaceDetails, Boolean showSettings) {
|
||||
super(PARAM_EVENTID, eventUuidAsString, PARAM_NAVIGATION_TAB, navigationTab.name(), PARAM_LEADERBOARD_NAME, leaderboardIdAsNameString,
|
||||
PARAM_SHOW_RACE_DETAILS, String.valueOf(showRaceDetails), PARAM_SHOW_SETTINGS, String.valueOf(showSettings));
|
||||
super(Util.<String, String>mapBuilder()
|
||||
.put(PARAM_EVENTID, eventUuidAsString)
|
||||
.put(PARAM_NAVIGATION_TAB, navigationTab.name())
|
||||
.put(PARAM_LEADERBOARD_NAME, leaderboardIdAsNameString)
|
||||
.put(PARAM_SHOW_RACE_DETAILS, String.valueOf(showRaceDetails))
|
||||
.put(PARAM_SHOW_SETTINGS, String.valueOf(showSettings))
|
||||
.build());
|
||||
this.eventUuidAsString = eventUuidAsString;
|
||||
this.navigationTab = navigationTab;
|
||||
this.leaderboardIdAsNameString = leaderboardIdAsNameString;
|
||||
|
||||
+8
-2
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.home.client.place.event.legacy;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.gwt.shared.ClientConfiguration;
|
||||
|
||||
public class SeriesPlace extends AbstractBasePlace {
|
||||
@@ -35,8 +36,13 @@ public class SeriesPlace extends AbstractBasePlace {
|
||||
}
|
||||
|
||||
public SeriesPlace(String eventUuidAsString, SeriesNavigationTabs navigationTab, String leaderboardIdAsNameString, Boolean showRaceDetails, Boolean showSettings) {
|
||||
super(PARAM_EVENTID, eventUuidAsString, PARAM_NAVIGATION_TAB, navigationTab.name(), PARAM_LEADERBOARD_NAME, leaderboardIdAsNameString,
|
||||
PARAM_SHOW_RACE_DETAILS, String.valueOf(showRaceDetails), PARAM_SHOW_SETTINGS, String.valueOf(showSettings));
|
||||
super(Util.<String, String>mapBuilder()
|
||||
.put(PARAM_EVENTID, eventUuidAsString)
|
||||
.put(PARAM_NAVIGATION_TAB, navigationTab.name())
|
||||
.put(PARAM_LEADERBOARD_NAME, leaderboardIdAsNameString)
|
||||
.put(PARAM_SHOW_RACE_DETAILS, String.valueOf(showRaceDetails))
|
||||
.put(PARAM_SHOW_SETTINGS, String.valueOf(showSettings))
|
||||
.build());
|
||||
this.eventUuidAsString = eventUuidAsString;
|
||||
this.navigationTab = navigationTab;
|
||||
this.leaderboardIdAsNameString = leaderboardIdAsNameString;
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.home.desktop.places.whatsnew;
|
||||
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public class WhatsNewPlace extends AbstractBasePlace {
|
||||
public enum WhatsNewNavigationTabs { SailingAnalytics, RaceManagerApp, InSightApp, BuoyPingerApp, TrainingDiary, SailingSimulator };
|
||||
@@ -15,7 +16,7 @@ public class WhatsNewPlace extends AbstractBasePlace {
|
||||
}
|
||||
|
||||
public WhatsNewPlace(WhatsNewNavigationTabs navigationTab) {
|
||||
super(PARAM_NAVIGATION_TAB, navigationTab.name());
|
||||
super(Util.<String, String>mapBuilder().put(PARAM_NAVIGATION_TAB, navigationTab.name()).build());
|
||||
this.navigationTab = navigationTab;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class HomePlacesNavigator extends AbstractPlaceNavigator {
|
||||
}
|
||||
|
||||
public PlaceNavigation<ImprintPlace> getImprintNavigation() {
|
||||
return createGlobalPlaceNavigation(new ImprintPlace());
|
||||
return createGlobalPlaceNavigation(new ImprintPlace((String) null /* empty place token */));
|
||||
}
|
||||
|
||||
public PlaceNavigation<EventDefaultPlace> getEventNavigation(String eventUuidAsString, String baseUrl,
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ public class ErrorPlace extends AbstractBasePlace implements HasMobileVersion {
|
||||
}
|
||||
|
||||
private ErrorPlace(final boolean reloadedError, final String errorMessageDetail) {
|
||||
super("");
|
||||
this.errorMessageDetail = errorMessageDetail;
|
||||
this.reloadedError = reloadedError;
|
||||
}
|
||||
|
||||
+6
-2
@@ -9,6 +9,10 @@ import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
|
||||
public class ImprintPlace extends AbstractBasePlace implements HasLocationTitle, HasMobileVersion {
|
||||
public ImprintPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocationTitle() {
|
||||
return StringMessages.INSTANCE.impressum();
|
||||
@@ -22,8 +26,8 @@ public class ImprintPlace extends AbstractBasePlace implements HasLocationTitle,
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImprintPlace getPlace(String url) {
|
||||
return new ImprintPlace();
|
||||
public ImprintPlace getPlace(String token) {
|
||||
return new ImprintPlace(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -11,6 +11,7 @@ import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sailing.gwt.home.shared.app.HasLocationTitle;
|
||||
import com.sap.sailing.gwt.home.shared.app.HasMobileVersion;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public class SolutionsPlace extends AbstractBasePlace implements HasLocationTitle, HasMobileVersion {
|
||||
|
||||
@@ -67,7 +68,7 @@ public class SolutionsPlace extends AbstractBasePlace implements HasLocationTitl
|
||||
}
|
||||
|
||||
public SolutionsPlace(SolutionsNavigationTabs navigationTab) {
|
||||
super(PARAM_NAVIGATION_TAB, navigationTab.name());
|
||||
super(Util.<String, String>mapBuilder().put(PARAM_NAVIGATION_TAB, navigationTab.name()).build());
|
||||
this.navigationTab = navigationTab;
|
||||
this.invokedFromCalendar = false;
|
||||
}
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ public class ConfirmationPlace extends AbstractBasePlace implements HasMobileVer
|
||||
}
|
||||
|
||||
public ConfirmationPlace(Action action, String name, String validationSecret) {
|
||||
super((String) null); // TODO bug5288 the AbstractBasePlace logic is
|
||||
this.action = action;
|
||||
this.name = name;
|
||||
this.validationSecret = validationSecret;
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ public class PasswordResetPlace extends AbstractBasePlace implements HasMobileVe
|
||||
}
|
||||
|
||||
public PasswordResetPlace(String name, String email, String resetSecret) {
|
||||
super((String) null); // TODO bug5288: can the generic token parsing that AbstractBasePlace offers be used here to tokenize the place params?
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
this.resetSecret = resetSecret;
|
||||
@@ -74,7 +75,7 @@ public class PasswordResetPlace extends AbstractBasePlace implements HasMobileVe
|
||||
|
||||
@Override
|
||||
public String getToken(PasswordResetPlace place) {
|
||||
return "";
|
||||
return ""; // TODO bug5288: why not the tokenized parameters as they were parsed by getPlace(token)?
|
||||
}
|
||||
}
|
||||
}
|
||||
-3
@@ -36,13 +36,11 @@ public class AdminConsoleClientFactoryImpl implements AdminConsoleClientFactory
|
||||
private TopLevelView topLevelView;
|
||||
|
||||
public AdminConsoleClientFactoryImpl() {
|
||||
|
||||
}
|
||||
|
||||
public AdminConsoleClientFactoryImpl(final SailingServiceWriteAsync sailingService) {
|
||||
this.sailingService = sailingService;
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) mediaServiceWrite, RemoteServiceMappingConstants.mediaServiceRemotePath, HEADER_FORWARD_TO_MASTER);
|
||||
|
||||
topLevelView = new AdminConsoleTopLevelView(eventBus);
|
||||
}
|
||||
|
||||
@@ -100,5 +98,4 @@ public class AdminConsoleClientFactoryImpl implements AdminConsoleClientFactory
|
||||
public AcceptsOneWidget getContent() {
|
||||
return topLevelView.getContent();
|
||||
}
|
||||
|
||||
}
|
||||
+1
-8
@@ -20,7 +20,6 @@ import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
|
||||
public class AdminConsoleEntryPoint extends AbstractSailingWriteEntryPoint {
|
||||
|
||||
private final MediaServiceWriteAsync mediaServiceWrite = GWT.create(MediaServiceWrite.class);
|
||||
|
||||
private SimplePanel appWidget = new SimpleLayoutPanel();
|
||||
@@ -30,7 +29,6 @@ public class AdminConsoleEntryPoint extends AbstractSailingWriteEntryPoint {
|
||||
Highcharts.ensureInjectedWithMore();
|
||||
super.doOnModuleLoad();
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) mediaServiceWrite, RemoteServiceMappingConstants.mediaServiceRemotePath, HEADER_FORWARD_TO_MASTER);
|
||||
|
||||
initActivitiesAndPlaces();
|
||||
}
|
||||
|
||||
@@ -38,18 +36,13 @@ public class AdminConsoleEntryPoint extends AbstractSailingWriteEntryPoint {
|
||||
final AdminConsoleClientFactory clientFactory = new AdminConsoleClientFactoryImpl(getSailingService());
|
||||
EventBus eventBus = clientFactory.getEventBus();
|
||||
PlaceController placeController = clientFactory.getPlaceController();
|
||||
|
||||
AdminConsoleActivityMapper activityMapper = new AdminConsoleActivityMapper(clientFactory);
|
||||
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
|
||||
activityManager.setDisplay(appWidget);
|
||||
|
||||
AdminConsolePlaceHistoryMapper historyMapper = GWT.create(AdminConsolePlaceHistoryMapper.class);
|
||||
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
|
||||
historyHandler.register(placeController, eventBus, new EventsPlace());
|
||||
|
||||
historyHandler.register(placeController, eventBus, new EventsPlace((String) null /* no place token */));
|
||||
RootLayoutPanel.get().add(appWidget);
|
||||
|
||||
historyHandler.handleCurrentHistory();
|
||||
}
|
||||
|
||||
}
|
||||
+9
-1
@@ -1,12 +1,20 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sse.gwt.adminconsole.AdminConsolePlace;
|
||||
|
||||
public abstract class AbstractAdminConsolePlace extends AbstractBasePlace implements AdminConsolePlace {
|
||||
protected AbstractAdminConsolePlace(String placeParamsFromUrlFragment) {
|
||||
super(placeParamsFromUrlFragment);
|
||||
}
|
||||
|
||||
protected AbstractAdminConsolePlace(Map<String, String> paramKeysAndValues) {
|
||||
super(paramKeysAndValues);
|
||||
}
|
||||
|
||||
public boolean isSamePlace(Object obj) {
|
||||
return obj != null && obj.getClass() == this.getClass();
|
||||
}
|
||||
|
||||
}
|
||||
+50
-39
@@ -1,64 +1,80 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sse.gwt.adminconsole.FilterableAdminConsolePlace;
|
||||
import com.sap.sse.gwt.client.panels.FilterParameter;
|
||||
import com.sap.sse.gwt.client.panels.FilterAndSelectParameters;
|
||||
|
||||
public abstract class AbstractFilterablePlace extends AbstractAdminConsolePlace implements FilterableAdminConsolePlace {
|
||||
|
||||
/**
|
||||
* Name of the place parameter that adds the parameter's value into the place's main table's filter box unchanged.
|
||||
*/
|
||||
private static final String FILTER_KEY = "filter";
|
||||
|
||||
/**
|
||||
* Name of the place parameter that can be used to make a selection in the place's main table. The logic for
|
||||
* identifying the rows based on the parameter value is the same as implemented by the filter box.
|
||||
*/
|
||||
private static final String SELECT_KEY = "select";
|
||||
|
||||
/**
|
||||
* Name of the place parameter that combines {@link #FILTER_KEY} and {@link #SELECT_KEY}, filtering and selecting
|
||||
* based on the same search string.
|
||||
*/
|
||||
private static final String FILTER_AND_SELECT_KEY = "filterAndSelect";
|
||||
|
||||
/**
|
||||
* Name of the place parameter that requests an exact and complete match for the parameter value with at least one
|
||||
* searchable column value of the place's main table's rows.
|
||||
*/
|
||||
private static final String SELECT_EXACT_KEY = "selectExact";
|
||||
|
||||
private FilterParameter filterParameter = new FilterParameter();
|
||||
private final FilterAndSelectParameters filterAndSelectParameters;
|
||||
|
||||
protected AbstractFilterablePlace(String token) {
|
||||
super(token);
|
||||
filterAndSelectParameters = getFilterAndSelectParametersFromPlaceParams();
|
||||
}
|
||||
|
||||
protected AbstractFilterablePlace(Map<String, String> paramKeysAndValues) {
|
||||
super(paramKeysAndValues);
|
||||
filterAndSelectParameters = getFilterAndSelectParametersFromPlaceParams();
|
||||
}
|
||||
|
||||
private FilterAndSelectParameters getFilterAndSelectParametersFromPlaceParams() {
|
||||
return new FilterAndSelectParameters(getParameterDecoded(FILTER_KEY), getParameterDecoded(SELECT_KEY),
|
||||
getParameterDecoded(SELECT_EXACT_KEY), getParameterDecoded(FILTER_AND_SELECT_KEY));
|
||||
}
|
||||
|
||||
public String getFilter() {
|
||||
return filterParameter.getFilter();
|
||||
return filterAndSelectParameters.getFilter();
|
||||
}
|
||||
|
||||
public String getSelect() {
|
||||
return filterParameter.getSelect();
|
||||
return filterAndSelectParameters.getSelect();
|
||||
}
|
||||
|
||||
void loadFilterParam() {
|
||||
this.filterParameter.setFilter(getParameter(FILTER_KEY));
|
||||
}
|
||||
|
||||
void loadSelectParam() {
|
||||
this.filterParameter.setSelect(getParameter(SELECT_KEY));
|
||||
}
|
||||
|
||||
void loadSelectExactParam() {
|
||||
this.filterParameter.setSelectExact(getParameter(SELECT_EXACT_KEY));
|
||||
}
|
||||
|
||||
public void loadFilterAndSelectParam() {
|
||||
this.filterParameter.setFilterAndSelect(getParameter(FILTER_AND_SELECT_KEY));
|
||||
}
|
||||
|
||||
public String getSelectExact() {
|
||||
return filterParameter.getSelectExact();
|
||||
return filterAndSelectParameters.getSelectExact();
|
||||
}
|
||||
|
||||
public String getFilterAndSelect() {
|
||||
return this.filterParameter.getFilterAndSelect();
|
||||
return this.filterAndSelectParameters.getFilterAndSelect();
|
||||
}
|
||||
|
||||
public FilterParameter getFilterParameter() {
|
||||
return this.filterParameter;
|
||||
public FilterAndSelectParameters getFilterAndSelectParameters() {
|
||||
return this.filterAndSelectParameters;
|
||||
}
|
||||
|
||||
// TODO bug5288: this method should not have to exist, and subclasses should not maintain information redundant with how the panels are assembled in the AdminConsole tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
protected static abstract class TablePlaceTokenizer<P extends AbstractFilterablePlace> implements PlaceTokenizer<P> {
|
||||
|
||||
@Override
|
||||
public String getToken(P place) {
|
||||
return place.getParametersAsToken();
|
||||
@@ -66,29 +82,24 @@ public abstract class AbstractFilterablePlace extends AbstractAdminConsolePlace
|
||||
|
||||
@Override
|
||||
public P getPlace(String token) {
|
||||
P place = getPlaceFactory().get();
|
||||
P place = getPlaceFactory().apply(token);
|
||||
place.extractUrlParams(token);
|
||||
|
||||
place.loadFilterParam();
|
||||
place.loadSelectParam();
|
||||
place.loadSelectExactParam();
|
||||
place.loadFilterAndSelectParam();
|
||||
return place;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a {@link Function factory} to create a new place from parsed {@link Long token} on deserialization.
|
||||
* Provides a {@link Function factory} to create a new place from parsed {@link String token} on deserialization.
|
||||
*
|
||||
* @return the {@link Function} to get the place instance from
|
||||
*/
|
||||
protected abstract Supplier<P> getPlaceFactory();
|
||||
protected abstract Function<String, P> getPlaceFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((filterParameter == null) ? 0 : filterParameter.hashCode());
|
||||
result = prime * result + ((filterAndSelectParameters == null) ? 0 : filterAndSelectParameters.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -101,10 +112,10 @@ public abstract class AbstractFilterablePlace extends AbstractAdminConsolePlace
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
AbstractFilterablePlace other = (AbstractFilterablePlace) obj;
|
||||
if (filterParameter == null) {
|
||||
if (other.filterParameter != null)
|
||||
if (filterAndSelectParameters == null) {
|
||||
if (other.filterAndSelectParameters != null)
|
||||
return false;
|
||||
} else if (!filterParameter.equals(other.filterParameter))
|
||||
} else if (!filterAndSelectParameters.equals(other.filterAndSelectParameters))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
+34
-36
@@ -144,14 +144,14 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
private final StringMessages stringMessages = StringMessages.INSTANCE;
|
||||
|
||||
private UserService userService;
|
||||
|
||||
|
||||
private ErrorReporter errorReporter;
|
||||
|
||||
private AdminConsolePanel<AbstractAdminConsolePlace> adminConsolePanel;
|
||||
private PlaceController placeController;
|
||||
|
||||
|
||||
private AbstractAdminConsolePlace defaultPlace;
|
||||
|
||||
|
||||
public AdminConsoleViewImpl() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
@@ -200,8 +200,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
getWidget().fillEvents();
|
||||
presenter.fillLeaderboardGroups();
|
||||
}
|
||||
}, stringMessages.events(), new EventsPlace(), SecuredDomainType.EVENT.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
}, stringMessages.events(), new EventsPlace((String) null /* no place token */), SecuredDomainType.EVENT.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
/* REGATTAS */
|
||||
final RegattaManagementPanelSupplier regattaManagementPanelSupplier = new RegattaManagementPanelSupplier(stringMessages, presenter);
|
||||
adminConsolePanel.addToVerticalTabPanel(new DefaultRefreshableAdminConsolePanel<RegattaManagementPanel>(regattaManagementPanelSupplier) {
|
||||
@@ -209,8 +208,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillRegattas();
|
||||
}
|
||||
}, stringMessages.regattas(), new RegattasPlace(), SecuredDomainType.REGATTA.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
}, stringMessages.regattas(), new RegattasPlace((String) null /* no place token */), SecuredDomainType.REGATTA.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
/* LEADERBOARDS */
|
||||
final HorizontalTabLayoutPanel leaderboardTabPanel = adminConsolePanel
|
||||
.addVerticalTab(stringMessages.leaderboards(), LEADERBOARDS);
|
||||
@@ -223,7 +221,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillLeaderboards();
|
||||
}
|
||||
}, stringMessages.leaderboards(), new LeaderboardsPlace(), SecuredDomainType.LEADERBOARD.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
}, stringMessages.leaderboards(), new LeaderboardsPlace((String) null /* no place token */), SecuredDomainType.LEADERBOARD.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Leaderboard Group */
|
||||
final LeaderboardGroupConfigPanelSupplier leaderboardGroupConfigPanelSupplier = new LeaderboardGroupConfigPanelSupplier(
|
||||
@@ -240,7 +238,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
refreshAfterBecomingVisible(); //Refresh to sure that actual data is provided
|
||||
presenter.setupLeaderboardGroups(getWidget(), params);
|
||||
}
|
||||
}, stringMessages.leaderboardGroups(), new LeaderboardGroupsPlace(), SecuredDomainType.LEADERBOARD_GROUP.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
}, stringMessages.leaderboardGroups(), new LeaderboardGroupsPlace((String) null /* no place token */), SecuredDomainType.LEADERBOARD_GROUP.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* RACES */
|
||||
final HorizontalTabLayoutPanel racesTabPanel = adminConsolePanel.addVerticalTab(stringMessages.trackedRaces(), RACES);
|
||||
@@ -253,7 +251,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillRegattas();
|
||||
}
|
||||
}, stringMessages.trackedRaces(), new TrackedRacesPlace(),
|
||||
}, stringMessages.trackedRaces(), new TrackedRacesPlace((String) null /* no place token */),
|
||||
SecuredDomainType.TRACKED_RACE.getPermission(TrackedRaceActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Competitor */
|
||||
@@ -263,7 +261,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshCompetitorList();
|
||||
}
|
||||
}, stringMessages.competitors(), new CompetitorsPlace(),
|
||||
}, stringMessages.competitors(), new CompetitorsPlace(null),
|
||||
SecuredDomainType.COMPETITOR.getPermission(DefaultActions.MUTATION_ACTIONS_FOR_NON_DELETABLE_TYPES));
|
||||
|
||||
/* Boat */
|
||||
@@ -273,7 +271,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshBoatList();
|
||||
}
|
||||
}, stringMessages.boats(), new BoatsPlace(),
|
||||
}, stringMessages.boats(), new BoatsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.BOAT.getPermission(DefaultActions.MUTATION_ACTIONS_FOR_NON_DELETABLE_TYPES));
|
||||
|
||||
/* Race */
|
||||
@@ -285,7 +283,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillRegattas();
|
||||
}
|
||||
}, stringMessages.courseLayout(), new CourseLayoutPlace(),
|
||||
}, stringMessages.courseLayout(), new CourseLayoutPlace((String) null /* no place token */),
|
||||
SecuredDomainType.TRACKED_RACE.getPermission(DefaultActions.UPDATE));
|
||||
|
||||
/* Wind */
|
||||
@@ -295,7 +293,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillRegattas();
|
||||
}
|
||||
}, stringMessages.wind(), new WindPlace(), SecuredDomainType.TRACKED_RACE.getPermission(DefaultActions.UPDATE));
|
||||
}, stringMessages.wind(), new WindPlace((String) null /* no place token */), SecuredDomainType.TRACKED_RACE.getPermission(DefaultActions.UPDATE));
|
||||
|
||||
/* Media */
|
||||
final MediaPanelSupplier mediaPanelSupplier = new MediaPanelSupplier(stringMessages, presenter);
|
||||
@@ -304,7 +302,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().onShow();
|
||||
}
|
||||
}, stringMessages.mediaPanel(), new AudioAndVideoPlace(),
|
||||
}, stringMessages.mediaPanel(), new AudioAndVideoPlace((String) null /* no place token */),
|
||||
SecuredDomainType.MEDIA_TRACK.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* RACE COMMITTEE APP */
|
||||
@@ -314,7 +312,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
final DeviceConfigurationPanelSupplier deviceConfigurationUserPanelSupplier = new DeviceConfigurationPanelSupplier(stringMessages, presenter);
|
||||
adminConsolePanel.addToTabPanel(raceCommitteeTabPanel,
|
||||
new DefaultRefreshableAdminConsolePanel<DeviceConfigurationPanel>(deviceConfigurationUserPanelSupplier),
|
||||
stringMessages.deviceConfiguration(), new DeviceConfigurationPlace(),
|
||||
stringMessages.deviceConfiguration(), new DeviceConfigurationPlace((String) null /* no place token */),
|
||||
SecuredDomainType.RACE_MANAGER_APP_DEVICE_CONFIGURATION.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* CONNECTORS */
|
||||
@@ -330,7 +328,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
getWidget().refreshTracTracConnectors();
|
||||
}
|
||||
},
|
||||
stringMessages.tracTracEvents(), new TracTracEventsPlace(),
|
||||
stringMessages.tracTracEvents(), new TracTracEventsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.TRACTRAC_ACCOUNT.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Swiss Timing Replay Connector */
|
||||
@@ -339,14 +337,14 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
adminConsolePanel.addToTabPanel(connectorsTabPanel,
|
||||
new DefaultRefreshableAdminConsolePanel<SwissTimingReplayConnectorPanel>(
|
||||
swissTimingReplayConnectorPanelSupplier),
|
||||
stringMessages.swissTimingArchiveConnector(), new SwissTimingArchivedEventsPlace(),
|
||||
stringMessages.swissTimingArchiveConnector(), new SwissTimingArchivedEventsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.SWISS_TIMING_ARCHIVE_ACCOUNT.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Swiss Timing Event Management */
|
||||
final SwissTimingEventManagementPanelSupplier swissTimingEventManagementPanelSupplier =
|
||||
new SwissTimingEventManagementPanelSupplier(stringMessages, presenter, tableResources);
|
||||
adminConsolePanel.addToTabPanel(connectorsTabPanel, new DefaultRefreshableAdminConsolePanel<SwissTimingEventManagementPanel>(swissTimingEventManagementPanelSupplier),
|
||||
stringMessages.swissTimingEvents(), new SwissTimingEventsPlace(),
|
||||
stringMessages.swissTimingEvents(), new SwissTimingEventsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.SWISS_TIMING_ACCOUNT.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Smartphone Tracking Event Management */
|
||||
@@ -359,7 +357,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
presenter.fillLeaderboards();
|
||||
}
|
||||
}, stringMessages.smartphoneTracking(), new SmartphoneTrackingPlace(),
|
||||
}, stringMessages.smartphoneTracking(), new SmartphoneTrackingPlace((String) null /* no place token */),
|
||||
SecuredDomainType.LEADERBOARD.getPermission(DefaultActions.UPDATE, DefaultActions.DELETE));
|
||||
|
||||
/* Igtimi Accounts */
|
||||
@@ -370,7 +368,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refresh();
|
||||
}
|
||||
}, stringMessages.igtimiAccounts(), new IgtimiAccountsPlace(),
|
||||
}, stringMessages.igtimiAccounts(), new IgtimiAccountsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.IGTIMI_ACCOUNT.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Expedition Device Configurations */
|
||||
@@ -382,7 +380,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refresh();
|
||||
}
|
||||
}, stringMessages.expeditionDeviceConfigurations(), new ExpeditionDeviceConfigurationsPlace(),
|
||||
}, stringMessages.expeditionDeviceConfigurations(), new ExpeditionDeviceConfigurationsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.EXPEDITION_DEVICE_CONFIGURATION.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Result Import Urls List */
|
||||
@@ -390,7 +388,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
stringMessages, presenter);
|
||||
adminConsolePanel.addToTabPanel(connectorsTabPanel,
|
||||
new DefaultRefreshableAdminConsolePanel<ResultImportUrlsListComposite>(urlsListCompositeSupplier),
|
||||
stringMessages.resultImportUrls(), new ResultImportUrlsPlace(),
|
||||
stringMessages.resultImportUrls(), new ResultImportUrlsPlace((String) null /* no place token */),
|
||||
SecuredDomainType.RESULT_IMPORT_URL.getPermission(DefaultActions.values()));
|
||||
|
||||
/* Structure Import Management */
|
||||
@@ -400,7 +398,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
new DefaultRefreshableAdminConsolePanel<StructureImportManagementPanel>(
|
||||
structureImportManagementPanelSupplier),
|
||||
stringMessages.manage2Sail() + " " + stringMessages.regattaStructureImport(),
|
||||
new Manage2SailRegattaStructureImportPlace(),
|
||||
new Manage2SailRegattaStructureImportPlace((String) null /* no place token */),
|
||||
SecuredDomainType.REGATTA.getPermission(DefaultActions.CREATE));
|
||||
|
||||
/* ADVANCED */
|
||||
@@ -414,21 +412,21 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().updateReplicaList();
|
||||
}
|
||||
}, stringMessages.replication(), new ReplicationPlace(),
|
||||
}, stringMessages.replication(), new ReplicationPlace((String) null /* no place token */),
|
||||
() -> userService.hasAnyServerPermission(ServerActions.REPLICATE, ServerActions.START_REPLICATION,
|
||||
ServerActions.READ_REPLICATOR));
|
||||
|
||||
/* Master Data */
|
||||
final MasterDataImportPanelSupplier masterDataImportPanelSupplier = new MasterDataImportPanelSupplier(stringMessages, presenter);
|
||||
adminConsolePanel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<MasterDataImportPanel>(masterDataImportPanelSupplier),
|
||||
stringMessages.masterDataImportPanel(), new MasterDataImportPlace(), SecuredSecurityTypes.SERVER.getPermissionForObject(
|
||||
stringMessages.masterDataImportPanel(), new MasterDataImportPlace((String) null /* no place token */), SecuredSecurityTypes.SERVER.getPermissionForObject(
|
||||
SecuredSecurityTypes.ServerActions.CAN_IMPORT_MASTERDATA, serverInfo));
|
||||
|
||||
/* Remote Server Instance Manager */
|
||||
final RemoteServerInstancesManagementPanelSupplier remoteServerInstancesManagementPanelSupplier =
|
||||
new RemoteServerInstancesManagementPanelSupplier(stringMessages, presenter, tableResources);
|
||||
adminConsolePanel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<RemoteServerInstancesManagementPanel>(remoteServerInstancesManagementPanelSupplier),
|
||||
stringMessages.remoteServerInstances(), new RemoteServerInstancesPlace(),
|
||||
stringMessages.remoteServerInstances(), new RemoteServerInstancesPlace((String) null /* no place token */),
|
||||
SecuredSecurityTypes.SERVER.getPermissionForObject(
|
||||
SecuredSecurityTypes.ServerActions.CONFIGURE_REMOTE_INSTANCES, serverInfo));
|
||||
|
||||
@@ -442,7 +440,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshServerConfiguration();
|
||||
}
|
||||
}, stringMessages.localServer(), new LocalServerPlace(),
|
||||
}, stringMessages.localServer(), new LocalServerPlace((String) null /* no place token */),
|
||||
// We explicitly use a different permission check here.
|
||||
// Most panels show a list of domain objects which means we check if the user has permissions for any
|
||||
// potentially existing object to decide about the visibility.
|
||||
@@ -460,7 +458,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
getWidget().updateUsers();
|
||||
getWidget().refreshSuggests();
|
||||
}
|
||||
}, stringMessages.userManagement(), new UserManagementPlace(), SecuredSecurityTypes.USER.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
}, stringMessages.userManagement(), new UserManagementPlace((String) null /* no place token */), SecuredSecurityTypes.USER.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Role Definition */
|
||||
final RoleDefinitionsPanelSupplier roleDefinitionsPanelSupplier = new RoleDefinitionsPanelSupplier(presenter, tableResources);
|
||||
@@ -470,7 +468,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().updateRoleDefinitions();
|
||||
}
|
||||
}, stringMessages.roles(), new RolesPlace(),
|
||||
}, stringMessages.roles(), new RolesPlace((String) null /* no place token */),
|
||||
SecuredSecurityTypes.ROLE_DEFINITION.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* User Group Management */
|
||||
@@ -482,12 +480,12 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
getWidget().updateUserGroups();
|
||||
getWidget().refreshSuggests();
|
||||
}
|
||||
}, stringMessages.userGroupManagement(), new UserGroupManagementPlace(), SecuredSecurityTypes.USER_GROUP.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
}, stringMessages.userGroupManagement(), new UserGroupManagementPlace((String) null /* no place token */), SecuredSecurityTypes.USER_GROUP.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* File Storage */
|
||||
final FileStoragePanelSupplier fileStoragePanelSupplier = new FileStoragePanelSupplier(presenter);
|
||||
adminConsolePanel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<FileStoragePanel>(fileStoragePanelSupplier),
|
||||
stringMessages.fileStorage(), new FileStoragePlace(),
|
||||
stringMessages.fileStorage(), new FileStoragePlace(null),
|
||||
SecuredSecurityTypes.SERVER.getPermissionForObject(
|
||||
SecuredSecurityTypes.ServerActions.CONFIGURE_FILE_STORAGE, serverInfo));
|
||||
|
||||
@@ -503,7 +501,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshMarkTemplates();
|
||||
}
|
||||
}, stringMessages.markTemplates(), new MarkTemplatesPlace(),
|
||||
}, stringMessages.markTemplates(), new MarkTemplatesPlace((String) null /* no place token */),
|
||||
SecuredDomainType.MARK_TEMPLATE.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Mark Properties */
|
||||
@@ -514,7 +512,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshMarkProperties();
|
||||
}
|
||||
}, stringMessages.markProperties(), new MarkPropertiesPlace(),
|
||||
}, stringMessages.markProperties(), new MarkPropertiesPlace((String) null /* no place token */),
|
||||
SecuredDomainType.MARK_PROPERTIES.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Course Template */
|
||||
@@ -525,7 +523,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshCourseTemplates();
|
||||
}
|
||||
}, stringMessages.courseTemplates(), new CourseTemplatesPlace(),
|
||||
}, stringMessages.courseTemplates(), new CourseTemplatesPlace((String) null /* no place token */),
|
||||
SecuredDomainType.COURSE_TEMPLATE.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
/* Mark Role */
|
||||
@@ -536,7 +534,7 @@ public class AdminConsoleViewImpl extends Composite implements AdminConsoleView
|
||||
public void refreshAfterBecomingVisible() {
|
||||
getWidget().refreshMarkRoles();
|
||||
}
|
||||
}, stringMessages.markRoles(), new MarkRolesPlace(),
|
||||
}, stringMessages.markRoles(), new MarkRolesPlace((String) null /* no place token */),
|
||||
SecuredDomainType.MARK_ROLE.getPermission(DefaultActions.MUTATION_ACTIONS));
|
||||
|
||||
adminConsolePanel.initUI(defaultPlace);
|
||||
|
||||
+4
-1
@@ -4,10 +4,13 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AbstractAdminConsolePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public abstract class AbstractAdvancedPlace extends AbstractAdminConsolePlace {
|
||||
public AbstractAdvancedPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288: this method should not have static knowledge about which place is where; redundant with AdminConsoleViewImpl
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.ADVANCED;
|
||||
}
|
||||
|
||||
}
|
||||
+4
-5
@@ -3,20 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class FileStoragePlace extends AbstractAdvancedPlace {
|
||||
|
||||
public FileStoragePlace() {
|
||||
public FileStoragePlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<FileStoragePlace> {
|
||||
@Override
|
||||
public String getToken(final FileStoragePlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileStoragePlace getPlace(final String token) {
|
||||
return new FileStoragePlace();
|
||||
return new FileStoragePlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -3,19 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class LocalServerPlace extends AbstractAdvancedPlace {
|
||||
|
||||
public LocalServerPlace() {
|
||||
public LocalServerPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<LocalServerPlace> {
|
||||
@Override
|
||||
public String getToken(final LocalServerPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalServerPlace getPlace(final String token) {
|
||||
return new LocalServerPlace();
|
||||
return new LocalServerPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -3,20 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class MasterDataImportPlace extends AbstractAdvancedPlace {
|
||||
|
||||
public MasterDataImportPlace() {
|
||||
public MasterDataImportPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<MasterDataImportPlace> {
|
||||
@Override
|
||||
public String getToken(final MasterDataImportPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MasterDataImportPlace getPlace(final String token) {
|
||||
return new MasterDataImportPlace();
|
||||
return new MasterDataImportPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-3
@@ -1,21 +1,24 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class RemoteServerInstancesPlace extends AbstractFilterablePlace {
|
||||
public RemoteServerInstancesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 this method shouldn't have static information redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.ADVANCED;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<RemoteServerInstancesPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<RemoteServerInstancesPlace> getPlaceFactory() {
|
||||
protected Function<String, RemoteServerInstancesPlace> getPlaceFactory() {
|
||||
return RemoteServerInstancesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -3,20 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class ReplicationPlace extends AbstractAdvancedPlace {
|
||||
|
||||
public ReplicationPlace() {
|
||||
public ReplicationPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<ReplicationPlace> {
|
||||
@Override
|
||||
public String getToken(final ReplicationPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReplicationPlace getPlace(final String token) {
|
||||
return new ReplicationPlace();
|
||||
return new ReplicationPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+5
-3
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class RolesPlace extends AbstractFilterablePlace {
|
||||
public RolesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -13,9 +16,8 @@ public class RolesPlace extends AbstractFilterablePlace {
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<RolesPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<RolesPlace> getPlaceFactory() {
|
||||
protected Function<String, RolesPlace> getPlaceFactory() {
|
||||
return RolesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class UserGroupManagementPlace extends AbstractFilterablePlace {
|
||||
public UserGroupManagementPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -13,9 +16,8 @@ public class UserGroupManagementPlace extends AbstractFilterablePlace {
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<UserGroupManagementPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<UserGroupManagementPlace> getPlaceFactory() {
|
||||
protected Function<String, UserGroupManagementPlace> getPlaceFactory() {
|
||||
return UserGroupManagementPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.advanced;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class UserManagementPlace extends AbstractFilterablePlace {
|
||||
public UserManagementPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -15,7 +18,7 @@ public class UserManagementPlace extends AbstractFilterablePlace {
|
||||
public static class Tokenizer extends TablePlaceTokenizer<UserManagementPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<UserManagementPlace> getPlaceFactory() {
|
||||
protected Function<String, UserManagementPlace> getPlaceFactory() {
|
||||
return UserManagementPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -4,10 +4,12 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AbstractAdminConsolePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public abstract class AbstractConnectorsPlace extends AbstractAdminConsolePlace {
|
||||
public AbstractConnectorsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.CONNECTORS;
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class ExpeditionDeviceConfigurationsPlace extends AbstractFilterablePlace {
|
||||
public ExpeditionDeviceConfigurationsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -15,7 +18,7 @@ public class ExpeditionDeviceConfigurationsPlace extends AbstractFilterablePlace
|
||||
public static class Tokenizer extends TablePlaceTokenizer<ExpeditionDeviceConfigurationsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<ExpeditionDeviceConfigurationsPlace> getPlaceFactory() {
|
||||
protected Function<String, ExpeditionDeviceConfigurationsPlace> getPlaceFactory() {
|
||||
return ExpeditionDeviceConfigurationsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,12 +1,16 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class IgtimiAccountsPlace extends AbstractFilterablePlace {
|
||||
|
||||
public IgtimiAccountsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.CONNECTORS;
|
||||
@@ -15,7 +19,7 @@ public class IgtimiAccountsPlace extends AbstractFilterablePlace {
|
||||
public static class Tokenizer extends TablePlaceTokenizer<IgtimiAccountsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<IgtimiAccountsPlace> getPlaceFactory() {
|
||||
protected Function<String, IgtimiAccountsPlace> getPlaceFactory() {
|
||||
return IgtimiAccountsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -3,19 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class Manage2SailRegattaStructureImportPlace extends AbstractConnectorsPlace {
|
||||
|
||||
public Manage2SailRegattaStructureImportPlace() {
|
||||
public Manage2SailRegattaStructureImportPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<Manage2SailRegattaStructureImportPlace> {
|
||||
@Override
|
||||
public String getToken(final Manage2SailRegattaStructureImportPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Manage2SailRegattaStructureImportPlace getPlace(final String token) {
|
||||
return new Manage2SailRegattaStructureImportPlace();
|
||||
return new Manage2SailRegattaStructureImportPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -3,20 +3,19 @@ package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
|
||||
public class ResultImportUrlsPlace extends AbstractConnectorsPlace {
|
||||
|
||||
public ResultImportUrlsPlace() {
|
||||
public ResultImportUrlsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<ResultImportUrlsPlace> {
|
||||
@Override
|
||||
public String getToken(final ResultImportUrlsPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultImportUrlsPlace getPlace(final String token) {
|
||||
return new ResultImportUrlsPlace();
|
||||
return new ResultImportUrlsPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+5
-3
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class SmartphoneTrackingPlace extends AbstractFilterablePlace {
|
||||
public SmartphoneTrackingPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -13,9 +16,8 @@ public class SmartphoneTrackingPlace extends AbstractFilterablePlace {
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<SmartphoneTrackingPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<SmartphoneTrackingPlace> getPlaceFactory() {
|
||||
protected Function<String, SmartphoneTrackingPlace> getPlaceFactory() {
|
||||
return SmartphoneTrackingPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class SwissTimingArchivedEventsPlace extends AbstractFilterablePlace {
|
||||
public SwissTimingArchivedEventsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -13,9 +16,8 @@ public class SwissTimingArchivedEventsPlace extends AbstractFilterablePlace {
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<SwissTimingArchivedEventsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<SwissTimingArchivedEventsPlace> getPlaceFactory() {
|
||||
protected Function<String, SwissTimingArchivedEventsPlace> getPlaceFactory() {
|
||||
return SwissTimingArchivedEventsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class SwissTimingEventsPlace extends AbstractFilterablePlace {
|
||||
public SwissTimingEventsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -13,9 +16,8 @@ public class SwissTimingEventsPlace extends AbstractFilterablePlace {
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<SwissTimingEventsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<SwissTimingEventsPlace> getPlaceFactory() {
|
||||
protected Function<String, SwissTimingEventsPlace> getPlaceFactory() {
|
||||
return SwissTimingEventsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,11 +1,14 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.connectors;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class TracTracEventsPlace extends AbstractFilterablePlace {
|
||||
public TracTracEventsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
@@ -15,7 +18,7 @@ public class TracTracEventsPlace extends AbstractFilterablePlace {
|
||||
public static class Tokenizer extends TablePlaceTokenizer<TracTracEventsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<TracTracEventsPlace> getPlaceFactory() {
|
||||
protected Function<String, TracTracEventsPlace> getPlaceFactory() {
|
||||
return TracTracEventsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -4,9 +4,11 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public abstract class AbstractCourseCreationPlace extends AbstractFilterablePlace {
|
||||
public AbstractCourseCreationPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.COURSE_CREATION;
|
||||
}
|
||||
|
||||
}
|
||||
+6
-5
@@ -1,15 +1,16 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.coursecreation;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class CourseTemplatesPlace extends AbstractCourseCreationPlace {
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<CourseTemplatesPlace> {
|
||||
public CourseTemplatesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<CourseTemplatesPlace> {
|
||||
@Override
|
||||
protected Supplier<CourseTemplatesPlace> getPlaceFactory() {
|
||||
protected Function<String, CourseTemplatesPlace> getPlaceFactory() {
|
||||
return CourseTemplatesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+4
-6
@@ -1,18 +1,16 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.coursecreation;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class MarkPropertiesPlace extends AbstractCourseCreationPlace {
|
||||
|
||||
public MarkPropertiesPlace() {
|
||||
public MarkPropertiesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<MarkPropertiesPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<MarkPropertiesPlace> getPlaceFactory() {
|
||||
protected Function<String, MarkPropertiesPlace> getPlaceFactory() {
|
||||
return MarkPropertiesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-5
@@ -1,15 +1,16 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.coursecreation;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class MarkRolesPlace extends AbstractCourseCreationPlace {
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<MarkRolesPlace> {
|
||||
public MarkRolesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<MarkRolesPlace> {
|
||||
@Override
|
||||
protected Supplier<MarkRolesPlace> getPlaceFactory() {
|
||||
protected Function<String, MarkRolesPlace> getPlaceFactory() {
|
||||
return MarkRolesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-4
@@ -1,13 +1,15 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.coursecreation;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class MarkTemplatesPlace extends AbstractCourseCreationPlace {
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<MarkTemplatesPlace> {
|
||||
public MarkTemplatesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<MarkTemplatesPlace> {
|
||||
@Override
|
||||
protected Supplier<MarkTemplatesPlace> getPlaceFactory() {
|
||||
protected Function<String, MarkTemplatesPlace> getPlaceFactory() {
|
||||
return MarkTemplatesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -1,18 +1,19 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.events;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
|
||||
|
||||
public class EventsPlace extends AbstractFilterablePlace {
|
||||
public EventsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<EventsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<EventsPlace> getPlaceFactory() {
|
||||
protected Function<String, EventsPlace> getPlaceFactory() {
|
||||
return EventsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -4,10 +4,13 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public abstract class AbstractLeaderboardsPlace extends AbstractFilterablePlace {
|
||||
public AbstractLeaderboardsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 this method should not have static information that is redundant with AdminConsoleViewImpl and how it composes the panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.LEADERBOARDS;
|
||||
}
|
||||
|
||||
}
|
||||
+5
-3
@@ -1,13 +1,15 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.leaderboards;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class LeaderboardGroupsPlace extends AbstractLeaderboardsPlace {
|
||||
public LeaderboardGroupsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<LeaderboardGroupsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<LeaderboardGroupsPlace> getPlaceFactory() {
|
||||
protected Function<String, LeaderboardGroupsPlace> getPlaceFactory() {
|
||||
return LeaderboardGroupsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,13 +1,15 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.leaderboards;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class LeaderboardsPlace extends AbstractLeaderboardsPlace {
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<LeaderboardsPlace> {
|
||||
public LeaderboardsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<LeaderboardsPlace> {
|
||||
@Override
|
||||
protected Supplier<LeaderboardsPlace> getPlaceFactory() {
|
||||
protected Function<String, LeaderboardsPlace> getPlaceFactory() {
|
||||
return LeaderboardsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -6,24 +6,25 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class DeviceConfigurationPlace extends AbstractAdminConsolePlace {
|
||||
|
||||
public DeviceConfigurationPlace() {
|
||||
public DeviceConfigurationPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<DeviceConfigurationPlace> {
|
||||
@Override
|
||||
public String getToken(final DeviceConfigurationPlace place) {
|
||||
return "";
|
||||
return place.getParametersAsToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceConfigurationPlace getPlace(final String token) {
|
||||
return new DeviceConfigurationPlace();
|
||||
return new DeviceConfigurationPlace(token);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACE_COMMITEE;
|
||||
}
|
||||
|
||||
}
|
||||
+5
-4
@@ -1,17 +1,18 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.regattas;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
|
||||
public class RegattasPlace extends AbstractFilterablePlace {
|
||||
public RegattasPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<RegattasPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<RegattasPlace> getPlaceFactory() {
|
||||
protected Function<String, RegattasPlace> getPlaceFactory() {
|
||||
return RegattasPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -4,10 +4,13 @@ import com.sap.sailing.gwt.ui.adminconsole.places.AbstractAdminConsolePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public abstract class AbstractTrackedRacesPlace extends AbstractAdminConsolePlace {
|
||||
public AbstractTrackedRacesPlace(String placeParamsFromUrlFragment) {
|
||||
super(placeParamsFromUrlFragment);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
}
|
||||
+6
-4
@@ -1,23 +1,25 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class AudioAndVideoPlace extends AbstractFilterablePlace {
|
||||
public AudioAndVideoPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<AudioAndVideoPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<AudioAndVideoPlace> getPlaceFactory() {
|
||||
protected Function<String, AudioAndVideoPlace> getPlaceFactory() {
|
||||
return AudioAndVideoPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-4
@@ -1,23 +1,25 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class BoatsPlace extends AbstractFilterablePlace {
|
||||
public BoatsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<BoatsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<BoatsPlace> getPlaceFactory() {
|
||||
protected Function<String, BoatsPlace> getPlaceFactory() {
|
||||
return BoatsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+12
-4
@@ -1,21 +1,29 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class CompetitorsPlace extends AbstractFilterablePlace {
|
||||
|
||||
public CompetitorsPlace(Map<String, String> paramKeysAndValues) {
|
||||
super(paramKeysAndValues);
|
||||
}
|
||||
|
||||
protected CompetitorsPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<CompetitorsPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<CompetitorsPlace> getPlaceFactory() {
|
||||
protected Function<String, CompetitorsPlace> getPlaceFactory() {
|
||||
return CompetitorsPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,23 +1,25 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class CourseLayoutPlace extends AbstractFilterablePlace {
|
||||
public CourseLayoutPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<CourseLayoutPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<CourseLayoutPlace> getPlaceFactory() {
|
||||
protected Function<String, CourseLayoutPlace> getPlaceFactory() {
|
||||
return CourseLayoutPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-4
@@ -1,23 +1,25 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class TrackedRacesPlace extends AbstractFilterablePlace {
|
||||
public TrackedRacesPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
}
|
||||
|
||||
public static class Tokenizer extends TablePlaceTokenizer<TrackedRacesPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<TrackedRacesPlace> getPlaceFactory() {
|
||||
protected Function<String, TrackedRacesPlace> getPlaceFactory() {
|
||||
return TrackedRacesPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-3
@@ -1,12 +1,16 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole.places.trackedraces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AbstractFilterablePlace;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleViewImpl;
|
||||
|
||||
public class WindPlace extends AbstractFilterablePlace {
|
||||
public WindPlace(String token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
// TODO bug5288 redundant with how AdminConsoleViewImpl assembles panels in tabs
|
||||
@Override
|
||||
public String getVerticalTabName() {
|
||||
return AdminConsoleViewImpl.RACES;
|
||||
@@ -15,9 +19,8 @@ public class WindPlace extends AbstractFilterablePlace {
|
||||
public static class Tokenizer extends TablePlaceTokenizer<WindPlace> {
|
||||
|
||||
@Override
|
||||
protected Supplier<WindPlace> getPlaceFactory() {
|
||||
protected Function<String, WindPlace> getPlaceFactory() {
|
||||
return WindPlace::new;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class CourseConfiguration extends JsonWrapper {
|
||||
public MarkConfiguration getMarkConfigurationByEffectiveName(String name) {
|
||||
MarkConfiguration result = null;
|
||||
for (MarkConfiguration markConfiguration : getMarkConfigurations()) {
|
||||
MarkAppearance effectiveProperties = markConfiguration.getEffectiveProperties();
|
||||
FreestyleProperties effectiveProperties = markConfiguration.getEffectiveProperties();
|
||||
if (effectiveProperties != null && name.equals(effectiveProperties.getName())) {
|
||||
result = markConfiguration;
|
||||
break;
|
||||
|
||||
+10
-4
@@ -1,10 +1,13 @@
|
||||
package com.sap.sailing.selenium.api.coursetemplate;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.selenium.api.core.JsonWrapper;
|
||||
|
||||
public class MarkAppearance extends JsonWrapper {
|
||||
public class FreestyleProperties extends JsonWrapper {
|
||||
|
||||
private static final String FIELD_NAME = "name";
|
||||
private static final String FIELD_SHORT_NAME = "shortName";
|
||||
@@ -12,13 +15,14 @@ public class MarkAppearance extends JsonWrapper {
|
||||
private static final String FIELD_SHAPE = "shape";
|
||||
private static final String FIELD_PATTERN = "pattern";
|
||||
private static final String FIELD_MARK_TYPE = "markType";
|
||||
private static final String FIELD_TAG = "tags";
|
||||
|
||||
public MarkAppearance(final JSONObject json) {
|
||||
public FreestyleProperties(final JSONObject json) {
|
||||
super(json);
|
||||
}
|
||||
|
||||
public MarkAppearance(final String name, final String shortName, final String color, final String shape,
|
||||
final String pattern, final String markType) {
|
||||
public FreestyleProperties(final String name, final String shortName, final String color, final String shape,
|
||||
final String pattern, final String markType, Set<String> tags) {
|
||||
super(new JSONObject());
|
||||
getJson().put(FIELD_NAME, name);
|
||||
getJson().put(FIELD_SHORT_NAME, shortName);
|
||||
@@ -26,6 +30,8 @@ public class MarkAppearance extends JsonWrapper {
|
||||
getJson().put(FIELD_SHAPE, shape);
|
||||
getJson().put(FIELD_PATTERN, pattern);
|
||||
getJson().put(FIELD_MARK_TYPE, markType);
|
||||
JSONArray jsonTags = new JSONArray(tags);
|
||||
getJson().put(FIELD_TAG, jsonTags);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
+7
-6
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class MarkConfiguration extends JsonWrapper {
|
||||
|
||||
public static MarkConfiguration createFreestyle(final UUID markTemplateId, final UUID markPropertiesId,
|
||||
final UUID associatedRoleId, final String name, final String shortName, final String color,
|
||||
final String shape, final String pattern, final String markType) {
|
||||
final String shape, final String pattern, final String markType, Set<String> tags) {
|
||||
MarkConfiguration markConfiguration = new MarkConfiguration(new JSONObject());
|
||||
markConfiguration.getJson().put(FIELD_ID, UUID.randomUUID().toString());
|
||||
if (markTemplateId != null) {
|
||||
@@ -51,7 +52,7 @@ public class MarkConfiguration extends JsonWrapper {
|
||||
markConfiguration.getJson().put(FIELD_ASSOCIATED_ROLE_ID, associatedRoleId.toString());
|
||||
}
|
||||
markConfiguration.getJson().put(FIELD_FREESTYLE_PROPERTIES,
|
||||
new MarkAppearance(name, shortName, color, shape, pattern, markType).getJson());
|
||||
new FreestyleProperties(name, shortName, color, shape, pattern, markType, tags).getJson());
|
||||
return markConfiguration;
|
||||
}
|
||||
|
||||
@@ -137,14 +138,14 @@ public class MarkConfiguration extends JsonWrapper {
|
||||
return markTemplateId != null ? UUID.fromString((String) markTemplateId) : null;
|
||||
}
|
||||
|
||||
public MarkAppearance getEffectiveProperties() {
|
||||
public FreestyleProperties getEffectiveProperties() {
|
||||
final JSONObject effectivePropertiesJson = (JSONObject) get(FIELD_EFFECTIVE_PROPERTIES);
|
||||
return effectivePropertiesJson != null ? new MarkAppearance(effectivePropertiesJson) : null;
|
||||
return effectivePropertiesJson != null ? new FreestyleProperties(effectivePropertiesJson) : null;
|
||||
}
|
||||
|
||||
public MarkAppearance getFreestyleProperties() {
|
||||
public FreestyleProperties getFreestyleProperties() {
|
||||
final JSONObject effectivePropertiesJson = (JSONObject) get(FIELD_FREESTYLE_PROPERTIES);
|
||||
return effectivePropertiesJson != null ? new MarkAppearance(effectivePropertiesJson) : null;
|
||||
return effectivePropertiesJson != null ? new FreestyleProperties(effectivePropertiesJson) : null;
|
||||
}
|
||||
|
||||
public boolean isStoreToInventory() {
|
||||
|
||||
+16
@@ -1,7 +1,10 @@
|
||||
package com.sap.sailing.selenium.api.coursetemplate;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
@@ -21,6 +24,8 @@ public class MarkProperties extends JsonWrapper {
|
||||
private static final String FIELD_POSITIONING_DEVICE_IDENTIFIER = "device_identifier";
|
||||
private static final String FIELD_POSITIONING_FIXED_POSITION_LATDEG = "latitude_deg";
|
||||
private static final String FIELD_POSITIONING_FIXED_POSITION_LONDEG = "longitude_deg";
|
||||
private static final String FIELD_TAGS = "tags";
|
||||
|
||||
|
||||
public MarkProperties(JSONObject json) {
|
||||
super(json);
|
||||
@@ -79,6 +84,17 @@ public class MarkProperties extends JsonWrapper {
|
||||
final JSONObject position = (JSONObject) ((JSONObject) get(FIELD_POSITIONING)).get(FIELD_POSITIONING_POSITION);
|
||||
return (Double) (position == null ? null : position.get(FIELD_POSITIONING_FIXED_POSITION_LONDEG));
|
||||
}
|
||||
|
||||
public Set<String> getTags() {
|
||||
JSONArray jsonTags = get(FIELD_TAGS);
|
||||
final Set<String> tags = new HashSet<>();
|
||||
if(jsonTags != null) {
|
||||
for(Object tag : jsonTags) {
|
||||
tags.add(tag.toString());
|
||||
}
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setLonDeg(double lonDeg) {
|
||||
JSONObject jsonPositioning = get(FIELD_POSITIONING);
|
||||
|
||||
+52
-16
@@ -40,7 +40,7 @@ import com.sap.sailing.selenium.api.coursetemplate.CourseConfigurationApi;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.CourseTemplate;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.CourseTemplateApi;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.DeviceMapping;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.MarkAppearance;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.FreestyleProperties;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.MarkConfiguration;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.MarkProperties;
|
||||
import com.sap.sailing.selenium.api.coursetemplate.MarkPropertiesApi;
|
||||
@@ -115,14 +115,14 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
final Map<MarkConfiguration, String> markConfigurationToNameMap = new HashMap<>();
|
||||
for (final MarkConfiguration markConfiguration : srcMarkConfigurations) {
|
||||
final UUID markTemplateId = markConfiguration.getMarkTemplateId();
|
||||
MarkAppearance srcAppearance = markConfiguration.getEffectiveProperties();
|
||||
FreestyleProperties srcAppearance = markConfiguration.getEffectiveProperties();
|
||||
if (srcAppearance == null) {
|
||||
srcAppearance = markConfiguration.getFreestyleProperties();
|
||||
}
|
||||
Positioning srcPositioning = markConfiguration.getPositioning();
|
||||
boolean found = false;
|
||||
for (final MarkConfiguration trgtMarkConfiguration : trgtMarkConfigurations) {
|
||||
final MarkAppearance trgtAppearance = trgtMarkConfiguration.getEffectiveProperties();
|
||||
final FreestyleProperties trgtAppearance = trgtMarkConfiguration.getEffectiveProperties();
|
||||
if (srcAppearance == null && trgtAppearance == null) {
|
||||
return;
|
||||
}
|
||||
@@ -572,14 +572,17 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
eventApi.createEvent(ctx, regattaName, "", CompetitorRegistrationType.CLOSED, "");
|
||||
final RaceColumn race = regattaApi.addRaceColumn(ctx, regattaName, /* prefix */ null, 1)[0];
|
||||
MarkConfiguration sb = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), "startboat", "sb", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), "startboat", "sb",
|
||||
null, null, null, null, Collections.emptySet());
|
||||
sb.setFixedPosition(5.5, 7.1);
|
||||
MarkConfiguration pe = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe",
|
||||
null, null, null, null, Collections.emptySet());
|
||||
UUID randomDeviceId = UUID.randomUUID();
|
||||
pe.setTrackingDeviceId(randomDeviceId);
|
||||
MarkConfiguration bl = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null, "#0000FF", null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null,
|
||||
"#0000FF", null, null, null, Collections.emptySet());
|
||||
WaypointWithMarkConfiguration wp1 = new WaypointWithMarkConfiguration("start/end", "s/e",
|
||||
PassingInstruction.Line, Arrays.asList(sb.getId(), pe.getId()));
|
||||
WaypointWithMarkConfiguration wp2 = new WaypointWithMarkConfiguration(null, null, PassingInstruction.Port,
|
||||
@@ -596,14 +599,17 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
@Test
|
||||
public void testCreateCourseTemplateWithPositioningIncluded() {
|
||||
MarkConfiguration sb = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), "startboat", "sb", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), "startboat", "sb",
|
||||
null, null, null, null, Collections.emptySet());
|
||||
sb.setFixedPosition(5.5, 7.1);
|
||||
MarkConfiguration pe = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe",
|
||||
null, null, null, null, Collections.emptySet());
|
||||
UUID randomDeviceId = UUID.randomUUID();
|
||||
pe.setTrackingDeviceId(randomDeviceId);
|
||||
MarkConfiguration bl = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null, "#0000FF", null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null,
|
||||
"#0000FF", null, null, null, Collections.emptySet());
|
||||
WaypointWithMarkConfiguration wp1 = new WaypointWithMarkConfiguration("start/end", "s/e",
|
||||
PassingInstruction.Line, Arrays.asList(sb.getId(), pe.getId()));
|
||||
WaypointWithMarkConfiguration wp2 = new WaypointWithMarkConfiguration(null, null, PassingInstruction.Port,
|
||||
@@ -640,7 +646,8 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
mc2.setFixedPosition(latDeg, longDeg); // overrides the 1.0 / 1.0 as provided by the mp1 MarkProperties object
|
||||
|
||||
final MarkConfiguration mc3 = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_mp2", /* shortName */ null).getId(), "mc3", "mc3", "#0000FF", null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_mp2", /* shortName */ null).getId(), "mc3", "mc3",
|
||||
"#0000FF", null, null, null, Collections.emptySet());
|
||||
mc3.setFixedPosition(latDeg, longDeg);
|
||||
|
||||
final UUID deviceId = UUID.randomUUID();
|
||||
@@ -764,11 +771,11 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
final RaceColumn race = regattaApi.addRaceColumn(ctx, regattaName, /* prefix */ null, 1)[0];
|
||||
final String pinEndName = "Start/Finish Pin";
|
||||
MarkConfiguration sfp = MarkConfiguration.createFreestyle(null, null, null, pinEndName, "SFP", null, null, null,
|
||||
MarkType.BUOY.name());
|
||||
MarkType.BUOY.name(), Collections.emptySet());
|
||||
sfp.setFixedPosition(47.159776, 27.5891346);
|
||||
sfp.setStoreToInventory(true);
|
||||
MarkConfiguration sfb = MarkConfiguration.createFreestyle(null, null, null, "Start/Finish Boat", "SFB", null,
|
||||
null, null, MarkType.STARTBOAT.name());
|
||||
null, null, MarkType.STARTBOAT.name(), Collections.emptySet());
|
||||
sfp.setStoreToInventory(true);
|
||||
WaypointWithMarkConfiguration wp1 = new WaypointWithMarkConfiguration("Start", "S", PassingInstruction.Gate,
|
||||
Arrays.asList(sfp.getId(), sfb.getId()));
|
||||
@@ -810,7 +817,7 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
|
||||
String markName = "some mark";
|
||||
MarkConfiguration mark = MarkConfiguration.createFreestyle(null, null, null, markName, null, null, null, null,
|
||||
MarkType.BUOY.name());
|
||||
MarkType.BUOY.name(), Collections.emptySet());
|
||||
|
||||
WaypointWithMarkConfiguration wp = new WaypointWithMarkConfiguration(null, null, PassingInstruction.Starboard,
|
||||
Arrays.asList(mark.getId()));
|
||||
@@ -875,18 +882,21 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
private void testCreateCourseConfigurationWithStoreToInventory(final ApiContext ctx, final ApiContext sharedServerCtx) {
|
||||
final String STARTBOAT_NAME = "startboat";
|
||||
MarkConfiguration sb = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), STARTBOAT_NAME, "sb", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_sb", /* shortName */ null).getId(), STARTBOAT_NAME,
|
||||
"sb", null, null, null, null, Collections.emptySet());
|
||||
final double startBoatLatDeg = 5.5;
|
||||
final double startBoatLonDeg = 7.1;
|
||||
sb.setFixedPosition(startBoatLatDeg, startBoatLonDeg);
|
||||
sb.setStoreToInventory(true);
|
||||
MarkConfiguration pe = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe", null, null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_pe", /* shortName */ null).getId(), "pin end", "pe",
|
||||
null, null, null, null, Collections.emptySet());
|
||||
pe.setStoreToInventory(true);
|
||||
UUID randomDeviceId = UUID.randomUUID();
|
||||
pe.setTrackingDeviceId(randomDeviceId);
|
||||
MarkConfiguration bl = MarkConfiguration.createFreestyle(null, null,
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null, "#0000FF", null, null, null);
|
||||
markRoleApi.createMarkRole(sharedServerCtx, "role_bl", /* shortName */ null).getId(), "1", null,
|
||||
"#0000FF", null, null, null, Collections.emptySet());
|
||||
MarkTemplate mtb2 = markTemplateApi.createMarkTemplate(sharedServerCtx, "mark template 1", "mt1", "#FFFFFF", "Cylinder",
|
||||
"Checkered", MarkType.BUOY.name());
|
||||
MarkConfiguration b2 = MarkConfiguration.createMarkTemplateBased(mtb2.getId(),
|
||||
@@ -987,6 +997,32 @@ public class CourseConfigurationTest extends AbstractSeleniumTest {
|
||||
assertConsistentCourseConfiguration(createdCourseConfiguration);
|
||||
assertCourseConfigurationCompared(sharedServerCtx, simpleCourseConfiguration, createdCourseConfiguration);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createCourseConfigurationWithFreestyleUpdateForExistingMarkProperty() {
|
||||
final double MP_LAT_DEG = 49.097487;
|
||||
final double MP_LNG_DEG = 8.648631;
|
||||
final UUID markPropertiesId = markPropertiesApi.createMarkProperties(sharedServerCtx, "mpWithPos", "mpWithPos",
|
||||
/* deviceUuid */ null, "#ffffff", "shape", "pattern", MarkType.LANDMARK.name(),
|
||||
Collections.emptyList(), MP_LAT_DEG, MP_LNG_DEG).getId();
|
||||
final Set<String> tags = new HashSet<>();
|
||||
tags.add("tag1");
|
||||
final MarkConfiguration mc1 = MarkConfiguration.createFreestyle(null, markPropertiesId, null, null, null,
|
||||
null, null, null, null, tags);
|
||||
mc1.setStoreToInventory(true);
|
||||
final WaypointWithMarkConfiguration wp1 = new WaypointWithMarkConfiguration("landmark", "landmark",
|
||||
PassingInstruction.Single_Unknown, Arrays.asList(mc1.getId()));
|
||||
final CourseConfiguration courseConfiguration = new CourseConfiguration("test1", Arrays.asList(mc1),
|
||||
Arrays.asList(wp1));
|
||||
final String regattaName = "Regatta1";
|
||||
eventApi.createEvent(ctx, regattaName, "", CompetitorRegistrationType.CLOSED, "");
|
||||
final RaceColumn race = regattaApi.addRaceColumn(ctx, regattaName, null, 1)[0];
|
||||
courseConfigurationApi.createCourse(ctx, courseConfiguration, regattaName,
|
||||
race.getRaceName(), "Default");
|
||||
MarkProperties markProperties = markPropertiesApi.getMarkProperties(sharedServerCtx, markPropertiesId);
|
||||
Set<String> updatedTags = markProperties.getTags();
|
||||
assertEquals(tags, updatedTags);
|
||||
}
|
||||
|
||||
private CourseConfiguration createSimpleCourseConfiguration(final ApiContext ctx) {
|
||||
List<MarkConfiguration> markConfigurations = new ArrayList<MarkConfiguration>();
|
||||
|
||||
+3
-2
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -153,11 +154,11 @@ public class MarkApiTest extends AbstractSeleniumTest {
|
||||
|
||||
final String pinEndName = "Start/Finish Pin";
|
||||
final MarkConfiguration sfp = MarkConfiguration.createFreestyle(null, null, null, pinEndName, "SFP", null, null,
|
||||
null, MarkType.BUOY.name());
|
||||
null, MarkType.BUOY.name(), Collections.emptySet());
|
||||
sfp.setFixedPosition(47.159776, 27.5891346);
|
||||
sfp.setStoreToInventory(true);
|
||||
final MarkConfiguration sfb = MarkConfiguration.createFreestyle(null, null, null, "Start/Finish Boat", "SFB",
|
||||
null, null, null, MarkType.STARTBOAT.name());
|
||||
null, null, null, MarkType.STARTBOAT.name(), Collections.emptySet());
|
||||
sfp.setStoreToInventory(true);
|
||||
final MarkConfiguration sft = MarkConfiguration.createMarkBased(mark.getMarkId(), null);
|
||||
sft.setFixedPosition(47.159776, 37.5891346);
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.sap.sailing.selenium.pages;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import org.openqa.selenium.JavascriptExecutor;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
@@ -48,7 +51,36 @@ public abstract class HostPage extends PageObject {
|
||||
fragment = uri.getFragment();
|
||||
driver.get(new URI(scheme, userInfo, host, uri.getPort(), path, query, fragment).toString());
|
||||
}
|
||||
|
||||
protected final static <T extends HostPage> T goToPlace(HostPageSupplier<T> supplier, WebDriver driver, String url, String place, String... parameters) {
|
||||
try {
|
||||
URI uri = new URI(url);
|
||||
String scheme = uri.getScheme(), userInfo = uri.getUserInfo(), host = uri.getHost();
|
||||
String placeParameters = parameters == null ? ":" : getUrlParametersAsString(parameters);
|
||||
String path = uri.getPath(),
|
||||
query = getGWTCodeServerAndLocale() + (uri.getQuery() != null ? "&" + uri.getQuery() : ""),
|
||||
fragment = uri.getFragment();
|
||||
driver.get(new URI(scheme, userInfo, host, uri.getPort(), path, query, fragment).toString() + "#" + place + placeParameters);
|
||||
return supplier.get(driver);
|
||||
} catch (URISyntaxException exc) {
|
||||
throw new IllegalArgumentException(exc);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getUrlParametersAsString(String... parameters) {
|
||||
Iterator<String> iterableParameters = Arrays.asList(parameters).iterator();
|
||||
StringJoiner placeParameters = new StringJoiner("&", ":", "");
|
||||
while (iterableParameters.hasNext()) {
|
||||
String key = iterableParameters.next();
|
||||
String keyValuePair = key;
|
||||
if (iterableParameters.hasNext()) {
|
||||
keyValuePair += "=" + iterableParameters.next();
|
||||
}
|
||||
placeParameters.add(keyValuePair);
|
||||
}
|
||||
return placeParameters.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Creates a new page object with the given web driver. In GWT an entry point is connected to a HTML page in which
|
||||
|
||||
+19
@@ -5,8 +5,10 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.ui.FluentWait;
|
||||
|
||||
import com.sap.sailing.selenium.core.BySeleniumId;
|
||||
import com.sap.sailing.selenium.core.ElementSearchConditions;
|
||||
import com.sap.sailing.selenium.core.FindBy;
|
||||
import com.sap.sailing.selenium.pages.HostPage;
|
||||
import com.sap.sailing.selenium.pages.HostPageWithAuthentication;
|
||||
@@ -109,6 +111,23 @@ public class AdminConsolePage extends HostPageWithAuthentication {
|
||||
return HostPage.goToUrl(AdminConsolePage::new, driver, root + "gwt/AdminConsole.html");
|
||||
}
|
||||
|
||||
public static AdminConsolePage goToLeaderboardConfigurationPlace(WebDriver driver, String root, String ...urlParameterKeysAndValues) {
|
||||
return HostPage.goToPlace(AdminConsolePage::new, driver, root + "gwt/AdminConsole.html", "LeaderboardsPlace", urlParameterKeysAndValues);
|
||||
}
|
||||
|
||||
public LeaderboardConfigurationPanelPO getLeaderboardConfigurationPanelPO () {
|
||||
// Wait for the tab to become visible due to the used animations.
|
||||
FluentWait<WebElement> wait = createFluentWait(administrationTabPanel);
|
||||
WebElement content = wait.until(ElementSearchConditions.visibilityOfElementLocated(new BySeleniumId(LEADERBOARD_CONFIGURATION_TAB_IDENTIFIER)));
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e) {
|
||||
logger.log(Level.WARNING, "internal error sleeping for 500ms", e);
|
||||
} // wait for a bit to make sure the UI had a change to trigger any asynchronous background update/refresh
|
||||
waitForAjaxRequests(); // switching tabs can trigger asynchronous updates, replacing UI elements
|
||||
return new LeaderboardConfigurationPanelPO(driver, content);
|
||||
}
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "AdministrationTabs")
|
||||
private WebElement administrationTabPanel;
|
||||
|
||||
|
||||
+345
@@ -0,0 +1,345 @@
|
||||
package com.sap.sailing.selenium.test.adminconsole;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.FlexibleLeaderboardCreateDialogPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO.LeaderboardEntryPO;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
/**
|
||||
* <p>Tests for creation of leader boards.</p>
|
||||
*
|
||||
* @author
|
||||
* D049941
|
||||
*/
|
||||
public class TestLeaderboardFilterAndSelectByUrlParameters extends AbstractSeleniumTest {
|
||||
|
||||
private static final String PARAM_FILTER = "filter";
|
||||
private static final String PARAM_SELECT = "select";
|
||||
private static final String PARAM_SELECT_EXACT = "selectExact";
|
||||
private static final String PARAM_FILTER_AND_SELECT = "filterAndSelect";
|
||||
|
||||
@Override
|
||||
@Before
|
||||
public void setUp() {
|
||||
clearState(getContextRoot());
|
||||
super.setUp();
|
||||
createTestLeaderboards();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParameterFilter() {
|
||||
List<String> availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "2017");
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
assertEquals("505 World 2017", availableLeaderboards.get(0));
|
||||
assertEquals("505 Pre-World 2017", availableLeaderboards.get(1));
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "\"\"");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParameterSelect() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT, "505");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(4, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT, "2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(2, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
assertEquals("505 Pre-World 2017", selectedEntries.get(1).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParameterFilterAndSelect() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "505");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(4, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "505 World 2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(2, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
assertEquals("505 Pre-World 2017", selectedEntries.get(1).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParameterSelectExact() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParametersSelectExactAndSelect() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT,
|
||||
"505 World 2017", PARAM_SELECT, "2017");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505", PARAM_SELECT, "2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParametersSelectExactAndFilterAndSelect() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT,
|
||||
"505", PARAM_FILTER_AND_SELECT, "2017");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllSelectionUrlParameters() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "2015");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "World");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "2015");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllSelectionAndFilterUrlParameters() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "2015", PARAM_FILTER, "2017");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "World", PARAM_FILTER, "505");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("505 World 2017", selectedEntries.get(0).getName());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2015", PARAM_SELECT, "World", PARAM_FILTER, "2017");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(0, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2015", PARAM_SELECT, "World", PARAM_FILTER, "2015");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(1, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
|
||||
leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017",
|
||||
PARAM_FILTER_AND_SELECT, "2017", PARAM_SELECT, "2015", PARAM_FILTER, "505");
|
||||
availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(0, selectedEntries.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlParameterDecoding() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams();
|
||||
createFlexibleLeaderboard(leaderboardConfigurationPanelPO, "Sailing & 2011");
|
||||
createFlexibleLeaderboard(leaderboardConfigurationPanelPO, "Sailing&2015");
|
||||
createFlexibleLeaderboard(leaderboardConfigurationPanelPO, "&");
|
||||
|
||||
List<String> availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "2017 %26");
|
||||
assertEquals(0, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "2011 %26", PARAM_SELECT, "505");
|
||||
assertEquals(1, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "Sailing %26 2011");
|
||||
assertEquals(1, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "%26", PARAM_SELECT, "%26");
|
||||
assertEquals(3, availableLeaderboards.size());
|
||||
List<LeaderboardEntryPO> selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(3, selectedEntries.size());
|
||||
assertEquals("&", selectedEntries.get(0).getName());
|
||||
assertEquals("Sailing & 2011", selectedEntries.get(1).getName());
|
||||
assertEquals("Sailing&2015", selectedEntries.get(2).getName());
|
||||
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "%26", PARAM_SELECT_EXACT, "%26");
|
||||
assertEquals(3, availableLeaderboards.size());
|
||||
selectedEntries = leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries();
|
||||
assertEquals(1, selectedEntries.size());
|
||||
assertEquals("&", selectedEntries.get(0).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResetFilterWhenSelectionUrlParametersOnly() {
|
||||
List<String> availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "2017");
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "2017");
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT_EXACT, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "x");
|
||||
assertEquals(0, availableLeaderboards.size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
}
|
||||
|
||||
/** TODO bug5288
|
||||
@Test
|
||||
public void testResetFilterAndSelectWhenParametersMissing() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "2017");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
assertEquals(2, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT, "2017");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(2, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(1, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "505 World 2017");
|
||||
assertEquals(1, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams();
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
} **/
|
||||
|
||||
@Test
|
||||
public void testResetSelectWhenFilterUrlParametersOnly() {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfigurationPanelPO = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(PARAM_FILTER_AND_SELECT, "2017");
|
||||
List<String> availableLeaderboards = leaderboardConfigurationPanelPO.getAvailableLeaderboards();
|
||||
assertEquals(2, availableLeaderboards.size());
|
||||
assertEquals(2, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT, "2017");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(2, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_SELECT_EXACT, "505 World 2017");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(1, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
|
||||
availableLeaderboards = getLeaderboardsOfPageWithUrlParams(PARAM_FILTER, "505");
|
||||
assertEquals(4, availableLeaderboards.size());
|
||||
assertEquals(0, leaderboardConfigurationPanelPO.getLeaderboardTable().getSelectedEntries().size());
|
||||
}
|
||||
|
||||
private void createTestLeaderboards() {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
LeaderboardConfigurationPanelPO leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
|
||||
|
||||
createFlexibleLeaderboard(leaderboardConfiguration, "505 World 2017");
|
||||
createFlexibleLeaderboard(leaderboardConfiguration, "505 Pre-World 2017");
|
||||
createFlexibleLeaderboard(leaderboardConfiguration, "505 World 2015");
|
||||
createFlexibleLeaderboard(leaderboardConfiguration, "505 World 2011");
|
||||
}
|
||||
|
||||
private void createFlexibleLeaderboard(LeaderboardConfigurationPanelPO leaderboardConfiguration, String name) {
|
||||
FlexibleLeaderboardCreateDialogPO dialog = leaderboardConfiguration.startCreatingFlexibleLeaderboard();
|
||||
dialog.setName(name);
|
||||
assertTrue(dialog.isOkButtonEnabled());
|
||||
dialog.pressOk();
|
||||
}
|
||||
|
||||
private List<String> getLeaderboardsOfPageWithUrlParams(String ...keysValues) {
|
||||
LeaderboardConfigurationPanelPO leaderboardConfiguration = getLeaderboardConfigurationPanelPoOfPageWithUrlParams(keysValues);
|
||||
return leaderboardConfiguration.getAvailableLeaderboards();
|
||||
}
|
||||
|
||||
private LeaderboardConfigurationPanelPO getLeaderboardConfigurationPanelPoOfPageWithUrlParams(String ...keysValues) {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToLeaderboardConfigurationPlace(getWebDriver(), getContextRoot(), keysValues);
|
||||
return adminConsole.getLeaderboardConfigurationPanelPO();
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -20,7 +20,7 @@ import com.sap.sailing.domain.common.DeviceIdentifier;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.impl.GPSFixImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseTemplate;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseTemplateCompatibilityChecker;
|
||||
@@ -98,7 +98,7 @@ public class CourseConfigurationBuilder {
|
||||
}
|
||||
|
||||
public MarkConfiguration<MarkConfigurationRequestAnnotation> addMarkConfiguration(UUID optionalMarkTemplateID, UUID optionalMarkPropertiesID,
|
||||
UUID optionalMarkID, CommonMarkProperties commonMarkProperties, Positioning optionalPositioning,
|
||||
UUID optionalMarkID, FreestyleMarkProperties commonMarkProperties, Positioning optionalPositioning,
|
||||
boolean storeToInventory, MarkRoleCreationRequest optionalMarkRoleCreationRequest) {
|
||||
final MarkConfiguration<MarkConfigurationRequestAnnotation> result;
|
||||
final MarkConfigurationRequestAnnotationImpl markConfigurationRequestAnnotation = new MarkConfigurationRequestAnnotationImpl(
|
||||
@@ -186,7 +186,7 @@ public class CourseConfigurationBuilder {
|
||||
}
|
||||
|
||||
public FreestyleMarkConfiguration<MarkConfigurationRequestAnnotation> addFreestyleMarkConfiguration(UUID optionalMarkTemplateID,
|
||||
UUID optionalMarkPropertiesID, CommonMarkProperties commonMarkProperties, MarkConfigurationRequestAnnotation markConfigurationRequestAnnotation) {
|
||||
UUID optionalMarkPropertiesID, FreestyleMarkProperties commonMarkProperties, MarkConfigurationRequestAnnotation markConfigurationRequestAnnotation) {
|
||||
final MarkTemplate resolvedMarkTemplate = optionalMarkTemplateID == null ? null
|
||||
: resolveMarkTemplateByID(optionalMarkTemplateID);
|
||||
final MarkProperties resolvedMarkProperties = sharedSailingData.getMarkPropertiesById(optionalMarkPropertiesID);
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@ import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseTemplate;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkConfiguration;
|
||||
@@ -30,7 +30,7 @@ import com.sap.sailing.shared.server.SharedSailingData;
|
||||
public class CourseConfigurationJsonDeserializer implements JsonDeserializer<CourseConfiguration<MarkConfigurationRequestAnnotation>> {
|
||||
|
||||
private final SharedSailingData sharedSailingData;
|
||||
private final CommonMarkPropertiesJsonDeserializer commonMarkPropertiesJsonDeserializer;
|
||||
private final FreestyleMarkPropertiesJsonDeserializer commonMarkPropertiesJsonDeserializer;
|
||||
private final JsonDeserializer<RepeatablePart> repeatablePartJsonDeserializer;
|
||||
private final Regatta regatta;
|
||||
private final PositioningJsonDeserializer positioningJsonDeserializer;
|
||||
@@ -38,7 +38,7 @@ public class CourseConfigurationJsonDeserializer implements JsonDeserializer<Cou
|
||||
public CourseConfigurationJsonDeserializer(final SharedSailingData sharedSailingData,
|
||||
DeviceIdentifierJsonDeserializer deviceIdentifierDeserializer, final Regatta regatta) {
|
||||
this.sharedSailingData = sharedSailingData;
|
||||
commonMarkPropertiesJsonDeserializer = new CommonMarkPropertiesJsonDeserializer();
|
||||
commonMarkPropertiesJsonDeserializer = new FreestyleMarkPropertiesJsonDeserializer();
|
||||
repeatablePartJsonDeserializer = new RepeatablePartJsonDeserializer();
|
||||
positioningJsonDeserializer = new PositioningJsonDeserializer(deviceIdentifierDeserializer);
|
||||
this.regatta = regatta;
|
||||
@@ -76,7 +76,7 @@ public class CourseConfigurationJsonDeserializer implements JsonDeserializer<Cou
|
||||
.get(CourseConfigurationJsonSerializer.FIELD_MARK_CONFIGURATION_MARK_ID);
|
||||
final JSONObject freestylePropertiesObject = (JSONObject) markConfigurationJSON
|
||||
.get(CourseConfigurationJsonSerializer.FIELD_MARK_CONFIGURATION_FREESTYLE_PROPERTIES);
|
||||
final CommonMarkProperties optionalFreestyleProperties = freestylePropertiesObject == null ? null
|
||||
final FreestyleMarkProperties optionalFreestyleProperties = freestylePropertiesObject == null ? null
|
||||
: commonMarkPropertiesJsonDeserializer.deserialize(freestylePropertiesObject);
|
||||
final Object positioningObject = markConfigurationJSON
|
||||
.get(CourseConfigurationJsonSerializer.FIELD_MARK_CONFIGURATION_POSITIONING);
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.sap.sailing.server.gateway.deserialization.impl;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.FreestyleMarkPropertiesImpl;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializer;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.FreestyleMarkPropertiesJsonSerializer;
|
||||
|
||||
public class FreestyleMarkPropertiesJsonDeserializer implements JsonDeserializer<FreestyleMarkProperties> {
|
||||
private final CommonMarkPropertiesJsonDeserializer commonMarkPropertiesJsonDeserializer;
|
||||
|
||||
public FreestyleMarkPropertiesJsonDeserializer() {
|
||||
this.commonMarkPropertiesJsonDeserializer = new CommonMarkPropertiesJsonDeserializer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FreestyleMarkProperties deserialize(JSONObject json) throws JsonDeserializationException {
|
||||
Object tagsArray = json.get(FreestyleMarkPropertiesJsonSerializer.FIELD_TAGS);
|
||||
final Set<String> tags = new HashSet<>();
|
||||
if (tagsArray != null && tagsArray instanceof JSONArray) {
|
||||
for (Object tag : (JSONArray) tagsArray) {
|
||||
tags.add(tag.toString());
|
||||
}
|
||||
}
|
||||
CommonMarkProperties commonMarkProperties = commonMarkPropertiesJsonDeserializer.deserialize(json);
|
||||
return new FreestyleMarkPropertiesImpl(commonMarkProperties, tags);
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -10,6 +10,7 @@ import org.json.simple.JSONObject;
|
||||
import com.sap.sailing.domain.common.DeviceIdentifier;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.coursetemplate.CommonMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.ControlPointWithMarkConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkConfiguration;
|
||||
@@ -62,11 +63,13 @@ public class CourseConfigurationJsonSerializer implements JsonSerializer<CourseC
|
||||
|
||||
private final JsonSerializer<RepeatablePart> repeatablePartJsonSerializer;
|
||||
private final JsonSerializer<CommonMarkProperties> commonMarkPropertiesJsonSerializer;
|
||||
private final JsonSerializer<FreestyleMarkProperties> commonMarkPropertiesWithTagsJsonSerializer;
|
||||
private final JsonSerializer<GPSFix> gpsFixJsonSerializer;
|
||||
|
||||
public CourseConfigurationJsonSerializer() {
|
||||
this.repeatablePartJsonSerializer = new RepeatablePartJsonSerializer();
|
||||
this.commonMarkPropertiesJsonSerializer = new CommonMarkPropertiesJsonSerializer();
|
||||
this.commonMarkPropertiesWithTagsJsonSerializer = new FreestyleMarkPropertiesJsonSerializer();
|
||||
this.gpsFixJsonSerializer = new GPSFixJsonSerializer();
|
||||
}
|
||||
|
||||
@@ -110,7 +113,7 @@ public class CourseConfigurationJsonSerializer implements JsonSerializer<CourseC
|
||||
freeStyleMarkConfiguration.getOptionalMarkProperties().getId().toString());
|
||||
}
|
||||
markConfigurationsEntry.put(FIELD_MARK_CONFIGURATION_FREESTYLE_PROPERTIES,
|
||||
commonMarkPropertiesJsonSerializer
|
||||
commonMarkPropertiesWithTagsJsonSerializer
|
||||
.serialize(freeStyleMarkConfiguration.getFreestyleProperties()));
|
||||
return null;
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.server.gateway.serialization.impl;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.server.gateway.serialization.JsonSerializer;
|
||||
|
||||
public class FreestyleMarkPropertiesJsonSerializer implements JsonSerializer<FreestyleMarkProperties> {
|
||||
|
||||
public static final String FIELD_TAGS = "tags";
|
||||
|
||||
private final CommonMarkPropertiesJsonSerializer commonMarkPropertiesJsonSerializer;
|
||||
|
||||
public FreestyleMarkPropertiesJsonSerializer() {
|
||||
commonMarkPropertiesJsonSerializer = new CommonMarkPropertiesJsonSerializer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject serialize(FreestyleMarkProperties commonMarkProperties) {
|
||||
JSONObject result = commonMarkPropertiesJsonSerializer.serialize(commonMarkProperties);
|
||||
JSONArray jsonTags = new JSONArray();
|
||||
for (String tag : commonMarkProperties.getTags()) {
|
||||
jsonTags.add(tag);
|
||||
}
|
||||
result.put(FIELD_TAGS, jsonTags);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -8,14 +8,13 @@ import com.sap.sailing.server.gateway.serialization.JsonSerializer;
|
||||
|
||||
public class MarkPropertiesJsonSerializer implements JsonSerializer<MarkProperties> {
|
||||
private static final String FIELD_ID = "id";
|
||||
private static final String FIELD_TAGS = "tags";
|
||||
private static final String FIELD_POSITIONING = "positioning";
|
||||
|
||||
private final CommonMarkPropertiesJsonSerializer commonMarkPropertiesJsonSerializer;
|
||||
private final FreestyleMarkPropertiesJsonSerializer commonMarkPropertiesWithTagsJsonSerializer;
|
||||
private final PositioningJsonSerializer positioningJsonSerializer;
|
||||
|
||||
public MarkPropertiesJsonSerializer(DeviceIdentifierJsonSerializer deviceIdentifierSerializer) {
|
||||
this.commonMarkPropertiesJsonSerializer = new CommonMarkPropertiesJsonSerializer();
|
||||
this.commonMarkPropertiesWithTagsJsonSerializer = new FreestyleMarkPropertiesJsonSerializer();
|
||||
this.positioningJsonSerializer = new PositioningJsonSerializer(deviceIdentifierSerializer);
|
||||
}
|
||||
|
||||
@@ -25,8 +24,7 @@ public class MarkPropertiesJsonSerializer implements JsonSerializer<MarkProperti
|
||||
result.put(FIELD_ID, markProperties.getId().toString());
|
||||
final JSONArray tags = new JSONArray();
|
||||
markProperties.getTags().forEach(tags::add);
|
||||
result.put(FIELD_TAGS, tags);
|
||||
result.putAll(commonMarkPropertiesJsonSerializer.serialize(markProperties));
|
||||
result.putAll(commonMarkPropertiesWithTagsJsonSerializer.serialize(markProperties));
|
||||
result.put(FIELD_POSITIONING, markProperties.getPositioningInformation() == null ? null :
|
||||
positioningJsonSerializer.serialize(markProperties.getPositioningInformation()));
|
||||
return result;
|
||||
|
||||
@@ -27,8 +27,9 @@ name to make sure you get to the event you're interested in.
|
||||
<br/>
|
||||
<b>Webservices API-Documention:</b><br/>
|
||||
<ul style="margin-left: 20px;">
|
||||
<li><a href="api/v1/index.html">SAP Sailing Analytics Webservices Version 1.0</a></li>
|
||||
<li><a href="api/v1/index.html">SAP Sailing Analytics Webservices Version 1.0</a></li>
|
||||
<li><a href="api/v2/index.html">SAP Sailing Analytics Webservices Version 2.0</a></li>
|
||||
<li><a href="/security/webservices/api/index.html">Security API</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
+28
-9
@@ -53,6 +53,7 @@ import com.sap.sailing.domain.coursetemplate.CourseTemplate;
|
||||
import com.sap.sailing.domain.coursetemplate.CourseTemplateCompatibilityChecker;
|
||||
import com.sap.sailing.domain.coursetemplate.FixedPositioning;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.FreestyleMarkProperties;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkConfigurationRequestAnnotation;
|
||||
import com.sap.sailing.domain.coursetemplate.MarkConfigurationRequestAnnotation.MarkRoleCreationRequest;
|
||||
@@ -75,6 +76,7 @@ import com.sap.sailing.domain.coursetemplate.WaypointTemplate;
|
||||
import com.sap.sailing.domain.coursetemplate.WaypointWithMarkConfiguration;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.CourseConfigurationImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.FreestyleMarkConfigurationImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.FreestyleMarkPropertiesImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.MarkConfigurationRequestAnnotationImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.MarkPairWithConfigurationImpl;
|
||||
import com.sap.sailing.domain.coursetemplate.impl.MarkPropertiesBasedMarkConfigurationImpl;
|
||||
@@ -213,16 +215,30 @@ public class CourseAndMarkConfigurationFactoryImpl implements CourseAndMarkConfi
|
||||
final Positioning positioningOrNull = markConfiguration.getAnnotationInfo().getOptionalPositioning();
|
||||
// create or update the non position-related aspects of the MarkProperties object in the "inventory":
|
||||
if (markPropertiesOrNull == null) {
|
||||
CommonMarkProperties effectiveProperties = markConfiguration.getEffectiveProperties();
|
||||
Iterable<String> tags = Collections.emptySet();
|
||||
if (effectiveProperties instanceof FreestyleMarkProperties) {
|
||||
tags = ((FreestyleMarkProperties) effectiveProperties).getTags();
|
||||
}else {
|
||||
tags = Collections.emptySet();
|
||||
}
|
||||
// If no mark properties exist yet, a new one is created
|
||||
markPropertiesInInventory = getSharedSailingData().createMarkProperties(markConfiguration.getEffectiveProperties(),
|
||||
/* tags */ Collections.emptySet(), optionalNonDefaultGroupOwnership);
|
||||
markPropertiesInInventory = getSharedSailingData().createMarkProperties(effectiveProperties, tags,
|
||||
optionalNonDefaultGroupOwnership);
|
||||
} else {
|
||||
CommonMarkProperties effectiveProperties = markConfiguration.getEffectiveProperties();
|
||||
final Iterable<String> tags;
|
||||
if (effectiveProperties instanceof FreestyleMarkProperties) {
|
||||
tags = ((FreestyleMarkProperties) effectiveProperties).getTags();
|
||||
}else {
|
||||
tags = Collections.emptySet();
|
||||
}
|
||||
// in the case of a MarkPropertiesBasedMarkConfiguration, the following call is expected to notice
|
||||
// the identity between the mark properties object to update and the mark properties that constitute
|
||||
// the effective properties and then skip the update.
|
||||
markPropertiesInInventory = markPropertiesOrNull;
|
||||
getSharedSailingData().updateMarkProperties(markPropertiesInInventory.getId(), markConfiguration.getEffectiveProperties(),
|
||||
positioningOrNull, /* TODO tags */ Collections.emptySet());
|
||||
getSharedSailingData().updateMarkProperties(markPropertiesInInventory.getId(), effectiveProperties,
|
||||
positioningOrNull, tags);
|
||||
}
|
||||
if (positioningOrNull != null) {
|
||||
positioningOrNull.accept(new PositioningVisitor<Void>() {
|
||||
@@ -316,11 +332,14 @@ public class CourseAndMarkConfigurationFactoryImpl implements CourseAndMarkConfi
|
||||
if (markPropertiesOrNull.hasEqualAppeareanceWith(effectiveMarkTemplate)) {
|
||||
effectiveConfiguration = new MarkPropertiesBasedMarkConfigurationImpl<>(markPropertiesOrNull,
|
||||
effectiveMarkTemplate, markConfiguration.getAnnotationInfo());
|
||||
} else {
|
||||
effectiveConfiguration = new FreestyleMarkConfigurationImpl<>(effectiveMarkTemplate,
|
||||
markPropertiesOrNull, effectiveMarkTemplate, markConfiguration.getAnnotationInfo());
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
effectiveConfiguration = new FreestyleMarkConfigurationImpl<>(effectiveMarkTemplate,
|
||||
markPropertiesOrNull,
|
||||
new FreestyleMarkPropertiesImpl(effectiveMarkTemplate,
|
||||
/* tags */ null),
|
||||
markConfiguration.getAnnotationInfo());
|
||||
}
|
||||
} else {
|
||||
effectiveConfiguration = new MarkTemplateBasedMarkConfigurationImpl<>(effectiveMarkTemplate,
|
||||
markConfiguration.getAnnotationInfo());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?pde version="3.8"?>
|
||||
<target name="Race Analysis Target" sequenceNumber="164">
|
||||
<target name="Race Analysis Target" sequenceNumber="165">
|
||||
<locations>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
<unit id="javax.ws.rs" version="1.1.1.v20130318-1750"/>
|
||||
@@ -62,7 +62,7 @@
|
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20180905201904/repository/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.jetty.bundles.f.feature.group" version="9.4.8.201802270002"/>
|
||||
<unit id="org.eclipse.jetty.bundles.f.feature.group" version="9.4.34.v20201102"/>
|
||||
<repository location="https://download.eclipse.org/jetty/updates/jetty-bundles-9.x/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
@@ -213,10 +213,10 @@
|
||||
<plugin id="org.eclipse.jetty.client.source"/>
|
||||
<plugin id="org.eclipse.jetty.deploy"/>
|
||||
<plugin id="org.eclipse.jetty.deploy.source"/>
|
||||
<plugin id="org.eclipse.jetty.http" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.http.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.io" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.io.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.http" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.http.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.io" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.io.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.jaas"/>
|
||||
<plugin id="org.eclipse.jetty.jmx"/>
|
||||
<plugin id="org.eclipse.jetty.jmx.source"/>
|
||||
@@ -227,17 +227,17 @@
|
||||
<plugin id="org.eclipse.jetty.proxy"/>
|
||||
<plugin id="org.eclipse.jetty.rewrite"/>
|
||||
<plugin id="org.eclipse.jetty.rewrite.source"/>
|
||||
<plugin id="org.eclipse.jetty.security" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.security.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.server" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.server.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.servlet" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.servlet.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.security" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.security.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.server" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.server.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.servlet" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.servlet.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.servlets.source"/>
|
||||
<plugin id="org.eclipse.jetty.util" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.util" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.util.ajax"/>
|
||||
<plugin id="org.eclipse.jetty.util.ajax.source"/>
|
||||
<plugin id="org.eclipse.jetty.util.source" version="9.4.8.v20171121"/>
|
||||
<plugin id="org.eclipse.jetty.util.source" version="9.4.34.v20201102"/>
|
||||
<plugin id="org.eclipse.jetty.webapp"/>
|
||||
<plugin id="org.eclipse.jetty.webapp.source"/>
|
||||
<plugin id="org.eclipse.jetty.websocket.api"/>
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -810,7 +811,7 @@ public class Util {
|
||||
|
||||
/**
|
||||
* Groups the given values by a key. The key is being extracted from the values by using the given {@link Function}. Inner
|
||||
* Collections of the resulting Map are created using the given {@link Provider} instance.
|
||||
* Collections of the resulting Map are created using the given {@link Supplier} instance.
|
||||
* <br>
|
||||
* Can be replaced with Java 8 Stream API in the future.
|
||||
*
|
||||
@@ -994,4 +995,26 @@ public class Util {
|
||||
public static <T> boolean setEquals(Iterable<T> a, Iterable<T> b) {
|
||||
return asSet(a).equals(asSet(b));
|
||||
}
|
||||
|
||||
public static interface MapBuilder<K, V> {
|
||||
MapBuilder<K, V> put(K key, V value);
|
||||
Map<K, V> build();
|
||||
}
|
||||
|
||||
public static <K, V> MapBuilder<K, V> mapBuilder() {
|
||||
return new MapBuilder<K, V>() {
|
||||
final Map<K, V> result = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public Map<K, V> build() {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapBuilder<K, V> put(K key, V value) {
|
||||
result.put(key, value);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public abstract class KeywordMatcher<T> {
|
||||
}
|
||||
|
||||
public boolean matchesExactly(Iterable<String> keywords, T t) {
|
||||
return keywords != null && matches(t, keywords, true);
|
||||
return keywords != null && matches(t, keywords, /* exactMatch */ true);
|
||||
}
|
||||
|
||||
private boolean containsText(T obj, Iterable<String> keywords) {
|
||||
@@ -65,10 +65,6 @@ public abstract class KeywordMatcher<T> {
|
||||
}
|
||||
|
||||
private boolean matches(String s, String keyword, boolean exactMatch) {
|
||||
if (s == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return exactMatch ? s.equalsIgnoreCase(keyword) : s.toUpperCase().contains(keyword);
|
||||
return s != null && (exactMatch ? s.equalsIgnoreCase(keyword) : s.toUpperCase().contains(keyword));
|
||||
}
|
||||
}
|
||||
@@ -35,14 +35,14 @@
|
||||
id="org.eclipse.jetty.osgi.boot"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.osgi.boot.warurl"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
@@ -106,91 +106,91 @@
|
||||
id="org.eclipse.jetty.deploy"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.http"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.io"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.jmx"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.security"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.server"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.servlet"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.util"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.webapp"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.websocket.api"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.websocket.client"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.websocket.common"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.xml"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
@@ -357,7 +357,7 @@
|
||||
id="org.eclipse.jetty.client"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
version="9.4.34.v20201102"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
|
||||
+4
-5
@@ -132,7 +132,7 @@ public class AdminConsolePanel<T extends Place & AdminConsolePlace> extends Head
|
||||
|
||||
refreshDataFor(selectedPanel);
|
||||
goToWidgetsPlace(selectedPanel);
|
||||
|
||||
|
||||
} else if (source instanceof VerticalTabLayoutPanel) {
|
||||
logger.info("onSelection vertical tab layout");
|
||||
final VerticalTabLayoutPanel verticalTabLayoutPanel = (VerticalTabLayoutPanel) source;
|
||||
@@ -508,8 +508,7 @@ public class AdminConsolePanel<T extends Place & AdminConsolePlace> extends Head
|
||||
permissionsAnyOfWhichIsRequiredToSeeWidget.put(tabPanel.getPanel(), permissionsForTabPanel);
|
||||
}
|
||||
permissionsForTabPanel.add(permissionCheck);
|
||||
|
||||
if (place != null) { //for horizontal tabs
|
||||
if (place != null) { // for horizontal tabs
|
||||
widgetPlacesMap.put(widgetToAdd, place);
|
||||
}
|
||||
}
|
||||
@@ -617,10 +616,10 @@ public class AdminConsolePanel<T extends Place & AdminConsolePlace> extends Head
|
||||
}
|
||||
|
||||
private void filterAndSelect(final T place, final Widget widget) {
|
||||
if (widget instanceof FilterablePanelProvider && place instanceof FilterableAdminConsolePlace && ((FilterableAdminConsolePlace)place).getFilterParameter() != null) {
|
||||
if (widget instanceof FilterablePanelProvider && place instanceof FilterableAdminConsolePlace && ((FilterableAdminConsolePlace)place).getFilterAndSelectParameters() != null) {
|
||||
FilterablePanelProvider<?> filterablePanelProvider = (FilterablePanelProvider<?>) widget;
|
||||
FilterableAdminConsolePlace filterablePlace = (FilterableAdminConsolePlace) place;
|
||||
filterablePanelProvider.getFilterablePanel().filter(filterablePlace.getFilterParameter());
|
||||
filterablePanelProvider.getFilterablePanel().filterAndSelect(filterablePlace.getFilterAndSelectParameters());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -1,14 +1,14 @@
|
||||
package com.sap.sse.gwt.adminconsole;
|
||||
|
||||
import com.sap.sse.gwt.client.panels.FilterParameter;
|
||||
import com.sap.sse.gwt.client.panels.FilterAndSelectParameters;
|
||||
|
||||
/**
|
||||
* Places that have filterable tables and should be filterable by URL parameters must implement this interface.
|
||||
* The panel that is rendered when the place is called must implement FilterablePanelProvider.
|
||||
* Otherwise the filter-parameters will be ignored when the place is called.
|
||||
* Places that have filterable tables and should be filterable by URL parameters must implement this interface. The
|
||||
* panel that is rendered when the place is called must implement FilterablePanelProvider. Otherwise the
|
||||
* filter-parameters will be ignored when the place is called.
|
||||
*
|
||||
* @see com.sap.sse.gwt.adminconsole.FilterablePanelProvider
|
||||
*/
|
||||
public interface FilterableAdminConsolePlace {
|
||||
|
||||
public FilterParameter getFilterParameter();
|
||||
FilterAndSelectParameters getFilterAndSelectParameters();
|
||||
}
|
||||
+58
-55
@@ -279,21 +279,21 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
* If field {@link #executeSelectOnRefresh executeSelectOnRefresh} is set to true, selection will be executed immediately.
|
||||
* otherwise, selection will be postponed to be called the next time the table items are refreshed.
|
||||
*
|
||||
* @param filterParameter defines the parameters for filtering and selection
|
||||
* @param filterParameters defines the parameters for filtering and selection
|
||||
*/
|
||||
public void filter(FilterParameter filterParameter) {
|
||||
if (filterParameter.getFilterString() != null) {
|
||||
search(filterParameter.getFilterString());
|
||||
}
|
||||
if (!executeSelectOnRefresh) {
|
||||
select(filterParameter.getSelectList(), filterParameter.getSelectExact());
|
||||
} else {
|
||||
this.selectExact = filterParameter.getSelectExact();
|
||||
this.select = filterParameter.getSelectList();
|
||||
this.executeSelect = true;
|
||||
public void filterAndSelect(FilterAndSelectParameters filterParameters) {
|
||||
if (filterParameters.isAnyParameterSet()) {
|
||||
if (filterParameters.getFilterString() != null) {
|
||||
search(filterParameters.getFilterString());
|
||||
}
|
||||
if (!executeSelectOnRefresh) {
|
||||
select(filterParameters.getSelectList(), filterParameters.getSelectExact());
|
||||
} else {
|
||||
setSelectParameters(filterParameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract AbstractCellTable<T> getCellTable();
|
||||
|
||||
protected void retainElementsInFilteredThatPassFilter() {
|
||||
@@ -307,9 +307,7 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
}
|
||||
|
||||
private void select() {
|
||||
if (isSelectParameterSet()) {
|
||||
select(select, selectExact);
|
||||
}
|
||||
select(select, selectExact);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,12 +319,30 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
*
|
||||
*/
|
||||
private void select(List<String> selections, String selectExact) {
|
||||
if (isSingleSelect()) {
|
||||
if (!isSelectParameterSet()) {
|
||||
deselectAll();
|
||||
}
|
||||
else if (isSingleSelect()) {
|
||||
selectSingle(selections, selectExact);
|
||||
} else {
|
||||
selectMultiple(selections, selectExact);
|
||||
}
|
||||
|
||||
}
|
||||
resetSelectParameters();
|
||||
}
|
||||
|
||||
private void deselectAll() {
|
||||
for (T t : all.getList()) {
|
||||
select(t, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setSelectParameters(FilterAndSelectParameters filterParameters) {
|
||||
this.selectExact = filterParameters.getSelectExact();
|
||||
this.select = filterParameters.getSelectList();
|
||||
this.executeSelect = true;
|
||||
}
|
||||
|
||||
private void resetSelectParameters() {
|
||||
if (select != null) {
|
||||
select.clear();
|
||||
}
|
||||
@@ -349,22 +365,21 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
* @param selections list of selection parameters. Will use same logic as the filter mechanism to select items
|
||||
* @param selectExact parameter that will be used to find and select exactly matching items in the table
|
||||
*/
|
||||
private void selectMultiple(List<String> selections, String selectExact) {
|
||||
private void selectMultiple(List<String> selections, String selectExact) {
|
||||
selectionFilter.setKeywords(selectExact == null ? new ArrayList<>() : Arrays.asList(selectExact));
|
||||
for (T t : all.getList()) {
|
||||
boolean matchesAtLeastOneSelection = false;
|
||||
boolean isMatchingItem = true;
|
||||
for (String selection : selections) {
|
||||
setKeywordsFilterSplitValue(selection);
|
||||
if (matches(t)) {
|
||||
matchesAtLeastOneSelection = true;
|
||||
if (!matches(t)) {
|
||||
isMatchingItem = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
select(t, matchesAtLeastOneSelection);
|
||||
select(t, isMatchingItem && matchesExactly(t));
|
||||
}
|
||||
resetKeywordsFilterSplitValue();
|
||||
|
||||
selectExact(selectExact);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selection logic for single-selection tables.
|
||||
@@ -375,12 +390,11 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
* @param selectExact parameter that will be used to find and select exactly matching items in the table
|
||||
*/
|
||||
private void selectSingle(List<String> selections, String selectExact) {
|
||||
boolean selected = singleSelectExact(selectExact);
|
||||
|
||||
final boolean selected = singleSelectExact(selectExact);
|
||||
if (!selected) {
|
||||
try {
|
||||
for (T t : all.getList()) {
|
||||
for (String selection : selections) {
|
||||
for (final T t : all.getList()) {
|
||||
for (final String selection : selections) {
|
||||
setKeywordsFilterSplitValue(selection);
|
||||
if (matches(t)) {
|
||||
select(t);
|
||||
@@ -402,39 +416,28 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
|
||||
getCellTable().getSelectionModel().setSelected(item, select);
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects exactly matching items
|
||||
* @param selectExact parameter that will be used to find and select exactly matching items in the table
|
||||
*/
|
||||
private void selectExact(String selectExact) {
|
||||
if (selectExact == null) {
|
||||
return;
|
||||
}
|
||||
selectionFilter.setKeywords(Arrays.asList(selectExact));
|
||||
for (T t : all.getList()) {
|
||||
if (matchesExactly(t)) {
|
||||
select(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects exactly matching items
|
||||
* @param selectExact parameter that will be used to find and select exactly matching items in the table
|
||||
* @return true if an exactly matching item has been found and selected.
|
||||
*/
|
||||
private boolean singleSelectExact(String selectExact) {
|
||||
final boolean result;
|
||||
if (selectExact == null) {
|
||||
return false;
|
||||
result = false;
|
||||
} else {
|
||||
selectionFilter.setKeywords(Arrays.asList(selectExact));
|
||||
boolean found = false;
|
||||
for (T t : all.getList()) {
|
||||
if (matchesExactly(t)) {
|
||||
select(t);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = found;
|
||||
}
|
||||
selectionFilter.setKeywords(Arrays.asList(selectExact));
|
||||
for (T t : all.getList()) {
|
||||
if (matchesExactly(t)) {
|
||||
select(t);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean matchesExactly(T t) {
|
||||
|
||||
+18
-25
@@ -5,12 +5,20 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
public class FilterParameter implements Serializable {
|
||||
public class FilterAndSelectParameters implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8498346319001912273L;
|
||||
|
||||
private String filter, select, selectExact, filterAndSelect;
|
||||
private final String filter, select, selectExact, filterAndSelect;
|
||||
|
||||
public FilterAndSelectParameters(String filter, String select, String selectExact, String filterAndSelect) {
|
||||
super();
|
||||
this.filter = filter;
|
||||
this.select = select;
|
||||
this.selectExact = selectExact;
|
||||
this.filterAndSelect = filterAndSelect;
|
||||
}
|
||||
|
||||
public String getFilter() {
|
||||
return filter;
|
||||
}
|
||||
@@ -19,18 +27,6 @@ public class FilterParameter implements Serializable {
|
||||
return select;
|
||||
}
|
||||
|
||||
public void setFilter(String filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public void setSelect(String select) {
|
||||
this.select = select;
|
||||
}
|
||||
|
||||
public void setSelectExact(String selectExact) {
|
||||
this.selectExact = selectExact;
|
||||
}
|
||||
|
||||
public String getSelectExact() {
|
||||
return selectExact;
|
||||
}
|
||||
@@ -39,10 +35,6 @@ public class FilterParameter implements Serializable {
|
||||
return filterAndSelect;
|
||||
}
|
||||
|
||||
public void setFilterAndSelect (String filterAndSelect) {
|
||||
this.filterAndSelect = filterAndSelect;
|
||||
}
|
||||
|
||||
public String getFilterString() {
|
||||
StringJoiner filterString = new StringJoiner(" ");
|
||||
if (filter != null) {
|
||||
@@ -51,7 +43,7 @@ public class FilterParameter implements Serializable {
|
||||
if (filterAndSelect != null) {
|
||||
filterString.add(filterAndSelect);
|
||||
}
|
||||
return filterString.length() <= 0 ? null : filterString.toString();
|
||||
return filterString.length() <= 0 && !isSelectParameterSet() ? null : filterString.toString();
|
||||
}
|
||||
|
||||
public List<String> getSelectList() {
|
||||
@@ -65,11 +57,12 @@ public class FilterParameter implements Serializable {
|
||||
return selects;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.filter = null;
|
||||
this.filterAndSelect = null;
|
||||
this.selectExact = null;
|
||||
this.filterAndSelect = null;
|
||||
private boolean isSelectParameterSet() {
|
||||
return select != null || selectExact != null || filterAndSelect != null;
|
||||
}
|
||||
|
||||
public boolean isAnyParameterSet() {
|
||||
return isSelectParameterSet() || getFilterString() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,7 +84,7 @@ public class FilterParameter implements Serializable {
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
FilterParameter other = (FilterParameter) obj;
|
||||
FilterAndSelectParameters other = (FilterAndSelectParameters) obj;
|
||||
if (filter == null) {
|
||||
if (other.filter != null)
|
||||
return false;
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sap.sse.gwt.client.xdstorage.impl;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.sap.sse.gwt.client.Storage;
|
||||
@@ -15,6 +16,7 @@ import com.sap.sse.gwt.client.xdstorage.CrossDomainStorageEvent.Handler;
|
||||
*
|
||||
*/
|
||||
public class LocalStorage implements CrossDomainStorage {
|
||||
private static final Logger logger = Logger.getLogger(LocalStorage.class.getName());
|
||||
private final Storage storage;
|
||||
|
||||
public LocalStorage() {
|
||||
@@ -29,7 +31,11 @@ public class LocalStorage implements CrossDomainStorage {
|
||||
|
||||
@Override
|
||||
public void setItem(String key, String value, Consumer<Void> callback) {
|
||||
storage.setItem(key, value);
|
||||
if (storage != null) {
|
||||
storage.setItem(key, value);
|
||||
} else {
|
||||
logger.warning("Cannot store "+key+"="+value+" in local storage; local storage not accessible");
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.accept(null);
|
||||
}
|
||||
@@ -37,14 +43,25 @@ public class LocalStorage implements CrossDomainStorage {
|
||||
|
||||
@Override
|
||||
public void getItem(String key, Consumer<String> callback) {
|
||||
final String result;
|
||||
if (storage != null) {
|
||||
result = storage.getItem(key);
|
||||
} else {
|
||||
logger.warning("Cannot read "+key+" from local storage; local storage not accessible");
|
||||
result = null;
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.accept(storage.getItem(key));
|
||||
callback.accept(result);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeItem(String key, Consumer<Void> callback) {
|
||||
storage.removeItem(key);
|
||||
if (storage != null) {
|
||||
storage.removeItem(key);
|
||||
} else {
|
||||
logger.warning("Cannot remove "+key+" from local storage; local storage not accessible");
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.accept(null);
|
||||
}
|
||||
@@ -52,7 +69,11 @@ public class LocalStorage implements CrossDomainStorage {
|
||||
|
||||
@Override
|
||||
public void clear(Consumer<Void> callback) {
|
||||
storage.clear();
|
||||
if (storage != null) {
|
||||
storage.clear();
|
||||
} else {
|
||||
logger.warning("Cannot clear local storage; local storage not accessible");
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.accept(null);
|
||||
}
|
||||
@@ -60,15 +81,29 @@ public class LocalStorage implements CrossDomainStorage {
|
||||
|
||||
@Override
|
||||
public void key(int index, Consumer<String> callback) {
|
||||
final String result;
|
||||
if (storage != null) {
|
||||
result = storage.key(index);
|
||||
} else {
|
||||
logger.warning("Cannot read key at index "+index+" from local storage; local storage not accessible");
|
||||
result = null;
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.accept(storage.key(index));
|
||||
callback.accept(result);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLength(Consumer<Integer> callback) {
|
||||
if (callback != null) {
|
||||
callback.accept(storage.getLength());
|
||||
final Integer result;
|
||||
if (storage != null) {
|
||||
result = storage.getLength();
|
||||
} else {
|
||||
logger.warning("Warning: cannot get local storage length; local storage not accessible");
|
||||
result = null;
|
||||
}
|
||||
callback.accept(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.sap.sse.jettyextensions</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,7 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -1,3 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
@@ -1,9 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Jettyextensions
|
||||
Bundle-SymbolicName: com.sap.sse.jettyextensions
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Fragment-Host: org.eclipse.jetty.osgi.boot
|
||||
Automatic-Module-Name: com.sap.sse.jettyextensions
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
@@ -1,4 +0,0 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>root</artifactId>
|
||||
<groupId>com.sap.sailing</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.sap.sse.jettyextensions</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.sap.sse.jettyextensions;
|
||||
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
|
||||
public class SynchronizedContextHandlerCollection extends ContextHandlerCollection {
|
||||
public SynchronizedContextHandlerCollection() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void setHandlers(Handler[] handlers) {
|
||||
super.setHandlers(handlers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void addHandler(Handler handler) {
|
||||
super.addHandler(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void prependHandler(Handler handler) {
|
||||
super.prependHandler(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void removeHandler(Handler handler) {
|
||||
super.removeHandler(handler);
|
||||
}
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package com.sap.sse.jettyextensions;
|
||||
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
|
||||
public class SynchronizedHandlerCollection extends HandlerCollection {
|
||||
public SynchronizedHandlerCollection() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void setHandlers(Handler[] handlers) {
|
||||
super.setHandlers(handlers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void addHandler(Handler handler) {
|
||||
super.addHandler(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void prependHandler(Handler handler) {
|
||||
super.prependHandler(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void removeHandler(Handler handler) {
|
||||
super.removeHandler(handler);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,6 @@
|
||||
<module>com.sap.sailing.landscape</module>
|
||||
<module>com.sap.sailing.landscape.test</module>
|
||||
<module>com.sap.sse.jersey.jaxbdependencyfragment</module>
|
||||
<module>com.sap.sse.jettyextensions</module>
|
||||
<module>com.sap.sailing.routeconverterjava11extension</module>
|
||||
<module>com.sap.sse.mail</module>
|
||||
<module>com.sap.sse.mail.replication.test</module>
|
||||
|
||||
+1
-4
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||
|
||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- Configure the deployment manager -->
|
||||
<!-- -->
|
||||
@@ -10,8 +9,7 @@
|
||||
<!-- to behave in a similaraly to the legacy ContextDeployer -->
|
||||
<!-- and WebAppDeployer from previous versions of Jetty. -->
|
||||
<!-- =========================================================== -->
|
||||
|
||||
<Call name="addBean">
|
||||
<Call name="addBean">
|
||||
<Arg>
|
||||
<New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
|
||||
<Set name="contexts">
|
||||
@@ -44,5 +42,4 @@
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
|
||||
</Configure>
|
||||
@@ -42,7 +42,6 @@
|
||||
<Set name="acceptQueueSize"><Property name="jetty.http.acceptQueueSize" deprecated="http.acceptQueueSize" default="0"/></Set>
|
||||
<Get name="SelectorManager">
|
||||
<Set name="connectTimeout"><Property name="jetty.http.connectTimeout" default="25000"/></Set>
|
||||
<Set name="reservedThreads"><Property name="jetty.http.reservedThreads" default="-2"/></Set>
|
||||
</Get>
|
||||
</New>
|
||||
</Arg>
|
||||
|
||||
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user