Skip to content

Commit

Permalink
Synchronize DatedServiceJourney with CEN version
Browse files Browse the repository at this point in the history
  • Loading branch information
vpaturet committed Jan 12, 2024
1 parent 75d6569 commit 38cb23e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 32 deletions.
16 changes: 8 additions & 8 deletions bindings.xjb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

<!-- See the script bin/version_updater.sh It updates version in schema locations-->

| <jxb:bindings schemaLocation="./src/main/resources/xsd/1.15/NeTEx_publication.xsd">
| <jxb:bindings schemaLocation="./src/main/resources/xsd/1.16/NeTEx_publication.xsd">
<jxb:schemaBindings>
<jxb:package name="org.rutebanken.netex.model" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_framework/netex_genericFramework/netex_organisation_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_framework/netex_genericFramework/netex_organisation_version.xsd">
<jxb:bindings node="//xsd:element[@name = 'Status']">
<jxb:property name="StatusOrganisationGroup" />
</jxb:bindings>
Expand All @@ -30,35 +30,35 @@
</jxb:bindings>
</jxb:bindings>
<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_part_3/part3_fares/netex_salesOfferPackage_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_part_3/part3_fares/netex_salesOfferPackage_version.xsd">
<jxb:bindings node="//xsd:element[@ref = 'ResponsibilitySetRef']">
<jxb:property name="ResponsibilitySetRefDistributionByGroup" />
</jxb:bindings>
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_part_2/part2_journeyTimes/netex_vehicleJourneyFrequency_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_part_2/part2_journeyTimes/netex_vehicleJourneyFrequency_version.xsd">
<jxb:bindings node="//xsd:group[@name= 'HeadwayJourneyGroupGroup']/xsd:sequence/xsd:element[@name = 'Description']">
<jxb:property name="DescriptionHeadwayJourneyGroupGroup" />
</jxb:bindings>
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_part_3/part3_salesTransactions/netex_salesContract_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_part_3/part3_salesTransactions/netex_salesContract_version.xsd">
<jxb:bindings node="//xsd:element[@name = 'Status']">
<jxb:property name="StatusPassengerContractGroup" />
</jxb:bindings>
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_part_3/part3_salesTransactions/netex_retailConsortium_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_part_3/part3_salesTransactions/netex_retailConsortium_version.xsd">
<jxb:bindings node="//xsd:element[@name = 'Status']">
<jxb:property name="StatusRetailDeviceGroup" />
</jxb:bindings>
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_framework/netex_responsibility/netex_version_support.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_framework/netex_responsibility/netex_version_support.xsd">
<jxb:bindings node="//xsd:attributeGroup[@name = 'BasicModificationDetailsGroup']/xsd:attribute[@name = 'status']">
<jxb:property name="status_BasicModificationDetailsGroup" />
</jxb:bindings>
Expand All @@ -68,7 +68,7 @@
</jxb:bindings>

<jxb:bindings
schemaLocation="./src/main/resources/xsd/1.15/netex_framework/netex_genericFramework/netex_zone_version.xsd">
schemaLocation="./src/main/resources/xsd/1.16/netex_framework/netex_genericFramework/netex_zone_version.xsd">
<jxb:bindings node="//xsd:complexType[@name = 'tariffZonesInFrame_RelStructure']/xsd:complexContent/xsd:extension[@base = 'containmentAggregationStructure']/xsd:sequence/xsd:element[@ref = 'TariffZone_']">
<jxb:property name="tariffZone" />
</jxb:bindings>
Expand Down
52 changes: 34 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
<jdk.version>11</jdk.version>

<netexRepoName>NeTEx</netexRepoName>
<netexBranch>master</netexBranch>
<netexBranch>update_dsj</netexBranch>
<netexGithubUrl>https://github.com/entur/${netexRepoName}</netexGithubUrl>
<netexVersion>1.15</netexVersion>
<netexVersion>1.16</netexVersion>

<!-- JAXB components versions -->
<jakarta-xml-bind.version>4.0.0</jakarta-xml-bind.version>
Expand Down Expand Up @@ -230,22 +230,22 @@
<version>${maven-exec-plugin.version}</version>
<executions>

