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

Fix issue where CustomConverter is ignored in table-driven feature mapping mode and provide exemplary implementations [3.5] #1665

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

stephanr
Copy link
Member

@stephanr stephanr commented Mar 13, 2024

This PR fixes the table-driven mapping of feature types, which until now ignored custom converts.

Besides documentation, an exemplary implementation to map BLOB/bytea columns as strings encoded in RFC 4648/2397 and large text columns CLOB/text as strings is included.

see #1668 for 3.6 version

Test setup

Oracle

CREATE TABLE LOB_TEST 
(
  ID NUMBER NOT NULL 
, CLOB CLOB 
, BLOB_BASE64 BLOB 
, BLOB_DATAURL BLOB 
);

CREATE SEQUENCE LOB_TEST_SEQ;

CREATE TRIGGER BI_LOB_TEST 
BEFORE INSERT ON LOB_TEST 
FOR EACH ROW 
BEGIN
  <<COLUMN_SEQUENCES>>
  BEGIN
    IF INSERTING AND :NEW.ID IS NULL THEN
      SELECT LOB_TEST_SEQ.NEXTVAL INTO :NEW.ID FROM SYS.DUAL;
    END IF;
  END COLUMN_SEQUENCES;
END;
/

PostgreSQL

CREATE TABLE public.lob_test
(
    id serial NOT NULL,
    clob text,
    blob_base64 bytea,
    blob_dataurl bytea,
    PRIMARY KEY (id)
);

Test requests

<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <Insert>
        <LobTestOra xmlns="http://www.deegree.org/app">
            <clob>PNG</clob>
            <base64>iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAATSURBVChTY3gro4IHjUpjQTIqAIR/dZVEjQXwAAAAAElFTkSuQmCC</base64>
            <dataUrl>data:image/ignored;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAATSURBVChTY3gro4IHjUpjQTIqAIR/dZVEjQXwAAAAAElFTkSuQmCC</dataUrl>
        </LobTestOra>
    </Insert>
</Transaction>

More example requests, which are too large for the description:
example_requests.txt

References

@stephanr stephanr added bug error issue and bug (fix) enhancement enhancement or improvement core deegree core modules labels Mar 13, 2024
@stephanr stephanr added this to the 3.5.7 milestone Mar 13, 2024
@stephanr stephanr changed the title Fix CustomConvert in table-driven feature mapping and provide exemplary implementations [3.5] Fix issue where CustomConverter is ignored in table-driven feature mapping mode and provide exemplary implementations [3.5] Mar 14, 2024
@stephanr stephanr marked this pull request as ready for review March 14, 2024 10:12
@stephanr stephanr self-assigned this Apr 9, 2024
@copierrj copierrj merged commit 7d0b68e into deegree:3.5-main Apr 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error issue and bug (fix) core deegree core modules enhancement enhancement or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants