From: Ray Lee Date: Tue, 2 Aug 2016 07:51:30 +0000 (-0700) Subject: DRYD-23: Implement JSON to XML conversion. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=82ad3564487f7f8805d0fa4e951edc87acf67cf8;p=tmp%2Fjakarta-migration.git DRYD-23: Implement JSON to XML conversion. --- diff --git a/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/web.xml b/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/web.xml index c375f1830..5e785a495 100644 --- a/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/web.xml +++ b/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/web.xml @@ -90,6 +90,19 @@ CSpaceFilter /* + + + + JsonToXmlFilter + org.collectionspace.services.common.xmljson.JsonToXmlFilter + + + + JsonToXmlFilter + /* + \ No newline at end of file diff --git a/services/common/src/test/resources/test-data/xmljson/numeric-json.json b/services/common/src/test/resources/test-data/xmljson/numeric-json.json new file mode 100644 index 000000000..12092150f --- /dev/null +++ b/services/common/src/test/resources/test-data/xmljson/numeric-json.json @@ -0,0 +1,12 @@ +{ + "document": { + "@name": "examples", + "ns:examples_common": { + "@xmlns:ns": "http://collectionspace.org/services/example", + "integer": 123, + "negInt": -8, + "float": 3.14159, + "negFloat": -341.24 + } + } +} diff --git a/services/common/src/test/resources/test-data/xmljson/numeric-json.xml b/services/common/src/test/resources/test-data/xmljson/numeric-json.xml new file mode 100644 index 000000000..6c4026e30 --- /dev/null +++ b/services/common/src/test/resources/test-data/xmljson/numeric-json.xml @@ -0,0 +1,8 @@ + + + 123 + -8 + 3.14159 + -341.24 + + diff --git a/services/common/src/test/resources/test-data/xmljson/record.json b/services/common/src/test/resources/test-data/xmljson/record.json index a008f4ddb..6e6b8d081 100644 --- a/services/common/src/test/resources/test-data/xmljson/record.json +++ b/services/common/src/test/resources/test-data/xmljson/record.json @@ -30,6 +30,7 @@ "repeating scalar field value 4" ] }, + "empty": null, "repeatstruct": { "innerstruct": [ { @@ -52,6 +53,9 @@ } } ] + }, + "emptytop": { + "emptynested": null } } } diff --git a/services/common/src/test/resources/test-data/xmljson/record.xml b/services/common/src/test/resources/test-data/xmljson/record.xml index ff18c8aaf..8a613c5d7 100644 --- a/services/common/src/test/resources/test-data/xmljson/record.xml +++ b/services/common/src/test/resources/test-data/xmljson/record.xml @@ -10,6 +10,7 @@ This is a scalar field value + A value in a structured field Another structured field value diff --git a/services/report/pom.xml b/services/report/pom.xml index df07a56f8..22d226d01 100644 --- a/services/report/pom.xml +++ b/services/report/pom.xml @@ -24,6 +24,11 @@ itext com.lowagie + + + jackson-core + com.fasterxml.jackson.core +