mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 22:43:57 +00:00
Merge branch 'master' into 60_inch
This commit is contained in:
commit
436bf158aa
2 files changed
+4
-10
No files matched your search
-7
@@ -1,10 +1,8 @@
|
||||
package com.sap.sailing.manage2sail.resultimport;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.sap.sailing.manage2sail.RegattaResultDescriptor;
|
||||
import com.sap.sailing.resultimport.ResultDocumentDescriptor;
|
||||
import com.sap.sailing.resultimport.ResultDocumentProvider;
|
||||
import com.sap.sailing.resultimport.ResultUrlProvider;
|
||||
|
||||
@@ -14,11 +12,6 @@ public class Manage2SailResultDocumentProvider extends AbstractManage2SailResult
|
||||
super(resultUrlProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<ResultDocumentDescriptor> getResultDocumentDescriptors() throws IOException {
|
||||
return super.getResultDocumentDescriptors();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected URL getDocumentUrlForRegatta(RegattaResultDescriptor regattaResult) {
|
||||
final URL resultUrl;
|
||||
|
||||
+4
-3
@@ -76,7 +76,7 @@ public class ScoreCorrectionProviderImpl extends AbstractManage2SailProvider imp
|
||||
@Override
|
||||
public RegattaScoreCorrections getScoreCorrections(String eventName, String boatClassName,
|
||||
TimePoint timePointPublished) throws IOException, SAXException, ParserConfigurationException {
|
||||
Parser parser = resolveParser(eventName, boatClassName);
|
||||
Parser parser = resolveParser(eventName, boatClassName, timePointPublished);
|
||||
try {
|
||||
RegattaResults regattaResults = parser.parse();
|
||||
for (Object o : regattaResults.getPersonOrBoatOrTeam()) {
|
||||
@@ -107,14 +107,15 @@ public class ScoreCorrectionProviderImpl extends AbstractManage2SailProvider imp
|
||||
return null;
|
||||
}
|
||||
|
||||
private Parser resolveParser(String eventName, String boatClassName) throws IOException {
|
||||
private Parser resolveParser(String eventName, String boatClassName, TimePoint timePointPublished) throws IOException {
|
||||
Parser result = null;
|
||||
for (ResultDocumentDescriptor resultDocDescr : documentProvider.getResultDocumentDescriptors()) {
|
||||
String boatClassAndGenderType = resultDocDescr.getBoatClass();
|
||||
if (resultDocDescr.getCompetitorGenderType() != null) {
|
||||
boatClassAndGenderType += ", " + resultDocDescr.getCompetitorGenderType().name();
|
||||
}
|
||||
if (eventName.equals(resultDocDescr.getEventName()) && boatClassName.equals(boatClassAndGenderType)) {
|
||||
if (eventName.equals(resultDocDescr.getEventName()) && boatClassName.equals(boatClassAndGenderType) &&
|
||||
Util.equalsWithNull(resultDocDescr.getLastModified(), timePointPublished)) {
|
||||
result = getParserFactory().createParser(resultDocDescr.getInputStream(), resultDocDescr.getEventName());
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user