mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
a first compilable version of an XRR importer
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
source.. = src/
|
||||
source.. = src/,\
|
||||
resources/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
|
||||
Binary file not shown.
@@ -257,7 +257,7 @@
|
||||
<Race RaceID="SAM004909" RaceName="Race 9" RaceNumber="9" RaceStartDate="04082012" RaceStartTime="120700" RaceStatus="Official" />
|
||||
<Race RaceID="SAM004910" RaceName="Race 10" RaceNumber="10" RaceStartDate="04082012" RaceStartTime="133700" RaceStatus="Official" />
|
||||
<Race RaceID="SAM004101" RaceName="Medal Race" RaceNumber="1" RaceStartDate="06082012" RaceStartTime="140500" RaceStatus="Official" />
|
||||
<Division DivisionID="SAM004000" Gender="M" IFDivisionID="" Title="Laser">
|
||||
<Division DivisionID="SAM004000" Gender="M" IFDivisionID="" Title="Laser" IFClassID=".25T">
|
||||
<RaceResult TeamID="1107624" Discard="false" RaceID="SAM004901" RacePoints="20" ScoreCode="" />
|
||||
<RaceResult TeamID="1107624" Discard="false" RaceID="SAM004902" RacePoints="7" ScoreCode="" />
|
||||
<RaceResult TeamID="1107624" Discard="false" RaceID="SAM004903" RacePoints="5" ScoreCode="" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified">
|
||||
<xsd:include schemaLocation="http://datafeed.sailing.org/sailingXRR_isafextend.xsd" />
|
||||
<xsd:include schemaLocation="http://datafeed.sailing.org/sailingXRR_isafextend.xsd"/>
|
||||
<xsd:simpleType name="CrewPosition">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="S">
|
||||
@@ -17,21 +17,21 @@
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="EventType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Regatta" />
|
||||
<xsd:enumeration value="RegattaSeries" />
|
||||
<xsd:enumeration value="Regatta"/>
|
||||
<xsd:enumeration value="RegattaSeries"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="DivisionType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="FleetRace" />
|
||||
<xsd:enumeration value="TeamRace" />
|
||||
<xsd:enumeration value="MatchRace" />
|
||||
<xsd:enumeration value="FleetRace"/>
|
||||
<xsd:enumeration value="TeamRace"/>
|
||||
<xsd:enumeration value="MatchRace"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="MatchRaceEntry">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="Port" />
|
||||
<xsd:enumeration value="Starboard" />
|
||||
<xsd:enumeration value="Port"/>
|
||||
<xsd:enumeration value="Starboard"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:simpleType name="PersonGender">
|
||||
@@ -73,49 +73,49 @@
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="Person">
|
||||
<xsd:attribute name="PersonID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="IFPersonID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="FamilyName" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="GivenName" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="NOC" type="IFNationCode" use="optional" />
|
||||
<xsd:attribute name="Gender" type="PersonGender" use="optional" />
|
||||
<xsd:attribute name="ClassificationGroup" type="IFCfcnGroup" use="optional" />
|
||||
<xsd:attribute name="ClassificationStatus" type="IFCfcnStatus" use="optional" />
|
||||
<xsd:attribute name="ClassificationExpiry" type="xsd:date" use="optional" />
|
||||
<xsd:attribute name="PersonID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="IFPersonID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="FamilyName" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="GivenName" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="NOC" type="IFNationCode" use="optional"/>
|
||||
<xsd:attribute name="Gender" type="PersonGender" use="optional"/>
|
||||
<xsd:attribute name="ClassificationGroup" type="IFCfcnGroup" use="optional"/>
|
||||
<xsd:attribute name="ClassificationStatus" type="IFCfcnStatus" use="optional"/>
|
||||
<xsd:attribute name="ClassificationExpiry" type="xsd:date" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Crew">
|
||||
<xsd:attribute name="PersonID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="Position" type="CrewPosition" use="required" />
|
||||
<xsd:attribute name="PersonID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="Position" type="CrewPosition" use="required"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Boat">
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="BoatName" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="SailNumber" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="BoatName" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="SailNumber" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Division">
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="SeriesResult" type="SeriesResult" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="RaceResult" type="RaceResult" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="TRRaceResult" type="TRRaceResult" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="TRSeriesResult" type="TRSeriesResult" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:choice maxOccurs="unbounded" minOccurs="0">
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="SeriesResult" type="SeriesResult"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="RaceResult" type="RaceResult"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="TRRaceResult" type="TRRaceResult"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="TRSeriesResult" type="TRSeriesResult"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="Type" type="DivisionType" use="optional" default="FleetRace" />
|
||||
<xsd:attribute name="DivisionID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="IFDivisionID" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="Title" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="IFClassID" type="IFClassCode" use="optional" />
|
||||
<xsd:attribute name="Gender" type="EventGender" use="optional" />
|
||||
<xsd:attribute name="Disabled" type="xsd:boolean" use="optional" />
|
||||
<xsd:attribute default="FleetRace" name="Type" type="DivisionType" use="optional"/>
|
||||
<xsd:attribute name="DivisionID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="IFDivisionID" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="Title" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="IFClassID" type="IFClassCode" use="optional"/>
|
||||
<xsd:attribute name="Gender" type="EventGender" use="optional"/>
|
||||
<xsd:attribute name="Disabled" type="xsd:boolean" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Team">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Crew" type="Crew" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Crew" type="Crew"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="NOC" type="IFNationCode" use="optional" />
|
||||
<xsd:attribute name="TeamName" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="Gender" type="EventGender" use="optional" />
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="NOC" type="IFNationCode" use="optional"/>
|
||||
<xsd:attribute name="TeamName" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="Gender" type="EventGender" use="optional"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="Race">
|
||||
@@ -124,82 +124,82 @@
|
||||
very preliminary, info about a single race within a regatta
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="RaceNumber" type="xsd:integer" use="required" />
|
||||
<xsd:attribute name="RaceName" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="RaceStartDate" type="xsd:date" use="optional" />
|
||||
<xsd:attribute name="RaceStartTime" type="xsd:time" use="optional" />
|
||||
<xsd:attribute name="RaceStatus" type="IFRaceStatus" use="optional" />
|
||||
<xsd:attribute name="Stage" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="Flight" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="Match" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="RaceNumber" type="xsd:integer" use="required"/>
|
||||
<xsd:attribute name="RaceName" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="RaceStartDate" type="xsd:date" use="optional"/>
|
||||
<xsd:attribute name="RaceStartTime" type="xsd:time" use="optional"/>
|
||||
<xsd:attribute name="RaceStatus" type="IFRaceStatus" use="optional"/>
|
||||
<xsd:attribute name="Stage" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="Flight" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="Match" type="xsd:string" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="RaceResult">
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="RacePoints" type="xsd:decimal" use="required" />
|
||||
<xsd:attribute name="RaceRank" type="xsd:positiveInteger" use="optional" />
|
||||
<xsd:attribute name="Discard" type="xsd:boolean" use="optional" default="false" />
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="BoatID" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="RacePoints" type="xsd:decimal" use="required"/>
|
||||
<xsd:attribute name="RaceRank" type="xsd:positiveInteger" use="optional"/>
|
||||
<xsd:attribute default="false" name="Discard" type="xsd:boolean" use="optional"/>
|
||||
<xsd:attribute name="ScoreCode" type="IFBoatStatus" use="optional"/>
|
||||
<xsd:attribute name="Entry" type="MatchRaceEntry" use="optional" />
|
||||
<xsd:attribute name="Entry" type="MatchRaceEntry" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SeriesResult">
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="optional" />
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="optional" />
|
||||
<xsd:attribute name="Tied" type="xsd:boolean" use="optional" default="false" />
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required" />
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="optional"/>
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="optional"/>
|
||||
<xsd:attribute default="false" name="Tied" type="xsd:boolean" use="optional"/>
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="TRRaceResult">
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="required" />
|
||||
<xsd:attribute name="TeamPoints" type="xsd:decimal" use="required" />
|
||||
<xsd:attribute name="RaceRank" type="xsd:positiveInteger" use="optional" />
|
||||
<xsd:attribute name="RaceID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="required"/>
|
||||
<xsd:attribute name="TeamPoints" type="xsd:decimal" use="required"/>
|
||||
<xsd:attribute name="RaceRank" type="xsd:positiveInteger" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="TRSeriesResult">
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="optional" />
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="optional" />
|
||||
<xsd:attribute name="Tied" type="xsd:boolean" use="optional" default="false" />
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required" />
|
||||
<xsd:attribute name="NetPoints" type="xsd:decimal" use="optional"/>
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="optional"/>
|
||||
<xsd:attribute default="false" name="Tied" type="xsd:boolean" use="optional"/>
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="EventRef">
|
||||
<xsd:attribute name="Value" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="Value" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="RegattaSeriesResult">
|
||||
<xsd:choice minOccurs="1" maxOccurs="unbounded">
|
||||
<xsd:element name="EventID" type="EventRef" />
|
||||
<xsd:choice maxOccurs="unbounded" minOccurs="1">
|
||||
<xsd:element name="EventID" type="EventRef"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="required" />
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required" />
|
||||
<xsd:attribute name="TeamID" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="TotalPoints" type="xsd:decimal" use="required"/>
|
||||
<xsd:attribute name="Rank" type="xsd:positiveInteger" use="required"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="Event">
|
||||
<xsd:choice maxOccurs="unbounded" minOccurs="1">
|
||||
<xsd:element name="Race" type="Race" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xsd:element name="Division" type="Division" maxOccurs="unbounded" minOccurs="0" />
|
||||
<xsd:element name="RegattaSeriesResult" type="RegattaSeriesResult" maxOccurs="unbounded" minOccurs="0" />
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Race" type="Race"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Division" type="Division"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="0" name="RegattaSeriesResult" type="RegattaSeriesResult"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="EventID" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="IFEventID" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="Type" type="EventType" use="optional" default="Regatta" />
|
||||
<xsd:attribute name="Title" type="xsd:string" use="optional" />
|
||||
<xsd:attribute name="EventID" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="IFEventID" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute default="Regatta" name="Type" type="EventType" use="optional"/>
|
||||
<xsd:attribute name="Title" type="xsd:string" use="optional"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="RegattaResults">
|
||||
<xsd:choice maxOccurs="unbounded" minOccurs="1">
|
||||
<xsd:element name="Person" type="Person" maxOccurs="unbounded" minOccurs="1" />
|
||||
<xsd:element name="Boat" type="Boat" maxOccurs="unbounded" minOccurs="1" />
|
||||
<xsd:element name="Team" type="Team" maxOccurs="unbounded" minOccurs="1" />
|
||||
<xsd:element name="Event" type="Event" maxOccurs="unbounded" minOccurs="1" />
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="1" name="Person" type="Person"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="1" name="Boat" type="Boat"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="1" name="Team" type="Team"/>
|
||||
<xsd:element maxOccurs="unbounded" minOccurs="1" name="Event" type="Event"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="Date" type="xsd:date" use="required" />
|
||||
<xsd:attribute name="Time" type="xsd:time" use="required" />
|
||||
<xsd:attribute name="Type" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="Version" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="Date" type="xsd:date" use="required"/>
|
||||
<xsd:attribute name="Time" type="xsd:time" use="required"/>
|
||||
<xsd:attribute name="Type" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="Version" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:element name="SailingXRR" type="RegattaResults">
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</xsd:schema>
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@ import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.xrr.resultimport.ParserImpl;
|
||||
import com.sap.sailing.xrr.resultimport.impl.ParserImpl;
|
||||
import com.sap.sailing.xrr.resultimport.schema.RegattaResults;
|
||||
|
||||
public class ParserTest {
|
||||
@@ -30,13 +30,13 @@ public class ParserTest {
|
||||
|
||||
@Test
|
||||
public void testSimpleParsingSomeLaserDocument() throws JAXBException, IOException {
|
||||
RegattaResults o = new ParserImpl().parse(getInputStream(SAMPLE_INPUT_NAME_LASER));
|
||||
RegattaResults o = new ParserImpl().parse();
|
||||
assertNotNull(o);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleParsingSomeStarDocument() throws JAXBException, IOException {
|
||||
RegattaResults o = new ParserImpl().parse(getInputStream(SAMPLE_INPUT_NAME_STAR));
|
||||
RegattaResults o = new ParserImpl().parse();
|
||||
assertNotNull(o);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user