Skip to content

NAS support#502

Open
cportele wants to merge 13 commits into
masterfrom
nas
Open

NAS support#502
cportele wants to merge 13 commits into
masterfrom
nas

Conversation

@cportele
Copy link
Copy Markdown
Contributor

@cportele cportele commented May 13, 2026

cportele added 11 commits May 2, 2026 13:29
Use `XMLStreamWriter` instead of `StringBuilder`.
…r USE_SURFACE_RING_CURVE

CurvePolygon now serializes as gml:Surface with gml:PolygonPatch; gml:Ring
holds curve members directly (it is implicitly a CompositeCurve). CompoundCurve
serializes as gml:CompositeCurve. Adds Spock tests for LineString, Polygon,
CurvePolygon (CircularString and CompoundCurve rings), and CompoundCurve.
Introduce an optional `alias` property on FeatureSchema as an
identifier-style alternative property name (distinct from the
display-oriented `label`). Encoders that opt in via a `useAlias`
flag receive the alias as the property name; explicit `rename`
transformations still take precedence.

Plumbed via a new 3-arg getSchemaTransformations(mapping,
inCollection, useAlias) overload and a useAlias-aware constructor on
SchemaTransformerChain. The chain injects a synthetic rename to the
alias only when no explicit (non-pathOnly) rename exists at the
property's exact path; pathOnly renames do not suppress the alias.

Avoids the duplication of large `rename` transformation maps in
per-format building-block configurations when an application schema
(e.g. AdV NAS) has both a short and a mnemonic name per property.
Add a default boolean useAlias() predicate on PropertyTransformations
(defaults to false) and have FeatureTokenTransformerMappings forward
that predicate to the 3-arg getSchemaTransformations() overload added
in the previous commit.

This is the encoding-side wiring for the alias mechanism: only the
feature-encoding pipeline reads useAlias(). Schema-derivation paths
(WithTransformationsApplied for queryables, sortables, JSON Schema
documents, etc.) call the 2-arg getSchemaTransformations() and so
continue to use schema names regardless of any format configuration's
alias preference.

When useAlias=true, walk the feature schema and inject each property's
alias as an explicit rename into propertyTransformations before applyRename.
This re-keys every downstream transformation (wrap for virtual objects,
auto-DATETIME formatter, value transformers, …) by the aliased path, so
schema lookups, SchemaTransformerChain, and TokenSliceTransformerChain
all see consistent aliased paths.

useAlias() is propagated through PropertyTransformations.mergeInto and
withSubstitutions.
applyRename rebuilt the propertyTransformations map keyed by the rename
target. For a top-level rename (e.g. qag -> qualitaetsangaben) the
single-element rename matched the renamed full path. For nested renames
the key was only the leaf rename, not the cumulative renamed path -
so the lookup at runtime (which uses the full target path) missed any
transformation registered for the inner property.

Two symptoms when nested renames were configured:

1. The auto-added DATETIME formatter (provider-level, keyed by the
   original full path) was re-keyed by just the leaf rename. A DATETIME
   leaf inside a renamed object came through as the raw JDBC string
   instead of ISO-8601.

2. Wrap transformers for virtual objects (intermediate OBJECT levels
   without sourcePath) were similarly mis-keyed. The token-slice wrap
   step did not fire for those intermediates, so OBJECT/OBJECT_END
   tokens were never synthesized and the renamed inner objects
   disappeared from the output.

Both symptoms have the same root cause and the same fix: walk the
parent chain and apply each segment's rename so the new key is the
full renamed path.
…ersion

Move alias handling out of PropertyTransformations and SchemaTransformerChain.
Aliases are now converted to explicit rename transformations by a single
utility, FeatureSchemaAliases.injectAliasRenames, called by ldproxy at the
format-extension boundary. The xtraplatform-spatial pipeline downstream of
that point no longer knows about aliases — it just sees regular renames
and reuses the existing rename cascade machinery for everything else
(wrap transformers on virtual objects, auto-DATETIME formatters, value
transformers, ...).

Removed:
- PropertyTransformations.useAlias() predicate and its propagation
  through mergeInto and withSubstitutions
- 3-arg PropertyTransformations.getSchemaTransformations overload
- SchemaTransformerChain.useAlias field, 4-arg constructor, in-chain
  alias-injection branch, and hasExplicitRename helper

Added:
- FeatureSchemaAliases public utility with injectAliasRenames(pt, schema)
- FeatureSchemaAliasesSpec covering nested paths, no-aliases, existing
  transformations, and a feature-type alias being ignored

The cross-module boundary now carries only PropertyTransformations; the
useAlias signal stays inside ldproxy's AliasConfiguration where it
belongs.
@cportele cportele requested a review from azahnen as a code owner May 13, 2026 17:55
@cportele cportele mentioned this pull request May 13, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant