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 aeff146
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 30 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 @@ -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 aeff146

Please sign in to comment.