diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/.settings/org.eclipse.jdt.groovy.core.prefs b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..74af1ba777 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/.settings/org.eclipse.jdt.groovy.core.prefs b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..74af1ba777 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 diff --git a/common/plugins/eu.esdihumboldt.hale.common.cache.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.cache.test/META-INF/MANIFEST.MF index 73507afee9..c4f86998f1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cache.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.cache.test/META-INF/MANIFEST.MF @@ -7,3 +7,4 @@ Fragment-Host: eu.esdihumboldt.hale.common.cache;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: data harmonisation panel Automatic-Module-Name: eu.esdihumboldt.hale.common.cache.test +Import-Package: org.junit diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java index 3e1743a49d..7299dea99e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/HaleIO.java @@ -209,15 +209,28 @@ public static List findContentTypesFor(Collection ty List results = new ArrayList(); + IContentType highestScoreMatch = null; + long highestScore = 0; + if (filename != null && !filename.isEmpty()) { // test file extension String lowerFile = filename.toLowerCase(); + for (IContentType type : types) { String[] extensions = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC); boolean match = false; for (int i = 0; i < extensions.length && !match; i++) { if (lowerFile.endsWith("." + extensions[i].toLowerCase())) { match = true; + + // determine score based on how many dots are contained + // in the extension (e.g. `gml.gz` has a score of 1 and + // is considered a match with a high score) + long extensionScore = extensions[i].chars().filter(ch -> ch == '.').count(); + if (extensionScore > highestScore) { + highestScoreMatch = type; + highestScore = extensionScore; + } } } if (match) { @@ -226,6 +239,13 @@ public static List findContentTypesFor(Collection ty } } + if (results.size() > 1 && highestScoreMatch != null) { + // if there are multiple results based on extension, use the + // available match with the highest score. + results.clear(); + results.add(highestScoreMatch); + } + if ((results.isEmpty() || results.size() > 1) && in != null) { // remember previous results List extensionResults = null; @@ -322,9 +342,7 @@ public boolean acceptCollection( /** * Find an I/O provider factory * - * @param - *

- * the provider interface type + * @param

the provider interface type * * @param providerType the provider type, usually an interface * @param contentType the content type the provider must match, may be @@ -366,9 +384,7 @@ public static

IOProviderDescriptor findIOProviderFactory( /** * Creates an I/O provider instance * - * @param - *

- * the provider interface type + * @param

the provider interface type * * @param providerType the provider type, usually an interface * @param contentType the content type the provider must match, may be @@ -399,9 +415,7 @@ public static

P createIOProvider(Class

providerType, /** * Find the content type for the given input * - * @param - *

- * the provider interface type + * @param

the provider interface type * * @param providerType the provider type, usually an interface * @param in the input supplier to use for testing, may be null @@ -435,9 +449,7 @@ public static

IContentType findContentType(Class

provi /** * Find an I/O provider instance for the given input * - * @param - *

- * the provider interface type + * @param

the provider interface type * * @param providerType the provider type, usually an interface * @param in the input supplier to use for testing, may be null diff --git a/ext/ageobw/eu.esdihumboldt.hale.app.bgis.ade/.settings/org.eclipse.jdt.groovy.core.prefs b/ext/ageobw/eu.esdihumboldt.hale.app.bgis.ade/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..1e68ed69ff 100644 --- a/ext/ageobw/eu.esdihumboldt.hale.app.bgis.ade/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/ext/ageobw/eu.esdihumboldt.hale.app.bgis.ade/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,3 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 +groovy.script.filters=**/*.dsld,y,**/*.gradle,n diff --git a/ext/xslt/eu.esdihumboldt.hale.io.xslt.test/.settings/org.eclipse.jdt.groovy.core.prefs b/ext/xslt/eu.esdihumboldt.hale.io.xslt.test/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..74af1ba777 100644 --- a/ext/xslt/eu.esdihumboldt.hale.io.xslt.test/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/ext/xslt/eu.esdihumboldt.hale.io.xslt.test/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 diff --git a/ext/xslt/eu.esdihumboldt.hale.io.xslt/.settings/org.eclipse.jdt.groovy.core.prefs b/ext/xslt/eu.esdihumboldt.hale.io.xslt/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..74af1ba777 100644 --- a/ext/xslt/eu.esdihumboldt.hale.io.xslt/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/ext/xslt/eu.esdihumboldt.hale.io.xslt/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.test/META-INF/MANIFEST.MF b/io/plugins/eu.esdihumboldt.hale.io.json.test/META-INF/MANIFEST.MF index e43b652a85..4654092a30 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json.test/META-INF/MANIFEST.MF +++ b/io/plugins/eu.esdihumboldt.hale.io.json.test/META-INF/MANIFEST.MF @@ -14,12 +14,16 @@ Require-Bundle: eu.esdihumboldt.hale.io.json;bundle-version="2.9.0", eu.esdihumboldt.cst.functions.geometric;bundle-version="4.2.0", org.locationtech.jts.jts-core;bundle-version="1.16.0", org.junit;bundle-version="4.13.0", - eu.esdihumboldt.hale.common.align.groovy;bundle-version="2.9.0" + eu.esdihumboldt.hale.common.align.groovy;bundle-version="2.9.0", + com.fasterxml.jackson.core.jackson-core;bundle-version="2.13.4", + com.fasterxml.jackson.core.jackson-databind;bundle-version="2.13.4" Import-Package: de.fhg.igd.slf4jplus, eu.esdihumboldt.hale.common.instance.groovy, eu.esdihumboldt.hale.common.instance.model, + eu.esdihumboldt.util.io, eu.esdihumboldt.util.xml, net.jcip.annotations, + org.assertj.core.api;version="3.22.0", org.hamcrest.core;version="1.3.0", org.slf4j;version="1.7.2" Automatic-Module-Name: eu.esdihumboldt.hale.io.json.test diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/GeoJSONConfigTypeTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/GeoJSONConfigTypeTest.groovy deleted file mode 100644 index cbd78ad4fa..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/GeoJSONConfigTypeTest.groovy +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2014 Data Harmonisation Panel - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution. If not, see . - * - * Contributors: - * Data Harmonisation Panel - */ - -package eu.esdihumboldt.hale.io.json.test; - -import static org.junit.Assert.* - -import org.junit.Before -import org.junit.Test -import org.w3c.dom.Element - -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition -import eu.esdihumboldt.hale.common.core.io.HaleIO -import eu.esdihumboldt.hale.common.schema.SchemaSpaceID -import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition -import eu.esdihumboldt.hale.io.json.GeoJSONConfig -import eu.esdihumboldt.util.xml.XmlUtil - - -/** - * TODO Type description - * @author Simon Templer - */ -class GeoJSONConfigTypeTest { - - private static final String MAIN_NS = 'http://www.example.com' - - private static final String PROPERTY_NS = 'http://www.example.com/property' - - private static final String SPECIAL_NS = 'totally-different-namespace' - - private TypeDefinition itemType; - - private TypeDefinition orderType; - - @Before - public void createTestSchema() throws Exception { - new SchemaBuilder(defaultPropertyTypeNamespace: PROPERTY_NS).schema(MAIN_NS) { - itemType = Item { - name() - price(Double) - alternateNames { name(cardinality: '*') } - _(cardinality: 0..1) { - name(namespace: SPECIAL_NS) - link(URI) - } - } - - orderType = SingleOrder { - item(itemType) - quantity(Integer) - } - } - } - - @Test - public void testReadWrite() { - GeoJSONConfig config = new GeoJSONConfig() - - TypeDefinition type1 = itemType - TypeEntityDefinition typeEntity1 = new TypeEntityDefinition(type1, SchemaSpaceID.TARGET, null) - PropertyEntityDefinition property1 = typeEntity1.accessor().price as PropertyEntityDefinition - config.addDefaultGeometry(type1, property1) - - TypeDefinition type2 = orderType - TypeEntityDefinition typeEntity2 = new TypeEntityDefinition(type2, SchemaSpaceID.TARGET, null) - PropertyEntityDefinition property2 = typeEntity2.accessor().quantity as PropertyEntityDefinition - config.addDefaultGeometry(type2, property2) - - // convert to DOM - Element fragment = HaleIO.getComplexElement(config) - - println XmlUtil.serialize(fragment, true) - - // convert back - GeoJSONConfig conv = HaleIO.getComplexValue(fragment, GeoJSONConfig, null) - - assertNotNull conv - - PropertyEntityDefinition convProperty1 = conv.getDefaultGeometry(type1) - assertNotNull convProperty1 - assertEquals convProperty1, property1 - - PropertyEntityDefinition convProperty2 = conv.getDefaultGeometry(type2) - assertNotNull convProperty2 - assertEquals convProperty2, property2 - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy index e6d61b93f8..d62aea2271 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy +++ b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/InstanceToJsonTest.groovy @@ -24,7 +24,7 @@ import eu.esdihumboldt.hale.common.core.report.SimpleLog import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder import eu.esdihumboldt.hale.common.schema.model.Schema -import eu.esdihumboldt.hale.io.json.writer.InstanceToJson +import eu.esdihumboldt.hale.io.json.internal.InstanceToJson import groovy.json.JsonSlurper class InstanceToJsonTest { diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy new file mode 100644 index 0000000000..1f23d3eb1c --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonInstanceCollectionTest.groovy @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.hale.io.json.test + +import static org.assertj.core.api.Assertions.* + +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets + +import org.junit.Test + +import eu.esdihumboldt.hale.common.core.report.SimpleLog +import eu.esdihumboldt.hale.common.instance.model.Instance +import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder +import eu.esdihumboldt.hale.common.schema.model.Schema +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition +import eu.esdihumboldt.hale.io.json.internal.JsonInstanceCollection +import eu.esdihumboldt.hale.io.json.internal.JsonToInstance +import eu.esdihumboldt.util.io.StringInputSupplier + +/** + * Tests for translating collections of Json/GeoJson objects to hale instance model. + * + * @author Simon Templer + */ +class JsonInstanceCollectionTest { + + // simple type and schema used in some tests + TypeDefinition simpleType + + Schema simpleSchema = new SchemaBuilder().schema { + simpleType = SimpleType { + id(String) + name(String) + } + } + + // default charset used in tests + Charset charset = StandardCharsets.UTF_8 + + // default test data for simple data in GeoJson FeatureCollection + def testDataSimpleFc = ''' +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] + ] + }, + "properties": { + "id": "line", + "name": "Line feature" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0] ] + ] + }, + "properties": { + "id": "poly", + "name": "Polygon feature" + } + } + ] +} +''' + + @Test + void testReadFeatureCollection() { + def translate = new JsonToInstance(true, simpleType, SimpleLog.CONSOLE_LOG) + def collection = new JsonInstanceCollection(translate, new StringInputSupplier(testDataSimpleFc, charset), charset) + collection.iterator().withCloseable { + def count = 0 + while (it.hasNext()) { + def instance = it.next() + + checkSimpleInstance(instance, count) + + count++ + } + + // test expected feature count + assertThat(count).isEqualTo(2) + } + } + + @Test + void testSkipFeatureCollection() { + def translate = new JsonToInstance(true, simpleType, SimpleLog.CONSOLE_LOG) + def collection = new JsonInstanceCollection(translate, new StringInputSupplier(testDataSimpleFc, charset), charset) + collection.iterator().withCloseable { + def count = 0 + while (it.hasNext()) { + it.skip() + count++ + } + + // test expected feature count + assertThat(count).isEqualTo(2) + } + } + + @Test + void testReadGeoJsonArray() { + def translate = new JsonToInstance(true, simpleType, SimpleLog.CONSOLE_LOG) + + def testData = ''' +[ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] + ] + }, + "properties": { + "id": "line", + "name": "Line feature" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0] ] + ] + }, + "properties": { + "id": "poly", + "name": "Polygon feature" + } + } +] +''' + def collection = new JsonInstanceCollection(translate, new StringInputSupplier(testData, charset), charset) + collection.iterator().withCloseable { + def count = 0 + while (it.hasNext()) { + def instance = it.next() + + checkSimpleInstance(instance, count) + + count++ + } + + // test expected feature count + assertThat(count).isEqualTo(2) + } + } + + @Test + void testReadJsonArray() { + def translate = new JsonToInstance(false, simpleType, SimpleLog.CONSOLE_LOG) + + def testData = ''' +[ + { + "geometry": { + "type": "LineString", + "coordinates": [ + [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] + ] + }, + "id": "line", + "name": "Line feature" + }, + { + "geometry": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0] ] + ] + }, + "id": "poly", + "name": "Polygon feature" + } +] +''' + def collection = new JsonInstanceCollection(translate, new StringInputSupplier(testData, charset), charset) + collection.iterator().withCloseable { + def count = 0 + while (it.hasNext()) { + def instance = it.next() + + checkSimpleInstance(instance, count) + + count++ + } + + // test expected feature count + assertThat(count).isEqualTo(2) + } + } + + // helper methods + + /** + * Check an instance from default sample data in simple schema. + * @param instance the instance to check + * @param index the index of the instance in the data + */ + void checkSimpleInstance(Instance instance, int index) { + if (index < 0 || index > 1) fail("Unexpected instance index " + index) + + def id = instance.p.id.value() + def name = instance.p.name.value() + + def expectedId = index == 0 ? "line" : "poly" + def expectedName = index == 0 ? "Line feature" : "Polygon feature" + + assertThat(id).isEqualTo(expectedId) + assertThat(name).isEqualTo(expectedName) + + //FIXME also check geometry (also requires extending schema) + } +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy new file mode 100644 index 0000000000..342aa64ee2 --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json.test/src/eu/esdihumboldt/hale/io/json/test/JsonToInstanceTest.groovy @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.hale.io.json.test + +import static org.assertj.core.api.Assertions.* + +import org.junit.Test + +import com.fasterxml.jackson.core.JsonParser +import com.fasterxml.jackson.core.JsonToken +import com.fasterxml.jackson.databind.ObjectMapper + +import eu.esdihumboldt.hale.common.core.report.SimpleLog +import eu.esdihumboldt.hale.common.instance.model.Instance +import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder +import eu.esdihumboldt.hale.common.schema.model.Schema +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition +import eu.esdihumboldt.hale.io.json.internal.JsonToInstance + +/** + * Tests for translating Json/GeoJson to hale instance model. + * + * @author Simon Templer + */ +class JsonToInstanceTest { + + /** + * Test reading a string property. + */ + @Test + void testReadString() { + TypeDefinition type + Schema schema = new SchemaBuilder().schema { + type = TestType { + text(String) + } + } + + def json = '''{ + "text": "This is a test text" +}''' + + def instance = readInstance(json, type) + + assertThat(instance.p.text.value()).isEqualTo('This is a test text') + } + + /* + * FIXME add additional tests for specific cases: + * - different Json value types (boolean, numeric, etc.) + * - geometries + * - any specific bindings that should be supported? + * Later: + */ + + // helper methods + + /** + * Read an instance from a JSON string containing a single object. + * + * @param json the JSON string + * @param type the type the instance should be loaded with + * @param expectGeoJson if the JSON object is expected to be in GeoJSON encoding + * @return the parsed instance + */ + Instance readInstance(String json, TypeDefinition type, boolean expectGeoJson = false) { + def translate = new JsonToInstance(expectGeoJson, type, SimpleLog.CONSOLE_LOG) + JsonParser parser = new ObjectMapper().getJsonFactory().createJsonParser(json) + assertThat(parser.nextToken()).isEqualTo(JsonToken.START_OBJECT) + translate.readInstance(parser) + } +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.classpath b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.classpath deleted file mode 100644 index 81fe078c20..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.project b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.project deleted file mode 100644 index f51a88c17d..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - eu.esdihumboldt.hale.io.json.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/edu.umd.cs.findbugs.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/edu.umd.cs.findbugs.core.prefs deleted file mode 100644 index cc6501cb67..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/edu.umd.cs.findbugs.core.prefs +++ /dev/null @@ -1,132 +0,0 @@ -#Updated from default preferences Apr 11, 2014 12:49:55 PM -#Fri Apr 11 12:49:55 CEST 2014 -cloud_id=edu.umd.cs.findbugs.cloud.doNothingCloud -detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true -detectorAtomicityProblem=AtomicityProblem|true -detectorBadAppletConstructor=BadAppletConstructor|false -detectorBadResultSetAccess=BadResultSetAccess|true -detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true -detectorBadUseOfReturnValue=BadUseOfReturnValue|true -detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true -detectorBooleanReturnNull=BooleanReturnNull|true -detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true -detectorCheckExpectedWarnings=CheckExpectedWarnings|false -detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true -detectorCheckTypeQualifiers=CheckTypeQualifiers|true -detectorCloneIdiom=CloneIdiom|true -detectorComparatorIdiom=ComparatorIdiom|true -detectorConfusedInheritance=ConfusedInheritance|true -detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true -detectorCrossSiteScripting=CrossSiteScripting|true -detectorDefaultEncodingDetector=DefaultEncodingDetector|true -detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true -detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true -detectorDontIgnoreResultOfPutIfAbsent=DontIgnoreResultOfPutIfAbsent|true -detectorDontUseEnum=DontUseEnum|true -detectorDroppedException=DroppedException|true -detectorDumbMethodInvocations=DumbMethodInvocations|true -detectorDumbMethods=DumbMethods|true -detectorDuplicateBranches=DuplicateBranches|true -detectorEmptyZipFileEntry=EmptyZipFileEntry|true -detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true -detectorExplicitSerialization=ExplicitSerialization|true -detectorFinalizerNullsFields=FinalizerNullsFields|true -detectorFindBadCast2=FindBadCast2|true -detectorFindBadForLoop=FindBadForLoop|true -detectorFindCircularDependencies=FindCircularDependencies|false -detectorFindDeadLocalStores=FindDeadLocalStores|true -detectorFindDoubleCheck=FindDoubleCheck|true -detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true -detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true -detectorFindFinalizeInvocations=FindFinalizeInvocations|true -detectorFindFloatEquality=FindFloatEquality|true -detectorFindHEmismatch=FindHEmismatch|true -detectorFindInconsistentSync2=FindInconsistentSync2|true -detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true -detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true -detectorFindMaskedFields=FindMaskedFields|true -detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true -detectorFindNakedNotify=FindNakedNotify|true -detectorFindNonShortCircuit=FindNonShortCircuit|true -detectorFindNullDeref=FindNullDeref|true -detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true -detectorFindOpenStream=FindOpenStream|true -detectorFindPuzzlers=FindPuzzlers|true -detectorFindRefComparison=FindRefComparison|true -detectorFindReturnRef=FindReturnRef|true -detectorFindRunInvocations=FindRunInvocations|true -detectorFindSelfComparison=FindSelfComparison|true -detectorFindSelfComparison2=FindSelfComparison2|true -detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true -detectorFindSpinLoop=FindSpinLoop|true -detectorFindSqlInjection=FindSqlInjection|true -detectorFindTwoLockWait=FindTwoLockWait|true -detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true -detectorFindUnconditionalWait=FindUnconditionalWait|true -detectorFindUninitializedGet=FindUninitializedGet|true -detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true -detectorFindUnreleasedLock=FindUnreleasedLock|true -detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true -detectorFindUnsyncGet=FindUnsyncGet|true -detectorFindUseOfNonSerializableValue=FindUseOfNonSerializableValue|true -detectorFindUselessControlFlow=FindUselessControlFlow|true -detectorFormatStringChecker=FormatStringChecker|true -detectorHugeSharedStringConstants=HugeSharedStringConstants|true -detectorIDivResultCastToDouble=IDivResultCastToDouble|true -detectorIncompatMask=IncompatMask|true -detectorInconsistentAnnotations=InconsistentAnnotations|true -detectorInefficientMemberAccess=InefficientMemberAccess|false -detectorInefficientToArray=InefficientToArray|true -detectorInfiniteLoop=InfiniteLoop|true -detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true -detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true -detectorInitializationChain=InitializationChain|true -detectorInitializeNonnullFieldsInConstructor=InitializeNonnullFieldsInConstructor|true -detectorInstantiateStaticClass=InstantiateStaticClass|true -detectorIntCast2LongAsInstant=IntCast2LongAsInstant|true -detectorInvalidJUnitTest=InvalidJUnitTest|true -detectorIteratorIdioms=IteratorIdioms|true -detectorLazyInit=LazyInit|true -detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true -detectorLostLoggerDueToWeakReference=LostLoggerDueToWeakReference|true -detectorMethodReturnCheck=MethodReturnCheck|true -detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true -detectorMutableLock=MutableLock|true -detectorMutableStaticFields=MutableStaticFields|true -detectorNaming=Naming|true -detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true -detectorNumberConstructor=NumberConstructor|true -detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true -detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true -detectorPublicSemaphores=PublicSemaphores|true -detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true -detectorReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass=ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass|true -detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true -detectorRedundantInterfaces=RedundantInterfaces|true -detectorRepeatedConditionals=RepeatedConditionals|true -detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true -detectorSerializableIdiom=SerializableIdiom|true -detectorStartInConstructor=StartInConstructor|true -detectorStaticCalendarDetector=StaticCalendarDetector|true -detectorStringConcatenation=StringConcatenation|true -detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true -detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true -detectorSwitchFallthrough=SwitchFallthrough|true -detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true -detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true -detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true -detectorURLProblems=URLProblems|true -detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true -detectorUnnecessaryMath=UnnecessaryMath|true -detectorUnreadFields=UnreadFields|true -detectorUselessSubclassMethod=UselessSubclassMethod|true -detectorVarArgsProblems=VarArgsProblems|true -detectorVolatileUsage=VolatileUsage|true -detectorWaitInLoop=WaitInLoop|true -detectorWrongMapIterator=WrongMapIterator|true -detectorXMLFactoryBypass=XMLFactoryBypass|true -detector_threshold=2 -effort=default -filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false|15 -filter_settings_neg=NOISE,EXPERIMENTAL| -run_at_full_build=false diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.core.resources.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index ad7821bc5a..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 30.09.2013 14:54:04 -#Mon Sep 30 14:54:04 CEST 2013 -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d78078c076..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,424 +0,0 @@ -#Updated from default preferences 28 Oct 2022, 08:10:29 -#Fri Oct 28 08:10:29 CEST 2022 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,.svn/ -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes=,_ -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=17 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=17 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.groovy.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.groovy.core.prefs deleted file mode 100644 index 71fa16a068..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.groovy.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 28 Oct 2022, 08:10:29 -#Fri Oct 28 08:10:29 CEST 2022 -eclipse.preferences.version=1 -groovy.compiler.level=25 diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.launching.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.launching.prefs deleted file mode 100644 index d1f3d041b7..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.launching.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 30.09.2013 14:54:04 -#Mon Sep 30 14:54:04 CEST 2013 -eclipse.preferences.version=1 -org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.ui.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 46646fbb60..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,64 +0,0 @@ -#Updated from default preferences Jul 9, 2016 10:07:16 AM -#Sat Jul 09 10:07:16 CEST 2016 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_HALE -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=true -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=false -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index 2e2e63f976..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 30.09.2013 14:54:04 -#Mon Sep 30 14:54:04 CEST 2013 -eclipse.preferences.version=1 -resolve.requirebundle=false diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.prefs b/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.prefs deleted file mode 100644 index fae5965fb0..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,36 +0,0 @@ -#Created from default preferences Jul 25, 2018 1:58:36 PM -#Wed Jul 25 13:58:36 CEST 2018 -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=2 -compilers.p.build=1 -compilers.p.build.bin.includes=1 -compilers.p.build.encodings=2 -compilers.p.build.java.compiler=2 -compilers.p.build.java.compliance=1 -compilers.p.build.missing.output=2 -compilers.p.build.output.library=1 -compilers.p.build.source.library=1 -compilers.p.build.src.includes=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.internal=1 -compilers.p.missing-packages=2 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=2 -compilers.p.no-required-att=0 -compilers.p.no.automatic.module=1 -compilers.p.not-externalized-att=2 -compilers.p.service.component.without.lazyactivation=1 -compilers.p.unknown-attribute=1 -compilers.p.unknown-class=1 -compilers.p.unknown-element=1 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -eclipse.preferences.version=1 diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/META-INF/MANIFEST.MF b/io/plugins/eu.esdihumboldt.hale.io.json.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 8e74667d1e..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: JSON Export UI -Bundle-SymbolicName: eu.esdihumboldt.hale.io.json.ui;singleton:=true -Bundle-Version: 5.1.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Require-Bundle: org.eclipse.ui;bundle-version="3.7.0", - eu.esdihumboldt.hale.ui;bundle-version="2.6.0", - eu.esdihumboldt.hale.io.json;bundle-version="2.6.0", - org.eclipse.core.runtime;bundle-version="3.7.0" -Import-Package: eu.esdihumboldt.hale.common.align.extension.function, - eu.esdihumboldt.hale.common.align.model, - eu.esdihumboldt.hale.common.align.model.condition, - eu.esdihumboldt.hale.common.align.model.condition.impl, - eu.esdihumboldt.hale.common.align.model.impl, - eu.esdihumboldt.hale.common.core.io, - eu.esdihumboldt.hale.common.core.io.impl, - eu.esdihumboldt.hale.common.core.io.project.model, - eu.esdihumboldt.hale.common.instance.io.impl, - eu.esdihumboldt.hale.common.instance.model, - eu.esdihumboldt.hale.common.schema, - eu.esdihumboldt.hale.common.schema.model, - eu.esdihumboldt.hale.ui.geometry.service, - eu.esdihumboldt.hale.ui.util.components, - eu.esdihumboldt.hale.ui.util.selector -Bundle-Vendor: data harmonisation panel -Automatic-Module-Name: eu.esdihumboldt.hale.io.json.ui diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/build.properties b/io/plugins/eu.esdihumboldt.hale.io.json.ui/build.properties deleted file mode 100644 index e9863e281e..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/plugin.xml b/io/plugins/eu.esdihumboldt.hale.io.json.ui/plugin.xml deleted file mode 100644 index 1df966a92f..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/plugin.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.json.ui/src/eu/esdihumboldt/hale/io/json/ui/GeoJSONConfigurationPage.java b/io/plugins/eu.esdihumboldt.hale.io.json.ui/src/eu/esdihumboldt/hale/io/json/ui/GeoJSONConfigurationPage.java deleted file mode 100644 index dd28b0045e..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json.ui/src/eu/esdihumboldt/hale/io/json/ui/GeoJSONConfigurationPage.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2012 Data Harmonisation Panel - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution. If not, see . - * - * Contributors: - * HUMBOLDT EU Integrated Project #030962 - * Data Harmonisation Panel - */ - -package eu.esdihumboldt.hale.io.json.ui; - -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.eclipse.jface.layout.GridLayoutFactory; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.PlatformUI; - -import eu.esdihumboldt.hale.common.align.extension.function.PropertyParameter; -import eu.esdihumboldt.hale.common.align.extension.function.PropertyParameterDefinition; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.align.model.condition.PropertyCondition; -import eu.esdihumboldt.hale.common.align.model.condition.PropertyOrChildrenTypeCondition; -import eu.esdihumboldt.hale.common.align.model.condition.impl.GeometryCondition; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; -import eu.esdihumboldt.hale.common.core.io.IOProvider; -import eu.esdihumboldt.hale.common.core.io.impl.ComplexValue; -import eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration; -import eu.esdihumboldt.hale.common.instance.model.DataSet; -import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.json.GeoJSONConfig; -import eu.esdihumboldt.hale.io.json.GeoJSONInstanceWriter; -import eu.esdihumboldt.hale.ui.HaleWizardPage; -import eu.esdihumboldt.hale.ui.function.common.PropertyEntitySelector; -import eu.esdihumboldt.hale.ui.geometry.service.GeometrySchemaService; -import eu.esdihumboldt.hale.ui.io.IOWizard; -import eu.esdihumboldt.hale.ui.io.IOWizardPage; -import eu.esdihumboldt.hale.ui.io.config.AbstractConfigurationPage; -import eu.esdihumboldt.hale.ui.service.instance.InstanceService; -import eu.esdihumboldt.hale.ui.util.components.DynamicScrolledComposite; - -/** - * Configuration page for configuring a SpatialDataSet. - * - * @author Kai Schwierczek - */ -public class GeoJSONConfigurationPage - extends AbstractConfigurationPage> { - - private final GeoJSONConfig config = new GeoJSONConfig(); - - /** - * Default constructor - */ - public GeoJSONConfigurationPage() { - super("GeoJSON.geometry-config"); - - setTitle("GeoJSON geometry configuration"); - setDescription("Please select the geometries to use for the GeoJSON export"); - setPageComplete(true); - } - - /** - * @see IOWizardPage#updateConfiguration(IOProvider) - */ - @Override - public boolean updateConfiguration(GeoJSONInstanceWriter provider) { - provider.setParameter(GeoJSONInstanceWriter.PARAM_GEOMETRY_CONFIG, - new ComplexValue(config)); - return true; - } - - /** - * @see HaleWizardPage#createContent(Composite) - */ - @Override - protected void createContent(final Composite page) { - page.setLayout(new GridLayout(1, false)); - Label explanation = new Label(page, SWT.NONE); - explanation.setText( - "If a geometry is set to \"none\", instances will still be included as GeoJSON features,\nbut without default geometries."); - final DynamicScrolledComposite sc = new DynamicScrolledComposite(page, SWT.V_SCROLL); - sc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - Composite parent = new Composite(sc, SWT.NONE); - sc.setExpandHorizontal(true); - - GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false).spacing(6, 12) - .applyTo(parent); - - InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class); - GeometrySchemaService gss = PlatformUI.getWorkbench() - .getService(GeometrySchemaService.class); - - Set types = is.getInstanceTypes(DataSet.TRANSFORMED); - - for (final TypeDefinition type : types) { - Label label = new Label(parent, SWT.NONE); - label.setText(type.getDisplayName() + ":"); - - PropertyCondition condition = new PropertyOrChildrenTypeCondition( - new GeometryCondition()); - PropertyParameterDefinition param = new PropertyParameter("", 0, 1, "Geometry", null, - Collections.singletonList(condition), false); - PropertyEntitySelector selector = new PropertyEntitySelector(SchemaSpaceID.TARGET, - param, parent, new TypeEntityDefinition(type, SchemaSpaceID.TARGET, null)); - selector.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - if (!event.getSelection().isEmpty() - && event.getSelection() instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) event - .getSelection(); - PropertyEntityDefinition property = (PropertyEntityDefinition) selection - .getFirstElement(); - config.addDefaultGeometry(type, property); - } - else { - config.addDefaultGeometry(type, null); - } - } - }); - selector.getControl().setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); - // initial selection - List path = gss.getDefaultGeometry(type); - if (path != null) { - EntityDefinition entityDef = new TypeEntityDefinition(type, SchemaSpaceID.TARGET, - null); - for (QName child : path) - entityDef = AlignmentUtil.getChild(entityDef, child); - selector.setSelection(new StructuredSelection(entityDef)); - } - } - - sc.setContent(parent); - } - - /** - * @see AbstractConfigurationPage#disable() - */ - @Override - public void disable() { - // do nothing - } - - /** - * @see AbstractConfigurationPage#enable() - */ - @Override - public void enable() { - // do nothing - } - - /** - * @see eu.esdihumboldt.hale.ui.io.IOWizardPage#loadPreSelection(eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration) - */ - @Override - public void loadPreSelection(IOConfiguration conf) { - // XXX geojsonconfig does not support serialization -> cannot be - // restored here. - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/META-INF/MANIFEST.MF b/io/plugins/eu.esdihumboldt.hale.io.json/META-INF/MANIFEST.MF index 4a75819aa5..601e2f5ab2 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/META-INF/MANIFEST.MF +++ b/io/plugins/eu.esdihumboldt.hale.io.json/META-INF/MANIFEST.MF @@ -22,6 +22,7 @@ Import-Package: com.google.common.base;version="1.6.0", eu.esdihumboldt.hale.common.core.io.supplier, eu.esdihumboldt.hale.common.core.parameter, eu.esdihumboldt.hale.common.core.report, + eu.esdihumboldt.hale.common.instance.groovy, eu.esdihumboldt.hale.common.instance.io, eu.esdihumboldt.hale.common.instance.io.impl, eu.esdihumboldt.hale.common.instance.model, @@ -61,13 +62,13 @@ Import-Package: com.google.common.base;version="1.6.0", org.osgi.framework;version="1.3.0", org.slf4j;version="1.5.11" Export-Package: eu.esdihumboldt.hale.io.json, - eu.esdihumboldt.hale.io.json.writer + eu.esdihumboldt.hale.io.json.internal Require-Bundle: org.eclipse.core.contenttype;bundle-version="3.4.100", org.eclipse.core.runtime;bundle-version="3.7.0", de.fhg.igd.eclipse.util, - org.codehaus.jackson.mapper;bundle-version="1.9.13", - org.codehaus.jackson;bundle-version="1.9.13", eu.esdihumboldt.hale.common.instance, - groovy;bundle-version="2.5.19" + groovy;bundle-version="2.5.19", + com.fasterxml.jackson.core.jackson-core;bundle-version="2.13.4", + com.fasterxml.jackson.core.jackson-databind;bundle-version="2.13.4" Bundle-Vendor: data harmonisation panel Automatic-Module-Name: eu.esdihumboldt.hale.io.json diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/plugin.xml b/io/plugins/eu.esdihumboldt.hale.io.json/plugin.xml index 0f5c1610f0..753340f473 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/plugin.xml +++ b/io/plugins/eu.esdihumboldt.hale.io.json/plugin.xml @@ -42,16 +42,19 @@ ref="eu.esdihumboldt.hale.io.json.gzip"> - - - - + + + + + + diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfig.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfig.java deleted file mode 100644 index 682a1b30d4..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfig.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013 Data Harmonisation Panel - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution. If not, see . - * - * Contributors: - * Data Harmonisation Panel - */ - -package eu.esdihumboldt.hale.io.json; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.io.json.writer.InstanceToJson; - -/** - * Object holding information about default geometries of types to use for the - * GeoJSON export. - * - * @author Kai Schwierczek - * - * @deprecated as of release 4.2.0 this class is deprecated because - * {@link InstanceToJson} is used to export the data into GeoJson or - * Json format. - */ -@Deprecated -public class GeoJSONConfig { - - private final Map defaultGeometries = new HashMap<>(); - - /** - * Add a default geometry property.
- * Each type may only have one property set, a subsequent call with the same - * type overrides the previous default. The property does not directly need - * to be the geometry, any geometries below the given property will be - * found. - * - * @param type the type to set the default geometry property for - * @param property the default geometry property for the given type (may be - * null) - */ - public void addDefaultGeometry(TypeDefinition type, PropertyEntityDefinition property) { - defaultGeometries.put(type, property); - } - - /** - * Returns the default geometry property for the given type.
- * Geometries must be searched below the given property. - * - * @param type the type in question - * @return the default geometry property for the given type (may be - * null) - */ - public PropertyEntityDefinition getDefaultGeometry(TypeDefinition type) { - return defaultGeometries.get(type); - } - - /** - * @return the default geometries configuration map - */ - public Map getDefaultGeometries() { - return Collections.unmodifiableMap(defaultGeometries); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigDescriptor.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigDescriptor.groovy deleted file mode 100644 index 1cdd62339b..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigDescriptor.groovy +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2014 Data Harmonisation Panel - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution. If not, see . - * - * Contributors: - * Data Harmonisation Panel - */ - -package eu.esdihumboldt.hale.io.json; - -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition -import eu.esdihumboldt.hale.common.core.io.Value -import eu.esdihumboldt.hale.common.core.parameter.AbstractParameterValueDescriptor -import eu.esdihumboldt.hale.common.schema.SchemaSpaceID -import eu.esdihumboldt.hale.common.schema.groovy.SchemaBuilder -import eu.esdihumboldt.hale.common.schema.model.Schema - -/** - * {@link GeoJSONConfig} parameter descriptor. - * - * @author Simon Templer - * @deprecated as of release 4.2.0 this class is deprecated because - * {@link InstanceToJson} is used to export the data into GeoJson - * format. - */ -@Deprecated -public class GeoJSONConfigDescriptor extends AbstractParameterValueDescriptor { - - /** - * Default constructor. - */ - public GeoJSONConfigDescriptor() { - super(null, Value.of(createSampleConfig())); - } - - private static GeoJSONConfig createSampleConfig() { - // create dummy schema - def type1 - def type2 - Schema schema = new SchemaBuilder().schema { - type1 = WatercourseType(namespace: 'http://www.example.com/namespace') { - // - geometry(namespace: 'http://www.example.com/namespace') - } - type2 = StandingWater { - // - the_geom() // - } - } - - PropertyEntityDefinition property1 = new TypeEntityDefinition(type1, SchemaSpaceID.SOURCE, null).accessor().geometry as PropertyEntityDefinition - PropertyEntityDefinition property2 = new TypeEntityDefinition(type2, SchemaSpaceID.SOURCE, null).accessor().the_geom as PropertyEntityDefinition - - GeoJSONConfig result = new GeoJSONConfig(); - - result.addDefaultGeometry(type1, property1); - result.addDefaultGeometry(type2, property2); - - return result; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigType.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigType.groovy deleted file mode 100644 index 3191cb2370..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONConfigType.groovy +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2014 Data Harmonisation Panel - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution. If not, see . - * - * Contributors: - * Data Harmonisation Panel - */ - -package eu.esdihumboldt.hale.io.json; - -import org.w3c.dom.Element - -import eu.esdihumboldt.hale.common.align.io.impl.DOMEntityDefinitionHelper -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition -import eu.esdihumboldt.hale.common.core.io.ComplexValueType -import eu.esdihumboldt.hale.common.schema.SchemaSpaceID -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition -import eu.esdihumboldt.util.groovy.xml.NSDOMBuilder -import eu.esdihumboldt.util.groovy.xml.NSDOMCategory -import eu.esdihumboldt.util.xml.XmlUtil -import groovy.transform.CompileStatic -import groovy.xml.dom.DOMCategory - -/** - * Complex value type for {@link GeoJSONConfig}. - * - * @author Simon Templer - * @deprecated as of release 4.2.0 this class is deprecated because - * {@link InstanceToJson} is used to export the data into GeoJson - * format. - */ -@Deprecated -@CompileStatic -public class GeoJSONConfigType implements ComplexValueType { - - public static final String NAMESPACE = 'http://www.esdi-humboldt.eu/hale/geojson' - - @Override - public GeoJSONConfig fromDOM(Element fragment, Object context) { - GeoJSONConfig config = new GeoJSONConfig() - - def entries = NSDOMCategory.children(fragment, NAMESPACE, 'default-geometry') - for (Element entry in entries) { - // property from first element - PropertyEntityDefinition property = DOMEntityDefinitionHelper.propertyFromDOM( - (Element) DOMCategory.getAt(entry, 0), null, SchemaSpaceID.TARGET) - // add to configuration - config.addDefaultGeometry(property.getType(), property) - } - - return config - } - - @Override - public Element toDOM(GeoJSONConfig config) { - def b = NSDOMBuilder.newBuilder(gj: NAMESPACE) - - Element fragment = b 'gj:config', { - config.defaultGeometries.each { TypeDefinition type, PropertyEntityDefinition property -> - if (type != null && property != null) { - Element association = b 'gj:default-geometry' - // append property - XmlUtil.append(association, DOMEntityDefinitionHelper.propertyToDOM(property)) - } - } - } - - return fragment - } - - @Override - public Class getContextType() { - return Object.class; - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONInstanceWriter.java index c540e9bb86..7202fdc832 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/GeoJSONInstanceWriter.java @@ -22,17 +22,6 @@ */ public class GeoJSONInstanceWriter extends JsonInstanceWriter { - /** - * Parameter name for the default geometry association. - * - * @deprecated as of release 4.2.0 because we don't use geometry - * configuration for geoJson and export the data in WG84 format. - * As geoJson expects WGS 84 with lon/lat (see - * https://tools.ietf.org/html/rfc7946) - */ - @Deprecated - public static final String PARAM_GEOMETRY_CONFIG = "geojson.geometry.config"; - /** * Default constructor. */ diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java new file mode 100644 index 0000000000..514b4a3e19 --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceReader.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.hale.io.json; + +import java.io.IOException; + +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; +import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; +import eu.esdihumboldt.hale.common.core.io.report.IOReporter; +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceReader; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.io.json.internal.JsonInstanceCollection; +import eu.esdihumboldt.hale.io.json.internal.JsonToInstance; + +/** + * Reader for Json/GeoJson data. + * + * @author Simon Templer + */ +public class JsonInstanceReader extends AbstractInstanceReader { + + private static final ALogger log = ALoggerFactory.getLogger(JsonInstanceReader.class); + + private InstanceCollection instances; + + @Override + public InstanceCollection getInstances() { + return instances; + } + + @Override + public boolean isCancelable() { + // actual + return false; + } + + @Override + protected IOReport execute(ProgressIndicator progress, IOReporter reporter) + throws IOProviderConfigurationException, IOException { + progress.begin("Creating " + getDefaultTypeName() + " parser", ProgressIndicator.UNKNOWN); + + try { + boolean expectGeoJson = true; // currently defaults to true, no + // major difference in functionality + + // FIXME support configuring type; possibly also type detection + // XXX for now first type found in schema is used + TypeDefinition type = getSourceSchema().getMappingRelevantTypes().stream().findFirst() + .orElse(null); + + JsonToInstance translator = new JsonToInstance(expectGeoJson, type, + SimpleLog.fromLogger(log)); + instances = new JsonInstanceCollection(translator, getSource(), getCharset()); + + reporter.setSuccess(true); + } catch (Exception e) { + reporter.error("Error preparing reading {0}", getDefaultTypeName(), e); + reporter.setSuccess(false); + } finally { + progress.end(); + } + return reporter; + } + + @Override + protected String getDefaultTypeName() { + return "JSON"; + } + +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java index fed6289fd9..8f2aa6eeb7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/JsonInstanceWriter.java @@ -31,7 +31,7 @@ import eu.esdihumboldt.hale.common.core.io.supplier.LocatableOutputSupplier; import eu.esdihumboldt.hale.common.instance.io.impl.AbstractInstanceWriter; import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; -import eu.esdihumboldt.hale.io.json.writer.InstanceToJson; +import eu.esdihumboldt.hale.io.json.internal.InstanceToJson; /** * Writes instances as JSON. @@ -84,7 +84,6 @@ protected IOReport execute(ProgressIndicator progress, IOReporter reporter) progress.end(); } return reporter; - } /** diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IgnoreNamespaces.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java similarity index 79% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IgnoreNamespaces.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java index 022b5e2050..bdd46431e6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IgnoreNamespaces.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IgnoreNamespaces.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import java.util.Map; import java.util.Optional; @@ -31,7 +31,7 @@ public class IgnoreNamespaces implements NamespaceManager { * This method will not set any prefix to the namespace and will simply do * nothing when called * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#setPrefix(java.lang.String, + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#setPrefix(java.lang.String, * java.lang.String) */ @Override @@ -43,7 +43,7 @@ public void setPrefix(String namespace, String prefix) { * This is the overridden method and will always return an empty string for * the prefix * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#getPrefix(java.lang.String) + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getPrefix(java.lang.String) */ @Override public String getPrefix(String namespace) { @@ -55,7 +55,7 @@ public String getPrefix(String namespace) { * This method will not add any desired prefix to the namespace and will * ignore the call * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#addNamespace(java.lang.String, + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#addNamespace(java.lang.String, * java.util.Optional) */ @Override @@ -71,7 +71,7 @@ public String addNamespace(String namespace, Optional desiredPrefix) { * * @param prefixes a map of namespaces to prefixes * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#addPrefixes(java.util.Map) + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#addPrefixes(java.util.Map) */ @Override public void addPrefixes(Map prefixes) { @@ -82,7 +82,7 @@ public void addPrefixes(Map prefixes) { * Return null as we don't want to add any namespace. The caller should * handle null checks. * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#getNamespaces() + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getNamespaces() */ @Override public Map getNamespaces() { @@ -93,7 +93,7 @@ public Map getNamespaces() { * Return null as we don't want to add any namespace. The caller should * handle null checks. * - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#getNamespace(java.lang.String) + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getNamespace(java.lang.String) */ @Override public Optional getNamespace(String prefix) { diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IncludeNamespaces.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java similarity index 92% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IncludeNamespaces.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java index 9816f1a847..4f3d161dc1 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/IncludeNamespaces.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/IncludeNamespaces.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import java.util.Collections; import java.util.Map; @@ -66,7 +66,7 @@ public Optional getNamespace(String prefix) { } /** - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#getPrefix(java.lang.String) + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#getPrefix(java.lang.String) */ @Override public String getPrefix(String namespace) { @@ -74,7 +74,7 @@ public String getPrefix(String namespace) { } /** - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#addNamespace(java.lang.String, + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#addNamespace(java.lang.String, * java.util.Optional) */ @Override @@ -125,7 +125,7 @@ public String addNamespace(String namespace, Optional desiredPrefix) { } /** - * @see eu.esdihumboldt.hale.io.json.writer.NamespaceManager#setPrefix(java.lang.String, + * @see eu.esdihumboldt.hale.io.json.internal.NamespaceManager#setPrefix(java.lang.String, * java.lang.String) */ @Override diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceJsonConstants.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceJsonConstants.java similarity index 95% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceJsonConstants.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceJsonConstants.java index 4ad21bbabf..b08f947826 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceJsonConstants.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceJsonConstants.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; /** * Constants used to generate JSON from instances. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceToJson.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java similarity index 99% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceToJson.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java index a120c160b9..23631b70e6 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/InstanceToJson.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/InstanceToJson.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import java.io.IOException; import java.io.StringWriter; @@ -28,13 +28,13 @@ import javax.xml.namespace.QName; -import org.codehaus.jackson.JsonFactory; -import org.codehaus.jackson.JsonGenerator; import org.geotools.geojson.geom.GeometryJSON; import org.geotools.geometry.jts.JTS; import org.locationtech.jts.geom.Geometry; import org.opengis.referencing.operation.MathTransform; +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonGenerator; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy new file mode 100644 index 0000000000..c4fa84cb64 --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceBuilder.groovy @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ +package eu.esdihumboldt.hale.io.json.internal + +import org.geotools.geojson.geom.GeometryJSON + +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.node.ObjectNode + +import eu.esdihumboldt.hale.common.core.report.SimpleLog +import eu.esdihumboldt.hale.common.instance.groovy.InstanceBuilder +import eu.esdihumboldt.hale.common.instance.model.Instance +import eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty +import eu.esdihumboldt.hale.common.schema.model.DefinitionGroup +import eu.esdihumboldt.hale.common.schema.model.DefinitionUtil +import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition +import eu.esdihumboldt.hale.common.schema.model.constraint.type.GeometryType +import eu.esdihumboldt.hale.common.schema.model.constraint.type.HasValueFlag + +/** + * Instance builder for Json/GeoJson. + * + * @author Simon Templer + */ +class JsonInstanceBuilder { + + private final SimpleLog log + private final InstanceBuilder builder + private final GeometryJSON geometryJson + private final NamespaceManager namespaces + + /** + * Default constructor. + * @param namespaces + */ + public JsonInstanceBuilder(SimpleLog log, NamespaceManager namespaces) { + super(); + this.log = log + this.namespaces = namespaces + this.geometryJson = new GeometryJSON() + + builder = new InstanceBuilder( + strictBinding: false, + strictValueFlags: false // allow setting values even if no value is expected (mainly for use with XML schema and geometries) + ) + } + + /** + * Build an instance of the given type. + * + * @param type the type definition or null if without schema + * @param geom a dedicated (GeoJson) geometry object or null + * @param properties map of properties or null + * @return the created instance + */ + public Instance buildInstance(TypeDefinition type, ObjectNode geom, + Map properties) { + if (type == null) { + // TODO implement schema-less mode + throw new UnsupportedOperationException("Schema-less mode not implemented yet"); + } + + /* + * TODO Handle explicitly provided geometry: + * + * 1. Determine geometry property in type that should be used + * + * 2. Process value for identified property (XXX takes precedence over otherwise provided value? or should it be dropped if there is a value in properties) + */ + + return builder.createInstance(type) { + properties.each { name, value -> + // determine property + //TODO also support groups/choices etc.? + PropertyDefinition property = determineProperty(type, name) + + if (property == null) { + log.warn("Could not find property with name {0} in type {1}", name, type.name) + } + else { + if (value.isArray()) { + // add each value + def iterator = value.getElements() + while (iterator.hasNext()) { + JsonNode item = iterator.next() + def itemValue = translateValue(item, property) + + if (itemValue != null) { + builder.createProperty(property.name.localPart, property.name.namespaceURI, itemValue) + } + } + } + else { + // add individual value + def itemValue = translateValue(value, property) + + if (itemValue != null) { + builder.createProperty(property.name.localPart, property.name.namespaceURI, itemValue) + } + } + } + } + } + } + + public PropertyDefinition determineProperty(DefinitionGroup parent, String name) { + //TODO should ideally extract namespace prefix and respect namespace mapping (not supported for now) + + def properties = DefinitionUtil.getAllProperties(parent) + //XXX for now only a simple condition, matching the field name with the local property name + def candidate = properties.find { it.name.localPart == name } + + candidate + } + + public Object translateValue(JsonNode value, PropertyDefinition property) { + def type = property.getPropertyType() + + if (type.getConstraint(GeometryType).isGeometry()) { + translateGeometry(value) + } + else if (type.children.empty) { + // no children -> no group or instance + + if (type.getConstraint(HasValueFlag)) { + // handle simple value + + //TODO conversion necessary? + //TODO support for specific types needed? (e.g. dates, timestamps, etc.) + + if (value.isValueNode()) { + if (value.isBoolean()) { + value.booleanValue() + } + else if (value.isTextual()) { + value.textValue() + } + //FIXME add all other cases + else { + // unhandled type + // TODO log warning/error? + value.asText() + } + } + else { + //XXX what to do in this case? For now use string representation + value.toString() + } + } + } + else { + //FIXME handle complex properties? + //XXX for now ignore + null + } + } + + public GeometryProperty translateGeometry(JsonNode value) { + //TODO implement geometry parsing using Geotools functionality + //XXX for now return null + null + } +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java new file mode 100644 index 0000000000..ddc5ea4163 --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonInstanceCollection.java @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.hale.io.json.internal; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.Charset; +import java.util.Map; +import java.util.NoSuchElementException; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.ObjectMapper; + +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.instance.model.Filter; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.instance.model.InstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.InstanceReference; +import eu.esdihumboldt.hale.common.instance.model.ResourceIterator; +import eu.esdihumboldt.hale.common.instance.model.ext.InstanceCollection2; +import eu.esdihumboldt.hale.common.instance.model.ext.InstanceIterator; +import eu.esdihumboldt.hale.common.instance.model.impl.FilteredInstanceCollection; +import eu.esdihumboldt.hale.common.instance.model.impl.PseudoInstanceReference; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.util.io.InputSupplier; + +/** + * Instance collection backed by a Json document. + * + * @author Simon Templer + */ +public class JsonInstanceCollection implements InstanceCollection2 { + + private static final ALogger log = ALoggerFactory.getLogger(JsonInstanceCollection.class); + + private class JsonIterator implements InstanceIterator { + + private boolean closed = false; + + private Reader reader = null; + private JsonParser parser = null; + + private void proceedToNext() { + if (closed) { + return; + } + + if (parser == null) { + try { + reader = new BufferedReader(new InputStreamReader(input.getInput(), charset)); + ObjectMapper mapper = new ObjectMapper(); + JsonFactory jsonFactory = mapper.getJsonFactory(); + parser = jsonFactory.createJsonParser(reader); + } catch (Exception e) { + close("Error accessing JSON source", e); + } + + try { + translator.init(parser); + } catch (IOException e) { + close("Error initializing reading JSON source", e); + } + } + } + + private void close(String message, Exception e) { + log.error(message, e); + close(); + if (e instanceof RuntimeException) { + throw (RuntimeException) e; + } + else { + throw new RuntimeException(e); + } + } + + @Override + public void close() { + closed = true; + if (parser != null) { + try { + parser.close(); + } catch (IOException e) { + log.error("Error closing JSON parser", e); + } + } + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + log.error("Error closing JSON reader", e); + } + } + } + + @Override + public boolean hasNext() { + if (closed) { + return false; + } + + proceedToNext(); + + return parser.getCurrentToken() == JsonToken.START_OBJECT; + } + + @Override + public Instance next() { + if (closed) { + return null; + } + + proceedToNext(); + + if (parser.getCurrentToken() == JsonToken.START_OBJECT) { + try { + return translator.readInstance(parser); + } catch (IOException e) { + close("Error reading instance from JSON source", e); + return null; + } + } + else + throw new NoSuchElementException("No object start: " + parser.getCurrentToken()); + } + + @Override + public TypeDefinition typePeek() { + return null; + } + + @Override + public boolean supportsTypePeek() { + return false; + } + + @Override + public void skip() { + if (closed) { + return; + } + + proceedToNext(); + + try { + translator.skipValue(parser); + } catch (IOException e) { + close("Error skipping instance in JSON source", e); + } + } + + } + + private final JsonToInstance translator; + + private Boolean empty; + + private final InputSupplier input; + + private final Charset charset; + + /** + * Create a new instance collection. + * + * @param translator translator for creating instances from Json + * @param input the input to load + * @param charset the character set to use for reading the input + */ + public JsonInstanceCollection(JsonToInstance translator, + InputSupplier input, Charset charset) { + super(); + this.translator = translator; + this.input = input; + this.charset = charset; + } + + @Override + public InstanceIterator iterator() { + return new JsonIterator(); + } + + @Override + public boolean hasSize() { + return false; + } + + @Override + public int size() { + return UNKNOWN_SIZE; + } + + @Override + public boolean isEmpty() { + if (empty != null) { + return empty; + } + + try (ResourceIterator it = iterator()) { + empty = !it.hasNext(); + } + return empty; + } + + @Override + public InstanceCollection select(Filter filter) { + return FilteredInstanceCollection.applyFilter(this, filter); + } + + @Override + public InstanceReference getReference(Instance instance) { + return new PseudoInstanceReference(instance); + } + + @Override + public Instance getInstance(InstanceReference reference) { + if (reference instanceof PseudoInstanceReference) { + return ((PseudoInstanceReference) reference).getInstance(); + } + + return null; + } + + @Override + public boolean supportsFanout() { + return false; + } + + @Override + public Map fanout() { + return null; + } + +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/JsonNamespaces.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonNamespaces.java similarity index 95% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/JsonNamespaces.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonNamespaces.java index 3d42dc0541..0bca56378d 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/JsonNamespaces.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonNamespaces.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import java.util.Optional; diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java new file mode 100644 index 0000000000..5ac5a50cf4 --- /dev/null +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/JsonToInstance.java @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.hale.io.json.internal; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import eu.esdihumboldt.hale.common.core.report.SimpleLog; +import eu.esdihumboldt.hale.common.instance.geometry.impl.CodeDefinition; +import eu.esdihumboldt.hale.common.instance.model.Instance; +import eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; + +/** + * Class to read instances from JSON. + * + * @author Simon Templer + */ +public class JsonToInstance implements InstanceJsonConstants { + + private final NamespaceManager namespaces; + private final boolean expectGeoJson; + + private final JsonInstanceBuilder builder; + + // GeoJson expects WGS 84 with lon/lat (see + // https://tools.ietf.org/html/rfc7946) + private final CRSDefinition sourceCrs = new CodeDefinition("EPSG:4326", true); + + private final TypeDefinition featureType; + private final SimpleLog log; + + /** + * + * @param expectGeoJson if the input is expected to be GeoJson + * @param featureType the feature type to use for all features or + * null + */ + public JsonToInstance(boolean expectGeoJson, TypeDefinition featureType, SimpleLog log) { + this(expectGeoJson, featureType, log, + new IgnoreNamespaces() /* new JsonNamespaces() */); + } + + /** + * + * @param expectGeoJson if the input is expected to be GeoJson + * @param featureType the feature type to use for all features or + * null + * @param namespaces the namespace manager + */ + public JsonToInstance(boolean expectGeoJson, TypeDefinition featureType, SimpleLog log, + NamespaceManager namespaces) { + super(); + this.expectGeoJson = expectGeoJson; + this.namespaces = namespaces; + this.featureType = featureType; + this.log = log; + + this.builder = new JsonInstanceBuilder(log, namespaces); + + if (expectGeoJson) { + // XXX should GeoJson namespace be the namespace w/o prefix? +// namespaces.setPrefix(NAMESPACE_GEOJSON, ""); + } + } + + /** + * @return namespace + */ + public NamespaceManager getNamespaces() { + return namespaces; + } + + /** + * Initialize the parser to point at the right position to start reading + * instances. + * + * @param parser the JSON parser + */ + public void init(JsonParser parser) throws JsonParseException, IOException { + // proceed to first object + + JsonToken start = parser.nextToken(); + switch (start) { + case START_ARRAY: + // collection is an array, nothing to do + break; + case START_OBJECT: + // expecting feature collection + // -> move to "features" array + proceedToField("features", parser); + if (parser.getCurrentToken() != JsonToken.FIELD_NAME) { + throw new IllegalStateException( + "Did not find field \"features\" in FeatureCollection"); + } + + // proceed to array start + if (parser.nextToken() != JsonToken.START_ARRAY) { + throw new IllegalStateException("\"features\" expected to be an array"); + } + break; + default: + throw new IllegalStateException("Unexpected start token " + start); + } + + parser.nextToken(); // move to value start + } + + private void proceedToField(String fieldName, JsonParser parser) + throws JsonParseException, IOException { + while (parser.nextToken() != null) { + JsonToken current = parser.getCurrentToken(); + if (current == JsonToken.FIELD_NAME && fieldName.equals(parser.getCurrentName())) { + // found field name + return; + } + + else if (current == JsonToken.START_ARRAY || current == JsonToken.START_OBJECT) { + // skip child arrays and objects + parser.skipChildren(); + } + } + } + + /** + * Read a single instance from the given parser. It is expected that the + * current position of the parser is at the start of an object. + * + * @param parser the JSON parser + * @return the parsed instance + * @throws IOException if parsing the JSON fails + */ + public Instance readInstance(JsonParser parser) throws IOException { + JsonToken current = parser.getCurrentToken(); + + if (current != JsonToken.START_OBJECT) { + throw new IllegalStateException( + "Read instance: Expected object start but found " + current); + } + + /* + * Note: It would be nice to use the streaming API to process the + * complete JSON, but in that case we would rely for some things on + * information being provided in a certain order, which we can't rely + * on. + * + * Example cases where order does matter: + * + * - detecting if GeoJson is used + * + * - determining a schema type automatically (based on @type field or + * event structure) [not done yet] + */ + Map fields = readFieldsAsTree(parser); + + boolean isGeoJson = false; + + // for GeoJson expect type = Feature + JsonNode typeNode = fields.get("type"); + JsonNode geomNode = fields.get("geometry"); + JsonNode propNode = fields.get("properties"); + boolean hasFt = typeNode != null && "Feature".equals(typeNode.textValue()); + boolean hasGeometry = geomNode != null && geomNode.isObject(); + boolean hasProperties = propNode != null && propNode.isObject(); + + if (expectGeoJson) { + // if we expect GeoJson, one of the conditions is enough + isGeoJson = hasFt || hasGeometry || hasProperties; + } + else { + // if we do not expect it there should be at least the type and one + // of the other fields defined + isGeoJson = hasFt && (hasGeometry || hasProperties); + } + + // move on to next token (beginning of next instance) + parser.nextToken(); + + // determine schema type + + /* + * Currently only configuration of a fixed type that should be assumed + * for all features is supported. This could be extended later with some + * form of type detection (e.g. using the information in @type in case + * the data was written with InstanceToJson) + */ + TypeDefinition type = featureType; + + // create instance + + if (isGeoJson) { + // build from GeoJson feature structure + ObjectNode geom = (geomNode != null && geomNode.isObject()) ? (ObjectNode) geomNode + : null; + ObjectNode props = (propNode != null && propNode.isObject()) ? (ObjectNode) propNode + : null; + Map properties = new HashMap<>(); + if (props != null) { + Iterator> it = props.fields(); + while (it.hasNext()) { + Entry entry = it.next(); + properties.put(entry.getKey(), entry.getValue()); + } + } + + return builder.buildInstance(type, geom, properties); + } + else { + // generic JSON instance + return builder.buildInstance(type, null, fields); + } + } + + /** + * Read the fields of the current object as Json nodes. + * + * @param parser the JSON parser + * @return the map of field names and and values as nodes + * @throws IOException if parsing the JSON fails + */ + private Map readFieldsAsTree(JsonParser parser) throws IOException { + Map fields = new HashMap<>(); + while (parser.nextToken() != JsonToken.END_OBJECT) { + if (parser.getCurrentToken() == JsonToken.FIELD_NAME) { + parser.nextToken(); + } + + fields.put(parser.getCurrentName(), parser.readValueAsTree()); + + // FIXME where is the token after reading as tree?! + } + return fields; + } + + /** + * Skip a field value in the JSON parser. + * + * @param parser the JSON parser + * @throws IOException if parsing the JSON fails + */ + public void skipValue(JsonParser parser) throws IOException { + JsonToken current = parser.getCurrentToken(); + + if (current == JsonToken.FIELD_NAME) { + // skip field name + current = parser.nextToken(); + } + + if (current == JsonToken.START_ARRAY || current == JsonToken.START_OBJECT) { + // skip child arrays and objects + parser.skipChildren(); + // skip end token + parser.nextToken(); + } + else { + // skip value or end token + parser.nextToken(); + } + } + +} diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/NamespaceManager.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java similarity index 97% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/NamespaceManager.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java index 01c018826a..b382a016a5 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/NamespaceManager.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/NamespaceManager.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import java.util.Map; import java.util.Optional; diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/Placement.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/Placement.java similarity index 94% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/Placement.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/Placement.java index afeb47630b..7c4138de59 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/Placement.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/Placement.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; /** * Enum used to generate JSON from instances. diff --git a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/TransformCache.java b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java similarity index 97% rename from io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/TransformCache.java rename to io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java index e612ab05f3..73a9b0b52b 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/writer/TransformCache.java +++ b/io/plugins/eu.esdihumboldt.hale.io.json/src/eu/esdihumboldt/hale/io/json/internal/TransformCache.java @@ -13,7 +13,7 @@ * wetransform GmbH */ -package eu.esdihumboldt.hale.io.json.writer; +package eu.esdihumboldt.hale.io.json.internal; import org.geotools.referencing.CRS; import org.opengis.referencing.crs.CoordinateReferenceSystem; diff --git a/util/plugins/eu.esdihumboldt.util.blueprints.entities.test/.settings/org.eclipse.jdt.groovy.core.prefs b/util/plugins/eu.esdihumboldt.util.blueprints.entities.test/.settings/org.eclipse.jdt.groovy.core.prefs index d97b4a791c..74af1ba777 100644 --- a/util/plugins/eu.esdihumboldt.util.blueprints.entities.test/.settings/org.eclipse.jdt.groovy.core.prefs +++ b/util/plugins/eu.esdihumboldt.util.blueprints.entities.test/.settings/org.eclipse.jdt.groovy.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -groovy.compiler.level=40 +groovy.compiler.level=25 diff --git a/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/StringInputSupplier.java b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/StringInputSupplier.java new file mode 100644 index 0000000000..b92ccbdea8 --- /dev/null +++ b/util/plugins/eu.esdihumboldt.util/src/eu/esdihumboldt/util/io/StringInputSupplier.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 wetransform GmbH + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution. If not, see . + * + * Contributors: + * wetransform GmbH + */ + +package eu.esdihumboldt.util.io; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; + +/** + * Input supplier that provides an input stream from a string. + * + * @author Simon Templer + */ +public class StringInputSupplier implements InputSupplier { + + private final byte[] data; + + /** + * Create a new input supplier from the given text + * + * @param text the text, may not be null + * @param charset the charset to use, may not be null + */ + public StringInputSupplier(String text, Charset charset) { + super(); + this.data = text.getBytes(charset); + } + + @Override + public InputStream getInput() throws IOException { + return new ByteArrayInputStream(data); + } + +}