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

Implement new xml schema version strategy #953

Closed
Tracked by #1120
copierrj opened this issue Jan 25, 2019 · 4 comments
Closed
Tracked by #1120

Implement new xml schema version strategy #953

copierrj opened this issue Jan 25, 2019 · 4 comments
Labels
TMC discussion to be discussed by technical management committee members

Comments

@copierrj
Copy link
Member

copierrj commented Jan 25, 2019

Our xml schema files are versioned by having a version in the schema file url. Currently this version part of the url is also part of the filename in git.

We would like to remove the version from the filename in git and during the release procedure add the maven version to the schema file urls. This fixes the problem of having to change all references between schema files when changing the version.

Open issue: how to deal with the version attribute (= enum with previous versions).

relates to #915

@tfr42 tfr42 added TMC discussion to be discussed by technical management committee members schema change change to deegree configuration files labels Jan 25, 2019
@deegree-ci deegree-ci removed the schema change change to deegree configuration files label Feb 15, 2019
@stephanr
Copy link
Member

Proposal

All schemas are more or less structured like http://schemas.deegree.org/[grouping]/[version]/[name].xsd

The current schema situations have the following issues:

  • Currently the Version Number is [Major].[Minor].[Increment] which would force everyone to rename all folders when the version should stay consistient
  • Schema files are spitted on multiple modules which makes editing/renaming hard.
  • Schema files are hard coded into the code (/META-INF/schemas/layers/feature/3.4.0/feature.xsd)
  • Schema files contains import statements referencing complete URL to other schema files
  • Hosting is capable of also provide HTTPs
  • Version checking for every file is currently not active (as i see no references to org.deegree.services.controller.AbstractOWS.checkConfigVersion)
    it has been removed in 53fd059#diff-6cdeaab51250785e9f131927ea948a98
  • Version Checking in org.deegree.services.controller.AbstractOWS.checkConfigVersion relies on hard coded versions which was only used for services
  • org.deegree.services.wms.controller.WMSProvider

Proposal of changes made to the organisation of schema:

  • The folder structure Schema files should be hosted on schemas.deegree.org has to be changed to:
    http://schemas.deegree.org/[major.minor.increment]/[grouping]/[name].xsd (static non modifiable)
    http://schemas.deegree.org/[major.minor]/[grouping]/[name].xsd (either as a symbolic link or replaced on every increment release)
  • Generate a single artefact for each release (without version in path [grouping]/[name].xsd)
  • Changes in schema made on increment version have to be compatible to minor versions
    Proposal of changes made to the configuration files:
  • References are changed to only include major/minor version
  • All schema files are changed to use only relative references to include/import (as the version number is not needed any more to build a correct relative address)
  • Change the configVersion at the schema to be optional and of any type (backward compatibility)

Proposal of changes on Source-Code Level:

  • Every file/folder has to drop the version directory
    From: /META-INF/schemas/layers/feature/3.4.0/feature.xsd
    To: /META-INF/schemas/layers/feature/feature.xsd
  • Rename files (easy scriptable)
  • Rename internal references
  • Change the internal JAXB resolver (/uncoupled/deegree-jaxb-resolver/src/main/java/org/deegree/uncoupled/jaxb/CatalogResolver.java)
    to resolve http://schemas.deegree.org/[major.minor.increment] or http://schemas.deegree.org/[major.minor] to META-INF/schemas ignoring the exact version numbers
  • Extend the JAXB Utility to make a check while loading the xml where the referenced schema files are checked if they use a version which is not matching the running deegree version

As this change will force the users to change their configuration files (for schema references) I propose to make minor increment release of deegree, even if I expect that the 3.4.x config files can be used expect for validation.

@stephanr
Copy link
Member

stephanr commented Aug 31, 2019

For the last point of my proposal I prepared a proof of concept at the CodeSprint in Bucharest.
It is a routine used in the JAXB loading process to check xsi:schemaLocations for possible obsolete references.

Source: c838f5c

Log produced by JAXB loading:

[16:55:54]  INFO: [DefaultWorkspace] Preparing resource OWSProvider:samplewfs.
[16:55:55]  WARN: [SchemaVersionChecker]
[16:55:55]  WARN: [SchemaVersionChecker] *** Configuration uses an outdated Version please Upgrade refrence schemas.deegree.org/services/wfs/3.2.0/wfs_configuration.xsd
[16:55:55]  WARN: [SchemaVersionChecker]

Used configuration file samplewfs:

<deegreeWFS configVersion="3.4.0"
  xmlns="http://www.deegree.org/services/wfs"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.deegree.org/services/wfs
  http://schemas.deegree.org/services/wfs/3.2.0/wfs_configuration.xsd">
  <QueryCRS>urn:ogc:def:crs:EPSG::4258</QueryCRS>
</deegreeWFS>

@copierrj
Copy link
Member Author

The TMC discussed this proposal in detail and is very happy about this development. We concluded that this would most likely result in resolving our configuration versioning issue.

@stephanr
Copy link
Member

Done with #1335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TMC discussion to be discussed by technical management committee members
Projects
None yet
Development

No branches or pull requests

4 participants