mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
bug5609: using storedURI for non-replay/non-prefer-replay params
This commit is contained in:
1 parent
7e5221ccf6
commit
9dc1a5cf78
2 files changed
+9
-4
No files matched your search
+8
-3
@@ -26,6 +26,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
import com.sap.sse.security.SessionUtils;
|
||||
import com.tractrac.model.lib.api.event.CreateModelException;
|
||||
import com.tractrac.model.lib.api.event.IRace;
|
||||
import com.tractrac.util.lib.api.exceptions.TimeOutException;
|
||||
|
||||
/**
|
||||
@@ -143,10 +144,14 @@ public class TracTracConnectivityParamsHandler extends AbstractRaceTrackingConne
|
||||
|
||||
private void updatePersistentTracTracConfiguration(RaceTrackingConnectivityParametersImpl params)
|
||||
throws MalformedURLException, IOException, ParseException, CreateModelException, URISyntaxException, TimeOutException {
|
||||
final String jsonURL = params.getTractracRace().getParameterSet().getParameter("eventJSON");
|
||||
final IRace tractracRace = params.getTractracRace();
|
||||
final String jsonURL = tractracRace.getParameterSet().getParameter("eventJSON");
|
||||
final String creatorName = SessionUtils.getPrincipal().toString();
|
||||
final TracTracConfigurationImpl tracTracConfiguration = new TracTracConfigurationImpl(creatorName, params.getTractracRace().getEvent().getName(), jsonURL,
|
||||
/* live URI */ null, /* stored URI */ null, // we mainly want to enable the user to list the event's races again in case they are removed; live/stored stuff comes from the tracking params
|
||||
final TracTracConfigurationImpl tracTracConfiguration = new TracTracConfigurationImpl(creatorName, tractracRace.getEvent().getName(), jsonURL,
|
||||
(params.getLiveURI() == null ? null : params.getLiveURI().toString()),
|
||||
/* stored URI */ params.isPreferReplayIfAvailable() && params.isReplayRace(tractracRace)
|
||||
? null // we mainly want to enable the user to list the event's races again in case they are removed;
|
||||
: (params.getStoredURI() == null ? null : params.getStoredURI().toString()), // live/stored stuff comes from the tracking params
|
||||
params.getCourseDesignUpdateURI()==null?null:params.getCourseDesignUpdateURI().toString(), params.getTracTracUsername(), params.getTracTracPassword());
|
||||
tractracMongoObjectFactory.updateTracTracConfiguration(tracTracConfiguration);
|
||||
securityService.setDefaultOwnershipIfNotSet(tracTracConfiguration.getIdentifier());
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class RaceTrackingConnectivityParametersImpl extends AbstractRaceTracking
|
||||
this.preferReplayIfAvailable = preferReplayIfAvailable;
|
||||
}
|
||||
|
||||
private boolean isReplayRace(IRace tractracRace) {
|
||||
public boolean isReplayRace(IRace tractracRace) {
|
||||
return tractracRace.getStoredURI() != null && tractracRace.getStoredURI().toString().toLowerCase().endsWith(".mtb");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user