<!-- This is the current version which the model is built from. -->
<execution>
<id>download-extract-current-version</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<environmentVariables>
<GITHUB_URL>${netexGithubUrl}/archive/${netexBranch}.zip</GITHUB_URL>
<DESTINATION_PATH>src/main/resources/xsd/${netexVersion}</DESTINATION_PATH>
<ZIP_PATH_TO_EXTRACT>NeTEx-${netexBranch}/xsd/*</ZIP_PATH_TO_EXTRACT>
</environmentVariables>
<executable>./bin/netex-download-extract.sh</executable>
</configuration>
</execution>
<!-- This is the current version which the model is built from. -->
<!--execution>
<id>download-extract-current-version</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<environmentVariables>
<GITHUB_URL>${netexGithubUrl}/archive/${netexBranch}.zip</GITHUB_URL>
<DESTINATION_PATH>src/main/resources/xsd/${netexVersion}</DESTINATION_PATH>
<ZIP_PATH_TO_EXTRACT>NeTEx-${netexBranch}/xsd/*</ZIP_PATH_TO_EXTRACT>
</environmentVariables>
<executable>./bin/netex-download-extract.sh</executable>
</configuration>
</execution-->
<execution>
<id>replace-hard-coded-id-in-bindings-file</id>
<phase>generate-sources</phase>
Expand All @@ -261,6 +261,22 @@
</executable>
</configuration>
</execution>
<execution>
<!-- This downloads 1.15 for validation needs. This is not used to generate the model -->
<id>download-extract-legacy-1.15</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<environmentVariables>
<GITHUB_URL>${netexGithubUrl}/archive/tags/v1.0.15.zip</GITHUB_URL>
<DESTINATION_PATH>src/main/resources/xsd/1.15</DESTINATION_PATH>
<ZIP_PATH_TO_EXTRACT>NeTEx-tags-v1.0.15/xsd/*</ZIP_PATH_TO_EXTRACT>
</environmentVariables>
<executable>./bin/netex-download-extract.sh</executable>
</configuration>
</execution>
<execution>
<!-- This downloads 1.14 for validation needs. This is not used to generate the model -->
<id>download-extract-legacy-1.14</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public enum NetexVersion {
v1_12 ("1.12"),
v1_13 ("1.13"),
v1_14 ("1.14"),
v1_15 ("1.15");
v1_15 ("1.15"),
v1_16 ("1.16");

private final String folderName;

Expand All @@ -58,7 +59,7 @@ public String toString() {
}
private final Schema neTExSchema;

public static final NetexVersion LATEST = NetexVersion.v1_15;
public static final NetexVersion LATEST = NetexVersion.v1_16;

private static final Map<NetexVersion, NeTExValidator> VALIDATORS_PER_VERSION = new EnumMap<>(NetexVersion.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ void unmarshalTimetableFrame() throws JAXBException {
" <DatedServiceJourney version=\"1\" id=\"VYG:DatedServiceJourney:96_KMB-NK_23-12-09\">\n" +
" <ServiceAlteration>cancellation</ServiceAlteration>" +
" <ServiceJourneyRef ref=\"VYG:ServiceJourney:96-KMB_87815-R\" version=\"11\"></ServiceJourneyRef>\n" +
" <DatedServiceJourneyRef ref=\"VYG:DatedServiceJourney:8916_KVG-DEG_23-10-19\" version=\"1\"></DatedServiceJourneyRef>\n" +
" <OperatingDayRef ref=\"VYG:OperatingDay:2023-12-09\"></OperatingDayRef>\n" +
" <OperatingDayRef ref=\"VYG:OperatingDay:2023-12-09\"/>\n" +
" <replacedJourneys>" +
" <DatedVehicleJourneyRef ref=\"VYG:DatedServiceJourney:8916_KVG-DEG_23-10-19\" version=\"1\"/>\n" +
" </replacedJourneys>\n" +
" </DatedServiceJourney>\n" +
" </vehicleJourneys>\n" +
" </TimetableFrame>\n" +
Expand Down Expand Up @@ -127,12 +129,13 @@ void unmarshalTimetableFrame() throws JAXBException {

DatedServiceJourney dsj = (DatedServiceJourney) timetableFrame.getVehicleJourneys().getVehicleJourneyOrDatedVehicleJourneyOrNormalDatedVehicleJourney().get(1);
assertEquals("VYG:OperatingDay:2023-12-09", dsj.getOperatingDayRef().getRef());
assertEquals("VYG:ServiceJourney:96-KMB_87815-R", dsj.getJourneyRef().get(0).getValue().getRef());
assertEquals("VYG:DatedServiceJourney:8916_KVG-DEG_23-10-19", dsj.getJourneyRef().get(1).getValue().getRef());
assertEquals("VYG:ServiceJourney:96-KMB_87815-R", dsj.getJourneyRef().getValue().getRef());
assertEquals("VYG:DatedServiceJourney:8916_KVG-DEG_23-10-19", dsj.getReplacedJourneys().getDatedVehicleJourneyRefOrNormalDatedVehicleJourneyRef().get(0).getValue().getRef());
assertEquals("cancellation", dsj.getServiceAlteration().value());




}


Expand Down

0 comments on commit 38cb23e

Please sign in to comment.