Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize DatedServiceJourney with CEN version #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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