diff --git a/.travis.yml b/.travis.yml index 41462d6a5a..49b67b4d5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,7 @@ jobs: - sleep 10 - sudo systemctl status docker.service # Pull Docker images required for integration tests + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker pull kartoza/postgis - ./build.sh integrationStage # Killing background sleep loop @@ -84,6 +85,7 @@ jobs: script: # Output something every minute lest Travis kills the job - while sleep 1m; do echo "=====[ still running after $SECONDS seconds... ]====="; done & + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - mkdir -p build/target - ./build.sh product -a ${ARCH} -o ${PLATFORM} ${ADDITIONAL_FLAGS} ${PRODUCT} # Killing background sleep loop diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bbb853aa..0a3d8d3336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,43 @@ All notable changes to this project will be documented in this file. See the [change log guidelines](http://keepachangelog.com/) for information on how to structure the file. +## [Unreleased] + +## [4.1.0] + +### Added + +- Support for selecting multiple files during schema and the data import +- END-related schemas added in presets +- Support to remove a single schema from the project view +- Support to export the source and the transformed data to Shapefiles using GeoTools +- Support for missing time zone information when parsing timestamps +- Support for creating a spatial index when writing GeoPackage files +- Support for Java 8 date/time classes in Groovy + +### Changed + +- Activated XML pretty printing by default in the writer settings dialog page when exporting XML/GML + +### Removed + +- xtraserver plugin + +### Fixed + +- Fix application not starting on macOS +- Fix duplicate imports of the same schema when the schema locations differ only in the scheme part +- Fix use of IProxyService to apply proxy configuration in the UI +- Fix validity check of the hale»connect export dialog +- Fix loading of projects in case user context is not supported +- Fix ArcString interpolation handling +- Fix handling of HTTPS schema locations in schema resolver +- Fix for failing PostGIS integration tests +- Fix the last modified check when loading Groovy snippet from file +- Fix failing of CRS without remarks for geopackage +- Fix use of correct preferred bundle when loading geometry types +- Fix to not append time zone information when writing xmlDate + ## [4.0.0] ### Added @@ -360,6 +397,8 @@ See the [change log guidelines](http://keepachangelog.com/) for information on h Changes so far have been documented in the [hale help](http://hale.igd.fraunhofer.de/2.9.4/help/topic/eu.esdihumboldt.hale.doc.user/html/new/2_9_0.xhtml?cp=2_1_0). +[Unreleased]: https://github.com/halestudio/hale/compare/4.1.0...HEAD +[4.1.0]: https://github.com/halestudio/hale/compare/4.0.0...4.1.0 [4.0.0]: https://github.com/halestudio/hale/compare/3.5.0...4.0.0 [3.5.0]: https://github.com/halestudio/hale/compare/3.4.1...3.5.0 [3.4.1]: https://github.com/halestudio/hale/compare/3.4.0...3.4.1 diff --git a/README.md b/README.md index 6e3689e45b..33d1263cac 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ To contribute please check the [contribution guidelines](CONTRIBUTING.md) and re * [hale Community Forum](http://discuss.wetransform.to) * [hale Community Blog](https://www.wetransform.to/category/news/) * [hale Video Tutorial (4 Minutes)](https://www.youtube.com/watch?v=95Krki4thgs) +* [hale in-depth Video Tutorial (37 minutes)](https://www.youtube.com/watch?v=BKNMV-Jp9HM) ## License diff --git a/app/plugins/eu.esdihumboldt.hale.app.cli.commands/META-INF/MANIFEST.MF b/app/plugins/eu.esdihumboldt.hale.app.cli.commands/META-INF/MANIFEST.MF index cfc3249099..aeb64ea8f6 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.cli.commands/META-INF/MANIFEST.MF +++ b/app/plugins/eu.esdihumboldt.hale.app.cli.commands/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: hale CLI Default Commands Bundle-SymbolicName: eu.esdihumboldt.hale.app.cli.commands;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.util.cli;bundle-version="2.9.5", diff --git a/app/plugins/eu.esdihumboldt.hale.app.cli/META-INF/MANIFEST.MF b/app/plugins/eu.esdihumboldt.hale.app.cli/META-INF/MANIFEST.MF index d1111d306c..954ebd3506 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.cli/META-INF/MANIFEST.MF +++ b/app/plugins/eu.esdihumboldt.hale.app.cli/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: hale CLI application Bundle-SymbolicName: eu.esdihumboldt.hale.app.cli;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: eu.esdihumboldt.hale.common.core, diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform.test/META-INF/MANIFEST.MF b/app/plugins/eu.esdihumboldt.hale.app.transform.test/META-INF/MANIFEST.MF index 6a43391bda..2cfac466c5 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.transform.test/META-INF/MANIFEST.MF +++ b/app/plugins/eu.esdihumboldt.hale.app.transform.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Transformation Application Tests Bundle-SymbolicName: eu.esdihumboldt.hale.app.transform.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.app.transform;bundle-version="2.9.0", diff --git a/app/plugins/eu.esdihumboldt.hale.app.transform/META-INF/MANIFEST.MF b/app/plugins/eu.esdihumboldt.hale.app.transform/META-INF/MANIFEST.MF index 3d353f3c55..42ce6da686 100644 --- a/app/plugins/eu.esdihumboldt.hale.app.transform/META-INF/MANIFEST.MF +++ b/app/plugins/eu.esdihumboldt.hale.app.transform/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Application for command line transformation Bundle-SymbolicName: eu.esdihumboldt.hale.app.transform;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/build/build.gradle b/build/build.gradle index e17b8d740e..813313dbfa 100644 --- a/build/build.gradle +++ b/build/build.gradle @@ -147,7 +147,7 @@ ext { 'eu.esdihumboldt.hale.ui.feature.linux': ['linux'], 'eu.esdihumboldt.hale.ui.feature.macosx': ['macosx'] ] - + /* * List of bundles that are not platform specific, even if they are detected as such. */ @@ -156,9 +156,8 @@ ext { ] // URL to the directory containing mirrored artifacts (Maven, JRE, ...) - //artifactsCommit = '6589f561a36b8a6fe4cd6a115fdc892bbf812c68' - //artifactsMirrorUrl = "https://gitlab.wetransform.to/hale/hale-build-support/raw/${artifactsCommit}" - artifactsMirrorUrl = "http://build-artifacts.wetransform.to/hale-build-support-96b81f6" + artifactsCommit = '6431f1d635126138b32611dcc47467a401448c8e' + artifactsMirrorUrl = "https://gitlab.wetransform.to/hale/hale-build-support/raw/${artifactsCommit}" // Names of zip files containing Java Runtimes (sorted by their respective platform) jreArtifacts = [ @@ -172,12 +171,14 @@ ext { 'gtk': [ 'x86_64': 'OpenJDK8U-jre_x64_linux_hotspot_8u232b09.tar.gz' ] - ]/*, -- not available right now + ], //Make sure when `tar.gz` is extracted then the hirarchy should be `/Contents/...`. + //For e.g. `jdk8u282-b08/Contents/...` becuase during extraction, root folder named `jdk8u282-b08` + //is being stripped and the `Contents` folder is being copied into jre folder. 'macosx': [ 'cocoa': [ - 'x86_64': 'jdk-min-8u91-macosx-x64.tar.gz' + 'x86_64': 'OpenJDK8U-jdk_x64_mac_openj9_macosXL_8u282b08_openj9-0.24.0.tar.gz' ] - ]*/ + ] ] // Names of zip files containing mongodb instances (sorted by their respective platform) @@ -239,7 +240,7 @@ configureEnvironment() def configureEnvironment() { def wsMap = [win32: 'win32', linux: 'gtk', macosx: 'cocoa'] - + def current_os = System.getProperty('os.name') if (current_os.substring(0, 5).equalsIgnoreCase('linux')) current_os = 'linux' @@ -253,7 +254,7 @@ def configureEnvironment() { current_arch = 'x86' else if(current_arch == 'amd64') current_arch = 'x86_64' - + if (!ext.properties.containsKey('osgiOS')) { ext.osgiOS = current_os } diff --git a/build/config.groovy b/build/config.groovy index 9ab983c70e..d920a8d9c2 100644 --- a/build/config.groovy +++ b/build/config.groovy @@ -5,7 +5,7 @@ project = { // version // major.minor.micro-SNAPSHOT - remove -SNAPSHOT for releases - version = '4.0.0' + version = '4.1.0-SNAPSHOT' // when increasing the version number, at least the version of the .application bundles // should be increased so they state an updated application version diff --git a/build/gradle/commitAndProductionStage.gradle b/build/gradle/commitAndProductionStage.gradle index 95c6b42da3..bb39d664f8 100644 --- a/build/gradle/commitAndProductionStage.gradle +++ b/build/gradle/commitAndProductionStage.gradle @@ -24,6 +24,7 @@ import java.nio.file.Files; import java.text.SimpleDateFormat import org.apache.maven.cli.MavenCli import org.yaml.snakeyaml.Yaml +import org.apache.tools.ant.taskdefs.condition.Os /** * @return the value of the 'productFile' property @@ -390,9 +391,15 @@ def includeAdditionalFiles(artifacts, relsrcpath, productOutputPath, reldstpath, if (!Helper.buildForMac(project)) { ant.untar(src: artifactZipPath, dest: artifactInstallPath, compression: 'gzip') } else { - // Use external tar command for OSX build since the jdk to bundle with HALE contains symbolic links + //It is certain that this code will run when creating build for mac. + //Therefore, the jre must be copied into the `Eclipse` folder of the bundled application. + artifactInstallPath = new File(productOutputPath.absolutePath ,"/Eclipse.app/Contents/Eclipse/${reldstpath}") + + // Use external tar command for OSX build since the jdk to bundle with HALE, contains symbolic links. // This does only work on UNIX-based systems with tar installed! - def command = ['tar', '--preserve-permissions','-xzf', artifactZipPath.absolutePath] + //This command during extraction, will strip the root folder from jdk which is usually jdk name and will + //extract the data into root folder starting with `Contents`. + def command = ['tar', '--preserve-permissions','-xzf', artifactZipPath.absolutePath, '--strip-components=1'] artifactInstallPath.mkdir() try { // On windows, an IOException will be thrown here @@ -407,6 +414,10 @@ def includeAdditionalFiles(artifacts, relsrcpath, productOutputPath, reldstpath, } catch (ex) { throw new IllegalStateException("Unable to unpack ${name} - The MacOSX build requires a UNIX-based system with tar installed:\n${ex.toString()}") } + if (reldstpath.equals("jre")){ + //update HALE.ini file with the JRE path bundled in the Eclipse.app. + updateHaleIniFileWithJrePath(productOutputPath.absolutePath + "/Eclipse.app/Contents/Eclipse/HALE.ini") + } } } } else { @@ -629,6 +640,11 @@ def packageClient(productOutputPath) { targetDir.mkdir() def tarPath = targetDir.absolutePath + '/' + packageName + '.tar.gz'; def packCmd = ['tar', '--preserve-permissions', '-czf', tarPath, '--transform', "s,^\\./,$packageName/,", '.'] + //If the build script is run on the OS X then use gtar command. + //Note: gtar must be installed using `brew install gnu-tar`. + if (Os.isFamily(Os.FAMILY_MAC)) { + packCmd = ['gtar', '--preserve-permissions', '-czf', tarPath, '--transform', "s,^\\./,$packageName/,", '.'] + } def packProc = packCmd.execute(null, productOutputPath) def packBuffer = new StringBuffer() packProc.consumeProcessErrorStream(packBuffer) @@ -664,6 +680,10 @@ def packageClient(productOutputPath) { // Generate DMG image def genisoCmd = ['genisoimage', '-V', "${productName} ${bundleVersion}", '-D', '-R', '-apple', '-no-pad', '-o', "${targetDir}/${packageName}.dmg", '.'] + //create dmg file if the script is run on mac OS. + if (Os.isFamily(Os.FAMILY_MAC)) { + genisoCmd = "hdiutil create -ov -format UDZO -srcfolder ${productOutputPath.absolutePath} ${targetDir}/${packageName}.dmg" + } def genisoProc = genisoCmd.execute(null, productOutputPath) def genisoBuffer = new StringBuffer() genisoProc.consumeProcessErrorStream(genisoBuffer) @@ -826,6 +846,32 @@ def packageServer(productOutputPath) { } } +/** + * Method executed only for OS X. + * To run the HALE studio in mac, JRE must be bundled within the HALE studio app + * and its location must be added in the HALE.ini file. + * This method is a work around to modify HALE.ini file. + * This method reads HALE.ini file stored under "~/Eclipse.app/Contents/Eclipse/HALE.ini", + * then appends "-vm" arguments along with the JRE location bundled within the application. + * Finally, the changes are written back to the "HALE.ini" file. + * filepath HALE.ini file path + */ +def updateHaleIniFileWithJrePath(filepath) { + + File file = new File(filepath) + def fileContent = file.getText(); + + def indexOfVmargs = fileContent.indexOf("-vmargs") + + def updatedContent = fileContent.substring(0, indexOfVmargs) + .concat("-vm\n") + .concat("../Eclipse/jre/Contents/Home/jre/bin/java\n") + .concat(fileContent.substring(indexOfVmargs, fileContent.length())) + + println("HALE.ini file contents changed successfully!!") + file.write(updatedContent) +} + task makeProductFeatureProjectDefinition(type: Copy) { from Helper.resolveTemplate(project, 'plugin-project.xml') into new File(buildDir, 'gen.product.feature') @@ -945,7 +991,9 @@ task createProductFeature(dependsOn: [ generatePomFiles, makeProductFile, makePr new File("$productFeaturePath/HALE.p2.inf").text = ''' instructions.configure=\ addRepository(location:http${#58}//hale-geoserver.geo-solutions.it/,type:0,name:GeoServer App-Schema Plug-in for hale studio,enabled:true);\ - addRepository(location:http${#58}//hale-geoserver.geo-solutions.it/,type:1,name:GeoServer App-Schema Plug-in for hale studio,enabled:true); + addRepository(location:http${#58}//hale-geoserver.geo-solutions.it/,type:1,name:GeoServer App-Schema Plug-in for hale studio,enabled:true);\ + addRepository(location:https${#58}//interactive-instruments.github.io/xtraserver-plugin-for-hale/,type:0,name:XtraServer Plug-in for hale studio,enabled:true);\ + addRepository(location:https${#58}//interactive-instruments.github.io/xtraserver-plugin-for-hale/,type:1,name:XtraServer Plug-in for hale studio,enabled:true); ''' // remove platform-specific fragments from product diff --git a/common/features/eu.esdihumboldt.hale.common.feature.base/feature.xml b/common/features/eu.esdihumboldt.hale.common.feature.base/feature.xml index f9ffbfcdbb..d47fe3b409 100644 --- a/common/features/eu.esdihumboldt.hale.common.feature.base/feature.xml +++ b/common/features/eu.esdihumboldt.hale.common.feature.base/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. diff --git a/common/features/eu.esdihumboldt.hale.common.feature.core/feature.xml b/common/features/eu.esdihumboldt.hale.common.feature.core/feature.xml index 20db22c24b..8c7a141d21 100644 --- a/common/features/eu.esdihumboldt.hale.common.feature.core/feature.xml +++ b/common/features/eu.esdihumboldt.hale.common.feature.core/feature.xml @@ -2,7 +2,7 @@ diff --git a/common/features/eu.esdihumboldt.hale.common.feature.orient/feature.xml b/common/features/eu.esdihumboldt.hale.common.feature.orient/feature.xml index 0d20cec3fa..e8cdb781d4 100644 --- a/common/features/eu.esdihumboldt.hale.common.feature.orient/feature.xml +++ b/common/features/eu.esdihumboldt.hale.common.feature.orient/feature.xml @@ -2,7 +2,7 @@ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.groovy.test/META-INF/MANIFEST.MF index 71328ef4da..40fabc179a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Alignment Groovy API and Utilities Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.groovy.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align.groovy;bundle-version="2.6.0", eu.esdihumboldt.hale.common.schema.groovy;bundle-version="2.6.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/META-INF/MANIFEST.MF index bd1d399b06..fde6f27006 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.groovy/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Alignment Groovy API and Utilities Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="11.0.1", eu.esdihumboldt.hale.common.align.io.impl.internal.generated;version="2.9.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/META-INF/MANIFEST.MF index 57778a40c4..6ab76952fc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Alignment Merge Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.merge.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.3.7", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.merge/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.merge/META-INF/MANIFEST.MF index 9ea5631249..0693525013 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.merge/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.merge/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Alignment Merger Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.merge;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="3.3.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.test/META-INF/MANIFEST.MF index 1997043b6b..9c43961e5f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Alignment API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.test;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="11.0.1", eu.esdihumboldt.hale.common.align.io.impl.internal.generated;version="2.9.5", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/META-INF/MANIFEST.MF index e4b3ea1a6d..8f47b25851 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Transformation Graph Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.tgraph.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="11.0.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/META-INF/MANIFEST.MF index adb6974711..e7423a765d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align.tgraph/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Transformation Graph Bundle-SymbolicName: eu.esdihumboldt.hale.common.align.tgraph -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="11.0.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.align/META-INF/MANIFEST.MF index cfedaebdc3..5281a47d93 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.align/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Alignment API Bundle-SymbolicName: eu.esdihumboldt.hale.common.align;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="1.6.0", com.google.common.collect;version="1.6.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string.png b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string.png new file mode 100644 index 0000000000..547f25277e Binary files /dev/null and b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string.png differ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string_mapping.png b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string_mapping.png new file mode 100644 index 0000000000..0d334ecfba Binary files /dev/null and b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/Formatted_string_mapping.png differ diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/help.xhtml b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/help.xhtml new file mode 100644 index 0000000000..57a6518404 --- /dev/null +++ b/common/plugins/eu.esdihumboldt.hale.common.align/help/formattedString/help.xhtml @@ -0,0 +1,20 @@ + + + + +Formatted String + + +
+

Example mapping:

+

+ The formatted string function enables users to access attribute values and project variables to create concatenated string values. Enter text in the text field and double click on any available attribute value displayed in the function dialog to add the value. Alternatively press Ctrl+Space to access available variables and project variables. The entered values are concatenated to create string values in the target attribute.
+
+
+
+
+
+

+
+ + diff --git a/common/plugins/eu.esdihumboldt.hale.common.align/plugin.xml b/common/plugins/eu.esdihumboldt.hale.common.align/plugin.xml index 035ab5d471..1022904c4a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.align/plugin.xml +++ b/common/plugins/eu.esdihumboldt.hale.common.align/plugin.xml @@ -241,6 +241,7 @@ cellMigrator="eu.esdihumboldt.hale.common.align.model.functions.FormattedStringMigrator" description="Creates a formatted string based on a pattern and the input variables" icon="icons/text.png" + help="help/formattedString/help.xhtml" identifier="eu.esdihumboldt.hale.align.formattedstring" name="Formatted string"> diff --git a/common/plugins/eu.esdihumboldt.hale.common.app/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.app/META-INF/MANIFEST.MF index 34de14eb49..ee64eebe07 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.app/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.app/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Application Support Bundle-SymbolicName: eu.esdihumboldt.hale.common.app -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.common.app.internal.Activator Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 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 314a41d428..aef7ae2149 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 @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Cache Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.cache.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.hale.common.cache;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.junit diff --git a/common/plugins/eu.esdihumboldt.hale.common.cache/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.cache/META-INF/MANIFEST.MF index 32d8171e38..0b007d4d64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cache/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.cache/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Cache Bundle-SymbolicName: eu.esdihumboldt.hale.common.cache;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.io;version="9.0.0", de.fhg.igd.osgi.util, diff --git a/common/plugins/eu.esdihumboldt.hale.common.cli/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.cli/META-INF/MANIFEST.MF index 84eb8fd259..aec5f28a0c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.cli/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.cli/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: hale Core CLI Commands Bundle-SymbolicName: eu.esdihumboldt.hale.common.cli;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.3.7", diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/META-INF/MANIFEST.MF index 2b2baed226..e9351dc3f3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist.validator/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Codelist validator for instances Bundle-SymbolicName: eu.esdihumboldt.hale.common.codelist.validator;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.slf4jplus, diff --git a/common/plugins/eu.esdihumboldt.hale.common.codelist/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.codelist/META-INF/MANIFEST.MF index a50a070b87..d8515df5a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.codelist/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.codelist/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE CodeList Support Bundle-SymbolicName: eu.esdihumboldt.hale.common.codelist;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="15.0.0", eu.esdihumboldt.hale.common.align.model, diff --git a/common/plugins/eu.esdihumboldt.hale.common.config.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.config.test/META-INF/MANIFEST.MF index 9386261cda..40b0a9603a 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.config.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.config.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Configuration utilities for hale tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.config.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.hale.common.config;bundle-version="3.5.0" Automatic-Module-Name: eu.esdihumboldt.hale.common.config.test Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.config/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.config/META-INF/MANIFEST.MF index e4c778c30b..d91661874f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.config/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.config/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Configuration utilities for hale Bundle-SymbolicName: eu.esdihumboldt.hale.common.config -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Automatic-Module-Name: eu.esdihumboldt.hale.common.config Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.4.14", diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.convert.core/META-INF/MANIFEST.MF index 2fee7b8147..022ee232a3 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Core Converters Bundle-SymbolicName: eu.esdihumboldt.hale.common.convert.core;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.convert;bundle-version="2.5.0", groovy;bundle-version="2.3.7" diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/StringToInstantConverter.java b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/StringToInstantConverter.java index d3ee0954ad..8988d2ed06 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/StringToInstantConverter.java +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.core/src/eu/esdihumboldt/hale/common/convert/core/StringToInstantConverter.java @@ -16,6 +16,7 @@ package eu.esdihumboldt.hale.common.convert.core; import java.time.Instant; +import java.time.format.DateTimeParseException; import org.springframework.core.convert.converter.Converter; @@ -31,7 +32,19 @@ public Instant convert(String source) { if (source == null) { return null; } - return Instant.parse(source); - } + Instant result; + try { + result = Instant.parse(source); + } catch (DateTimeParseException e) { + // Be lenient about missing time zone information + try { + result = Instant.parse(source + "Z"); + } catch (Throwable t) { + throw e; + } + } + + return result; + } } diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/META-INF/MANIFEST.MF index c63a7d49ac..bf579e0289 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.convert.wkt/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: WKT Geometry Converters Bundle-SymbolicName: eu.esdihumboldt.hale.common.convert.wkt;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.locationtech.jts, org.locationtech.jts.geom, diff --git a/common/plugins/eu.esdihumboldt.hale.common.convert/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.convert/META-INF/MANIFEST.MF index 6889d123e3..6b06fe99e0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.convert/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.convert/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Conversion Service Bundle-SymbolicName: eu.esdihumboldt.hale.common.convert;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.springframework.core;bundle-version="3.0.0";visibility:=reexport, org.eclipse.core.runtime;bundle-version="3.10.0" diff --git a/common/plugins/eu.esdihumboldt.hale.common.core.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.core.test/META-INF/MANIFEST.MF index 737296080d..963255e978 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.core.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Core API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.core.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.hale.common.core;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: junit.framework;version="4.8.2", diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.core/META-INF/MANIFEST.MF index 339e76b93e..f698a4949b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Core API Bundle-SymbolicName: eu.esdihumboldt.hale.common.core;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.common.core.internal.CoreBundle Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java index efe28617b0..b373aec270 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/ImportProvider.java @@ -16,8 +16,10 @@ package eu.esdihumboldt.hale.common.core.io; +import java.io.IOException; import java.io.InputStream; +import eu.esdihumboldt.hale.common.core.io.report.IOReport; import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; /** @@ -63,4 +65,26 @@ public interface ImportProvider extends IOProvider { */ public String getResourceIdentifier(); + /** + * This method executes the I/O provider. It is a special case of + * IOProvider.execute(ProgressIndicator progress) and used when + * importing multiple schemas or instances. The method is overloaded with + * resourceIdentifier because for every file selected by the user a new + * resource identifier has to be generated so that every schema + * in @link{SchemaServiceImpl} gets a new ID for the selected schema. + * + * @param progress the progress indicator, may be null + * @param resourceIdentifier identifier of the provided resource. Null if a + * new resource id needs to be generated. + * @return the execution report + * + * @throws IOProviderConfigurationException if the I/O provider was not + * configured properly + * @throws IOException if an I/O operation fails + * @throws UnsupportedOperationException if the operation to load multiple + * files is not supported. + */ + public IOReport execute(ProgressIndicator progress, String resourceIdentifier) + throws IOProviderConfigurationException, IOException, UnsupportedOperationException; + } diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java index 1ab9b890fd..1fcffccf3f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/AbstractImportProvider.java @@ -74,6 +74,21 @@ public IOReport execute(ProgressIndicator progress) return super.execute(progress); } + /** + * @see eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider#execute(eu.esdihumboldt.hale.common.core.io.ProgressIndicator, + * java.lang.String) + */ + @SuppressWarnings("javadoc") + @Override + public IOReport execute(ProgressIndicator progress, String resourceIdentifier) + throws IOProviderConfigurationException, IOException, UnsupportedOperationException { + + if (resourceIdentifier == null) { + this.resourceIdentifier = generateResourceId(); + } + return super.execute(progress); + } + /** * Generate the unique resource identifier. * diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java index e23952ca1a..1334e7c60f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/impl/GZipEnabledImport.java @@ -64,6 +64,12 @@ public URI getUsedLocation() { return getLocation(); } + /** + * @return the wrapped LocatableInputSupplier + */ + public LocatableInputSupplier getSource() { + return source; + } } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java new file mode 100644 index 0000000000..7db7976c2c --- /dev/null +++ b/common/plugins/eu.esdihumboldt.hale.common.core/src/eu/esdihumboldt/hale/common/core/io/supplier/FilesIOSupplier.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2021 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.common.core.io.supplier; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import eu.esdihumboldt.util.io.InputSupplier; +import eu.esdihumboldt.util.io.OutputSupplier; + +/** + * I/O supplier based on a {@link File} and used when importing multiple schemas + * or instances. + * + * @author Kapil Agnihotri + */ +public class FilesIOSupplier + implements LocatableInputSupplier, LocatableOutputSupplier { + + private final File file; + private final List files; + private final List usedURILocations; + private final URI usedURI; + + /** + * Create a file I/O supplier. + * + * @param file the file + */ + public FilesIOSupplier(File file) { + this(file, file.toURI()); + } + + /** + * Create a file I/O supplier, which may return a relative URI on + * {@link #getLocation()}. + * + * @param absoluteFile the file + * + * @param usedURI the (relative) URI to use + * + */ + public FilesIOSupplier(File absoluteFile, URI usedURI) { + this(Arrays.asList(absoluteFile), Arrays.asList(usedURI)); + } + + /** + * Create a file I/O supplier, which may return a relative URI on + * {@link #getLocation()}. + * + * @param files list of files + * @param uris list of the (relative) URI to use + * + */ + public FilesIOSupplier(List files, List uris) { + super(); + this.file = files.get(0); + this.usedURI = uris.get(0); + this.files = files; + this.usedURILocations = uris; + } + + /** + * @see InputSupplier#getInput() + */ + @Override + public InputStream getInput() throws IOException { + return new BufferedInputStream(new FileInputStream(file)); + } + + /** + * @see OutputSupplier#getOutput() + */ + @Override + public OutputStream getOutput() throws IOException { + return new BufferedOutputStream(new FileOutputStream(file)); + } + + /** + * @see Locatable#getLocation() + */ + @Override + public URI getLocation() { + return file.toURI(); + } + + /** + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((file == null) ? 0 : file.hashCode()); + return result; + } + + /** + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + FilesIOSupplier other = (FilesIOSupplier) obj; + if (file == null) { + if (other.file != null) + return false; + } + else if (!file.equals(other.file)) + return false; + return true; + } + + @Override + public URI getUsedLocation() { + return usedURI; + } + + /** + * Getter + * + * @return the list of files + */ + public List getFiles() { + return files; + } + + /** + * Method to get a list of all the locations selected by the user during + * multiple import. + * + * @return list of URIs. + */ + public List getUsedLocations() { + return usedURILocations; + } + + /** + * Get the locations + * + * @return the list of locations, may be null + */ + public List getLocations() { + return files.stream().map(f -> f.toURI()).collect(Collectors.toList()); + } + +} diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.filter.test/META-INF/MANIFEST.MF index d81cf8503c..f35c57039d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.filter.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Hale Filter API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.filter.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.locationtech.jts;version="1.13.0", org.locationtech.jts.geom;version="1.13.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.filter/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.filter/META-INF/MANIFEST.MF index 32b8b4f7c7..19b5902fd0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.filter/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.filter/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Hale Filter API Bundle-SymbolicName: eu.esdihumboldt.hale.common.filter;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.slf4jplus, eu.esdihumboldt.hale.common.align.groovy.accessor, diff --git a/common/plugins/eu.esdihumboldt.hale.common.groovy.sandbox.enable/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.groovy.sandbox.enable/META-INF/MANIFEST.MF index 02af65f6f5..5cde16b6bd 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.groovy.sandbox.enable/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.groovy.sandbox.enable/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Enable Groovy Sandbox Service (for server side operation) Bundle-SymbolicName: eu.esdihumboldt.hale.common.groovy.sandbox.enable;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: eu.esdihumboldt.util.groovy.sandbox Require-Bundle: eu.esdihumboldt.hale.common.core diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless.orient/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.headless.orient/META-INF/MANIFEST.MF index 3923a70eab..a62dc0be26 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless.orient/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.headless.orient/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: OrientDB transformation sink Bundle-SymbolicName: eu.esdihumboldt.hale.common.headless.orient;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.instance.orient;bundle-version="2.9.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.headless.test/META-INF/MANIFEST.MF index a034567b15..305abc606d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.headless.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Headless API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.headless.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.headless/META-INF/MANIFEST.MF index 2de8ba8d6f..4f99cd0502 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Headless Transformation Bundle-SymbolicName: eu.esdihumboldt.hale.common.headless;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="11.0.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java index 52bcd0f166..807395a51b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.headless/src/eu/esdihumboldt/hale/common/headless/impl/LoadSchemaAdvisor.java @@ -17,7 +17,9 @@ import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import eu.esdihumboldt.hale.common.core.io.impl.AbstractIOAdvisor; import eu.esdihumboldt.hale.common.core.io.project.model.Project; @@ -26,7 +28,7 @@ import eu.esdihumboldt.hale.common.schema.io.SchemaReader; import eu.esdihumboldt.hale.common.schema.model.Schema; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; +import eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace; /** * Loads schemas and stores them in the advisor. As such an advisor instance may @@ -36,7 +38,7 @@ */ public class LoadSchemaAdvisor extends AbstractIOAdvisor { - private final List schemas = new ArrayList(); + private final Map schemas = new HashMap(); private final SchemaSpaceID ssid; @@ -72,7 +74,7 @@ public void prepareProvider(SchemaReader provider) { @Override public void handleResults(SchemaReader provider) { // add loaded schema to schema space - schemas.add(provider.getSchema()); + schemas.put(provider.getResourceIdentifier(), provider.getSchema()); super.handleResults(provider); } @@ -81,7 +83,7 @@ public void handleResults(SchemaReader provider) { * @return the schemas */ protected List getSchemas() { - return Collections.unmodifiableList(schemas); + return Collections.unmodifiableList(new ArrayList<>(schemas.values())); } /** @@ -91,15 +93,14 @@ protected List getSchemas() { */ public SchemaSpace getSchema() { // TODO cache? - DefaultSchemaSpace dss = new DefaultSchemaSpace(); + ResourceSchemaSpace dss = new ResourceSchemaSpace(); // add all schemas - for (Schema schema : schemas) { - // load information about mapping relevant types - SchemaIO.loadMappingRelevantTypesConfig(schema, ssid, project); - dss.addSchema(schema); + for (Map.Entry entry : schemas.entrySet()) { +// load information about mapping relevant types + SchemaIO.loadMappingRelevantTypesConfig(entry.getValue(), ssid, project); + dss.addSchema(entry.getKey(), entry.getValue()); } - return dss; } diff --git a/common/plugins/eu.esdihumboldt.hale.common.inspire/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.inspire/META-INF/MANIFEST.MF index 0005806455..8445c22e41 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.inspire/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.inspire/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: INSPIRE constants and apps Bundle-SymbolicName: eu.esdihumboldt.hale.common.inspire;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.graph.test/META-INF/MANIFEST.MF index bd38e7c902..6236951ec5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance Graphs Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.graph.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.instance.graph;bundle-version="2.9.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/META-INF/MANIFEST.MF index 3456ca13df..10ba64c0ba 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.graph/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.graph/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance Graphs Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.graph -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: com.tinkerpop.blueprints.core;bundle-version="2.5.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy.test/META-INF/MANIFEST.MF index 4946dab804..0501620165 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Groovy Instance API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.groovy.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Fragment-Host: eu.esdihumboldt.hale.common.instance.groovy;bundle-version="2.7.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/META-INF/MANIFEST.MF index 1bf65dd0ba..dbd39ae5fa 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Groovy Instance API Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="11.0.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.index/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.index/META-INF/MANIFEST.MF index bea15f276f..fbe69bad31 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.index/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.index/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance Indexes Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.index;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="17.0.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/META-INF/MANIFEST.MF index bebbc4a890..02689a1884 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.orient/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.orient/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance model based on Orient DB Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.orient;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.instance;bundle-version="2.5.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance.test/META-INF/MANIFEST.MF index 9b8fe6c9df..309e8358b7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Instance API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.instance.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.instance;bundle-version="2.5.0", org.geotools;bundle-version="8.0.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instance/META-INF/MANIFEST.MF index c4f48e0582..055006bfc7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Instance API Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="1.6.0", com.google.common.cache;version="17.0.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.instance/plugin.xml b/common/plugins/eu.esdihumboldt.hale.common.instance/plugin.xml index 142b6b58ed..449e44312d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instance/plugin.xml +++ b/common/plugins/eu.esdihumboldt.hale.common.instance/plugin.xml @@ -52,6 +52,18 @@ allowAll="false" class="org.locationtech.jts.geom.Coordinate"> + + + + + + diff --git a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/META-INF/MANIFEST.MF index a827f452e7..ecbf92e5b6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.instancevalidator/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance Validation Bundle-SymbolicName: eu.esdihumboldt.hale.common.instancevalidator;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension, de.fhg.igd.slf4jplus, diff --git a/common/plugins/eu.esdihumboldt.hale.common.logback.config.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.logback.config.test/META-INF/MANIFEST.MF index c19ab3b75d..59e4582a47 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.logback.config.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.logback.config.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Logback Test Configuration Bundle-SymbolicName: eu.esdihumboldt.hale.common.logback.config.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: ch.qos.logback.classic;bundle-version="0.9.19" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: data harmonisation panel diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.lookup.test/META-INF/MANIFEST.MF index 0ab91a3c36..f922339b1f 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Lookup Table Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.lookup.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Fragment-Host: eu.esdihumboldt.hale.common.lookup;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.lookup/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.lookup/META-INF/MANIFEST.MF index be5b973b14..72b1268ffc 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.lookup/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.lookup/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Lookup Table API Bundle-SymbolicName: eu.esdihumboldt.hale.common.lookup;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.core;bundle-version="2.5.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/META-INF/MANIFEST.MF index 942a1940ea..6ac74fc7e8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.propertyaccessor/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance PropertyAccessor Bundle-SymbolicName: eu.esdihumboldt.hale.common.propertyaccessor -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: org.geotools;bundle-version="8.0.0.M1" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: eu.esdihumboldt.hale.common.instance.helper, diff --git a/common/plugins/eu.esdihumboldt.hale.common.referencing.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.referencing.test/META-INF/MANIFEST.MF index 47874eda42..03e9d100d4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.referencing.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.referencing.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tests for GeoTools Referencing extensions Bundle-SymbolicName: eu.esdihumboldt.hale.common.referencing.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.3.7", diff --git a/common/plugins/eu.esdihumboldt.hale.common.referencing/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.referencing/META-INF/MANIFEST.MF index c5b112ab72..4b7779819c 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.referencing/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.referencing/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Extensions to GeoTools Referencing Bundle-SymbolicName: eu.esdihumboldt.hale.common.referencing;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Fragment-Host: org.geotools;bundle-version="12.2.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy.test/META-INF/MANIFEST.MF index 466f29c3da..e9029a6d64 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema Groovy API and Utilities Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.groovy.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Fragment-Host: eu.esdihumboldt.hale.common.schema.groovy;bundle-version="2.6.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/META-INF/MANIFEST.MF index 7e75980e13..3b69800362 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema Groovy API and Utilities Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.1.5", eu.esdihumboldt.hale.common.schema;bundle-version="2.6.0" diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.persist.test/META-INF/MANIFEST.MF index e39e17f036..49d59a05b9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema Persistence Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.persist.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.schema.persist;bundle-version="2.8.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/META-INF/MANIFEST.MF index fd12324774..45d6e292c1 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema Persistence Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.persist;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.schema;bundle-version="2.8.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy index b303007f8b..e411e4f4b4 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.persist/src/eu/esdihumboldt/hale/common/schema/persist/hsd/XmlToSchema.groovy @@ -181,7 +181,7 @@ public class XmlToSchema implements HaleSchemaConstants { } } else { - reporter.error(new IOMessageImpl("Could not find factory for constraint with type $id")) + reporter.error("Could not find factory for constraint with type $id") } } else { diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/META-INF/MANIFEST.MF index 63041a1f68..57813d61e5 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.presets/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.presets/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema Presets Extension Point Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.presets;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="17.0.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema.test/META-INF/MANIFEST.MF index e6019722a5..0dd6ad1a0e 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Schema API Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.schema;bundle-version="2.6.0", diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.schema/META-INF/MANIFEST.MF index cb055c0646..619d3e53a9 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Schema API Bundle-SymbolicName: eu.esdihumboldt.hale.common.schema;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base, com.google.common.collect;version="11.0.1", diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/impl/LoadSchemaAdvisor.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/impl/LoadSchemaAdvisor.java index 69d001a7e3..8705009351 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/impl/LoadSchemaAdvisor.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/io/impl/LoadSchemaAdvisor.java @@ -22,7 +22,7 @@ import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.io.SchemaReader; import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; +import eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace; /** * I/O configuration based advisor for loading schemas, that collects loaded @@ -32,7 +32,7 @@ */ public class LoadSchemaAdvisor extends ConfigurationIOAdvisor { - private final DefaultSchemaSpace schemaSpace = new DefaultSchemaSpace(); + private final ResourceSchemaSpace schemaSpace = new ResourceSchemaSpace(); private final SchemaSpaceID ssid; /** @@ -56,7 +56,7 @@ public void prepareProvider(SchemaReader provider) { */ @Override public void handleResults(SchemaReader provider) { - schemaSpace.addSchema(provider.getSchema()); + schemaSpace.addSchema(provider.getResourceIdentifier(), provider.getSchema()); } /** diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java index 86137a3baa..0ddc6132e7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/constraint/type/factory/GeometryTypeFactory.java @@ -45,18 +45,16 @@ public Value store(GeometryType constraint, TypeReferenceBuilder typeIndex) thro @Override public GeometryType restore(Value value, Definition definition, TypeResolver typeIndex, ClassResolver resolver) throws Exception { - Class binding = resolver.loadClass(value.as(String.class), "org.locationtech.jts"); + String className = value.as(String.class); + if (className.contains("com.vividsolutions.jts")) { + className = className.replace("com.vividsolutions.jts", "org.locationtech.jts"); + } - if (binding == null) { - String s = value.as(String.class); - binding = resolver.loadClass( - s.replace("com.vividsolutions.jts", "org.locationtech.jts"), - "org.locationtech.jts"); + Class binding = resolver.loadClass(className, "org.locationtech.jts.jts-core"); - if (binding == null) { - throw new IllegalStateException( - "Could not resolve geometry type " + value.as(String.class)); - } + if (binding == null) { + throw new IllegalStateException( + "Could not resolve geometry type " + value.as(String.class)); } return GeometryType.get((Class) binding); diff --git a/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java new file mode 100644 index 0000000000..9123628cb4 --- /dev/null +++ b/common/plugins/eu.esdihumboldt.hale.common.schema/src/eu/esdihumboldt/hale/common/schema/model/impl/ResourceSchemaSpace.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021 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.common.schema.model.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +import javax.xml.namespace.QName; + +import eu.esdihumboldt.hale.common.schema.model.Definition; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; +import eu.esdihumboldt.hale.common.schema.model.TypeConstraint; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.common.schema.model.TypeIndex; +import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; + +/** + * {@link SchemaSpace} implementation with resource Id. + * + * @author Kapil Agnihotri + */ +public class ResourceSchemaSpace implements SchemaSpace { + + private final Map schemasMap = new HashMap(); + + private Collection allTypes; + + private Collection mappingRelevantTypes; + + /** + * Adds a schema. + * + * @param resourceId resource id of the schema. + * + * @param schema the schema to add + * @return this schema space for chaining + */ + public ResourceSchemaSpace addSchema(String resourceId, Schema schema) { + synchronized (this) { + schemasMap.put(resourceId, schema); + if (allTypes != null) { + allTypes.addAll(schema.getTypes()); + } + if (mappingRelevantTypes != null) { + mappingRelevantTypes.addAll(schema.getMappingRelevantTypes()); + } + } + return this; + } + + /** + * Removes a schema. + * + * @param resourceId resource id of the schema. + * + * @return returns the schema to which this map previously associated the + * key, or null if the map contained no mapping for the key. + */ + public Schema removeSchema(String resourceId) { + Schema removed = schemasMap.remove(resourceId); + + // re-initialize. + allTypes = null; + getTypes(); + mappingRelevantTypes = null; + getMappingRelevantTypes(); + return removed; + + } + + /** + * @see TypeIndex#getTypes() + */ + @Override + public Collection getTypes() { + synchronized (this) { + if (allTypes == null) { + allTypes = new HashSet(); + for (Schema schema : schemasMap.values()) { + allTypes.addAll(schema.getTypes()); + } + } + return allTypes; + } + } + + /** + * @see TypeIndex#getType(QName) + */ + @Override + public TypeDefinition getType(QName name) { + synchronized (this) { + for (Schema schema : schemasMap.values()) { + if (schema != null) { + TypeDefinition result = schema.getType(name); + if (result != null) { + return result; + } + } + } + + return null; + } + } + + /** + * @see TypeIndex#getMappingRelevantTypes() + */ + @Override + public Collection getMappingRelevantTypes() { + synchronized (this) { + if (mappingRelevantTypes == null) { + mappingRelevantTypes = new HashSet(); + for (Schema schema : schemasMap.values()) { + mappingRelevantTypes.addAll(schema.getMappingRelevantTypes()); + } + } + return mappingRelevantTypes; + } + } + + /** + * @see SchemaSpace#getSchemas() + */ + @Override + public Iterable getSchemas() { + return new ArrayList(schemasMap.values()); + } + + /** + * @param resourceId resource id of the schema. + * @return schema. + */ + public Schema getSchemas(String resourceId) { + return schemasMap.get(resourceId); + } + + /** + * @see eu.esdihumboldt.hale.common.schema.model.TypeIndex#toggleMappingRelevant(java.util.Collection) + */ + @Override + public void toggleMappingRelevant(Collection types) { + synchronized (this) { + for (TypeDefinition type : types) { + Schema container = null; + for (Schema schema : schemasMap.values()) + if (schema.getTypes().contains(type)) { + container = schema; + break; + } + // toggle type in its schema + if (container != null) + container.toggleMappingRelevant(Collections.singletonList(type)); + else { + // shouldn't happen, but to be safe toggle it in this case + // too + Definition def = type; + ((AbstractDefinition) def).setConstraint(MappingRelevantFlag + .get(!type.getConstraint(MappingRelevantFlag.class).isEnabled())); + } + // was toggled, update own list + if (mappingRelevantTypes != null) + if (type.getConstraint(MappingRelevantFlag.class).isEnabled()) + mappingRelevantTypes.add(type); + else + mappingRelevantTypes.remove(type); + } + } + } +} diff --git a/common/plugins/eu.esdihumboldt.hale.common.scripting/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.scripting/META-INF/MANIFEST.MF index 0a9f74537d..63e893d9c0 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.scripting/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.scripting/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Common Scripting API Bundle-SymbolicName: eu.esdihumboldt.hale.common.scripting;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Require-Bundle: org.eclipse.core.runtime, eu.esdihumboldt.hale.common.align Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.service.helper.test/META-INF/MANIFEST.MF index 0331ddad10..e4c4505d2b 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE UI service helper test Bundle-SymbolicName: eu.esdihumboldt.hale.common.service.helper.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Fragment-Host: eu.esdihumboldt.hale.common.service.helper;bundle-version="3.1.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/common/plugins/eu.esdihumboldt.hale.common.service.helper/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.service.helper/META-INF/MANIFEST.MF index 4301d634d7..8a1aaf88c8 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.service.helper/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.service.helper/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Hale UI Service Implementer Bundle-SymbolicName: eu.esdihumboldt.hale.common.service.helper -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: wetransform GmbH Import-Package: eu.esdihumboldt.hale.common.align.model, diff --git a/common/plugins/eu.esdihumboldt.hale.common.style/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.style/META-INF/MANIFEST.MF index 64321bf874..29aa1b1cce 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.style/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.style/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Styles API Bundle-SymbolicName: eu.esdihumboldt.hale.common.style;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.common.style.io, diff --git a/common/plugins/eu.esdihumboldt.hale.common.tasks/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.tasks/META-INF/MANIFEST.MF index 231202350b..bbaca486b6 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.tasks/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.tasks/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tasks Bundle-SymbolicName: eu.esdihumboldt.hale.common.tasks;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.common.tasks, diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.allure/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.test.allure/META-INF/MANIFEST.MF index 367e749396..e90a4f9c9d 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.allure/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.test.allure/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Allure Test Integration Bundle-SymbolicName: eu.esdihumboldt.hale.common.test.allure;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: ru.yandex.qatools.allure.junit-adaptor;bundle-version="1.5.0", de.fhg.igd.equinox.test.app diff --git a/common/plugins/eu.esdihumboldt.hale.common.test.docker/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.test.docker/META-INF/MANIFEST.MF index a877d3d767..ecf0db76a7 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test.docker/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.test.docker/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Docker Bundle-SymbolicName: eu.esdihumboldt.hale.common.test.docker -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.common.test.docker.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.fasterxml.jackson.annotation;version="2.3.2", diff --git a/common/plugins/eu.esdihumboldt.hale.common.test/META-INF/MANIFEST.MF b/common/plugins/eu.esdihumboldt.hale.common.test/META-INF/MANIFEST.MF index 36894f7800..037aba0a10 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test/META-INF/MANIFEST.MF +++ b/common/plugins/eu.esdihumboldt.hale.common.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Test Support Project Bundle-SymbolicName: eu.esdihumboldt.hale.common.test;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.osgi.util, eu.esdihumboldt.hale.common.align.io, diff --git a/common/plugins/eu.esdihumboldt.hale.common.test/Tests.product b/common/plugins/eu.esdihumboldt.hale.common.test/Tests.product index 0e035b5204..8f5b497b15 100644 --- a/common/plugins/eu.esdihumboldt.hale.common.test/Tests.product +++ b/common/plugins/eu.esdihumboldt.hale.common.test/Tests.product @@ -1,7 +1,7 @@ - + @@ -22,7 +22,6 @@ - @@ -94,7 +93,6 @@ - @@ -211,6 +209,7 @@ + @@ -221,8 +220,6 @@ - - @@ -370,6 +367,7 @@ + @@ -524,4 +522,11 @@ + + + + + + + diff --git a/cst/features/eu.esdihumboldt.cst.feature/feature.xml b/cst/features/eu.esdihumboldt.cst.feature/feature.xml index 64510ddd36..c6443eb309 100644 --- a/cst/features/eu.esdihumboldt.cst.feature/feature.xml +++ b/cst/features/eu.esdihumboldt.cst.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.collector/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.collector/META-INF/MANIFEST.MF index 480684864c..e40427d09c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.collector/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.collector/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Collector functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.collector;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="17.0.0", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.core/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.core/META-INF/MANIFEST.MF index f28daa8859..14dd582f50 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.core/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Core Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.core;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="2.2.0", groovy;bundle-version="1.8.6" diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom.test/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.custom.test/META-INF/MANIFEST.MF index 0edc0d7cad..2c3e6b1e8a 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom.test/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Custom Functions Tests Bundle-SymbolicName: eu.esdihumboldt.cst.functions.custom.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.cst.functions.custom;bundle-version="2.9.3", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.custom/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.custom/META-INF/MANIFEST.MF index 5d74364223..66cacee74c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.custom/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.custom/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Custom transformation functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.custom;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.common.align.custom, diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric.test/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.geometric.test/META-INF/MANIFEST.MF index c715a96cca..3419c85acb 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric.test/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Geometric Functions Tests Bundle-SymbolicName: eu.esdihumboldt.cst.functions.geometric.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: data harmonisation panel Import-Package: eu.esdihumboldt.cst.test, diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/META-INF/MANIFEST.MF index dad4a47ccd..643e1834d8 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Geometric Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.geometric;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="2.5.0", org.opengis, diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/build.properties b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/build.properties index 6c480f39f1..fbb2dd21d2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/build.properties +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/build.properties @@ -3,4 +3,5 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - icons/ + icons/,\ + help/ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/Calculate_Length.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/Calculate_Length.png new file mode 100644 index 0000000000..e0062c4bf6 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/Calculate_Length.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/help.xhtml new file mode 100644 index 0000000000..8bae29db6e --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/CalculateLength/help.xhtml @@ -0,0 +1,25 @@ + + + + +Calculate Length + + +
+

General explanation

+

+The calculate length function computes the length of a given geometry in the source data and +assigns the resulting value to the target property.
+
+
+
+The example below shows how the length of the geometry contained in the LineString property of the River source dataset +is calculated and assigned to the length property of the Watercourse target dataset. The function is executed by +clicking the Finish button.
+
+ + +

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/aggregate.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/aggregate.png new file mode 100644 index 0000000000..d1e485323c Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/aggregate.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/help.xhtml new file mode 100644 index 0000000000..8d4484503c --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/aggregate/help.xhtml @@ -0,0 +1,24 @@ + + + + +Aggregate + + +
+

General explanation

+

+The aggregate function combines the input source features to create MultiLineString, MultiPoint or MultiPolygon geometries. The aggregate function performs a check to ensure that the input features have the same source CRS. In the cases of input multi geometries, a new multi geometry is created. +When different input geometry types are aggregated, you will receive a warning in the transformation log but the function will combine the geometries in a generic GeometryCollection. +In the case of lines the aggregate function tries to combine them to create a MultiLineString in which the individual lines are connected (i.e. end vertex of one line is the start vertex of the next one). +If this is not possible there is no guaranteed order in the MultiLineString.
+
+The aggregate function is often used in combination with the type level merge function. The use of the aggregate function is necessary to combine the geometries to create multi geometries and avoid selecting just one geometry from the merged source geometries. +
+
+
+
+

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_Input.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_Input.png new file mode 100644 index 0000000000..035ab79bd7 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_Input.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_map.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_map.png new file mode 100644 index 0000000000..a5f80dd8cf Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/Centroid_map.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/help.xhtml new file mode 100644 index 0000000000..73ce530f99 --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/centroid/help.xhtml @@ -0,0 +1,28 @@ + + + + +Centroid + + +
+

General explanation

+

+This function is used to create a centroid (or geometric center) for each feature geometry in the source dataset. The resulting +centroids are mapped to the target property as point features.
+
+
+
+In the example below, the centroid function was applied to populate the target geometry with the centroids of the source geometry features. +Note that for mapping centroids the target source has to have a point geometry.
+
+
+ +The picture below shows the result of the centroid function, where for each element of the target source data (left) a centroid was added.
+ +
+ +

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_BoundingBox.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_BoundingBox.png new file mode 100644 index 0000000000..e07351300c Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_BoundingBox.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_ConvexHull.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_ConvexHull.png new file mode 100644 index 0000000000..732763d3ce Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/ComputeExtent_ConvexHull.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/help.xhtml new file mode 100644 index 0000000000..14acbc5f5b --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/extent/help.xhtml @@ -0,0 +1,34 @@ + + + + +Compute Extent + + +
+

General explanation

+

+The compute extent function uses the source data geometries to derive the geometric extent and map it to the target geometry. +Three different options are available for extent computation: Bounding Box, Convex Hull and Union. Visual examples are +provided below.
+
+
+
+Bounding Box
+
+The bounding box option maps the smallest rectangle shape that encloses the source data geometries to the target data geometry.
+
+ + +
+
+Convex Hull
+
+The convex hull option maps the smallest convex shape that encloses the source data geometries to the target data geometry.
+
+ + +

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/help.xhtml new file mode 100644 index 0000000000..adb146c0e0 --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/help.xhtml @@ -0,0 +1,24 @@ + + + + +Interior Point + + +
+

General explanation

+

+Lines
+The interior point algorithm finds an interior vertex which is closest to the centroid of the line string.
+
+Areas
+The interior point algorithm computes sections along a horizontal scan line in the interior of the polygon. The final interior point is the midpoint of the widest computed section in the interior of the polygon. +For properties with multiple geometries, the interior point function selects the first geometry. +
+ Source:JTS Technical Documentation
+
+

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/interiorPoint.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/interiorPoint.png new file mode 100644 index 0000000000..7dc97ae788 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/interiorPoint/interiorPoint.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Buffer_Map.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Buffer_Map.png new file mode 100644 index 0000000000..2f5f5375ac Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Buffer_Map.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_ChoseParameter.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_ChoseParameter.png new file mode 100644 index 0000000000..9a498a3400 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_ChoseParameter.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Math.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Math.png new file mode 100644 index 0000000000..2685411941 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_Math.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_PlainValue.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_PlainValue.png new file mode 100644 index 0000000000..bb5f5754f9 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/NetworkExpansion_PlainValue.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/help.xhtml new file mode 100644 index 0000000000..2d3ed477a8 --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/network/help.xhtml @@ -0,0 +1,44 @@ + + + + +Network expansion + + +
+

General explanation

+

+The network expansion function creates a buffer around the geometry of the source data and applies it to the target data. The example +below shows a comparison of the unbuffered source data (left) to the buffered target data (right).
+ +
+ +Defining the buffer width
+ +The buffer width can be specified either by a plain value, a mathematical expression or a groovy script.
+
+
+ +Plain value
+
+ +To define the buffer size using a plain value, enter the value of the desired buffer size (e.g. 500) in the function dialog.
+ +
+ +Mathematical expression
+
+To apply a mathematical expression, a variable need to be added in the first step so that it can be used in the buffer +width expression in the second step. In the example below the variable 'width' was added and multiplied by the value 2 to +create a buffer around the source geometry.
+ +
+ +Groovy script
+
+Similar to the mathematical expression, a groovy script can be applied to create the desired buffer for the target data.
+ +

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/help.xhtml new file mode 100644 index 0000000000..05a9bb0b32 --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/help.xhtml @@ -0,0 +1,52 @@ + + + + +Spatial Join + + +
+

General explanation

+

+Spatial joins can join objects from multiple feature types together based on the spatial relationship between their geometries. +Spatial joins support the relation types contains, covered by, covers, crosses, equals, intersects, overlaps, touches, and within.
+
+Spatial joins are implemented based on the DE-9IM model.
+
+CONTAINS: Every point of the argument geometry is a point of this geometry, and the interiors of the two geometries have at least one point in common. Geometries do not contain their boundary. +If a geometry A is a subset of the points in the boundary of a geometry B, B.contains(A) = false. +CONTAINS is the converse of WITHIN.
+
+COVEREDBY: Every point of this geometry is a point of the argument geometry. +This predicate is similar to WITHIN but is more inclusive (i.e. returns true for more cases). +COVEREDBY is the converse of COVERS
+
+COVERS: Every point of the argument geometry is a point of this geometry. This predicate is similar to CONTAINS but is more inclusive (i.e. returns true for more cases). Unlike CONTAINS it does not distinguish between points in the boundary and in the interior of geometries. For most situations, COVERS should be used in preference to CONTAINS. +COVERS is the converse of COVEREDBY.
+
+CROSSES: The geometries have some but not all interior points in common.
+
+EQUALS: Tests whether this geometry is topologically equal to the argument geometry.
+
+INTERSECTS: The geometries have at least one point in common.
+
+OVERLAPS: The geometries have at least one point each not shared by the other (or equivalently neither covers the other), they have the same dimension, and the intersection of the interiors of the two geometries has the same dimension as the geometries themselves.
+
+TOUCHES: The geometries have at least one point in common, but their interiors do not intersect.
+
+WITHIN: Every point of this geometry is a point of the argument geometry, and the interiors of the two geometries have at least one point in common. The boundary of the geometry is not within the geometry. +If a geometry A is a subset of the points in the boundary of a geometry B, A.within(B) = false. +WITHIN is converse of CONTAINS
+
+Source:JTS Technical Documentation
+
+ +
+
+
+
+

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join.png new file mode 100644 index 0000000000..f99836f537 Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join_mapping.png b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join_mapping.png new file mode 100644 index 0000000000..983c070b3d Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/help/spatialJoin/spatial_join_mapping.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/plugin.xml b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/plugin.xml index 3278d27058..b9a215cf2e 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.geometric/plugin.xml +++ b/cst/plugins/eu.esdihumboldt.cst.functions.geometric/plugin.xml @@ -86,6 +86,7 @@ cellExplanation="eu.esdihumboldt.cst.functions.geometric.NetworkExpansionExplanation" description="Creates a buffer on a geometry." icon="icons/geometry.png" + help = "help/network/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.networkexpansion" name="Network Expansion"> @@ -129,6 +130,7 @@ cellExplanation="eu.esdihumboldt.cst.functions.geometric.CalculateLengthExplanation" description="Calculate the length of a geometry." icon="icons/geometry.png" + help = "help/CalculateLength/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.calculatelength" name="Calculate Length"> @@ -185,6 +187,7 @@ cellExplanation="eu.esdihumboldt.cst.functions.geometric.CentroidExplanation" description="Calculates the centroid of a given geometry." icon="icons/geometry.png" + help = "help/centroid/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.centroid" name="Centroid"> @@ -208,6 +211,7 @@ category="eu.esdihumboldt.cst.functions.geometric" description="Compute geometric extent based on all input geometries. The options Bounding Box, Convex Hull and Union are possible." icon="icons/geometry.png" + help = "help/extent/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.extent" name="Compute Extent"> @@ -253,6 +257,7 @@ category="eu.esdihumboldt.cst.functions.geometric" description="Aggregate similar input geometries" icon="icons/geometry.png" + help="help/aggregate/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.aggregate" name="Aggregate"> @@ -325,6 +330,7 @@ cellExplanation="eu.esdihumboldt.cst.functions.geometric.interiorpoint.InteriorPointExplanation" description="Computes an interior point of a geometry (up to 2D). An interior point is guaranteed to lie in the interior of the geometry, if it is possible to calculate such a point exactly. Otherwise, the point may lie on the boundary of the geometry (e.g. if the geometry is a line)." icon="icons/geometry.png" + help="help/interiorPoint/help.xhtml" identifier="eu.esdihumboldt.cst.functions.geometric.interiorPoint" name="Interior Point"> @@ -347,6 +353,7 @@ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers.test/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers.test/META-INF/MANIFEST.MF index 4311763052..b0a3c6dce2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers.test/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tests for general groovy helper functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.groovy.helpers.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.cst.functions.groovy.helpers;bundle-version="2.9.5", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/META-INF/MANIFEST.MF index de8543563e..4f1d2d4ee6 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy.helpers/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Helper Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.groovy.helpers;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.cst.functions.groovy;bundle-version="2.9.3", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/META-INF/MANIFEST.MF index a3e63294f1..58ed9ea987 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.groovy/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Groovy transformation function Bundle-SymbolicName: eu.esdihumboldt.cst.functions.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="9.0.0", com.google.common.collect;version="9.0.0", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/META-INF/MANIFEST.MF index 9df1004a3c..5bd43a68dc 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.inspire/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.inspire/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Inspire Transformation Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.inspire;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="2.5.0" Import-Package: com.google.common.base;version="9.0.0", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/META-INF/MANIFEST.MF index 704534903f..a951b242d2 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.numeric/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.numeric/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Numeric Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.numeric;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="2.5.0" Import-Package: com.google.common.base;version="9.0.0", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.functions.string/META-INF/MANIFEST.MF index 040e96cded..3e9c0da6cd 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.string/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.functions.string/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: String Transformation Functions Bundle-SymbolicName: eu.esdihumboldt.cst.functions.string;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="9.0.0", com.google.common.collect;version="9.0.0", diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/DateExtraction.png b/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/DateExtraction.png new file mode 100644 index 0000000000..3b64afb0eb Binary files /dev/null and b/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/DateExtraction.png differ diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/help.xhtml b/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/help.xhtml new file mode 100644 index 0000000000..3606f4f460 --- /dev/null +++ b/cst/plugins/eu.esdihumboldt.cst.functions.string/help/date/help.xhtml @@ -0,0 +1,22 @@ + + + + +Date extraction + + +
+

General explanation

+

+The date extraction function enables users to extract a date from a string type in the source data and assign the value to the target attribute.
+
+
+The date format must be specified by the user to achieve the correct result. In the example below the date is specified by month (MM), +day of month (dd) and year (yyyy).
+
+
+
+

+
+ + diff --git a/cst/plugins/eu.esdihumboldt.cst.functions.string/plugin.xml b/cst/plugins/eu.esdihumboldt.cst.functions.string/plugin.xml index c94244f8c8..fcdca78889 100644 --- a/cst/plugins/eu.esdihumboldt.cst.functions.string/plugin.xml +++ b/cst/plugins/eu.esdihumboldt.cst.functions.string/plugin.xml @@ -22,6 +22,7 @@ category="eu.esdihumboldt.hale.align.general" description="Extracts a date from a string type" cellExplanation="eu.esdihumboldt.cst.functions.string.DateExtractionExplanation" + help = "help/date/help.xhtml" identifier="eu.esdihumboldt.cst.functions.string.dateextraction" name="Date extraction"> diff --git a/cst/plugins/eu.esdihumboldt.cst.test/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst.test/META-INF/MANIFEST.MF index 63bcafb460..5116bc151c 100644 --- a/cst/plugins/eu.esdihumboldt.cst.test/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Conceptual Schema Transformer Tests Bundle-SymbolicName: eu.esdihumboldt.cst.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.cst;bundle-version="2.5.0", eu.esdihumboldt.hale.common.align;bundle-version="2.5.0", diff --git a/cst/plugins/eu.esdihumboldt.cst/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.cst/META-INF/MANIFEST.MF index b06285d07a..b237812bf6 100644 --- a/cst/plugins/eu.esdihumboldt.cst/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.cst/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Conceptual Schema Transformer Bundle-SymbolicName: eu.esdihumboldt.cst;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="11.0.1", com.google.common.collect;version="9.0.0", diff --git a/cst/plugins/eu.esdihumboldt.hale.common.instance.index.test/META-INF/MANIFEST.MF b/cst/plugins/eu.esdihumboldt.hale.common.instance.index.test/META-INF/MANIFEST.MF index 7b222bc842..40c18bd99c 100644 --- a/cst/plugins/eu.esdihumboldt.hale.common.instance.index.test/META-INF/MANIFEST.MF +++ b/cst/plugins/eu.esdihumboldt.hale.common.instance.index.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance Index Tests Bundle-SymbolicName: eu.esdihumboldt.hale.common.instance.index.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0", diff --git a/doc/plugins/eu.esdihumboldt.cst.doc.functions.dummy/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.cst.doc.functions.dummy/META-INF/MANIFEST.MF index ae0f326b5a..04a8adfa33 100644 --- a/doc/plugins/eu.esdihumboldt.cst.doc.functions.dummy/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.cst.doc.functions.dummy/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Dummy Functions Documentation Bundle-SymbolicName: eu.esdihumboldt.cst.doc.functions.dummy;singleton:=true Fragment-Host: eu.esdihumboldt.cst.doc.functions;bundle-version="2.5.0" -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0" Bundle-Vendor: data harmonisation panel diff --git a/doc/plugins/eu.esdihumboldt.cst.doc.functions.dynamic/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.cst.doc.functions.dynamic/META-INF/MANIFEST.MF index 719179c487..60f693e4a2 100644 --- a/doc/plugins/eu.esdihumboldt.cst.doc.functions.dynamic/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.cst.doc.functions.dynamic/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Function Reference Bundle-SymbolicName: eu.esdihumboldt.cst.doc.functions.dynamic;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.cst.doc.functions Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align;bundle-version="2.5.0", diff --git a/doc/plugins/eu.esdihumboldt.cst.doc.functions/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.cst.doc.functions/META-INF/MANIFEST.MF index 2fe676d190..bd66c90240 100644 --- a/doc/plugins/eu.esdihumboldt.cst.doc.functions/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.cst.doc.functions/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Functions Documentation Bundle-SymbolicName: eu.esdihumboldt.cst.doc.functions;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.cst.doc.functions Require-Bundle: org.eclipse.help;bundle-version="3.5.100" diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.application/Infocenter.product b/doc/plugins/eu.esdihumboldt.hale.doc.application/Infocenter.product index b395fecfef..baacf999d9 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.application/Infocenter.product +++ b/doc/plugins/eu.esdihumboldt.hale.doc.application/Infocenter.product @@ -1,7 +1,7 @@ - + @@ -81,7 +81,6 @@ - diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.application/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.application/META-INF/MANIFEST.MF index 409e696a49..e9d02eae61 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.application/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.application/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Infocenter Bundle-SymbolicName: eu.esdihumboldt.hale.doc.application;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", org.eclipse.help;bundle-version="3.5.100", org.eclipse.help.base;bundle-version="3.6.1" diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.dev/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.dev/META-INF/MANIFEST.MF index 0b1a15912b..8fc3054574 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.dev/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.dev/META-INF/MANIFEST.MF @@ -2,6 +2,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Developer Guide Bundle-SymbolicName: eu.esdihumboldt.hale.doc.dev;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Require-Bundle: org.eclipse.help;bundle-version="3.5.100" diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user.examples.meridian2/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.user.examples.meridian2/META-INF/MANIFEST.MF index 658d245cab..9474e2bb98 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user.examples.meridian2/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user.examples.meridian2/META-INF/MANIFEST.MF @@ -2,6 +2,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Meridian2 based example projects Bundle-SymbolicName: eu.esdihumboldt.hale.doc.user.examples.meridian2;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Require-Bundle: eu.esdihumboldt.hale.doc.user.examples;bundle-version="2.5.0" Bundle-Vendor: data harmonisation panel diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user.examples/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.user.examples/META-INF/MANIFEST.MF index 1b4067b447..bfd747f1d0 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user.examples/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user.examples/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Example Projects Help Bundle-SymbolicName: eu.esdihumboldt.hale.doc.user.examples;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.help;bundle-version="3.5.100", org.eclipse.core.runtime;bundle-version="3.7.0" diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user.ioproviders/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.user.ioproviders/META-INF/MANIFEST.MF index e72dfecd2b..76d62b74f9 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user.ioproviders/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user.ioproviders/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Help on Instance I/O Bundle-SymbolicName: eu.esdihumboldt.hale.doc.user.ioproviders;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension, de.fhg.igd.slf4jplus, diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/META-INF/MANIFEST.MF b/doc/plugins/eu.esdihumboldt.hale.doc.user/META-INF/MANIFEST.MF index 309aeb810a..fc37e0da5b 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/META-INF/MANIFEST.MF +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/META-INF/MANIFEST.MF @@ -2,6 +2,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE User Guide Bundle-SymbolicName: eu.esdihumboldt.hale.doc.user;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Require-Bundle: org.eclipse.help diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/functions.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/functions.html index 41681e442f..7227c1df58 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/functions.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/functions.html @@ -20,9 +20,9 @@

Functions

parameters.

- Note: The functions available in hale studio represent only + Note: The functions available in hale»studio represent only a small subset of possible relations - if you find that you are not - able to express a relation through the given functions, hale studio offers an + able to express a relation through the given functions, hale»studio offers an extension point to integrate additional functions.

There are two basic types of functions, functions that represent @@ -32,7 +32,7 @@

Type relations

A type relation describes how types from the source schema are to be translated to a type in the target schema.

- The most simple type relation in hale studio is represented by the hale»studio is represented by the Retype function, which expresses that a source and target type are semantically equal. For the transformation this means that for each diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/project_vars.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/project_vars.html index 64bec8fbe0..720acc5b1a 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/project_vars.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/project_vars.html @@ -19,7 +19,7 @@

Define variables

Go to WindowSettings and then to ProjectVariables - to define project variables from within halestudio. Any variable you + to define project variables from within hale»studio. Any variable you add here is stored in the project when you next save it.

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_instance.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_instance.html index 2fd2128081..c2d1b634da 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_instance.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_instance.html @@ -21,7 +21,7 @@

What is an Instance?

- When loading a source data set in hale studio, the data is partitioned + When loading a source data set in hale»studio, the data is partitioned into instances. Those instances can be inspected in the Source Data view. When a mapping/alignment is defined, the transformation is executed on the diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_schema.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_schema.html index 00ae10712f..ff92da4344 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_schema.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/concepts/what_is_schema.html @@ -21,10 +21,10 @@

What is a Schema?

- In hale studio we define the schema mapping on the conceptual level, + In hale»studio we define the schema mapping on the conceptual level, between classes/types and properties. For the complete transformation process however, information about the data format is needed. The - approach used in hale studio can deal with both kinds of schemas, + approach used in hale»studio can deal with both kinds of schemas, abstracting a conceptual view for logical schemas, while using the information from the logical schema for the transformation process. For conceptual schemas, no transformation can be applied, but the diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/contributors.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/contributors.html index 4b23da13af..ea41e004d5 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/contributors.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/contributors.html @@ -6,7 +6,7 @@

Contributors

-

Thanks to all who contributed to make hale studio what it is!

+

Thanks to all who contributed to make hale»studio what it is!

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/confWorkbench.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/confWorkbench.html index f67ec95698..ba9a77ff8b 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/confWorkbench.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/confWorkbench.html @@ -7,14 +7,14 @@

Configuring your workbench

- When you start hale studio the first time, it will present you with + When you start hale»studio the first time, it will present you with the First steps welcome page. It offers you to load an existing project or to continue with the command linkGet started with hale studio + alt="command link">Get started with hale»studio guide. After choosing either of those options the welcome page is - replaced with the hale studio workbench. You can also close the + replaced with the hale»studio workbench. You can also close the welcome page manually.

The workbench consists of

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/data_perspective.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/data_perspective.png index c7b62feb3d..d356d3757c 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/data_perspective.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/data_perspective.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/default_perspective.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/default_perspective.png index e1a2e6e3f7..7b50990b97 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/default_perspective.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/default_perspective.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help.html index 6fa2ff0c91..9d51c4a759 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help.html @@ -8,23 +8,23 @@ -

How to use the hale studio help

-

The hale studio help is available both online and in your version of - hale studio. In some help topics live actions are provided, that allow +

How to use the hale»studio help

+

The hale»studio help is available both online and in your version of + hale»studio. In some help topics live actions are provided, that allow you to directly perform a specific task in your currently running - version of hale studio. Here is an example: command linkImport source schema

-

In hale studio you have different means to access the help, you should +

In hale»studio you have different means to access the help, you should know how to use them to be able to find the right help topics quickly:

Dynamic help

When you have selected a specific view (e.g. the Schema Explorer) you can press F1 to find out what help topics are - associated to it. hale studio provides associated help topics for most of the + associated to it. hale»studio provides associated help topics for most of the views and even for specific objects. You can select a mapping cell or function and will be presented a link to the corresponding help topic in the function reference. @@ -40,7 +40,7 @@

Dynamic help

Help Browser

Use the Help Browser if you want to get an overview on the help and browse through tasks, views and the reference. The simplest way - to open the Help Browser is the hale studio toolbar:

+ to open the Help Browser is the hale»studio toolbar:

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help_browser.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help_browser.png index e603307111..6c51cd23fe 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help_browser.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/help_browser.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/install_plugins.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/install_plugins.html index 7bbabc7ac9..a7c1c5ad34 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/install_plugins.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/install_plugins.html @@ -7,18 +7,18 @@

Installing plugins

- Since version 3.5, hale studio supports the installation of plugins + Since version 3.5, hale»studio supports the installation of plugins via update sites. Update sites can be hosted on the internet or reside on your local disk.

- hale studio connectivity plugins enable users to directly access data in Oracle databases and ESRI File Geodatabases + hale»studio connectivity plugins enable users to directly access data in Oracle databases and ESRI File Geodatabases using the Oracle Database Reader/Writer and the FileGeodatabase Reader. The connectivity plugins are available to users with a - hale studio pro package. For more information, please contact + hale»studio pro package. For more information, please contact wetransform at info@wetransform.to.

- To install a new hale studio plugin, open the software installation dialog + To install a new hale»studio plugin, open the software installation dialog via the Help|Install new software... menu item and select the appropriate update site from the list.

@@ -48,7 +48,7 @@

Installing plugins

installation.

- In case you are installing unsigned plugins, hale studio will issue a security warning. + In case you are installing unsigned plugins, hale»studio will issue a security warning. Click Install anyway to proceed with the installation.

@@ -56,7 +56,7 @@

Installing plugins

style="max-width: 75%; display: block; margin-left: auto; margin-right: auto;">

- Once the installation is completed, hale studio will ask you to restart the application + Once the installation is completed, hale»studio will ask you to restart the application to apply the changes. The restart is necessary for the newly installed plugins to be available. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/main_workflow.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/main_workflow.html index bed935874c..b38d21b9a0 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/main_workflow.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/main_workflow.html @@ -10,15 +10,15 @@

First steps in hale studio

- hale studio is an application that strives to assist you in creating + hale»studio is an application that strives to assist you in creating schema mappings, allowing the transformation of data that conforms to - the source schema to data that is compliant to the target schema. hale studio + the source schema to data that is compliant to the target schema. hale»studio combines both the mapping creation and the transformation, facilitating an interactive mapping by giving feedback on each change to the mapping by transforming a given sample data set.

- A schema in hale studio is a collection of classes/types with + A schema in hale»studio is a collection of classes/types with well-defined properties/attributes. Schemas may be complex, i.e. the properties may again have properties themselves. Before starting with the mapping creation you should familiarize yourself with the source @@ -37,7 +37,7 @@

First steps in hale studio

online - or you can follow the instructions in the - command linkGet started with hale studio guide. + command linkGet started with hale»studio guide. It will show you a simple example project and get you going on starting your own alignment project.

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten.png index e282d298b0..8fb6b511a2 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten_perspective.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten_perspective.html index 3a605f1d7e..8f695606ee 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten_perspective.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/thorsten_perspective.html @@ -7,7 +7,7 @@

Thorsten perspective

The Thorsten perspective is how Thorsten works most efficiently - with hale studio. He likes to have schemas, data and the alignment in his + with hale»studio. He likes to have schemas, data and the alignment in his reach all the time. For creating the alignment he prefers an approach driven by sample data, so the data views and the map view play an important role in his favorite perspective.

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/workbench.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/workbench.png index 5e75b5b242..050b732a1e 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/workbench.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/getting_started/workbench.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_HALE.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_HALE.html index d0ae244362..447cecb32d 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_HALE.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_HALE.html @@ -2,16 +2,16 @@ -hale studio - The HUMBOLDT Alignment Editor +hale»studio - The HUMBOLDT Alignment Editor

hale studio - The HUMBOLDT Alignment Editor

The mapping of elements such as Feature Types and Attributes of one conceptual schema (e.g. GML Application Schemas, Database Schemas - or UML models) to another is a cornerstone of data harmonisation. The - HUMBOLDT Alignment Editor (hale studio) is a tool for defining and evaluating - conceptual schema mappings. hale studio allows domain experts to create + or UML models) to another is a cornerstone of data harmonization. The + HUMBOLDT Alignment Editor (hale»studio) is a tool for defining and evaluating + conceptual schema mappings. hale»studio allows domain experts to create logically and semantically consistent mappings and to transform geodata based on these mappings. Furthermore, a major focus is put on the documentation of the schema transformation process and its @@ -22,33 +22,33 @@

hale studio - The HUMBOLDT Alignment Editor

-

hale studio uses a high-level language for expressing the mappings. +

hale»studio uses a high-level language for expressing the mappings. They can later be used by the Conceptual Schema Transformer processing component to execute a data transformation, e.g. from a non-harmonised data source to a INSPIRE-compliant data set.

To make this complex process more accessible to domain experts - and to increase the quality of the transformations, hale studio allows + and to increase the quality of the transformations, hale»studio allows working with sample geodata (instances) for visualization and validation.

-

The value that hale studio provides to data custodians, i.e. +

The value that hale»studio provides to data custodians, i.e. maintainers of geographic datasets, is manifold:

    -
  • hale studio provides a unique declarative approach to making +
  • hale»studio provides a unique declarative approach to making interactive schema mapping a less daunting task;
  • -
  • hale studio is based on a powerful conceptual-level mapping paradigm +
  • hale»studio is based on a powerful conceptual-level mapping paradigm that makes mappings easier to understand and to maintain;
  • -
  • hale studio makes use of both the information in different +
  • hale»studio makes use of both the information in different conceptual schemas and of geographic instances to ensure high-quality mappings;
  • -
  • hale studio provides a rich, textual and graphical interface +
  • hale»studio provides a rich, textual and graphical interface specifically adopted for GI Experts;
  • -
  • hale studio gives instant feedback about the progress of mapping +
  • hale»studio gives instant feedback about the progress of mapping data from one schema to another, enabling throughout understanding of the transformation process;
  • -
  • hale studio enables collaborative creation of mappings;
  • -
  • With hale studio, users can furthermore document known limitations +
  • hale»studio enables collaborative creation of mappings;
  • +
  • With hale»studio, users can furthermore document known limitations of the mapping they are creating in the form of a unique Mismatch Description Language.
diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_dhp.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_dhp.html index 5149b16a8a..804991878b 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_dhp.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/introduction/introduction_dhp.html @@ -15,7 +15,7 @@

wetransform

Through the unique hale»studio data harmonisation technology and our hale»connect cloud platform, we make spatial and environmental data accessible and usable and thus provide the foundation for data ecosystems around topics such as Environmental Reporting, UAV Flight Zone Management and Forest Transformation.

We offer a wide range of services around data harmonisation for national and international standards and cover the whole process from transformation to publishing and quality assurance. Find out more on our website at www.wetransform.to!!

+ href="https://www.wetransform.to" target="_blank">www.wetransform.to!

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_0_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_0_0.xhtml index d92c7816e5..ecf554a6b3 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_0_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_0_0.xhtml @@ -3,10 +3,10 @@ -What's new in hale studio 3.0? +What's new in hale»studio 3.0? -

What's new in hale studio 3.0?

+

What's new in hale»studio 3.0?

It's time for a new major release, and it does come packed with many new features and improvements. First, you might notice the new name @@ -38,7 +38,7 @@

The majority of these new features were made possible through our contracts with more than 20 customers. We'd like to thank you all for your support!

As this is a major release, projects created with - hale studio 3.0 may be incompatible with previous versions of HALE.

+ hale»studio 3.0 may be incompatible with previous versions of HALE.

@@ -73,7 +73,7 @@ - - + - + - + - + - + @@ -74,7 +74,7 @@

Options

diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/save_project.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/save_project.html index e0d6fc61a2..a36aafc887 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/save_project.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/save_project.html @@ -7,7 +7,7 @@

Saving your work

- hale studio allows you to save your mapping, together with the + hale»studio allows you to save your mapping, together with the configuration which schemas and source data sets are used in an alignment project. The project also includes additional settings, e.g. the list of mapping relevant types and the map styles. You can @@ -40,7 +40,7 @@

Saving your work

  • With a hale connect transformation project you can upload your project including the alignment and all local resources to - the collaboration platform hale connect. + the collaboration platform hale»connect.
  • diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/inspire_schema.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/inspire_schema.html index 253f943e94..31c9755ac9 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/inspire_schema.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/inspire_schema.html @@ -12,13 +12,13 @@

    Using INSPIRE GML data models

    exchange formats for INSPIRE. One application of those exchange formats is the provision of data through INSPIRE Download services.

    - To use an INSPIRE GML data model in hale studio all you have to do is + To use an INSPIRE GML data model in hale»studio all you have to do is loading the corresponding GML Application Schema as source or target schema (see Loading and browsing schemas).
    The GML Application Schemas are provided by the European Commission. You can either use the schema - presets defined in hale studio (choose "From preset" when importing + presets defined in hale»studio (choose "From preset" when importing a schema) or the schema repository maintained by the JRC.

    @@ -27,7 +27,7 @@

    Using INSPIRE GML data models

    href="https://inspire.ec.europa.eu/data-specifications/2892" target="_blank">https://inspire.ec.europa.eu/data-specifications/2892

    -

    hale studio provides some pre-defined schema locations you can choose +

    hale»studio provides some pre-defined schema locations you can choose from - currently the INSPIRE schemas for Annex I, II and III in versions 3.0 and 4.0 are listed:

    @@ -44,7 +44,7 @@

    Using INSPIRE GML data models

    target="_blank">http://inspire.ec.europa.eu/draft-schemas/ (Draft schemas)

    The schemas available there are not meant for download - instead their URLs should be used to load them into - hale studio (e.g. by browsing the repository and using "Copy Link + hale»studio (e.g. by browsing the repository and using "Copy Link Location" for a schema file to copy its URL to the clipboard and further providing it in "From URL" when importing a schema).

    @@ -53,7 +53,7 @@

    Code lists

    The INSPIRE data models make heavy use of code lists. A lot of these code lists are provided through the INSPIRE - code list register. With hale studio you can easily load them to use them + code list register. With hale»studio you can easily load them to use them for a convenient selection from the available values. In the code list import, select "From INSPIRE registry" to download the current list of code lists and select a code list to load into the diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/load_browse_schema.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/load_browse_schema.html index 8f1729bb5e..4c375b19a2 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/load_browse_schema.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/schema/load_browse_schema.html @@ -10,7 +10,7 @@

    Loading and browsing schemas

    start with the creation of a mapping you have to determine what the source and target schemas are.

    - Loading a schema in hale studio provides you with the possibility to + Loading a schema in hale»studio provides you with the possibility to browse the schema in the Schema Explorer and to get detailed information on the defined types and their properties. @@ -50,7 +50,7 @@

    Target schema

    Supported schema formats

    - hale studio supports the following formats for schema import: + hale»studio supports the following formats for schema import:

    New Groovy Function Features Groovy Functions help when the functions we - ship with hale studio don't match specific requirements. To make + ship with hale»studio don't match specific requirements. To make them more powerful, we have added several new capabilities. The first of these is to output multiple features from a single Groovy Retype, Groovy Merge or Groovy Join function. You can use this @@ -144,7 +144,7 @@
    Read MS Access Databases MS Access databases are one of the most - common formats used in reporting and statistics. In hale studio, + common formats used in reporting and statistics. In hale»studio, you can now use MS Access databases to load source schemas and source data.

    Thanks to the European Environmental Agency for funding this diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_1_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_1_0.xhtml index 66f4d7def2..7957e76919 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_1_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_1_0.xhtml @@ -3,12 +3,12 @@ -What's new in hale studio 3.1? +What's new in hale»studio 3.1? -

    What's new in hale studio 3.1?

    +

    What's new in hale»studio 3.1?

    -

    hale studio 3.1 brings a couple of improvements and fixes. These +

    hale»studio 3.1 brings a couple of improvements and fixes. These are the most notable changes:

      @@ -42,7 +42,7 @@
    Microsoft SQL Serverhale studio now supports Microsoft SQL + hale»studio now supports Microsoft SQL Server as an additional type of database out of the box. This also includes support for geography and geometry data types.

    @@ -80,7 +80,7 @@

    Code lists in SKOS format are in wide use - not only for Linked Data. Now you can load SKOS resources as code - lists in hale studio, a SKOS concept represents an individual code. + lists in hale»studio, a SKOS concept represents an individual code.

    @@ -95,7 +95,7 @@ value restrictions in a schema, but also bring less safety in respect to validation. To check the data you create in respect to values from code lists you can now simply associate a code list to - a property - hale studio compares your data against the loaded code + a property - hale»studio compares your data against the loaded code list and informs you in case different values are used.

    @@ -110,7 +110,7 @@

    On your source schema you can define contexts for the mapping that are specified through a condition on a type or property, or an index of a property. When you have source - data loaded in hale studio you can now see directly how many + data loaded in hale»studio you can now see directly how many instances and values there are, that match these contexts.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_2_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_2_0.xhtml index abebd718f7..b718f0d37e 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_2_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_2_0.xhtml @@ -3,10 +3,10 @@ -What's new in hale studio 3.2? +What's new in hale»studio 3.2? -

    What's new in hale studio 3.2?

    +

    What's new in hale»studio 3.2?

    • Read interpolated Arc geometries from GML
    • @@ -58,7 +58,7 @@
    Multiple validators

    - hale studio's feature to validate exported XML and GML files has + hale»studio's feature to validate exported XML and GML files has been extended. It is now possible to configure multiple validators. Furthermore, a new type of validator, the Project validator has been added which allows validation of the export result based @@ -75,7 +75,7 @@

    WFS request pagination support

    - When loading from WFS sources, hale studio now supports request + When loading from WFS sources, hale»studio now supports request pagination, a capability that was introduced with the WFS 2.0 standard. This allows loading larger datasets from a WFS where previously this may have been limited by a server-side limit of retrievable features @@ -91,8 +91,8 @@

    Better UI support for project variables

    - The use of project variables, a feature that was introduced with hale - studio 3.0, is now easier as several wizards in hale studio have been + The use of project variables, a feature that was introduced with hale»studio 3.0, + is now easier as several wizards in hale»studio have been extended to provide content assistance. Simply press Ctrl+Space when inside a text field and choose the desired variable from a list. The content assistant will take care of the correct syntax. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_0.xhtml index 9b235053fb..bac427c55a 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_0.xhtml @@ -3,13 +3,13 @@ -What's new in hale studio 3.3? +What's new in hale»studio 3.3? -

    What's new in hale studio 3.3?

    +

    What's new in hale»studio 3.3?

      -
    • Load and share hale connect transformation projects
    • +
    • Load and share hale»connect transformation projects
    • Spatial Join transformation function
    • Use arbitrary SQL queries as a source for schemas and data
    @@ -33,11 +33,11 @@
    Load and share hale connect transformation projectsLoad and share hale»connect transformation projects

    - hale studio now comes with built-in support for the online - collaboration platform hale connect, where you can share + hale»studio now comes with built-in support for the online + collaboration platform hale»connect, where you can share transformation projects and discuss alignments with your colleagues. You can also browse transformation projects published by others, extend them and share them back publicly or within your organization. @@ -72,7 +72,7 @@

    Arbitrary SQL queries as a source for schemas and data

    - Database support in hale studio was further extended by + Database support in hale»studio was further extended by the possibility to tailor the schema and data import by custom SQL queries.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_1.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_1.xhtml index 402feb350d..13dbf74632 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_1.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_1.xhtml @@ -3,13 +3,13 @@ -What's new in hale studio 3.3.1? +What's new in hale»studio 3.3.1? -

    What's new in hale studio 3.3.1?

    +

    What's new in hale»studio 3.3.1?

      -
    • Save transformation projects directly to hale connect
    • +
    • Save transformation projects directly to hale»connect
    • Partition GML output into multiple files
    • Support for PostgreSQL Materialized Views
    @@ -33,14 +33,14 @@
    Save transformation projects directly to hale connectSave transformation projects directly to hale»connect

    - hale studio extends its integration with the online + hale»studio extends its integration with the online collaboration platform by allowing to save projects directly to - hale connect. This allows for a true online workflow + hale»connect. This allows for a true online workflow where your changes to a project that was saved to or loaded from - hale connect will be saved directly to the remote project + hale»connect will be saved directly to the remote project without the need of another export. You can switch back to an offline workflow at any time by saving your project to a local file on your computer. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_2.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_2.xhtml index 38ea3e74d3..2971ee4f04 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_2.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_3_2.xhtml @@ -3,13 +3,13 @@ -What's new in hale studio 3.3.2? +What's new in hale»studio 3.3.2? -

    What's new in hale studio 3.3.2?

    +

    What's new in hale»studio 3.3.2?

      -
    • Improved hale connect integration
    • +
    • Improved hale»connect integration
    • Enhanced CRS selection dialog
    • Character set detection for Shapefiles
    • Support for CQL functions in filter contexts
    • @@ -34,15 +34,15 @@
    Improved hale connect integrationImproved hale»connect integration

    - This release of hale studio improves the integration - with the online collaboration platform hale connect in + This release of hale»studio improves the integration + with the online collaboration platform hale»connect in a couple of ways. Firstly, it is now possible to select which organisation should own an uploaded transformation project for cases where the currently logged-in user is member of more than - one organisation. Furthermore, hale studio now supports + one organisation. Furthermore, hale»studio now supports a relogin with same or different credentials without having to clear the credentials stored in preferences.

    @@ -57,7 +57,7 @@

    When loading source data, the user is prompted to provide the - CRS of the contained coordinates. hale studio now + CRS of the contained coordinates. hale»studio now facilitates this by providing the content of the srsName attribute (in case of a GML source) or the WKT definition found in the projection file (.prj) that accompanies a Shape @@ -77,7 +77,7 @@ Importing a schema or source data from a Shapefile requires the user to select the encoding of the Shapefile. In cases where the Shape is accompanied by a Codepage file (.cpg), - hale studio can now read the encoding from that file + hale»studio can now read the encoding from that file a prefill the character set selection dialog.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_4_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_4_0.xhtml index 5a4e8fd00c..c1f6c3c20c 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_4_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_4_0.xhtml @@ -3,10 +3,10 @@ -What's new in hale studio 3.4? +What's new in hale»studio 3.4? -

    What's new in hale studio 3.4?

    +

    What's new in hale»studio 3.4?

    • Support for isolated workspaces in GeoServer App-Schema plugin
    • @@ -84,7 +84,7 @@ it possible to migrate a source project based on another project providing a schema mapping to the project's source. - In hale studio you can view tasks and messages generated by the + In hale»studio you can view tasks and messages generated by the merge with the new Tasks view.

      diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_5_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_5_0.xhtml index 7350998398..a456a6d3e9 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_5_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/3_5_0.xhtml @@ -3,10 +3,10 @@ -What's new in hale studio 3.5? +What's new in hale»studio 3.5? -

      What's new in hale studio 3.5?

      +

      What's new in hale»studio 3.5?

      • Deegree workspace configuration export
      • @@ -37,7 +37,7 @@

    A bit like the Geoserver App-Schema and Xtraserver configuration, it is now also - possible to generate deegree feature store configurations from hale studio alignments. + possible to generate deegree feature store configurations from hale»studio alignments. This feature is currently not available in the command line interface.

    @@ -53,7 +53,7 @@

    GML output partitioning by spatial extent

    - The GML/XML writer in hale studio already supported several partitioning modes, + The GML/XML writer in hale»studio already supported several partitioning modes, e.g. by Feature Type, or simply by feature count. We have now added support to partition output by spatial extent, using either a custom or a standard tile grid.

    @@ -70,14 +70,14 @@
    Support for plugin installation via update sites

    - The way to install plugins in hale studio has been improved: plugins can now be installed + The way to install plugins in hale»studio has been improved: plugins can now be installed and updated from within the application via Install new software... in the Help menu. More detailed instructions on how to use this new feature is available on the Installing plugins help page.

    The App-Schema plugin by Geosolutions is the first plugin that uses the new installation - method. Their corresponding update site is configured as a default in hale studio. + method. Their corresponding update site is configured as a default in hale»studio.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_0_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_0_0.xhtml index f622fa5534..2822f6fbbe 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_0_0.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_0_0.xhtml @@ -3,10 +3,10 @@ -What's new in hale studio 4.0? +What's new in hale»studio 4.0? -

    What's new in hale studio 4.0?

    +

    What's new in hale»studio 4.0?

    • Major updates to the documentation and help
    • @@ -31,7 +31,7 @@

      If you are a user of the hale studio pro plugins, you need to upgrade these as well. + target="_blank">hale»studio pro plugins, you need to upgrade these as well. Please reach out to the Servicedesk to get the new plug-ins.

      @@ -53,7 +53,7 @@ It doesn't have issues such as 11 character attribute limits, unknown encodings, missing or incomplete projection files, and is very fast to access.

      - For these reasons, there have been several requests to add GeoPackage to the list of supported formats for hale studio. + For these reasons, there have been several requests to add GeoPackage to the list of supported formats for hale»studio. We have now added a Reader and a Writer. The Writer can create GeoPackages from scratch, including the schema and metadata. This means you can even use an XML schema and then write your data to a GeoPackage. However, the required model transformations to make this work in complex cases are planned for the next release. @@ -71,7 +71,7 @@

    XPlanung is a standard for all kinds of spatial plans that is currently implemented by thousands of agencies all across Germany. - To make the work with XPlanGML in hale studio easier, we have added two features - Schema Presets for all releveant XPlanGML versions, + To make the work with XPlanGML in hale»studio easier, we have added two features - Schema Presets for all relevant XPlanGML versions, and a writer that creates XPlanAuszug files without requiring manual configuration. This writer furthermore supports writing the data to one file per plan object - so you will get a file that has, for example the BP_Plan, the BP_Bereich and all directly or indirectly referenced objects. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0.xhtml new file mode 100644 index 0000000000..ed35167e19 --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0.xhtml @@ -0,0 +1,69 @@ + + + + + +What's new in hale»studio 4.1? + + +

    What's new in hale»studio 4.1?

    + +
      +
    • Added support to select multiple files during the schema and the data import
    • +
    • Added support to remove a single schema from the project view
    • +
    • Added support to export the source and the transformed data to Shapefiles using GeoTools
    • +
    • Added presets for Environmental Noise Directive (END) schemas
    • +
    • Added support for create a spatial index when writing GeoPackage files
    • +
    • Various bug fixes and enhancements
    • +
    + +

    + For a full list of changes, please check out the changelog on GitHub +

    + +

    To avoid any compatibility issues when using an existing workspace, we recommend starting with a fresh one when you install + hale»studio 4.1.0

    + +

    The development work for this release was co-funded by the European Health and Digital Executive Agency (HaDEA) under Action No 2018-EU-IA-0093.

    + + + + + + + + + + + + + + + + + + + + +

    New features

    Import multiple files +

    + Until now, users could import only a single source schema or a single source data file. + However, from this release, the user can select multiple files during the schema import + or when importing source data. This allows the user to save a significant amount of time + when working with multiple files of the same format. +

    +

    + +

    +
    Shapefile writer +

    + This release adds the additional option to export source or transformed data as a Shapefile. +

    +

    + +

    +
    + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/export-shapefile.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/export-shapefile.png new file mode 100755 index 0000000000..f2cc6d026d Binary files /dev/null and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/export-shapefile.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/import-multiple-files.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/import-multiple-files.png new file mode 100755 index 0000000000..e0e858d3dc Binary files /dev/null and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/new/4_1_0_images/import-multiple-files.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/cql_filter.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/cql_filter.html index 7d9a8a9491..6c2cff6c73 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/cql_filter.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/cql_filter.html @@ -8,8 +8,8 @@

    CQL Filter

    The Common Query Language (CQL) is used to define expressions - and filters in several parts of hale studio. It can be used to define - conditions on schema elements or to filter instances. hale studio also + and filters in several parts of hale»studio. It can be used to define + conditions on schema elements or to filter instances. hale»studio also supports the extended CQL (ECQL) syntax as defined by Geotools.

    @@ -218,7 +218,7 @@

    Example filters

    project provided in the command linkGet started with hale studio guide, using the + alt="command link">Get started with hale»studio guide, using the Transformed Data view.

    Comparisons

    @@ -234,7 +234,7 @@

    Null

    details.address.city IS NOT NULL

    Supported filter operations

    Following is a list of filter operations that have been tested - with hale:

    + with hale»studio:

    Equal (=)

    @@ -334,7 +334,7 @@

    Spatial operations (CONTAINS,BBOX,...)

    literals defined must rely on source data having a specific reference system that is previously known.

    Note that spatial CQL filters only work on attributes that are - marked as geometry attributes in hale. It is right now not possible + marked as geometry attributes in hale»studio. It is right now not possible to apply them to parent attributes of geometry attributes directly.

    Examples

    CONTAINS(areaAttr, POINT(2 0))

    @@ -420,7 +420,7 @@

    Filter functions

    Unsupported operations

    -

    These are CQL filter operations that have been verified to not work with hale:

    +

    These are CQL filter operations that have been verified to not work with hale»studio:

    • EXISTS - use IS NOT NULL instead if possible
    • DOES-NOT-EXIST - use IS NULL instead if possible
    • diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/geopackage.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/geopackage.html new file mode 100644 index 0000000000..0e79a63f89 --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/geopackage.html @@ -0,0 +1,37 @@ + + + + +GeoPackage Data Export + + +

      GeoPackage Data Export

      +

      + The GeoPackage Writer can create GeoPackages from scratch, including the schema and metadata. + You can also use an XML schema and write your data to a GeoPackage, however the writer does not support complex structures. + The XML schema must consist of simple properties or properties that directly use a geometry type. +

      +
      + +
      + +
      + + + + + + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/html_mapping.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/html_mapping.html index 4f760d9241..de2ee12baa 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/html_mapping.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/html_mapping.html @@ -15,7 +15,7 @@

      HTML Mapping Documentation

      the example project from the command linkGet started with hale studio + alt="command link">Get started with hale»studio guide is provided as an example.

      To create the mapping documentation for your project, export the diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/images/geopackage.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/images/geopackage.png new file mode 100644 index 0000000000..83f43fa98b Binary files /dev/null and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/images/geopackage.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/jdbc.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/jdbc.html index c08e2a309f..6b85d41a50 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/jdbc.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/jdbc.html @@ -6,10 +6,10 @@

      Database Export

      -

      hale studio writes to databases using JDBC. hale studio +

      hale»studio writes to databases using JDBC. hale»studio offers support for PostgreSQL and PostGIS databases out of the box, support for other databases can be added through plug-ins.

      -

      The database export in this version of hale studio is +

      The database export in this version of hale»studio is deemed experimental. This means it does not have the full functionality we want to provide for a database export feature. However, within its limits it is functional and may be useful to you.

      @@ -26,7 +26,7 @@

      Database Export

      identifier assigned during transformation will be replaced by the auto-generated value.
    -

    When storing geometries in PostGIS, hale studio will try to detect the +

    When storing geometries in PostGIS, hale»studio will try to detect the spatial reference system associated to the target column and transform them appropriately.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/mssql.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/mssql.html index e30064fba9..99364439ab 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/mssql.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/mssql.html @@ -7,15 +7,15 @@

    MsSQL Server Export

    - Support for MsSQL Server in hale studio is based on the generic hale»studio is based on the generic Database export based on JDBC, and thus has the - same limitations. For instance hale studio needs the database schema to + same limitations. For instance hale»studio needs the database schema to already exist in SQL server, thus you can only write to database that have already been prepared and loaded as target schema.

    - hale studio supports writing both geometry and geography spatial data types + hale»studio supports writing both geometry and geography spatial data types of MsSQL Server but if any objects does not contain spatial reference system then (EPSG:4326) will be used as a default reference system. However, within this limit it is functional and may be useful to you. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/sqlite.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/sqlite.html index 46b7a6af77..e23bc6bd2b 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/sqlite.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/sqlite.html @@ -7,13 +7,13 @@

    SQLite and SpatiaLite Export

    - Support for SQLite and SpatiaLite in hale studio is based on the generic hale»studio is based on the generic Database export based on JDBC, and thus has the - same limitations. For instance hale studio needs the database schema to + same limitations. For instance hale»studio needs the database schema to already exist, thus you can only write to files that have already been prepared and loaded as target schema.

    -

    The database export in this version of hale studio is +

    The database export in this version of hale»studio is deemed experimental. This means it does not have the full functionality we want to provide for a database export feature. However, within its limits it is functional and may be useful to you.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/wfs.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/wfs.html index 8a34ef91ac..9b6328c464 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/wfs.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/wfs.html @@ -6,7 +6,7 @@

    Transactional WFS

    -

    hale studio supports publishing your transformed GML data to a WFS with +

    hale»studio supports publishing your transformed GML data to a WFS with support for transactions. Currently supported are Transactional Web Feature Services following the OGC WFS 1.1.0 or WFS 2.0.0 specifications. There are two different providers for publishing to @@ -25,7 +25,7 @@

    Transactional WFS

  • Keep instances that reference each other together: This is the default behaviour that used in previous versions of - hale studio. The partitioning is done based on the references + hale»studio. The partitioning is done based on the references between features. Features that are connected are kept together so the WFS-T is able to retain those references.
  • @@ -37,7 +37,7 @@

    Transactional WFS

    -

    The publishing to WFS in this version of hale studio is +

    The publishing to WFS in this version of hale»studio is deemed experimental. This means it does not have the full functionality we want to provide for a WFS publishing feature. However, within its limits it is functional and may be useful to you.

    @@ -49,15 +49,15 @@

    Transactional WFS

    messages in the transformation and export reports. There is no automatic recovery, features may have to be deleted manually if they are not desired to be published.
    -
    hale studio behaves like this because both transformation and GML +
    hale»studio behaves like this because both transformation and GML export aim to provide you a result even if there are small errors or inconsistencies.

    -
  • hale studio will not check the WFS Capabilities if the WFS +
  • hale»studio will not check the WFS Capabilities if the WFS supports any of the provided GML feature types.
  • Target location for the WFS-T export is the POST URL for the - WFS Transaction operation. The hale studio user interface provides a helper to + WFS Transaction operation. The hale»studio user interface provides a helper to determine that URL from the WFS capabilities.


    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xml_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xml_data.html index 6baaa56cd6..f6f3c34c6c 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xml_data.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xml_data.html @@ -25,7 +25,7 @@

    XML Data Export

    - When writing the transformed data, hale studio will try to find a + When writing the transformed data, hale»studio will try to find a valid XML path to write each of the transformed instances. If there are geometry objects contained in an instance, they are written as a GML geometry if possible. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xplan_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xplan_data.html new file mode 100644 index 0000000000..c78eed8c3f --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/export/xplan_data.html @@ -0,0 +1,35 @@ + + + + +XPlanGML Data Export + + +

    XPlanGML Data Export

    +

    + The support for exporting XPlanGML is covered by the XML Export. The XPlanGML Writer creates XPlanAuszug files without requiring manual configuration. + The Writer also supports writing the data to one file per plan object - so you will get a file that has, for example the BP_Plan, the BP_Bereich + and all directly or indirectly referenced objects. +

    + +
    + + + + + + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/csv.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/csv.html index ddb29547d5..f08607e977 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/csv.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/csv.html @@ -7,12 +7,12 @@

    CSV Import

    - Comma separated value (CSV) files can be used as a data source in hale studio, + Comma separated value (CSV) files can be used as a data source in hale»studio, with the schema definition also being derived from the CSV file.

    General CSV Import Options

    - When loading a CSV file, hale studio will try to auto-detect the + When loading a CSV file, hale»studio will try to auto-detect the settings for reading the file, i.e. which character is used to separate the values and what the quote and escape characters should be. You can correct the settings manually by choosing other characters diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/geopackage.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/geopackage.html new file mode 100644 index 0000000000..4543e044e4 --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/geopackage.html @@ -0,0 +1,17 @@ + + + + +GeoPackage Data Import + + +

    GeoPackage Data Import

    +

    + hale»studio supports the import of GeoPackages. + The GeoPackage first needs to be imported as schema, and then as data. +

    + +
    + + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_data.html index f9cef3912b..4648ca9153 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_data.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_data.html @@ -21,7 +21,7 @@

    GML Data Import

    Load data from a WFS

    - hale studio offers the possibility to load data based on a WFS GetFeature + hale»studio offers the possibility to load data based on a WFS GetFeature KVP request. You can specify the request URL manually or use the ... button to launch a wizard assisting you in building the URL from the service capabilities.

    @@ -35,7 +35,7 @@

    Load data from a WFS

    -

    When loading from WFS sources, hale studio supports request pagination, a capability that +

    When loading from WFS sources, hale»studio supports request pagination, a capability that was introduced with the WFS 2.0 standard. You can activate or deactivate request pagination on the XML/GML settings page. If activated, the number of features that will be retrieved per request can also be set. @@ -43,7 +43,7 @@

    Load data from a WFS

    Even though pagination was introduced in the WFS 2.0 standard, there are WFS server implementations available that support this feature for WFS 1.1.0 requests as well. If you know that the queried WFS supports this and activate - pagination, hale studio will paginate the requests also for WFS 1.1.0 requests. + pagination, hale»studio will paginate the requests also for WFS 1.1.0 requests.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_schema.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_schema.html index 9cf689b8f3..926c666a90 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_schema.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/gml_schema.html @@ -17,7 +17,7 @@

    GML Application Schema Import

    Load a schema from a WFS

    - hale studio offers the possibility to load a schema based on a WFS DescribeFeatureType + hale»studio offers the possibility to load a schema based on a WFS DescribeFeatureType KVP request. You can specify the request URL manually or use the ... button to launch a wizard assisting you in building the URL based on the service capabilities.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/jdbc.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/jdbc.html index 1aca765d0a..98080533de 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/jdbc.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/jdbc.html @@ -6,7 +6,7 @@

    Database Import

    -

    Database schemas and data are imported in hale studio using JDBC. hale studio +

    Database schemas and data are imported in hale»studio using JDBC. hale»studio offers support for Microsoft SQL Server, PostgreSQL and PostGIS databases out of the box, support for other databases can be added through plug-ins.

    The database import currently has the following known limitations:

    @@ -53,7 +53,7 @@

    Data import

    those types that are marked as mapping relevant.
    Before loading the data it is recommended to enable the selection of a sub-set as sample data (First n instances per type), so a - potentially big database is not loaded completely into hale studio just for + potentially big database is not loaded completely into hale»studio just for the analysis and mapping. This can be enabled in the tool bar or the project's source data settings.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/mssql.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/mssql.html index ccdc93378b..4ab1b6cfed 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/mssql.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/mssql.html @@ -7,12 +7,12 @@

    MsSQL Server Import

    - hale studio supports MsSQL Server database (tested version 2012 and 2014) import like generic + hale»studio supports MsSQL Server database (tested version 2012 and 2014) import like generic Database import based on JDBC. Thus has the same limitations.

    - hale studio supports both geometry and geography spatial data types + hale»studio supports both geometry and geography spatial data types of MsSQL Server but there are some limitations on curved spatial data objects.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/shapefile.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/shapefile.html index c22bd1060d..2acecd8d01 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/shapefile.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/shapefile.html @@ -7,7 +7,7 @@

    Shapefile (SHP) Import

    - Shapefiles can be used as a data source in hale studio, with the + Shapefiles can be used as a data source in hale»studio, with the schema definition also being derived from the Shapefile. Before importing a Shapefile as source data, you have to import it as source schema. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/sqlite.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/sqlite.html index 2882bc2c16..a737a91b04 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/sqlite.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/sqlite.html @@ -7,7 +7,7 @@

    SQLite and SpatiaLite Import

    - Support for SQLite and SpatiaLite in hale studio is based on the generic hale»studio is based on the generic Database import based on JDBC, and thus has the same limitations. For convenience, you can simply select a diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xls.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xls.html index bbbb6228eb..a1be5dba56 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xls.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xls.html @@ -7,7 +7,7 @@

    Excel File (XLS, XLSX) Import

    - Excel files can be used as a data source in hale studio. The + Excel files can be used as a data source in hale»studio. The schema definition can/should also be derived from this excel file, by using a headline or user input to define attribute names.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xml_schema.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xml_schema.html index 8e91b7b816..d5f7e2e0e5 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xml_schema.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xml_schema.html @@ -7,7 +7,7 @@

    XML Schema Import

    - hale studio supports loading schemas from XML Schema Definition (XSD) + hale»studio supports loading schemas from XML Schema Definition (XSD) files. XML elements and types will be analyzed in a given schema file, as well as in the included and imported additional schemas. Complex properties are supported, as well as cycles, substitutions, groups and diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xplan_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xplan_data.html new file mode 100644 index 0000000000..efdb041132 --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/import/xplan_data.html @@ -0,0 +1,24 @@ + + + + +XPlanGML Data Import + + +

    XPlanGML Data Import

    +

    + The hale»studio GML import supports XPlanGML. For more + information please see the GML Data Import +

    + +
    + +
    +
    +

    + GML Data Import +

    +
    + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/spatialite_common.xhtml b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/spatialite_common.xhtml index abf7fef14e..4dbc8a681d 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/spatialite_common.xhtml +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/reference/spatialite_common.xhtml @@ -11,18 +11,18 @@ To support SpatiaLite the mod_spatialite extension for SQLite must be available. For Windows users the - extension is provided together with hale studio, for other + extension is provided together with hale»studio, for other operating systems you may find it in your package manager or can compile it yourself.

    -

    hale studio specifically supports version 3 and 4 of SpatiaLite, but +

    hale»studio specifically supports version 3 and 4 of SpatiaLite, but should also work with previous versions. Please let us know if you experience any problems working with your files.

    SpatiaLite on Windows

    - hale studio ships with the SQLite extension mod_spatialite (Version 4.2.0), - which is available as DLLs in the main hale studio directory. You can + hale»studio ships with the SQLite extension mod_spatialite (Version 4.2.0), + which is available as DLLs in the main hale»studio directory. You can replace the library and its dependencies with different versions, e.g. as provided on the project page. diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/example_projects.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/example_projects.png new file mode 100644 index 0000000000..168d4ceb38 Binary files /dev/null and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/example_projects.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/resources_HALE.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/resources_HALE.html new file mode 100644 index 0000000000..5454568f0a --- /dev/null +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/resources/resources_HALE.html @@ -0,0 +1,61 @@ + + + + +Resources and Support + + +

    Resources and Support

    + +

    This section contains a list of links to a wide variety of helpful resources.

    + + Absolute beginners should start here + +

    The Getting Started section contains instructions on how to use the hale»studio help and how to navigate the UI. It also contains tutorial sections on core workflows in hale»studio.


    +
    + + Search for free text in the online help + +

    The hale»studio help page offers free text search to help you find the information you are looking for.


    +
    + +

    hale»studio desktop software offers a number of example transformation projects that you can load directly. The example projects contain mappings which use a variety of the functions available in hale»studio. + The example projects are a great way to gain familiarity with common use scenarios.The example projects can be accessed from the Help menu in hale»studio.


    +
    + +
    + +

    +
    + + + Watch the introductory webinar + +

    wetransform offers webinars on challenging topics throughout the year. Register for a webinar on our website.


    +
    + + Use the Support Forum + +

    We offer a support forum where you can post questions and view discussions going on in the user community.


    +
    + + Arrange an individual training (remote or on-premise) + +

    Call us at +49 6151 6290890. Wetransform offers a wide range of trainings and workshops on various topics including INSPIRE, and advanced use of hale»studio.


    +
    + + Get a professional support subscription + +

    A professional support contract can help you to achieve your goals more quickly. We provide complete end-to-end services, alleviating the need to struggle with complex requirements. In addition, we can provide you with the tools and training to do the work yourself. Please contact us at info@wetransform.to for more information.


    +
    + + + + diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/define_custom_function.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/define_custom_function.html index 683902af57..5568f9c214 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/define_custom_function.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/define_custom_function.html @@ -6,9 +6,9 @@

    Define a custom function

    -

    hale studio comes with a set of pre-defined transformation functions +

    hale»studio comes with a set of pre-defined transformation functions that cover most basic mapping cases. If you need other functionality - the easiest way is to define a custom function directly in hale studio. In a + the easiest way is to define a custom function directly in hale»studio. In a custom function you can use Groovy to determine the output, based on input and parameters, similar to the Groovy script function. The main difference to the Groovy script function is, that with a custom @@ -93,7 +93,7 @@

    Specify function behavior

    Function explanation

    -

    hale studio generates an explanation for mapping cells that reference specific +

    hale»studio generates an explanation for mapping cells that reference specific transformation functions. As a last step you have the opportunity to specify how this explanation is created for your custom function.

    The explanation can be a fixed text, or it can be a template @@ -104,12 +104,12 @@

    Function explanation

    To support both text and HTML explanations with a single template, - hale studio provides Markdown support using the hale»studio provides Markdown support using the pegdown Markdown processor.

    - To render the template hale studio uses the hale»studio uses the GStringTemplateEngine. The variables available to you in the template are the following: diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/edit.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/edit.png index dc0e3b4097..e946dd4de1 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/edit.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/edit.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/entity_selection.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/entity_selection.png index 5c2267836d..680c9cc9f1 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/entity_selection.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/entity_selection.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_create.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_create.png index a1c37fceb8..9fca357259 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_create.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_create.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_select.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_select.png index 9cc3668b6d..4c0a7ecc02 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_select.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/function_select.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/remove.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/remove.png index a32ec88532..81ffa7eaa1 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/remove.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/images/remove.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/mapping_schema_elem.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/mapping_schema_elem.html index 3fd11a7332..0a37447396 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/mapping_schema_elem.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/mapping_schema_elem.html @@ -7,7 +7,7 @@

    Mapping schema elements

    - The main purpose of hale studio is of course not to just inspect + The main purpose of hale»studio is of course not to just inspect schemas, but to map the elements of these schemas with the goal of transforming corresponding (geo)data sets.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/type_relations.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/type_relations.html index dd21d089fd..78a70ca2cc 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/type_relations.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/alignment/type_relations.html @@ -90,13 +90,13 @@

    Conditional relations

    Identify each type relation

    For the type correspondences as the next step you need to - identify how they can be expressed as relations in hale.

    + identify how they can be expressed as relations in hale»studio.

    The most simple kind of relation is a 1:1 relation - a correspondence between a single source and a single target type, where all information needed to populate a target instance is present in a single source instance - like in our River/Watercourse example. - This kind of relation is represented in hale by the hale»studio by the Retype function.

    diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/save_transformation.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/save_transformation.html index 6aacbf0ec2..d1e59fe840 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/save_transformation.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/save_transformation.html @@ -8,7 +8,7 @@

    Save the transformation result

    If you have defined a mapping and loaded source data in the - application, hale studio performs the transformation derived from the + application, hale»studio performs the transformation derived from the mapping on the source data. This happens on every change to the mapping, to instantly show the user what consequences his changes have. @@ -31,7 +31,7 @@

    Save the transformation result

    work based on a XML target schema.

    - Supported data export formats in hale studio are: + Supported data export formats in hale»studio are:

    • XML
    • diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/transform_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/transform_data.html index d6a7f9eca6..0303a89715 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/transform_data.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/transform_data.html @@ -7,7 +7,7 @@

      Transform external data

      To transform your data you don't need to load all of it into - hale studio. Usually it's a better practice to only load a representative + hale»studio. Usually it's a better practice to only load a representative sample of your data, to help you verify the mapping and quickly get feedback on its transformation. Once you have defined the mapping you have the possibility to transform your data without loading it into diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/validate_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/validate_data.html index 0cb7818f6f..9934012ead 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/validate_data.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/validate_data.html @@ -10,11 +10,11 @@

      Validate the transformed data

      transformation result to not only follow the schema's structure, but to also meet the other constraints defined by the schema, like mandatory properties or restrictions on property values.

      -

      Validation of instances in hale studio currently is supported for XML +

      Validation of instances in hale»studio currently is supported for XML based schemas. Validation can be done on the exported transformation result or on the transformed instances currently available in the application.

      -

      In addition to schema-based checks, hale studio supports validation of the +

      In addition to schema-based checks, hale»studio supports validation of the exported transformation result with Schematron. To perform Schematron validation, you can add the Schematron validator to the list of validators and configure it when exporting the transformed instances. @@ -35,7 +35,7 @@

      Validation of exported data

      produces a report about errors found during the validation and informs you whether the file is valid or not.

      -

      Validation inside hale studio

      +

      Validation inside hale»studio

      If a mapping exists and source data is loaded, each mapping change will trigger the live transformation (if activated). When the transformed data changes, schema-based validation is started @@ -73,10 +73,10 @@

      Validation inside hale studio

      -

      This kind of validation inside hale studio is very convenient, but may +

      This kind of validation inside hale»studio is very convenient, but may not be as accurate as the validation on export for some cases. This is due to the fact that the export itself may change the result slightly - from what is available in hale studio. This could for instance be encodings + from what is available in hale»studio. This could for instance be encodings that are only replied when writing certain properties, or values like identifiers that are generated when missing.

      diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/working_source_data.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/working_source_data.html index 9022571b74..02c3f27765 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/working_source_data.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/data/working_source_data.html @@ -8,12 +8,12 @@

      Working with a source data set

      The term source data refers to data according to the source - schema loaded in hale studio. Loading source data therefore always + schema loaded in hale»studio. Loading source data therefore always requires that the corresponding source schema has already been imported.

      - Loading source data in hale studio serves to provide feedback on the + Loading source data in hale»studio serves to provide feedback on the current mapping by transforming this data in the application. The Source Data view can be used to inspect the source data, while the Working with a source data set

      Configuring a sample data set

      You have the possibility to load only a sub-set of your data in - hale studio, to use it as a sample for the data analysis and transformation + hale»studio, to use it as a sample for the data analysis and transformation debugging. You can enable it in the tool bar or the project's source data settings. To open the settings use tool bar button highlighted below:

      @@ -61,7 +61,7 @@

      Sample data and transformation

      easily transform and export the complete data. Select TransformationTransform project data... from the menu to launch a wizard that will guide you through the export configuration and launch the transformation. While - the transformation runs you can continue working in hale studio, as the + the transformation runs you can continue working in hale»studio, as the transformation works on a copy of your current mapping.

      @@ -79,7 +79,7 @@

      Loading the data

      choose the one that applies.

      - Supported data import formats in hale studio are: + Supported data import formats in hale»studio are:

      • XML
      • diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/account.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/account.html index 694606e732..0fe809577e 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/account.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/account.html @@ -2,12 +2,12 @@ -Accessing your <i>hale connect</i> account +Accessing your <i>hale»connect</i> account

        Login

        - From hale studio you can login to your hale connect account + From hale»studio you can login to your hale»connect account either via the File menu or the Welcome page.

        @@ -19,7 +19,7 @@

        Login

        Save credentials checkbox. Your user name and password will be stored in a secure way. When you store your credentials for the first time, you will need to setup a master password for the secure - storage to protect it against unauthorized use. hale studio + storage to protect it against unauthorized use. hale»studio will query you for this password once every time the application is restarted as soon as the secure store is accessed for the first time.

        @@ -29,11 +29,11 @@

        Login

        Preferences

        You can edit the stored user name and password in the application - preferences dialog under hale connect. The credentials + preferences dialog under hale»connect. The credentials are saved by clicking Apply or closing the preferences dialog with OK. By clicking Validate credentials you can check whether the entered credentials are accepted by - hale connect. To remove stored credentials press + hale»connect. To remove stored credentials press Clear credentials or choose Log out and clear credentials from the File menu.

        diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/images/hale_connect_welcome.png b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/images/hale_connect_welcome.png index 6dcdf0267d..64ad36e4b7 100644 Binary files a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/images/hale_connect_welcome.png and b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/images/hale_connect_welcome.png differ diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/loadproject.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/loadproject.html index 073ffc6e56..5b4bba2cea 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/loadproject.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/loadproject.html @@ -2,22 +2,22 @@ -Accessing <i>hale connect</i> transformation projects +Accessing <i>hale»connect</i> transformation projects -

        Load a project from hale connect

        +

        Load a project from hale»connect

        - You can open hale connect transformation projects directly from - within hale studio. When you load a project from hale connect, + You can open hale»connect transformation projects directly from + within hale»studio. When you load a project from hale»connect, you can also save any changes you make directly back there. When a - project is loaded from hale connect, a [hale connect] label + project is loaded from hale»connect, a [hale connect] label will be shown in the application title.

        - To look for available projects online in hale connect, use the + To look for available projects online in hale»connect, use the FileOpen Alignment Project command and switch - to the From hale connect tab. In case you have not logged into - hale connect before, you can use the Login button on + to the From hale»connect tab. In case you have not logged into + hale»connect before, you can use the Login button on the screen shown below to log in.

        @@ -37,7 +37,7 @@

        Load a project from hale connect

        To continue, select the project you want to open from the list, and - press Finish twice to download the project into hale studio. + press Finish twice to download the project into hale»studio.

        \ No newline at end of file diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/shareproject.html b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/shareproject.html index ceaa401f6a..14fb99699d 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/shareproject.html +++ b/doc/plugins/eu.esdihumboldt.hale.doc.user/html/tasks/haleconnect/shareproject.html @@ -9,23 +9,23 @@

        Publishing a project

        There are two ways to publish a transformation project on - hale connect: + hale»connect:

        • By sharing the project with the FileShare project... command. This will export a snapshot of your current project to - hale connect. + hale»connect.
        • - By saving the project to hale connect + By saving the project to hale»connect just like you would save to a local project file using FileSave Alignment project as....
        In both cases you will be presented with the same wizard to complete - project details before the upload to hale connect. + project details before the upload to hale»connect.

        On the first screen of the wizard you are asked to provide the project @@ -33,21 +33,21 @@

        Publishing a project

        On the next page you are requested to provide the export destination. - In case you have not logged into hale connect before, you can + In case you have not logged into hale»connect before, you can use the Login button on the screen shown below to log in.

        - You can choose to either create a new project on hale connect + You can choose to either create a new project on hale»connect or update an existing one. In case the currently opened project - was loaded from hale connect, updating the loaded project + was loaded from hale»connect, updating the loaded project will be selected by default.

        You must also choose whether you will be the owner of the uploaded - project on hale connect or one of your organizations. You must + project on hale»connect or one of your organizations. You must select which of the organisations that you belong will own the uploaded project via the dropdown. Note that only the first option is available in cases where you are not allowed to add projects in the name of any of @@ -61,11 +61,11 @@

        Options

    Enable versioning?Enables versioning of the hale connect transformation project.Enables versioning of the hale»connect transformation project.
    Allow public access?If selected, the created or updated project will be publicly available on hale connect.If selected, the created or updated project will be publicly available on hale»connect.
    Include web resources?
    Exclude source data? - If selected, no source data will be uploaded to hale connect. This option is + If selected, no source data will be uploaded to hale»connect. This option is enabled by default to prevent the inadvertent upload of large datasets.
    -
    - -
    -
    - - - - - ci:NamedGeoObject - - -
    -
    - -
    -
    - - - - - ci:City - - -
    - - -
    - - -
    - - -
    -
    - - - -
    -
    -
    - - - - -
    -
    - - - - - - - ci:River - - -
    - -
    - -
    - - - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/cities-mapping.xml b/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/cities-mapping.xml deleted file mode 100644 index d304edb04c..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/cities-mapping.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - gml:AbstractFeature - - -
    -
    - -
    -
    - - - - - ci:NamedGeoObject - - -
    -
    - -
    -
    - - - - - ci:City - - -
    - - -
    - - -
    - - -
    -
    - - - -
    -
    -
    - - - - -
    -
    - - - - - - - ci:River - - -
    - -
    - -
    - - - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/simpledemo.halez b/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/simpledemo.halez deleted file mode 100755 index 61d57154a2..0000000000 Binary files a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/data/simpledemo.halez and /dev/null differ diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriterTest.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriterTest.java deleted file mode 100644 index 084be1f889..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver.test/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriterTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URL; - -import org.apache.commons.io.FileUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.google.common.io.Files; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter; -import eu.esdihumboldt.hale.common.align.model.Alignment; -import eu.esdihumboldt.hale.common.core.HalePlatform; -import eu.esdihumboldt.hale.common.core.io.IOProvider; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfoAware; -import eu.esdihumboldt.hale.common.core.io.project.model.Project; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier; -import eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment; -import eu.esdihumboldt.hale.common.headless.test.AbstractProjectTest; -import eu.esdihumboldt.hale.common.instance.io.InstanceReader; -import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; - -@SuppressWarnings("javadoc") -public class XtraServerMappingFileWriterTest extends AbstractProjectTest { - - private static final ALogger log = ALoggerFactory - .getLogger(XtraServerMappingFileWriterTest.class); - - private static final String PROJECT_LOCATION = "/data/simpledemo.halez"; - - private SchemaSpace sourceSchemaSpace; - private SchemaSpace targetSchemaSpace; - - private Project project; - private Alignment alignment; - private File tempDir; - - @Before - public void loadTestProject() { - try { - URL archiveLocation = XtraServerMappingFileWriterTest.class - .getResource(PROJECT_LOCATION); - assertNotNull(archiveLocation); - ProjectTransformationEnvironment projectTransformationEnvironment = this - .getProject(archiveLocation); - - this.project = projectTransformationEnvironment.getProject(); - this.alignment = projectTransformationEnvironment.getAlignment(); - this.sourceSchemaSpace = projectTransformationEnvironment.getSourceSchema(); - this.targetSchemaSpace = projectTransformationEnvironment.getTargetSchema(); - this.tempDir = Files.createTempDir(); - - } catch (Exception e) { - log.error("Exception occurred", e); - fail("Test project could not be loaded: " + e.getMessage()); - } - } - - @After - public void cleanUp() throws IOException { - if (tempDir != null && tempDir.exists()) { - FileUtils.deleteDirectory(tempDir); - } - } - - @Test - public void testProject() { - assertNotNull(project); - assertNotNull(alignment); - assertEquals(2, alignment.getTypeCells().size()); - } - - @Test - public void testWriteMappingFile() throws Exception { - - final File targetFile = File.createTempFile(Long.toString(System.currentTimeMillis()), - ".xml", tempDir); - - try { - writeAlignment(targetFile, XtraServerMappingFileWriter.CONTENT_TYPE_MAPPING); - - assertTrue(targetFile.exists()); - assertTrue(targetFile.length() > 0); - } finally { - if (targetFile != null) - targetFile.delete(); - } - - } - - @Test - public void testWriteArchive() throws Exception { - - final File targetFile = File.createTempFile(Long.toString(System.currentTimeMillis()), - ".zip", tempDir); - - try { - writeAlignment(targetFile, XtraServerMappingFileWriter.CONTENT_TYPE_ARCHIVE); - - assertTrue(targetFile.exists()); - assertTrue(targetFile.length() > 0); - } finally { - if (targetFile != null) - targetFile.delete(); - } - - } - - private void writeAlignment(File targetFile, String contentType) - throws IOException, IOProviderConfigurationException { - AbstractAlignmentWriter alignWriter = new XtraServerMappingFileWriter(); - prepareProvider(alignWriter, project, tempDir.toURI()); - alignWriter.setAlignment(alignment); - alignWriter.setSourceSchema(sourceSchemaSpace); - alignWriter.setTargetSchema(targetSchemaSpace); - alignWriter.setTarget(new FileIOSupplier(targetFile)); - alignWriter - .setContentType(HalePlatform.getContentTypeManager().getContentType(contentType)); - - IOReport report = alignWriter.execute(new LogProgressIndicator()); - assertNotNull(report); - assertTrue(report.isSuccess()); - } - - // adapted from DefaultIOAdvisor and subclasses - private void prepareProvider(IOProvider provider, ProjectInfo projectInfo, - URI projectLocation) { - if (provider instanceof ProjectInfoAware) { - ProjectInfoAware pia = (ProjectInfoAware) provider; - pia.setProjectInfo(projectInfo); - pia.setProjectLocation(projectLocation); - } - if (provider instanceof InstanceReader) { - InstanceReader ir = (InstanceReader) provider; - ir.setSourceSchema(sourceSchemaSpace); - } - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/edu.umd.cs.findbugs.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/edu.umd.cs.findbugs.core.prefs deleted file mode 100644 index 33d36c417c..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/edu.umd.cs.findbugs.core.prefs +++ /dev/null @@ -1,132 +0,0 @@ -#Created from default preferences 12-mag-2015 16.01.18 -#Tue May 12 16:01:18 CEST 2015 -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.xtraserver/.settings/org.eclipse.core.resources.prefs b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 8bd9f5c233..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 12-mag-2015 16.01.18 -#Tue May 12 16:01:18 CEST 2015 -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.jdt.ui.prefs b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 46646fbb60..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.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.xtraserver/.settings/org.eclipse.pde.core.prefs b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index cca138bc6a..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Created from default preferences 12-mag-2015 16.01.18 -#Tue May 12 16:01:18 CEST 2015 -eclipse.preferences.version=1 -resolve.requirebundle=false diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.pde.prefs b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.settings/org.eclipse.pde.prefs deleted file mode 100644 index fae5965fb0..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/.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.xtraserver/META-INF/MANIFEST.MF b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/META-INF/MANIFEST.MF deleted file mode 100644 index bcd91c2e14..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/META-INF/MANIFEST.MF +++ /dev/null @@ -1,80 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: XtraServer Mapping I/O -Bundle-SymbolicName: eu.esdihumboldt.hale.io.xtraserver;singleton:=true -Bundle-Version: 4.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Vendor: interactive instruments GmbH -Require-Bundle: eu.esdihumboldt.hale.common.instance, - org.eclipse.core.runtime;bundle-version="3.6.0", - eu.esdihumboldt.hale.common.align, - org.apache.velocity;bundle-version="1.6.2", - de.interactive_instruments.xtraserver-config-util;bundle-version="[1.0.0,1.1.0)", - eu.esdihumboldt.hale.io.jdbc;bundle-version="3.4.0" -Import-Package: com.google.common.base;version="17.0.0", - com.google.common.collect;version="1.0.0", - com.google.common.io;version="17.0.0", - de.fhg.igd.eclipse.util.extension, - de.fhg.igd.slf4jplus, - eu.esdihumboldt.cst.functions.core, - eu.esdihumboldt.cst.functions.geometric.extent, - eu.esdihumboldt.cst.functions.groovy, - eu.esdihumboldt.cst.functions.numeric, - eu.esdihumboldt.cst.functions.string, - eu.esdihumboldt.hale.common.align.extension.function, - eu.esdihumboldt.hale.common.align.io.impl, - eu.esdihumboldt.hale.common.align.io.impl.internal.generated;version="2.9.3", - eu.esdihumboldt.hale.common.align.model, - eu.esdihumboldt.hale.common.align.model.functions, - eu.esdihumboldt.hale.common.align.model.impl, - eu.esdihumboldt.hale.common.core, - eu.esdihumboldt.hale.common.core.io, - eu.esdihumboldt.hale.common.core.io.extension, - eu.esdihumboldt.hale.common.core.io.impl, - eu.esdihumboldt.hale.common.core.io.project, - eu.esdihumboldt.hale.common.core.io.project.model, - eu.esdihumboldt.hale.common.core.io.report, - eu.esdihumboldt.hale.common.core.io.report.impl, - eu.esdihumboldt.hale.common.core.io.supplier, - eu.esdihumboldt.hale.common.core.report, - eu.esdihumboldt.hale.common.core.service, - eu.esdihumboldt.hale.common.filter, - eu.esdihumboldt.hale.common.lookup, - eu.esdihumboldt.hale.common.schema, - eu.esdihumboldt.hale.common.schema.io, - eu.esdihumboldt.hale.common.schema.io.impl, - eu.esdihumboldt.hale.common.schema.model, - eu.esdihumboldt.hale.common.schema.model.constraint, - eu.esdihumboldt.hale.common.schema.model.constraint.property, - eu.esdihumboldt.hale.common.schema.model.constraint.type, - eu.esdihumboldt.hale.common.schema.model.impl, - eu.esdihumboldt.hale.common.schema.model.impl.internal, - eu.esdihumboldt.hale.common.schema.persist, - eu.esdihumboldt.hale.io.xsd.constraint, - eu.esdihumboldt.hale.io.xsd.model, - eu.esdihumboldt.hale.io.xsd.reader.internal.constraint, - eu.esdihumboldt.hale.util.nonosgi.contenttype.describer, - eu.esdihumboldt.util.definition, - eu.esdihumboldt.util.groovy.paths, - eu.esdihumboldt.util.io, - org.apache.commons.io;version="2.4.0", - org.apache.commons.io.filefilter;version="2.4.0", - org.apache.commons.lang;version="2.6.0", - org.apache.http;version="4.3.2", - org.apache.http.client;version="4.3.3", - org.apache.http.client.fluent;version="4.3.6", - org.apache.http.client.utils;version="4.3.6", - org.apache.http.entity;version="4.3.3", - org.apache.http.protocol;version="4.3.3", - org.apache.http.util;version="4.3.3", - org.apache.ws.commons.schema;version="1.4.7", - org.apache.xmlbeans;version="2.4.0", - org.geotools.filter;version="12.2.0.combined", - org.geotools.filter.text.cql2, - org.geotools.filter.visitor;version="12.2.0.combined", - org.opengis.filter;version="12.2.0", - org.opengis.filter.expression, - org.slf4j;version="1.5.11" -Export-Package: eu.esdihumboldt.hale.io.xtraserver.reader, - eu.esdihumboldt.hale.io.xtraserver.writer -Automatic-Module-Name: eu.esdihumboldt.hale.io.xtraserver diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/plugin.xml b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/plugin.xml deleted file mode 100644 index 026c341137..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/plugin.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/compatibility/XtraServerCompatibilityMode.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/compatibility/XtraServerCompatibilityMode.java deleted file mode 100644 index b29b6ac918..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/compatibility/XtraServerCompatibilityMode.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.compatibility; - -import com.google.common.collect.ListMultimap; - -import de.fhg.igd.slf4jplus.ALogger; -import de.fhg.igd.slf4jplus.ALoggerFactory; -import eu.esdihumboldt.hale.common.align.compatibility.CompatibilityMode; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.Condition; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.core.service.ServiceProvider; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.PropertyTransformationHandler; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler; - -/** - * Compatibility mode for XtraServer configuration mapping files - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class XtraServerCompatibilityMode implements CompatibilityMode { - - private static final ALogger logger = ALoggerFactory - .getLogger(XtraServerCompatibilityMode.class); - - /** - * Check all supported functions by delegating to the Type and Property - * Transformation Handlers - * - * @see eu.esdihumboldt.hale.common.align.compatibility.CompatibilityMode#supportsFunction(java.lang.String, - * eu.esdihumboldt.hale.common.core.service.ServiceProvider) - */ - @Override - public boolean supportsFunction(final String functionId, ServiceProvider serviceProvider) { - boolean supported = TypeTransformationHandler.isTransformationSupported(functionId) - || PropertyTransformationHandler.isTransformationSupported(functionId); - if (!supported) { - logger.debug("Function {} is not supported by the XtraServer plugin", supported); - } - return supported; - } - - /** - * Rejects filters - * - * @see eu.esdihumboldt.hale.common.align.compatibility.CompatibilityMode#supportsCell(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public boolean supportsCell(Cell cell) { - final ListMultimap entities = cell.getSource(); - if (entities == null) { - return true; - } - if (hasFilters(entities)) { - logger.warn("Filters are not supported"); - return false; - } - - return true; - } - - /** - * Returns true if Filters are found in the entity definitions or the - * property paths - * - * @param entities entities to check - * @return true if filters are found, false otherwise - */ - public static boolean hasFilters(final ListMultimap entities) { - for (Entity entity : entities.values()) { - for (ChildContext context : entity.getDefinition().getPropertyPath()) { - final Condition cond = context.getCondition(); - if (cond != null && cond.getFilter() != null) { - return true; - } - } - } - return false; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/XtraServerMappingFileReader.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/XtraServerMappingFileReader.java deleted file mode 100644 index 246b9707b3..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/XtraServerMappingFileReader.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader; - -import java.io.IOException; -import java.io.InputStream; - -import de.interactive_instruments.xtraserver.config.api.XtraServerMapping; -import de.interactive_instruments.xtraserver.config.io.XtraServerMappingFile; -import de.interactive_instruments.xtraserver.config.transformer.XtraServerMappingTransformer; -import eu.esdihumboldt.hale.common.align.io.EntityResolver; -import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentReader; -import eu.esdihumboldt.hale.common.align.model.MutableAlignment; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl; -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; -import eu.esdihumboldt.hale.io.xtraserver.reader.handler.AlignmentGenerator; - -/** - * Reads an XtraServer Mapping file into an Alignment . - * - * @author zahnen - */ -public class XtraServerMappingFileReader extends AbstractAlignmentReader { - - /** - * @see eu.esdihumboldt.hale.common.core.io.IOProvider#isCancelable() - */ - @Override - public boolean isCancelable() { - return false; - } - - /** - * @see eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentReader#loadAlignment(eu.esdihumboldt.hale.common.core.io.ProgressIndicator, - * eu.esdihumboldt.hale.common.core.io.report.IOReporter) - */ - @Override - protected MutableAlignment loadAlignment(ProgressIndicator progress, IOReporter reporter) - throws IOProviderConfigurationException, IOException { - - progress.begin("Initializing", ProgressIndicator.UNKNOWN); - - final TypeIndex schemaspace = getTargetSchema(); - if (schemaspace == null) { - reporter.error("Load the target schema first!"); - reporter.setSuccess(false); - return null; - } - if (!(schemaspace instanceof SchemaSpace)) { - throw new IllegalArgumentException( - "Unknown target schema type: " + schemaspace.getClass()); - } - - EntityResolver entityResolver = null; - if (getServiceProvider() != null) { - entityResolver = getServiceProvider().getService(EntityResolver.class); - } - TypeIndex sourceTypes = getSourceSchema(); - TypeIndex targetTypes = getTargetSchema(); - - final Schema schema = ((SchemaSpace) schemaspace).getSchemas().iterator().next(); - - final MutableAlignment alignment; - - try (final InputStream in = getSource().getInput()) { - - progress.setCurrentTask("Loading XtraServer Mapping file"); - - final XtraServerMapping xtraServerMapping = XtraServerMappingFile.read().fromStream(in); - - final XtraServerMapping flatXtraServerMapping = XtraServerMappingTransformer - .forMapping(xtraServerMapping).applySchemaInfo(schema.getLocation()) - .flattenInheritance().transform(); - - final AlignmentGenerator haleAlignmentGenerator = new AlignmentGenerator( - sourceTypes, targetTypes, entityResolver, progress, reporter, - flatXtraServerMapping); - - alignment = haleAlignmentGenerator.generate(); - - } catch (Exception e) { - reporter.error(new IOMessageImpl(e.getMessage(), e)); - reporter.setSuccess(false); - return null; - } - - progress.end(); - reporter.setSuccess(true); - - return alignment; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractPropertyTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractPropertyTransformationHandler.java deleted file mode 100644 index 2cdb01a154..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractPropertyTransformationHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import javax.xml.namespace.QName; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import eu.esdihumboldt.hale.common.align.model.MutableCell; -import eu.esdihumboldt.hale.common.align.model.impl.DefaultCell; - -/** - * Abstract Property Transformation Handler - * - * @author zahnen - */ -abstract class AbstractPropertyTransformationHandler implements PropertyTransformationHandler { - - private final static String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; - - protected final TransformationContext transformationContext; - - protected AbstractPropertyTransformationHandler( - final TransformationContext transformationContext) { - this.transformationContext = transformationContext; - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.reader.handler.TransformationHandler#handle(java.lang.Object, - * java.lang.String) - */ - @Override - public MutableCell handle(final MappingValue mappingValue, final String tableName) { - // ignore xsi:nil - QName lastPathElement = mappingValue.getQualifiedTargetPath() - .get(mappingValue.getQualifiedTargetPath().size() - 1); - if (lastPathElement.getNamespaceURI().equals(XSI_NS) - && lastPathElement.getLocalPart().equals("@nil")) { - return null; - } - - final String transformationIdentifier = doHandle(mappingValue, tableName); - - final MutableCell propertyCell = new DefaultCell(); - - propertyCell.setTransformationIdentifier(transformationIdentifier); - - if (transformationContext.hasCurrentSourceProperty()) { - propertyCell.setSource(transformationContext.getCurrentSourcePropertyEntities()); - } - propertyCell.setTarget(transformationContext.getCurrentTargetPropertyEntities()); - - propertyCell - .setTransformationParameters(transformationContext.getCurrentPropertyParameters()); - - return propertyCell; - } - - protected abstract String doHandle(final MappingValue mappingValue, final String tableName); - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractTypeTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractTypeTransformationHandler.java deleted file mode 100644 index 24eab8862a..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AbstractTypeTransformationHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import eu.esdihumboldt.hale.common.align.model.MutableCell; -import eu.esdihumboldt.hale.common.align.model.impl.DefaultCell; - -/** - * Abstract Type Transformation Handler - * - * @author zahnen - */ -abstract class AbstractTypeTransformationHandler implements TypeTransformationHandler { - - protected final TransformationContext transformationContext; - - protected AbstractTypeTransformationHandler(final TransformationContext transformationContext) { - this.transformationContext = transformationContext; - } - - @Override - public final MutableCell handle(final FeatureTypeMapping featureTypeMapping, - final String tableName) { - - transformationContext.nextTypeTransformation(tableName, featureTypeMapping); - - final String transformationIdentifier = doHandle(featureTypeMapping, tableName); - - final MutableCell typeCell = new DefaultCell(); - - typeCell.setTransformationIdentifier(transformationIdentifier); - - typeCell.setSource(transformationContext.getCurrentSourceTypeEntities()); - typeCell.setTarget(transformationContext.getCurrentTargetTypeEntities()); - - typeCell.setTransformationParameters(transformationContext.getCurrentTypeParameters()); - - return typeCell; - } - - public abstract String doHandle(final FeatureTypeMapping featureTypeMapping, - final String primaryTableName); - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AlignmentGenerator.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AlignmentGenerator.java deleted file mode 100644 index db942c16fb..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AlignmentGenerator.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.Optional; -import java.util.function.Function; -import java.util.stream.Stream; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.MappingTable; -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.XtraServerMapping; -import eu.esdihumboldt.hale.common.align.io.EntityResolver; -import eu.esdihumboldt.hale.common.align.model.MutableAlignment; -import eu.esdihumboldt.hale.common.align.model.MutableCell; -import eu.esdihumboldt.hale.common.align.model.impl.DefaultAlignment; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; - -/** - * Transforms a {@link XtraServerMapping} to a {@link MutableAlignment} - * - * @author zahnen - */ -public class AlignmentGenerator { - - private final TransformationContext transformationContext; - private final TypeTransformationHandlerFactory typeHandlerFactory; - private final PropertyTransformationHandlerFactory propertyHandlerFactory; - private final XtraServerMapping xtraServerMapping; - - /** - * @param sourceTypes source types - * @param targetTypes target types - * @param entityResolver entity resolver - * @param progress progress indicator - * @param reporter reporter - * @param xtraServerMapping XtraServer Mapping - * - */ - public AlignmentGenerator(final TypeIndex sourceTypes, final TypeIndex targetTypes, - final EntityResolver entityResolver, final ProgressIndicator progress, - final IOReporter reporter, final XtraServerMapping xtraServerMapping) { - this.transformationContext = new TransformationContext(sourceTypes, targetTypes, - entityResolver, progress, reporter); - this.typeHandlerFactory = TypeTransformationHandler.createFactory(transformationContext); - this.propertyHandlerFactory = PropertyTransformationHandler - .createFactory(transformationContext); - this.xtraServerMapping = xtraServerMapping; - } - - /** - * @return the generated alignment - */ - public MutableAlignment generate() { - final MutableAlignment alignment = new DefaultAlignment(); - - xtraServerMapping.getFeatureTypeMappings().stream().flatMap(generateFeatureTypeCellStream()) - .forEach(cell -> alignment.addCell(cell)); - - return alignment; - } - - private Function> generateFeatureTypeCellStream() { - return featureTypeMapping -> featureTypeMapping.getPrimaryTables().stream() - .flatMap(generateTableCellStream(featureTypeMapping, false)); - } - - private Function> generateTableCellStream( - final FeatureTypeMapping featureTypeMapping, final boolean isJoined) { - return mappingTable -> { - - final Stream propertyCellStream = mappingTable.getValues().stream() - .peek(mappingValue -> System.out.println(mappingValue.getTargetPath())) - .map(generatePropertyCell(featureTypeMapping.getName(), mappingTable.getName())) - .filter(Optional::isPresent).map(Optional::get); - - // recurse - final Stream joinedPropertyCellStream = mappingTable.getJoiningTables() - .stream().flatMap(generateTableCellStream(featureTypeMapping, true)); - - final Stream cellStream = Stream.concat(propertyCellStream, - joinedPropertyCellStream); - - if (isJoined) { - return cellStream; - } - else { - final Optional typeHandler = typeHandlerFactory - .create(featureTypeMapping, mappingTable.getName()); - - if (typeHandler.isPresent()) { - final MutableCell typeCell = typeHandler.get().handle(featureTypeMapping, - mappingTable.getName()); - - return Stream.concat(Stream.of(typeCell), cellStream); - } - else { - transformationContext.getReporter().warn( - "Mapping for feature type \"{0}\" could not be imported", - featureTypeMapping.getName()); - } - - return Stream.empty(); - } - }; - } - - private Function> generatePropertyCell( - final String featureTypeName, final String tableName) { - return mappingValue -> { - final Optional propertyHandler = propertyHandlerFactory - .create(mappingValue); - - if (propertyHandler.isPresent()) { - return Optional.ofNullable(propertyHandler.get().handle(mappingValue, tableName)); - - } - else { - transformationContext.getReporter().warn( - "Mapping for property \"{0}\" of feature type \"{1}\" could not be imported", - mappingValue.getTargetPath(), featureTypeName); - } - - return Optional.empty(); - }; - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AssignHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AssignHandler.java deleted file mode 100644 index 901a07517a..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/AssignHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.Map; -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; - -/** - * Transforms a {@link MappingValue} to a {@link AssignFunction} - * - * @author zahnen - */ -class AssignHandler extends AbstractPropertyTransformationHandler { - - AssignHandler(final TransformationContext transformationContext) { - super(transformationContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.reader.handler.AbstractPropertyTransformationHandler#doHandle(de.interactive_instruments.xtraserver.config.api.MappingValue, - * java.lang.String) - */ - @Override - public String doHandle(final MappingValue mappingValue, final String tableName) { - - Optional bindValue = Optional. empty(); - - if (isAttribute(mappingValue.getTargetPath())) { - final String parentTarget = mappingValue.getTargetPath().substring(0, - mappingValue.getTargetPath().lastIndexOf('/')); - - bindValue = transformationContext.getCurrentFeatureTypeMapping() - .getTableValuesForPath(parentTarget).entrySet().stream() - .filter(entry -> entry.getKey().getName().equals(tableName)) - .map(Map.Entry::getValue).filter(value -> !value.getValueColumns().isEmpty()) - .map(value -> value.getValueColumns().get(0)).findFirst(); - } - - if (bindValue.isPresent()) { - transformationContext.nextPropertyTransformation(mappingValue.getQualifiedTargetPath(), - tableName, "anchor", bindValue.get()); - } - else { - transformationContext.nextPropertyTransformation(mappingValue.getQualifiedTargetPath()); - } - - transformationContext.getCurrentPropertyParameters().put("value", - new ParameterValue(mappingValue.getValue())); - - return bindValue.isPresent() ? AssignFunction.ID_BOUND : AssignFunction.ID; - } - - private boolean isAttribute(String propertyPath) { - return propertyPath.contains("/@"); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/FormattedStringHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/FormattedStringHandler.java deleted file mode 100644 index f34464bbfc..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/FormattedStringHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction; - -/** - * Transforms a {@link MappingValue} to a {@link FormattedStringFunction} - * - * @author zahnen - */ -class FormattedStringHandler extends AbstractPropertyTransformationHandler { - - private static final Pattern EXPRESSION_PATTERN = Pattern.compile( - "(?:(?:'(?[^']*?)')|(?:(?:\\$T\\$\\.)(?[\\S]+)))(?:\\s*\\|\\|\\s*)?"); - - FormattedStringHandler(final TransformationContext transformationContext) { - super(transformationContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.reader.handler.AbstractPropertyTransformationHandler#doHandle(de.interactive_instruments.xtraserver.config.api.MappingValue, - * java.lang.String) - */ - @Override - public String doHandle(final MappingValue mappingValue, final String tableName) { - - final Matcher matcher = EXPRESSION_PATTERN.matcher(mappingValue.getValue()); - final StringBuilder pattern = new StringBuilder(); - final List columns = new ArrayList<>(); - - while (matcher.find()) { - String text = matcher.group("text"); - String column = matcher.group("column"); - - if (text != null) { - pattern.append(text); - } - else if (column != null) { - pattern.append('{').append(column).append('}'); - columns.add(column); - } - } - - if (columns.isEmpty()) { - throw new IllegalArgumentException( - "Expression could not be parsed: " + mappingValue.getValue()); - } - - transformationContext.nextPropertyTransformation(mappingValue.getQualifiedTargetPath(), - tableName, "var", columns.toArray(new String[0])); - - transformationContext.getCurrentPropertyParameters().put("pattern", - new ParameterValue(pattern.toString())); - - return FormattedStringFunction.ID; - } - - static boolean isFormattedStringExpression(String expression) { - Matcher matcher = EXPRESSION_PATTERN.matcher(expression); - boolean matches = false; - - do { - matches = matcher.find(); - } while (matches && !matcher.hitEnd()); - - return matches; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/JoinHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/JoinHandler.java deleted file mode 100644 index a238bb045b..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/JoinHandler.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.HashSet; -import java.util.Optional; -import java.util.Set; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.MappingJoin; -import de.interactive_instruments.xtraserver.config.api.MappingTable; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; -import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter; -import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.core.io.Value; - -/** - * Transforms a {@link FeatureTypeMapping} to a {@link JoinFunction} - * - * @author zahnen - */ -class JoinHandler extends AbstractTypeTransformationHandler { - - private final Set seenTables; - - JoinHandler(final TransformationContext mappingContext) { - super(mappingContext); - this.seenTables = new HashSet<>(); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public String doHandle(final FeatureTypeMapping featureTypeMapping, - final String primaryTableName) { - - final Optional primaryTable = featureTypeMapping.getTable(primaryTableName); - - if (!primaryTable.isPresent()) { - throw new IllegalArgumentException("Primary table not found: " + primaryTableName); - } - - seenTables.add(primaryTableName); - - final Set joinConditions = primaryTable.get().getAllJoiningTablesStream() - .filter(isNotJoinedYet()).filter(hasValues()) - .flatMap(joinedTable -> joinedTable.getJoinPaths().stream()) - .flatMap(joinPath -> joinPath.getJoinConditions().stream()) - .map(toHaleJoinCondition()).collect(Collectors.toSet()); - - final JoinParameter joinParameter = new JoinParameter( - transformationContext.getCurrentSourceTypeEntityDefinitions(), joinConditions); - - final String validation = joinParameter.validate(); - if (validation != null) { - throw new IllegalArgumentException("Join parameter invalid: " + validation); - } - - transformationContext.getCurrentTypeParameters().put("join", - new ParameterValue(Value.complex(joinParameter))); - - return JoinFunction.ID; - } - - private Function toHaleJoinCondition() { - return condition -> { - - final QName baseTableName = transformationContext.addTable(condition.getSourceTable()); - final QName joinedTableName = transformationContext - .addTable(condition.getTargetTable()); - - final PropertyEntityDefinition baseProperty = transformationContext - .getEntityDefinition(baseTableName, new QName(condition.getSourceField())); - final PropertyEntityDefinition joinedProperty = transformationContext - .getEntityDefinition(joinedTableName, new QName(condition.getTargetField())); - - return new JoinCondition(baseProperty, joinedProperty); - }; - } - - private Predicate isNotJoinedYet() { - return joinedTable -> { - if (seenTables.contains(joinedTable.getName())) { - transformationContext.getReporter() - .warn("Table is already joined for this feature type, skipping: " - + joinedTable.getName() + " [" - + joinedTable.getJoinPaths().toString() + "]"); - - return false; - } - - seenTables.add(joinedTable.getName()); - return true; - }; - } - - private Predicate hasValues() { - return joinedTable -> !joinedTable.getValues().isEmpty(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandler.java deleted file mode 100644 index 28f5086061..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; - -/** - * Handler for Property transformations - * - * @author zahnen - */ -@FunctionalInterface -public interface PropertyTransformationHandler extends TransformationHandler { - - /** - * Create a new {@link PropertyTransformationHandlerFactory} object - * - * @param transformationContext Transformation Context - * @return new Property Transformation Handler Factory object - */ - public static PropertyTransformationHandlerFactory createFactory( - final TransformationContext transformationContext) { - return new PropertyTransformationHandlerFactory(transformationContext); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandlerFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandlerFactory.java deleted file mode 100644 index c928641b2e..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/PropertyTransformationHandlerFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; - -/** - * Factory for creating Property Transformation Handlers - * - * @author zahnen - */ -public class PropertyTransformationHandlerFactory { - - private final TransformationContext transformationContext; - - /** - * @param transformationContext the transformation context - */ - public PropertyTransformationHandlerFactory(TransformationContext transformationContext) { - this.transformationContext = transformationContext; - } - - /** - * Create a new Property Transformation Handler - * - * @param mappingValue the mapping that should be transformed - * - * @return new TypeHandler - */ - public Optional create(final MappingValue mappingValue) { - if (mappingValue.isExpression() - && FormattedStringHandler.isFormattedStringExpression(mappingValue.getValue())) { - return Optional.of(new FormattedStringHandler(transformationContext)); - } - else if (mappingValue.isConstant()) { - return Optional.of(new AssignHandler(transformationContext)); - } - else if (mappingValue.isColumn()) { - return Optional.of(new RenameHandler(transformationContext)); - } - - return Optional.empty(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RenameHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RenameHandler.java deleted file mode 100644 index 8b6d23d101..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RenameHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; - -/** - * Transforms a {@link MappingValue} to a {@link RenameFunction} - * - * @author zahnen - */ -class RenameHandler extends AbstractPropertyTransformationHandler { - - RenameHandler(final TransformationContext transformationContext) { - super(transformationContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.reader.handler.AbstractPropertyTransformationHandler#doHandle(de.interactive_instruments.xtraserver.config.api.MappingValue, - * java.lang.String) - */ - @Override - public String doHandle(final MappingValue mappingValue, final String tableName) { - - transformationContext.nextPropertyTransformation(tableName, mappingValue.getValue(), - mappingValue.getQualifiedTargetPath()); - - final ListMultimap parameters = transformationContext - .getCurrentPropertyParameters(); - - parameters.put("ignoreNamespaces", new ParameterValue("false")); - parameters.put("structuralRename", new ParameterValue("false")); - - return RenameFunction.ID; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RetypeHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RetypeHandler.java deleted file mode 100644 index 605e450c18..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/RetypeHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.RetypeFunction; - -/** - * Transforms a {@link FeatureTypeMapping} to a {@link RetypeFunction} - * - * @author zahnen - */ -class RetypeHandler extends AbstractTypeTransformationHandler { - - RetypeHandler(final TransformationContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.reader.handler.AbstractTypeTransformationHandler#doHandle(de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping, - * java.lang.String) - */ - @Override - public String doHandle(final FeatureTypeMapping featureTypeMapping, - final String primaryTableName) { - - final ListMultimap parameters = transformationContext - .getCurrentTypeParameters(); - - parameters.put("ignoreNamespaces", new ParameterValue("false")); - parameters.put("structuralRename", new ParameterValue("false")); - - return RetypeFunction.ID; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationContext.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationContext.java deleted file mode 100644 index eb0c616af8..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationContext.java +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.bind.JAXBElement; -import javax.xml.namespace.QName; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Lists; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import eu.esdihumboldt.hale.common.align.io.EntityResolver; -import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ChildContextType; -import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.ClassType; -import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.NamedEntityType; -import eu.esdihumboldt.hale.common.align.io.impl.internal.generated.PropertyType; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -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.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.TypeIndex; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultPropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultTypeDefinition; -import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; - -/** - * - * - * @author zahnen - */ -public final class TransformationContext { - - private final TypeIndex sourceTypes; - private final TypeIndex targetTypes; - private final EntityResolver entityResolver; - private final IOReporter reporter; - private Set currentSourceTableNames; - private QName currentTargetTypeName; - private FeatureTypeMapping currentFeatureTypeMapping; - private ListMultimap currenTypeParameters; - private ListMultimap currentPropertyParameters; - private Set currentSourcePropertyNames; - private NamedEntityType currentTargetPropertyName; - - /** - * Constructor - * - * @param sourceTypes source types - * @param targetTypes target types - * @param entityResolver entity resolver - * @param progress progress indicator - * @param reporter reporter - */ - public TransformationContext(final TypeIndex sourceTypes, final TypeIndex targetTypes, - final EntityResolver entityResolver, final ProgressIndicator progress, - final IOReporter reporter) { - this.sourceTypes = sourceTypes; - this.targetTypes = targetTypes; - this.entityResolver = entityResolver; - this.reporter = reporter; - } - - void nextTypeTransformation(String sourceType, FeatureTypeMapping featureTypeMapping) { - this.currentSourceTableNames = new LinkedHashSet<>(); - addTable(sourceType); - this.currentTargetTypeName = findTargetType(featureTypeMapping.getQualifiedName()); - this.currentFeatureTypeMapping = featureTypeMapping; - this.currenTypeParameters = ArrayListMultimap.create(); - } - - void nextPropertyTransformation(List targetProperty) { - - nextPropertyTransformation(targetProperty, null, ""); - - } - - void nextPropertyTransformation(String sourceType, String sourceProperty, - List targetProperty) { - - nextPropertyTransformation(targetProperty, sourceType, "", sourceProperty); - - } - - void nextPropertyTransformation(List targetProperty, String sourceType, - String sourceVarName, String... sourceProperties) { - - if (sourceType != null && sourceProperties != null && sourceProperties.length > 0) { - final QName sourceTableName = findCurrentSourceType(sourceType); - - this.currentSourcePropertyNames = Arrays.stream(sourceProperties) - .map(sourceProperty -> getNamedEntity(sourceTableName, - new QName(sourceProperty), sourceVarName)) - .collect(Collectors.toSet()); - } - else { - this.currentSourcePropertyNames = new LinkedHashSet<>(); - } - - this.currentTargetPropertyName = getNamedEntity(currentTargetTypeName, targetProperty, ""); - - this.currentPropertyParameters = ArrayListMultimap.create(); - } - - boolean hasCurrentSourceProperty() { - return !this.currentSourcePropertyNames.isEmpty(); - } - - QName addTable(String name) { - final QName qualifiedName = findSourceType(name); - - currentSourceTableNames.add(qualifiedName); - - return qualifiedName; - } - - Set getCurrentSourceTableNames() { - return this.currentSourceTableNames; - } - - QName getCurrentTargetTypeName() { - return this.currentTargetTypeName; - } - - ListMultimap getCurrentTypeParameters() { - return this.currenTypeParameters; - } - - ListMultimap getCurrentPropertyParameters() { - return this.currentPropertyParameters; - } - - /** - * @return the currentFeatureTypeMapping - */ - FeatureTypeMapping getCurrentFeatureTypeMapping() { - return currentFeatureTypeMapping; - } - - IOReporter getReporter() { - return reporter; - } - - List getCurrentSourceTableNamedEntities() { - - return currentSourceTableNames.stream().map(this::getNamedEntityType) - .collect(Collectors.toList()); - } - - List getCurrentSourceTypeEntityDefinitions() { - return currentSourceTableNames.stream() - .map(sourceTableName -> new TypeEntityDefinition( - new DefaultTypeDefinition(sourceTableName), SchemaSpaceID.SOURCE, null)) - .collect(Collectors.toList()); - } - - ListMultimap getCurrentSourceTypeEntities() { - - return convertEntities(getCurrentSourceTableNamedEntities(), sourceTypes, - SchemaSpaceID.SOURCE); - } - - ListMultimap getCurrentTargetTypeEntities() { - - return convertEntities(ImmutableList.of(getNamedEntity(currentTargetTypeName)), targetTypes, - SchemaSpaceID.TARGET); - } - - ListMultimap getCurrentSourcePropertyEntities() { - - return convertEntities(ImmutableList.copyOf(currentSourcePropertyNames), sourceTypes, - SchemaSpaceID.SOURCE); - } - - ListMultimap getCurrentTargetPropertyEntities() { - - return convertEntities(ImmutableList.of(currentTargetPropertyName), targetTypes, - SchemaSpaceID.TARGET); - } - - private ListMultimap convertEntities(List namedEntities, - TypeIndex types, SchemaSpaceID schemaSpace) { - if (namedEntities == null || namedEntities.isEmpty()) { - return null; - } - - ListMultimap result = ArrayListMultimap.create(); - - for (NamedEntityType namedEntity : namedEntities) { - /** - * Resolve entity. - * - * Possible results: - *
      - *
    • non-null entity - entity could be resolved
    • - *
    • null entity - entity could not be resolved, continue
    • - *
    • IllegalStateException - entity could not be resolved, reject cell
    • - *
    - */ - Entity entity = entityResolver.resolve(namedEntity.getAbstractEntity().getValue(), - types, schemaSpace); - - if (entity != null) { - result.put(namedEntity.getName(), entity); - } - } - - return result; - } - - QName findSourceType(String name) { - return sourceTypes.getTypes().stream().map(TypeDefinition::getName) - .filter(type -> type.getLocalPart().equals(name)).findFirst().orElseThrow( - () -> new IllegalArgumentException("Source type '" + name + "' not found")); - } - - QName findTargetType(QName name) { - return targetTypes.getTypes().stream() - .filter(typeDefinition -> name.equals(getElementNameForType(typeDefinition))) - .map(TypeDefinition::getName).findFirst().orElseThrow( - () -> new IllegalArgumentException("Target type '" + name + "' not found")); - } - - QName findCurrentSourceType(String name) { - return currentSourceTableNames.stream() - .filter(tableName -> name.equals(tableName.getLocalPart())).findFirst().orElseThrow( - () -> new IllegalArgumentException("Source type '" + name + "' not found")); - } - - QName getElementNameForType(TypeDefinition typeDefinition) { - final XmlElements constraints = typeDefinition.getConstraint(XmlElements.class); - if (constraints == null || constraints.getElements().size() == 0) { - // throw new IllegalStateException("No constraint has been specified."); - return null; - } - else if (constraints.getElements().size() > 1) { - // throw new IllegalStateException("More than one constraint has been - // specified."); - return null; - } - - return constraints.getElements().iterator().next().getName(); - } - - NamedEntityType getNamedEntity(QName qname) { - return getNamedEntity(qname, ""); - } - - NamedEntityType getNamedEntityType(QName qname) { - return getNamedEntity(qname, "types"); - } - - NamedEntityType getNamedEntity(QName qname, String name) { - ClassType.Type sourceQNT = new ClassType.Type(); - sourceQNT.setName(qname.getLocalPart()); - sourceQNT.setNs(qname.getNamespaceURI()); - ClassType sourceQN = new ClassType(); - sourceQN.setType(sourceQNT); - NamedEntityType sourceType = new NamedEntityType(); - if (!name.isEmpty()) - sourceType.setName(name); - sourceType.setAbstractEntity( - new JAXBElement(new QName("type"), ClassType.class, sourceQN)); - - return sourceType; - } - - NamedEntityType getNamedEntity(QName qname, QName property) { - return getNamedEntity(qname, property, ""); - } - - NamedEntityType getNamedEntity(QName qname, List properties) { - return getNamedEntity(qname, properties, ""); - } - - private NamedEntityType getNamedEntity(QName qname, QName property, String name) { - return getNamedEntity(qname, Lists.newArrayList(property), name); - } - - private NamedEntityType getNamedEntity(QName qname, List properties, String name) { - PropertyType.Type sourceQNT = new PropertyType.Type(); - sourceQNT.setName(qname.getLocalPart()); - sourceQNT.setNs(qname.getNamespaceURI()); - - PropertyType sourceQN = new PropertyType(); - sourceQN.setType(sourceQNT); - - for (QName p : properties) { - String localName = p.getLocalPart().startsWith("@") ? p.getLocalPart().substring(1) - : p.getLocalPart(); - ChildContextType sourceP = new ChildContextType(); - sourceP.setName(localName); - sourceP.setNs(p.getNamespaceURI()); - sourceQN.getChild().add(sourceP); - } - - NamedEntityType sourceType = new NamedEntityType(); - if (!name.isEmpty()) - sourceType.setName(name); - sourceType.setAbstractEntity( - new JAXBElement(new QName("type"), PropertyType.class, sourceQN)); - - return sourceType; - } - - PropertyEntityDefinition getEntityDefinition(QName qname, QName property) { - TypeDefinition typeDefinition = new DefaultTypeDefinition(qname); - - ChildDefinition child = new DefaultPropertyDefinition(property, - typeDefinition, typeDefinition); - - typeDefinition.addChild(child); - - List path = new ArrayList<>(); - path.add(new ChildContext(child)); - - return new PropertyEntityDefinition(typeDefinition, path, SchemaSpaceID.SOURCE, null); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationHandler.java deleted file mode 100644 index f629072659..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TransformationHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import eu.esdihumboldt.hale.common.align.model.MutableCell; - -/** - * Transformation Handler - * - * @param output type to transform to - * - * @author zahnen - */ -@FunctionalInterface -public interface TransformationHandler { - - /** - * Transforms a {@link FeatureTypeMapping} or a {@link MappingValue} to an - * alignment cell - * - * @param typeOrProperty the mapping - * @param tableName the primary table name - * - * @return alignment cell - */ - MutableCell handle(final T typeOrProperty, final String tableName); -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandler.java deleted file mode 100644 index 0f5af0330a..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; - -/** - * Handler for Type transformations - * - * @author zahnen - */ -@FunctionalInterface -public interface TypeTransformationHandler extends TransformationHandler { - - /** - * Create a new {@link TypeTransformationHandlerFactory} object - * - * @param transformationContext Transformation Context - * @return new Type Transformation Handler Factory object - */ - public static TypeTransformationHandlerFactory createFactory( - final TransformationContext transformationContext) { - return new TypeTransformationHandlerFactory(transformationContext); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandlerFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandlerFactory.java deleted file mode 100644 index bab796c79f..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/reader/handler/TypeTransformationHandlerFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.reader.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; - -/** - * Factory for creating Type Transformation Handlers - * - * @author zahnen - */ -public class TypeTransformationHandlerFactory { - - private final TransformationContext transformationContext; - - /** - * @param transformationContext the transformation context - */ - public TypeTransformationHandlerFactory(TransformationContext transformationContext) { - this.transformationContext = transformationContext; - } - - /** - * Create a new Transformation Type Handler - * - * @param featureTypeMapping the mapping that should be transformed - * @param primaryTableName primary table name - * - * @return new TypeHandler - */ - public Optional create(final FeatureTypeMapping featureTypeMapping, - final String primaryTableName) { - if (featureTypeMapping.getTable(primaryTableName).isPresent()) { - if (featureTypeMapping.getTable(primaryTableName).get().getJoiningTables().isEmpty()) { - return Optional.of(new RetypeHandler(transformationContext)); - } - else { - return Optional.of(new JoinHandler(transformationContext)); - } - } - - return Optional.empty(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriter.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriter.java deleted file mode 100644 index d18a4e6d41..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingFileWriter.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Collections; -import java.util.Set; - -import javax.xml.bind.JAXBException; -import javax.xml.stream.XMLStreamException; - -import org.xml.sax.SAXException; - -import de.interactive_instruments.xtraserver.config.api.XtraServerMapping; -import de.interactive_instruments.xtraserver.config.io.XtraServerMappingFile; -import eu.esdihumboldt.hale.common.align.io.impl.AbstractAlignmentWriter; -import eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.ValueProperties; -import eu.esdihumboldt.hale.common.core.io.project.ComplexConfigurationService; -import eu.esdihumboldt.hale.common.core.io.project.ProjectIO; -import eu.esdihumboldt.hale.common.core.io.project.model.Project; -import eu.esdihumboldt.hale.common.core.io.report.IOReport; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.UnsupportedTransformationException; - -/** - * Writes an Alignment to a XtraServer Mapping file. - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class XtraServerMappingFileWriter extends AbstractAlignmentWriter { - - private final static String WRITER_TYPE_NAME = "XtraServer Mapping Exporter"; - - static final String CONTENT_TYPE_MAPPING = "eu.esdihumboldt.hale.io.xtraserver.mapping.xml"; - - static final String CONTENT_TYPE_ARCHIVE = "eu.esdihumboldt.hale.io.xtraserver.mapping.archive"; - - /** - * @see eu.esdihumboldt.hale.common.core.io.IOProvider#isCancelable() - */ - @Override - public boolean isCancelable() { - return false; - } - - /** - * @see eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider#getDefaultTypeName() - */ - @Override - protected String getDefaultTypeName() { - return WRITER_TYPE_NAME; - } - - /** - * @see eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider#execute(eu.esdihumboldt.hale.common.core.io.ProgressIndicator, - * eu.esdihumboldt.hale.common.core.io.report.IOReporter) - */ - @Override - protected IOReport execute(final ProgressIndicator progress, final IOReporter reporter) - throws IOProviderConfigurationException, IOException { - - ValueProperties projectProperties = null; - if (getProjectInfo() instanceof Project) { - final ComplexConfigurationService service = ProjectIO - .createProjectConfigService((Project) getProjectInfo()); - projectProperties = service.getProperty("variables").as(ValueProperties.class); - } - if (projectProperties == null) { - projectProperties = new ValueProperties(); - } - - progress.begin("Initialising", ProgressIndicator.UNKNOWN); - if (getAlignment() == null) { - throw new IOProviderConfigurationException("No alignment was provided."); - } - if (getTargetSchema() == null) { - throw new IOProviderConfigurationException("No target schema was provided."); - } - if (getTarget() == null) { - throw new IOProviderConfigurationException("No target was provided."); - } - try (final OutputStream out = getTarget().getOutput()) { - final XtraServerMappingGenerator generator = new XtraServerMappingGenerator( - getAlignment(), getTargetSchema(), progress, - Collections.unmodifiableMap(projectProperties), getProjectInfo(), - getProjectLocation(), reporter); - final XtraServerMapping mapping = generator.generate(reporter); - XtraServerMappingFile.Writer writer = XtraServerMappingFile.write().mapping(mapping); - - if (getContentType().getId().equals(CONTENT_TYPE_MAPPING)) { - progress.setCurrentTask("Writing XtraServer Mapping file"); - } - else if (getContentType().getId().equals(CONTENT_TYPE_ARCHIVE)) { - progress.setCurrentTask("Writing XtraServer Mapping Archive"); - writer.createArchiveWithAdditionalFiles(); - } - else { - throw new IOProviderConfigurationException( - "Content type not supported: " + getContentType().getName()); - } - writer.toStream(out); - progress.advance(1); - - final Set missingAssociationTargets = generator.getMissingAssociationTargets(); - if (!missingAssociationTargets.isEmpty()) { - StringBuilder builder = new StringBuilder(); - int warningCount = 0; - for (String s : missingAssociationTargets) { - builder.append(System.getProperty("line.separator")); - builder.append(s); - warningCount++; - } - reporter.countWarning(warningCount); - - reporter.warn( - "To determine the mapping association targets, this plugin relies on annotations " - + "that are described in 'ISO 19109 - Rules for application schema'. " - + "This requires that references possess a GML 'targetElement' elment inside an 'appInfo' " - + "schema annotation. Please note that the following list of properties are not mapped with " - + "association targets due to missing annotations: {0} ", - builder.toString()); - } - } catch (final UnsupportedTransformationException e) { - reporter.error("The transformation of the type '" + e.getTransformationIdentifier() - + "' is not supported. Make sure that the XtraServer compatibility mode is enabled."); - reporter.setSuccess(false); - return reporter; - } catch (final JAXBException | SAXException | XMLStreamException e) { - reporter.error("An internal error occurred", e); - reporter.setSuccess(false); - return reporter; - } - progress.end(); - reporter.setSuccess(true); - return reporter; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingGenerator.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingGenerator.java deleted file mode 100644 index 59a8d23b55..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingGenerator.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer; - -import java.net.URI; -import java.util.Comparator; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import de.interactive_instruments.xtraserver.config.api.XtraServerMapping; -import eu.esdihumboldt.hale.common.align.model.Alignment; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.core.io.ProgressIndicator; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.CellParentWrapper; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.MappingContext; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.PropertyTransformationHandler; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.PropertyTransformationHandlerFactory; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandlerFactory; -import eu.esdihumboldt.hale.io.xtraserver.writer.handler.UnsupportedTransformationException; - -/** - * Translates an Alignment to a XtraServer Mapping. - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class XtraServerMappingGenerator { - - private final Alignment alignment; - private final TypeTransformationHandlerFactory typeHandlerFactory; - private final PropertyTransformationHandlerFactory propertyHandlerFactory; - private final ProgressIndicator progress; - private final MappingContext mappingContext; - - /** - * Constructor - * - * @param alignment the Alignment with all cells - * @param targetSchemaSpace the target schema - * @param progress Progress indicator - * @param projectProperties project transformation properties - * @param projectInfo project info - * @param projectLocation project file - * @param reporter reporter - */ - public XtraServerMappingGenerator(final Alignment alignment, - final SchemaSpace targetSchemaSpace, final ProgressIndicator progress, - final Map projectProperties, final ProjectInfo projectInfo, - final URI projectLocation, final IOReporter reporter) { - this.alignment = alignment; - mappingContext = new MappingContext(alignment, targetSchemaSpace, projectProperties, - projectInfo, projectLocation, reporter); - this.typeHandlerFactory = TypeTransformationHandler.createFactory(mappingContext); - this.propertyHandlerFactory = PropertyTransformationHandler.createFactory(mappingContext); - // Calculate the total work units for the progress indicator (+1 for - // writing the - // file) - int c = 1; - for (final Cell typeCell : this.alignment.getActiveTypeCells()) { - c += this.alignment.getPropertyCells(typeCell).size() + 1; - } - progress.begin("Translating hale alignment to XtraServer Mapping file", c); - this.progress = progress; - } - - /** - * Generates the Mapping object - * - * @param reporter status reporter - * @return the generated XtraServer Mapping - * - * @throws UnsupportedTransformationException if the transformation of types - * or properties is not supported - */ - public XtraServerMapping generate(final IOReporter reporter) - throws UnsupportedTransformationException { - - for (final Cell typeCell : this.alignment.getActiveTypeCells()) { - final String typeTransformationIdentifier = typeCell.getTransformationIdentifier(); - // Create FeatureTypeMapping from the type cells. The Mapping tables - // are created - // and added by the Type Handlers - this.progress.setCurrentTask("Transforming type"); - final TypeTransformationHandler typeHandler = typeHandlerFactory - .create(typeTransformationIdentifier); - if (typeHandler != null) { - typeHandler.handle(typeCell); - this.progress.setCurrentTask( - "Mapping values for Feature Type " + mappingContext.getFeatureTypeName()); - // Add MappingValues from the type cell's property cells - for (final Cell propertyCell : this.alignment.getPropertyCells(typeCell).stream() - .sorted(new Comparator() { - - @Override - public int compare(Cell c1, Cell c2) { - return c1.getPriority().compareTo(c2.getPriority()); - } - }).collect(Collectors.toList())) { - final String propertyTransformationIdentifier = propertyCell - .getTransformationIdentifier(); - final PropertyTransformationHandler propertyHandler = propertyHandlerFactory - .create(propertyTransformationIdentifier); - if (propertyHandler != null) { - propertyHandler.handle(new CellParentWrapper(typeCell, propertyCell)); - } - this.progress.advance(1); - } - } - else { - this.progress.advance(this.alignment.getPropertyCells(typeCell).size()); - } - } - return mappingContext.getMapping(); - } - - /** - * Return all property paths for which no association target could be found - * in the schema. - * - * @return list of properties with missing association targets - */ - public Set getMissingAssociationTargets() { - return this.mappingContext.getMissingAssociationTargets(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingUtils.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingUtils.java deleted file mode 100644 index 513f2cdac1..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/XtraServerMappingUtils.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2018 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.xtraserver.writer; - -import com.google.common.collect.ListMultimap; - -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.Property; - -/** - * Utility methods for mapping generation. - * - * @author Stefano Costa, GeoSolutions - */ -public class XtraServerMappingUtils { - - /** - * Return the first source {@link Entity}, which is assumed to be a - * {@link Property}. - * - * @param propertyCell the property cell - * @return the target {@link Property} - */ - public static Property getSourceProperty(Cell propertyCell) { - ListMultimap sourceEntities = propertyCell.getSource(); - if (sourceEntities != null && !sourceEntities.isEmpty()) { - return (Property) sourceEntities.values().iterator().next(); - } - - return null; - } - - /** - * Return the first target {@link Entity}, which is assumed to be a - * {@link Property}. - * - * @param propertyCell the property cell - * @return the target {@link Property} - */ - public static Property getTargetProperty(Cell propertyCell) { - ListMultimap targetEntities = propertyCell.getTarget(); - if (targetEntities != null && !targetEntities.isEmpty()) { - return (Property) targetEntities.values().iterator().next(); - } - - return null; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractPropertyTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractPropertyTransformationHandler.java deleted file mode 100644 index 07f0241930..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractPropertyTransformationHandler.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Function; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.apache.ws.commons.schema.XmlSchemaAppInfo; -import org.w3c.dom.Node; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.schema.model.ChildDefinition; -import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.property.Reference; -import eu.esdihumboldt.hale.io.xsd.constraint.XmlAppInfo; -import eu.esdihumboldt.hale.io.xsd.constraint.XmlAttributeFlag; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Abstract Property Transformation Handler - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -abstract class AbstractPropertyTransformationHandler implements PropertyTransformationHandler { - - protected final MappingContext mappingContext; - - protected AbstractPropertyTransformationHandler(final MappingContext mappingContext) { - this.mappingContext = mappingContext; - } - - protected List buildPath(final List path) { - return buildPath(path, false); - } - - protected List buildPathWithoutLast(final List path) { - return buildPath(path, true); - } - - protected List buildPath(final List path, final boolean withoutLast) { - return path.stream().map(segment -> segment.getChild().asProperty()) - .filter(Objects::nonNull).map(toPropertyNameWithAttributePrefix()) - .limit(withoutLast ? path.size() - 1 : path.size()).collect(Collectors.toList()); - } - - private Function toPropertyNameWithAttributePrefix() { - return property -> property.getConstraint(XmlAttributeFlag.class).isEnabled() ? new QName( - property.getName().getNamespaceURI(), "@" + property.getName().getLocalPart()) - : property.getName(); - } - - protected static String propertyName(final List path) { - if (path == null || path.isEmpty()) { - return ""; - } - return path.get(path.size() - 1).getChild().getName().getLocalPart(); - } - - protected static String getSingleProperty( - final ListMultimap parameters, final String name) { - if (parameters != null) { - final List parameterValues = parameters.get(name); - if (parameterValues != null && !parameterValues.isEmpty()) { - return parameterValues.get(0).as(String.class); - } - } - return null; - } - - /** - * Check if the property cell is a reference and if yes add the association - * target that is found in the schema. - * - * @param propertyCell Property cell - * @param lastValue associated value mapping for the property - * @return possibly changed value mapping - */ - private MappingValue ensureAssociationTarget(final Cell propertyCell, - final MappingValue lastValue) { - final Property targetProperty = XtraServerMappingUtils.getTargetProperty(propertyCell); - if (targetProperty.getDefinition().getDefinition().getConstraint(Reference.class) - .isReference()) { - final String associationTargetRef = getTargetFromSchema(targetProperty); - if (associationTargetRef != null) { - return new MappingValueBuilder().reference() - .referencedFeatureType(associationTargetRef) - .qualifiedTargetPath(lastValue.getQualifiedTargetPath()) - .value(lastValue.getValue()).build(); - } - } - - return lastValue; - } - - /** - * Find the association target from the AppInfo annotation in the XSD - * - * @param targetProperty target property to analyze - * @return association target as String - */ - private String getTargetFromSchema(final Property targetProperty) { - if (targetProperty.getDefinition().getPropertyPath().isEmpty()) { - return null; - } - - final ChildDefinition firstChild = targetProperty.getDefinition().getPropertyPath() - .get(0).getChild(); - if (!(firstChild instanceof PropertyDefinition)) { - return null; - } - final XmlAppInfo appInfoAnnotation = ((PropertyDefinition) firstChild) - .getConstraint(XmlAppInfo.class); - - for (final XmlSchemaAppInfo appInfo : appInfoAnnotation.getAppInfos()) { - for (int i = 0; i < appInfo.getMarkup().getLength(); i++) { - final Node item = appInfo.getMarkup().item(i); - if ("targetElement".equals(item.getNodeName())) { - final String target = item.getTextContent(); - return target; - } - } - } - return null; - } - - @Override - public final MappingValue handle(final Cell propertyCell) { - final Property targetProperty = XtraServerMappingUtils.getTargetProperty(propertyCell); - final Property sourceProperty = XtraServerMappingUtils.getSourceProperty(propertyCell); - - if (targetProperty == null || (sourceProperty == null && !((this instanceof AssignHandler) - || (this instanceof CustomFunctionAdvToNamespace) - || (this instanceof SqlExpressionHandler) - || (this instanceof FormattedStringHandler)))) { - CellParentWrapper cellParentWrapper = (CellParentWrapper) propertyCell; - mappingContext - .getReporter() - .warn("Cell could not be exported, source or target property is not set (Table: {0}, Source: {1}, Target: {2})", - cellParentWrapper.getTableName(), sourceProperty, targetProperty); - return null; - } - - final Optional optionalMappingValue = doHandle(propertyCell, targetProperty); - - final String tableName = ((CellParentWrapper) propertyCell).getTableName(); - - optionalMappingValue.ifPresent(mappingValue -> { - mappingValue = ensureAssociationTarget(propertyCell, mappingValue); - - mappingContext.addValueMappingToTable(targetProperty, mappingValue, tableName); - }); - - return optionalMappingValue.orElse(null); - } - - protected abstract Optional doHandle(final Cell propertyCell, - final Property targetProperty); -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTransformationHandlerFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTransformationHandlerFactory.java deleted file mode 100644 index 832dff0b61..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTransformationHandlerFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Map; -import java.util.Objects; - -/** - * Abstract Factory for creating Type and Property Transformation Handlers - * - * @param TransformationHandler - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -abstract class AbstractTransformationHandlerFactory> { - - private final static boolean ignoreUnknownTransformations = true; - - private final Map handlers; - private final MappingContext mappingContext; - - AbstractTransformationHandlerFactory(final MappingContext mappingContext, - final Map handlers) { - this.mappingContext = mappingContext; - this.handlers = handlers; - } - - /** - * Create a new Transformation Type Handler - * - * @param typeTransformationIdentifier type function identifier - * @return new TypeHandler - * @throws UnsupportedTransformationException if the transformation is not - * supported - */ - public T create(final String typeTransformationIdentifier) - throws UnsupportedTransformationException { - final T handler = handlers.get(Objects.requireNonNull(typeTransformationIdentifier, - "Type transformation identifier is null")); - if (handler == null) { - if (ignoreUnknownTransformations) { - mappingContext.getReporter().warn("Transformation not supported: {0}", - typeTransformationIdentifier); - } - else { - throw new UnsupportedTransformationException(typeTransformationIdentifier); - } - } - return handler; - } -} \ No newline at end of file diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTypeTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTypeTransformationHandler.java deleted file mode 100644 index 4ace468524..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AbstractTypeTransformationHandler.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Collection; - -import javax.xml.namespace.QName; - -import org.geotools.filter.FilterFactoryImpl; -import org.geotools.filter.text.cql2.CQL; -import org.geotools.filter.text.cql2.CQLException; -import org.geotools.filter.visitor.DuplicatingFilterVisitor; -import org.opengis.filter.Filter; -import org.opengis.filter.FilterFactory2; -import org.opengis.filter.expression.PropertyName; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.MappingTableBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.filter.AbstractGeotoolsFilter; -import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.type.PrimaryKey; -import eu.esdihumboldt.hale.io.jdbc.constraints.DatabaseTable; -import eu.esdihumboldt.hale.io.xsd.constraint.XmlElements; -import eu.esdihumboldt.hale.io.xtraserver.compatibility.XtraServerCompatibilityMode; - -/** - * Abstract Type Transformation Handler - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -abstract class AbstractTypeTransformationHandler implements TypeTransformationHandler { - - protected final MappingContext mappingContext; - - protected AbstractTypeTransformationHandler(final MappingContext mappingContext) { - this.mappingContext = mappingContext; - } - - protected QName getFeatureTypeName(final Cell cell) { - final ListMultimap targetEntities = cell.getTarget(); - if (targetEntities == null || targetEntities.size() == 0) { - throw new IllegalStateException("No target type has been specified."); - } - final Entity targetType = targetEntities.values().iterator().next(); - final TypeDefinition targetTypeDefinition = targetType.getDefinition().getType(); - final XmlElements constraints = targetTypeDefinition.getConstraint(XmlElements.class); - if (constraints == null || constraints.getElements().size() == 0) { - throw new IllegalStateException("No constraint has been specified."); - } - else if (constraints.getElements().size() > 1) { - throw new IllegalStateException("More than one constraint has been specified."); - } - return constraints.getElements().iterator().next().getName(); - } - - protected String getPrimaryKey(final TypeDefinition definition) { - final PrimaryKey primaryKey = definition.getConstraint(PrimaryKey.class); - if (primaryKey == null || primaryKey.getPrimaryKeyPath() == null - || primaryKey.getPrimaryKeyPath().isEmpty()) { - return null; - } - return primaryKey.getPrimaryKeyPath().iterator().next().getLocalPart(); - } - - protected MappingTableBuilder createTableIfAbsent(final EntityDefinition sourceType) { - final TypeDefinition sourceTypeDefinition = sourceType.getType(); - final String tableName = sourceTypeDefinition.getDisplayName(); - - return this.mappingContext.getTable(tableName).orElseGet(() -> { - MappingTableBuilder table = new MappingTableBuilder(); - final DatabaseTable dbTable = sourceTypeDefinition.getConstraint(DatabaseTable.class); - if (dbTable != null && dbTable.getTableName() != null) { - table.name(dbTable.getTableName()); - } - else { - table.name(tableName); - } - - final String primaryKey = getPrimaryKey(sourceTypeDefinition); - if (primaryKey != null) { - table.primaryKey(primaryKey); - } - else { - table.primaryKey("id"); - mappingContext.getReporter().warn( - "No primary key for table \"{0}\" found, assuming \"id\". (context: oid_col in FeatureType \"{1}\")", - tableName, mappingContext.getFeatureTypeName()); - } - - if (sourceType.getFilter() != null) { - try { - AbstractGeotoolsFilter filter = (AbstractGeotoolsFilter) sourceType.getFilter(); - // table.predicate(filter.getFilterTerm()); - Filter qualifiedFilter = (Filter) CQL.toFilter(filter.getFilterTerm()) - .accept(new ResolvePropertyNamesFilterVisitor("$T$"), null); - table.predicate(CQL.toCQL(qualifiedFilter)); - } catch (ClassCastException | CQLException e) { - // ignore - } - } - - mappingContext.addCurrentMappingTable(tableName, table); - - return table; - }); - } - - @Override - public final FeatureTypeMapping handle(final Cell cell) { - mappingContext.addNextFeatureTypeMapping(getFeatureTypeName(cell)); - - final ListMultimap sourceEntities = cell.getSource(); - if (sourceEntities == null || sourceEntities.size() == 0) { - throw new IllegalStateException("No source type has been specified."); - } - if (XtraServerCompatibilityMode.hasFilters(cell.getSource())) { - mappingContext.getReporter().warn( - "Filters are not supported and are ignored during type transformation of Feature Type \"{0}\"", - mappingContext.getFeatureTypeName()); - } - - final ListMultimap targetEntities = cell.getTarget(); - if (targetEntities == null || targetEntities.size() == 0) { - throw new IllegalStateException("No target type has been specified."); - } - final Entity targetType = targetEntities.values().iterator().next(); - final Collection sourceTypes = sourceEntities.values(); - doHandle(sourceTypes, targetType, cell); - - return null; - } - - public abstract void doHandle(final Collection sourceTypes, - final Entity targetType, final Cell typeCell); - - private class ResolvePropertyNamesFilterVisitor extends DuplicatingFilterVisitor { - - final FilterFactory2 filterFactory = new FilterFactoryImpl(); - final String tableName; - - ResolvePropertyNamesFilterVisitor(String tableName) { - this.tableName = tableName; - } - - @Override - public Object visit(PropertyName expression, Object extraData) { - return filterFactory.property(tableName + "." + expression.getPropertyName()); - } - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AssignHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AssignHandler.java deleted file mode 100644 index 5704e92364..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/AssignHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import static eu.esdihumboldt.hale.common.align.model.functions.AssignFunction.PARAMETER_VALUE; - -import java.util.List; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; -import eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition; -import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.constraint.property.NillableFlag; - -/** - * Transforms the {@link AssignFunction} to a {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class AssignHandler extends AbstractPropertyTransformationHandler { - - private final static String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; - private final static String NIL_REASON = "@nilReason"; - - AssignHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - // Assign constant value from parameters - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - final List valueParams = parameters.get(PARAMETER_VALUE); - final String value = valueParams.get(0).getStringRepresentation(); - - final List path = buildPath(targetProperty.getDefinition().getPropertyPath()); - - // if nilReason is set and property is nillable, set xsi:nil to true - if (path.get(path.size() - 1).getLocalPart().equals(NIL_REASON) - && isNillable(targetProperty.getDefinition())) { - final List nilPath = ImmutableList. builder() - .addAll(path.subList(0, path.size() - 1)).add(new QName(XSI_NS, "@nil")) - .build(); - final MappingValue nilMappingValue = new MappingValueBuilder().constant() - .qualifiedTargetPath(nilPath).value("true").build(); - final String tableName = ((CellParentWrapper) propertyCell).getTableName(); - mappingContext.addValueMappingToTable(targetProperty, nilMappingValue, tableName); - } - - final MappingValue mappingValue = new MappingValueBuilder().constant() - .qualifiedTargetPath(path).value(mappingContext.resolveProjectVars(value)).build(); - - return Optional.of(mappingValue); - } - - private boolean isNillable(PropertyEntityDefinition definition) { - - if (definition.getPropertyPath().size() > 1) { - final PropertyDefinition property = definition.getPropertyPath() - .get(definition.getPropertyPath().size() - 2).getChild().asProperty(); - if (property != null) { - return property.getConstraint(NillableFlag.class).isEnabled(); - } - } - return false; - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CellParentWrapper.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CellParentWrapper.java deleted file mode 100644 index 26bf454554..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CellParentWrapper.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import static eu.esdihumboldt.hale.common.align.model.functions.JoinFunction.PARAMETER_JOIN; - -import java.util.List; -import java.util.Set; - -import com.google.common.collect.ListMultimap; - -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.EntityDefinition; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Priority; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.TransformationMode; -import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; -import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter; -import eu.esdihumboldt.hale.io.jdbc.constraints.DatabaseTable; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Parameter decorator, that provides access to the parent cell - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class CellParentWrapper implements Cell { - - private final Cell wrappedCell; - private final Cell parentTypeCell; - - /** - * Constructor. - * - * @param parentTypeCell type cell - * @param wrappedCell property cell - */ - public CellParentWrapper(final Cell parentTypeCell, final Cell wrappedCell) { - this.parentTypeCell = parentTypeCell; - this.wrappedCell = wrappedCell; - } - - /** - * Returns the parent type cell - * - * @return type cell - */ - public Cell getParentCell() { - return parentTypeCell; - } - - /** - * Returns the type mapping cell representation - * - * @return type mapping cell representation - */ - public Entity getParentCellSource() { - ListMultimap sourceEntities = parentTypeCell.getSource(); - if (sourceEntities != null && !sourceEntities.isEmpty()) { - return sourceEntities.values().iterator().next(); - } - return null; - } - - private EntityDefinition getParentCellSourceType() { - if (parentTypeCell.getTransformationIdentifier().equals(JoinFunction.ID)) { - List parameters = parentTypeCell.getTransformationParameters().get( - PARAMETER_JOIN); - if (!parameters.isEmpty()) { - final JoinParameter joinParameter = parameters.get(0).as(JoinParameter.class); - return joinParameter.getTypes().iterator().next(); - } - } - - return getParentCellSource().getDefinition(); - } - - /** - * Returns the table name of the property cell or the parent type cell. If - * the source of the alignment is not a database schema, the name of the - * type is returned. - * - * @return table name - */ - public String getTableName() { - final Property sourceProperty = XtraServerMappingUtils.getSourceProperty(wrappedCell); - if (sourceProperty != null) { - final DatabaseTable table = sourceProperty.getDefinition().getDefinition() - .getParentType().getConstraint(DatabaseTable.class); - if (table.isTable()) { - return table.getTableName(); - } - else { - final DatabaseTable tableOfType = sourceProperty.getDefinition().getType() - .getConstraint(DatabaseTable.class); - if (tableOfType.isTable()) { - return table.getTableName(); - } - else { - return sourceProperty.getDefinition().getType().getDisplayName(); - } - } - } - final EntityDefinition sourceType = getParentCellSourceType(); - final DatabaseTable table = sourceType.getType().getConstraint(DatabaseTable.class); - if (!table.isTable()) { - return sourceType.getType().getDisplayName(); - } - else { - return table.getTableName(); - } - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getSource() - */ - @Override - public ListMultimap getSource() { - return wrappedCell.getSource(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getTarget() - */ - @Override - public ListMultimap getTarget() { - return wrappedCell.getTarget(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getTransformationParameters() - */ - @Override - public ListMultimap getTransformationParameters() { - return wrappedCell.getTransformationParameters(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getAnnotations(java.lang.String) - */ - @Override - public List getAnnotations(String type) { - return wrappedCell.getAnnotations(type); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getAnnotationTypes() - */ - @Override - public Set getAnnotationTypes() { - return wrappedCell.getAnnotationTypes(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#addAnnotation(java.lang.String) - */ - @Override - public Object addAnnotation(String type) { - return wrappedCell.addAnnotation(type); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#addAnnotation(java.lang.String, - * java.lang.Object) - */ - @Override - public void addAnnotation(String type, Object annotation) { - wrappedCell.addAnnotation(type, annotation); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#removeAnnotation(java.lang.String, - * java.lang.Object) - */ - @Override - public void removeAnnotation(String type, Object annotation) { - wrappedCell.removeAnnotation(type, annotation); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getDocumentation() - */ - @Override - public ListMultimap getDocumentation() { - return wrappedCell.getDocumentation(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getTransformationIdentifier() - */ - @Override - public String getTransformationIdentifier() { - return wrappedCell.getTransformationIdentifier(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getId() - */ - @Override - public String getId() { - return wrappedCell.getId(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getDisabledFor() - */ - @Override - public Set getDisabledFor() { - return wrappedCell.getDisabledFor(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getPriority() - */ - @Override - public Priority getPriority() { - return wrappedCell.getPriority(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#getTransformationMode() - */ - @Override - public TransformationMode getTransformationMode() { - return wrappedCell.getTransformationMode(); - } - - /** - * @see eu.esdihumboldt.hale.common.align.model.Cell#isBaseCell() - */ - @Override - public boolean isBaseCell() { - return wrappedCell.isBaseCell(); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/ClassificationMappingHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/ClassificationMappingHandler.java deleted file mode 100644 index d27eb73afd..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/ClassificationMappingHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder.ValueClassification; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.functions.ClassificationMappingFunction; -import eu.esdihumboldt.hale.common.align.model.functions.ClassificationMappingUtil; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.service.ServiceManager; -import eu.esdihumboldt.hale.common.lookup.LookupTable; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the {@link ClassificationMappingFunction} to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class ClassificationMappingHandler extends AbstractPropertyTransformationHandler { - - private final static String NIL_REASON = "@nilReason"; - - ClassificationMappingHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - final ValueClassification mappingValue; - - final List path = buildPath(targetProperty.getDefinition().getPropertyPath()); - - if (path.get(path.size() - 1).getLocalPart().equals(NIL_REASON)) { - mappingValue = new MappingValueBuilder().nil(); - mappingValue.qualifiedTargetPath(path.subList(0, path.size() - 1)); - } - else { - mappingValue = new MappingValueBuilder().classification(); - mappingValue.qualifiedTargetPath(path); - } - - mappingValue.value(propertyName(XtraServerMappingUtils.getSourceProperty(propertyCell) - .getDefinition().getPropertyPath())); - - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - - // Assign DB codes and values from the lookup table - final LookupTable lookup = ClassificationMappingUtil.getClassificationLookup(parameters, - new ServiceManager(ServiceManager.SCOPE_PROJECT)); - if (lookup != null) { - final Map valueMap = lookup.asMap(); - final Iterator it = valueMap.keySet().iterator(); - while (it.hasNext()) { - final Value sourceValue = it.next(); - final String targetValueStr = '\'' + valueMap.get(sourceValue).as(String.class) + '\''; - - mappingValue.keyValue(sourceValue.as(String.class), targetValueStr); - } - } - else { - mappingValue.keyValue("NULL", ""); - } - - return Optional.of(mappingValue.build()); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToGeographicalNameSimple.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToGeographicalNameSimple.java deleted file mode 100644 index 54b7157061..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToGeographicalNameSimple.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * * Transforms the custom function - * 'custom:alignment:adv.inspire.GeographicalName.simple' to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class CustomFunctionAdvToGeographicalNameSimple extends FormattedStringHandler { - - public final static String FUNCTION_ID = "custom:alignment:adv.inspire.GeographicalName.simple"; - private final static String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; - private final static String XLINK_NS = "http://www.w3.org/1999/xlink"; - - CustomFunctionAdvToGeographicalNameSimple(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - - final List geographicalNamePath = buildPath(targetProperty.getDefinition() - .getPropertyPath()); - - final MappingValue mappingValue = new MappingValueBuilder() - .column() - .qualifiedTargetPath( - addToPath(geographicalNamePath, "spelling", "SpellingOfName", "text")) - .value(propertyName(XtraServerMappingUtils.getSourceProperty(propertyCell) - .getDefinition().getPropertyPath())).build(); - - final List constantValues = new ArrayList(); - - constantValues.add(createConstantValueMapping(addToPath(geographicalNamePath, "language"), - "deu")); - - final String nativenessParam = getSingleProperty(parameters, "nativeness"); - setCodeListValue(addToPath(geographicalNamePath, "nativeness"), "NativenessValue", - nativenessParam, "endonym", constantValues); - - final String nameStatusParam = getSingleProperty(parameters, "nameStatus"); - setCodeListValue(addToPath(geographicalNamePath, "nameStatus"), "NameStatusValue", - nameStatusParam, "official", constantValues); - - // Determine source with priorities: source first, ADV_MODELLART project - // property, AA_Modellart.advStandardModell - final String sourceParam = getSingleProperty(parameters, "source"); - final String sourceOfName; - if (sourceParam != null) { - sourceOfName = sourceParam; - } - else { - final Value projectPropertySource = this.mappingContext - .getTransformationProperty(MappingContext.PROPERTY_ADV_MODELLART); - if (!projectPropertySource.isEmpty()) { - sourceOfName = projectPropertySource.as(String.class); - } - else { - sourceOfName = "unknown"; - } - } - constantValues.add(createConstantValueMapping( - addToPath(geographicalNamePath, "sourceOfName"), sourceOfName)); - - constantValues - .add(createConstantValueMapping( - addToPath(XSI_NS, addToPath(geographicalNamePath, "pronunciation"), "@nil"), - "true")); - constantValues.add(createConstantValueMapping( - addToPath("", addToPath(geographicalNamePath, "pronunciation"), "@nilReason"), - "other:unpopulated")); - - constantValues.add(createConstantValueMapping( - addToPath(geographicalNamePath, "spelling", "SpellingOfName", "script"), "Latn")); - - final String tableName = ((CellParentWrapper) propertyCell).getTableName(); - - constantValues.forEach(c -> mappingContext.addValueMappingToTable(targetProperty, c, - tableName)); - - return Optional.of(mappingValue); - } - - private void setCodeListValue(final List propertyPath, final String codeListValue, - final String code, final String fallbackValue, final List constantValues) { - if (code == null) { - // default if not specified - constantValues.add(createConstantValueMapping( - addToPath(XLINK_NS, propertyPath, "@href"), - "http://inspire.ec.europa.eu/codelist/" + codeListValue + "/" + fallbackValue)); - } - else { - if ("unpopulated".equals(code)) { - constantValues.add(createConstantValueMapping( - addToPath("", propertyPath, "@nilReason"), "other:unpopulated")); - constantValues.add(createConstantValueMapping( - addToPath(XSI_NS, propertyPath, "@nil"), "true")); - } - else if ("unknown".equals(code)) { - constantValues.add(createConstantValueMapping( - addToPath("", propertyPath, "@nilReason"), "unknown")); - constantValues.add(createConstantValueMapping( - addToPath(XSI_NS, propertyPath, "@nil"), "true")); - } - else { - constantValues.add(createConstantValueMapping( - addToPath(XLINK_NS, propertyPath, "@href"), - "http://inspire.ec.europa.eu/codelist/" + codeListValue + "/" + code)); - } - } - } - - private List addToPath(final List basePath, final String... elements) { - final String gnNamespaceUri = basePath.get(basePath.size() - 1).getNamespaceURI(); - - return addToPath(gnNamespaceUri, basePath, elements); - } - - private List addToPath(final String namespaceUri, final List basePath, - final String... elements) { - return Stream.concat(basePath.stream(), - Arrays.stream(elements).map(element -> new QName(namespaceUri, element))).collect( - Collectors.toList()); - } - - private MappingValue createConstantValueMapping(final List target, final String value) { - return new MappingValueBuilder().constant().qualifiedTargetPath(target).value(value) - .build(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToIdentifier.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToIdentifier.java deleted file mode 100644 index 78185027f0..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToIdentifier.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.List; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ImmutableList; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder.ValueDefault; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the custom function 'custom:alignment:adv.inspire.identifier' to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class CustomFunctionAdvToIdentifier extends FormattedStringHandler { - - public final static String FUNCTION_ID = "custom:alignment:adv.inspire.identifier"; - - CustomFunctionAdvToIdentifier(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - final Value inspireNamespace = mappingContext - .getTransformationProperty(MappingContext.PROPERTY_INSPIRE_NAMESPACE); - - final String propertyName = propertyName(XtraServerMappingUtils - .getSourceProperty(propertyCell).getDefinition().getPropertyPath()); - - String value = "'"; - if (!inspireNamespace.isEmpty()) { - value += inspireNamespace.as(String.class) - + (inspireNamespace.as(String.class).endsWith("/") ? "" : "/"); - } - value += mappingContext.getFeatureTypeName() + "_' || $T$." + propertyName; - - final List propPath = buildPath(targetProperty.getDefinition().getPropertyPath()); - - final ValueDefault mappingValue = new MappingValueBuilder().expression() - .qualifiedTargetPath(propPath).value(value); - - // Add codespace - final List codespacePath = ImmutableList. builder().addAll(propPath) - .add(new QName("@codeSpace")).build(); - final MappingValue codeSpaceValue = new MappingValueBuilder().constant() - .qualifiedTargetPath(codespacePath).value("http://inspire.ec.europa.eu/ids") - .build(); - final String tableName = ((CellParentWrapper) propertyCell).getTableName(); - mappingContext.addValueMappingToTable(targetProperty, codeSpaceValue, tableName); - - return Optional.of(mappingValue.build()); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToLocalId.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToLocalId.java deleted file mode 100644 index 7c38420987..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToLocalId.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the custom function 'custom:alignment:adv.inspire.id.default' to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class CustomFunctionAdvToLocalId extends FormattedStringHandler { - - public final static String FUNCTION_ID = "custom:alignment:adv.inspire.id.default"; - - CustomFunctionAdvToLocalId(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - final String propertyName = propertyName(XtraServerMappingUtils - .getSourceProperty(propertyCell).getDefinition().getPropertyPath()); - - final MappingValue mappingValue = new MappingValueBuilder().expression() - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value("'" + mappingContext.getFeatureTypeName() + "_' || $T$." + propertyName) - .build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToNamespace.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToNamespace.java deleted file mode 100644 index 4012cd5ae8..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToNamespace.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.core.io.Value; - -/** - * Transforms the custom function 'custom:alignment:adv.inspire.namespace' to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class CustomFunctionAdvToNamespace extends FormattedStringHandler { - - public final static String FUNCTION_ID = "custom:alignment:adv.inspire.namespace"; - - CustomFunctionAdvToNamespace(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - final Value inspireNamespace = mappingContext - .getTransformationProperty(MappingContext.PROPERTY_INSPIRE_NAMESPACE); - if (!inspireNamespace.isEmpty()) { - final MappingValue mappingValue = new MappingValueBuilder().constant() - .qualifiedTargetPath( - buildPath(targetProperty.getDefinition().getPropertyPath())) - .value(inspireNamespace.as(String.class)).build(); - return Optional.of(mappingValue); - } - - return Optional.empty(); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToUCUM.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToUCUM.java deleted file mode 100644 index fcd3fc6161..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/CustomFunctionAdvToUCUM.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the custom function 'custom:alignment:adv.uom.toucum' to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class CustomFunctionAdvToUCUM extends ClassificationMappingHandler { - - public final static String FUNCTION_ID = "custom:alignment:adv.uom.toucum"; - - CustomFunctionAdvToUCUM(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - final MappingValue mappingValue = new MappingValueBuilder() - .classification() - .keyValue("urn:adv:uom:m2", "'m2'") - .keyValue("urn:adv:uom:m", "'m'") - .keyValue("urn:adv:uom:km", "'km'") - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value(propertyName(XtraServerMappingUtils.getSourceProperty(propertyCell) - .getDefinition().getPropertyPath())).build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/FormattedStringHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/FormattedStringHandler.java deleted file mode 100644 index 3300de97e6..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/FormattedStringHandler.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction; - -/** - * Transforms the {@link FormattedStringFunction} to a {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class FormattedStringHandler extends AbstractPropertyTransformationHandler { - - private static final Pattern VARIABLE_PATTERN = Pattern.compile("\\{([^$].+?)\\}"); - private static final String XS_VAR_PREFIX = "$T$."; - private static final String XS_CONCAT = " || "; - private static final String XS_CONCAT_LEFT_STR = "' || "; - private static final String XS_CONCAT_RIGHT_STR = " || '"; - - FormattedStringHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - // Get the formatted string from parameters - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - final List patterns = parameters.get("pattern"); - if (patterns == null || patterns.isEmpty() || patterns.get(0).isEmpty()) { - mappingContext.getReporter().warn("Formatted string was ignored, no pattern set."); - return Optional.empty(); - } - final String pattern = patterns.get(0).as(String.class); - final StringBuilder formattedStr = new StringBuilder( - mappingContext.resolveProjectVars(pattern)); - final int patternLength = formattedStr.length(); - - if (propertyCell.getSource() != null && propertyCell.getSource().asMap().get("var") != null - && !propertyCell.getSource().asMap().get("var").isEmpty()) { - final List variables = propertyCell.getSource().asMap().get("var").stream() - .map(var -> propertyName(var.getDefinition().getPropertyPath())) - .collect(Collectors.toList()); - final List startEndList = new ArrayList(); - final List varList = new ArrayList(); - final Matcher m = VARIABLE_PATTERN.matcher(formattedStr); - while (m.find()) { - int[] startEnd = new int[2]; - startEnd[0] = m.start(); // index of '{' character - startEnd[1] = m.end(); // index of '}' character - startEndList.add(startEnd); - varList.add(m.group(1)); // the variable name, without curly - // braces - } - - List missingVars = varList.stream().filter(var -> !variables.contains(var)) - .collect(Collectors.toList()); - if (!missingVars.isEmpty()) { - mappingContext.getReporter().warn("Formatted string was ignored. Variables \"" - + missingVars - + "\" were used in pattern, but do not exist in source properties."); - return Optional.empty(); - } - - if (!startEndList.isEmpty()) { - final StringBuilder varBuilder = new StringBuilder(); - int idxOffset = 0; - - // Add ' if string does not start with a variable definition - if (startEndList.get(0)[0] != 0) { - formattedStr.insert(0, '\''); - varBuilder.append(XS_CONCAT_LEFT_STR); - idxOffset++; - } - int firstStartIdx = startEndList.get(0)[0] + idxOffset; - int firstEndIdx = startEndList.get(0)[1] + idxOffset; - varBuilder.append(XS_VAR_PREFIX); - varBuilder.append(varList.get(0)); - if (firstEndIdx - idxOffset != pattern.length()) { - rightConcat(varBuilder, 0, startEndList); - if (varList.size() == 1) { - formattedStr.append('\''); - } - } - formattedStr.replace(firstStartIdx, firstEndIdx, varBuilder.toString()); - idxOffset += varBuilder.length() - firstEndIdx + firstStartIdx; - varBuilder.setLength(0); - - if (varList.size() > 1) { - for (int i = 1; i < startEndList.size(); i++) { - final int startIdx = startEndList.get(i)[0] + idxOffset; - final int endIdx = startEndList.get(i)[1] + idxOffset; - leftConcat(varBuilder, i, startEndList); - varBuilder.append(XS_VAR_PREFIX); - varBuilder.append(varList.get(i)); - rightConcat(varBuilder, i, startEndList); - formattedStr.replace(startIdx, endIdx, varBuilder.toString()); - idxOffset += varBuilder.length() - endIdx + startIdx; - varBuilder.setLength(0); - } - // Remove || ' after the last variable or append ' after the - // last string - if (startEndList.get(startEndList.size() - 1)[1] == patternLength) { - formattedStr - .setLength(formattedStr.length() - XS_CONCAT_RIGHT_STR.length()); - } - else { - formattedStr.append(XS_CONCAT_LEFT_STR); - } - } - } - } - else { - formattedStr.insert(0, '\''); - // Simple string without formatting - formattedStr.append('\''); - } - - final MappingValue mappingValue = new MappingValueBuilder().expression() - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value(formattedStr.toString()).build(); - - return Optional.of(mappingValue); - } - - private static void leftConcat(final StringBuilder builder, final int currentIdx, - final List startEndList) { - if (startEndList.get(currentIdx)[0] == startEndList.get(currentIdx - 1)[1]) { - builder.append(XS_CONCAT); - } - else { - builder.append(XS_CONCAT_LEFT_STR); - } - } - - private static void rightConcat(final StringBuilder builder, final int currentIdx, - final List startEndList) { - if (currentIdx + 1 < startEndList.size()) { - if (startEndList.get(currentIdx)[1] != startEndList.get(currentIdx + 1)[0]) { - builder.append(XS_CONCAT_RIGHT_STR); - } - } - else { - builder.append(XS_CONCAT_RIGHT_STR); - } - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/GroovyJoinHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/GroovyJoinHandler.java deleted file mode 100644 index 7c2f3b5e50..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/GroovyJoinHandler.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Collection; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; - -/** - * Transforms the eu.esdihumboldt.cst.functions.groovy.join function to a - * {@link FeatureTypeMapping} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class GroovyJoinHandler extends JoinHandler { - - GroovyJoinHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public void doHandle(final Collection sourceTypes, final Entity targetType, - final Cell typeCell) { - try { - super.doHandle(sourceTypes, targetType, typeCell); - } catch (final Exception e) { - mappingContext.getReporter().error("Error transforming GroovyJoin for Feature Type {0}." - + " Replace the GroovyJoin with a Join before you transform the Alignment.", - mappingContext.getFeatureTypeName()); - throw e; - } - mappingContext.getReporter() - .warn("A GroovyJoin for Feature Type {0} has been transformed but requires further" - + " manual editing in the generated Mapping file.", - mappingContext.getFeatureTypeName()); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/JoinHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/JoinHandler.java deleted file mode 100644 index 7951d81009..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/JoinHandler.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import static eu.esdihumboldt.hale.common.align.model.functions.JoinFunction.PARAMETER_JOIN; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.MappingJoin; -import de.interactive_instruments.xtraserver.config.api.MappingJoin.Condition; -import de.interactive_instruments.xtraserver.config.api.MappingJoinBuilder; -import de.interactive_instruments.xtraserver.config.api.MappingTableBuilder; -import eu.esdihumboldt.hale.common.align.model.AlignmentUtil; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; -import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter; -import eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition; -import eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition; - -/** - * Transforms the {@link JoinFunction} to a {@link FeatureTypeMapping} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class JoinHandler extends AbstractTypeTransformationHandler { - - JoinHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public void doHandle(final Collection sourceTypes, final Entity targetType, - final Cell typeCell) { - - for (final ParameterValue transParam : typeCell.getTransformationParameters() - .get(PARAMETER_JOIN)) { - - final JoinParameter joinParameter = transParam.as(JoinParameter.class); - final String validation = joinParameter.validate(); - if (validation != null) { - throw new IllegalArgumentException("Join parameter invalid: " + validation); - } - - final MappingTableBuilder baseTable = createTableIfAbsent( - joinParameter.getTypes().iterator().next()); - - final List sortedConditions = transformSortedConditions(joinParameter, - sourceTypes); - - // TODO: add nested joined tables to merged tables - - List sourceTables = new ArrayList<>(); - - sourceTables.add(baseTable.buildDraft().getName()); - - while (!sourceTables.isEmpty()) { - List nextSourceTables = new ArrayList<>(); - for (String tableName : sourceTables) { - final List joins = sortedConditions.stream() - .filter(condition -> condition.getSourceTable().equals(tableName)) - .map(condition -> { - final MappingJoinBuilder join = new MappingJoinBuilder(); - join.joinCondition(condition); - join.targetPath("TODO"); - return join.build(); - }).collect(Collectors.toList()); - - joins.forEach(joinPath -> { - mappingContext.getTable(joinPath.getTargetTable()) - .ifPresent(targetTable -> targetTable.joinPath(joinPath)); - }); - - nextSourceTables.addAll(joins.stream().map(st -> st.getTargetTable()) - .collect(Collectors.toList())); - } - sourceTables = nextSourceTables; - } - } - } - - /** - * Transform and sort hale Join Condition Set into Join Conditions that are - * attached to multiple XtraServer Join objects - * - * @param joinParameter hale conditions - * @param sourceTypes source types from cell with primary keys - * @return sorted joins - */ - private List transformSortedConditions(final JoinParameter joinParameter, - final Collection sourceTypes) { - - return joinParameter.getConditions().stream().sorted(new Comparator() { - - @Override - public int compare(JoinCondition o1, JoinCondition o2) { - TypeEntityDefinition o1Type = AlignmentUtil.getTypeEntity(o1.joinProperty); - TypeEntityDefinition o2Type = AlignmentUtil.getTypeEntity(o2.joinProperty); - return joinParameter.getTypes().indexOf(o1Type) - - joinParameter.getTypes().indexOf(o2Type); - } - }).map(condition -> { - final TypeEntityDefinition baseType = AlignmentUtil - .getTypeEntity(condition.baseProperty); - - final TypeEntityDefinition joinType = sourceTypes.stream() - .filter(entity -> entity.getDefinition().getType().getName() - .equals(condition.joinProperty.getType().getName())) - .map(entity -> AlignmentUtil.getTypeEntity(entity.getDefinition())).findFirst() - .orElse(AlignmentUtil.getTypeEntity(condition.joinProperty)); - - final MappingTableBuilder baseTable = createTableIfAbsent(baseType); - final String baseField = condition.baseProperty.getPropertyPath().iterator().next() - .getChild().getDisplayName(); - final MappingTableBuilder joinTable = createTableIfAbsent(joinType); - final String joinField = condition.joinProperty.getPropertyPath().iterator().next() - .getChild().getDisplayName(); - - final MappingJoin.Condition mappingJoinCondition = new MappingJoinBuilder.ConditionBuilder() - .sourceTable(baseTable.buildDraft().getName()).sourceField(baseField) - .targetTable(joinTable.buildDraft().getName()).targetField(joinField).build(); - - return mappingJoinCondition; - }).collect(Collectors.toList()); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MappingContext.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MappingContext.java deleted file mode 100644 index 314b3d6170..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MappingContext.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; -import java.util.function.Predicate; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMappingBuilder; -import de.interactive_instruments.xtraserver.config.api.MappingTable; -import de.interactive_instruments.xtraserver.config.api.MappingTableBuilder; -import de.interactive_instruments.xtraserver.config.api.MappingTableBuilder.MappingTableDraft; -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.XtraServerMapping; -import de.interactive_instruments.xtraserver.config.api.XtraServerMappingBuilder; -import de.interactive_instruments.xtraserver.config.transformer.XtraServerMappingTransformer; -import eu.esdihumboldt.hale.common.align.model.Alignment; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.core.io.Value; -import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; -import eu.esdihumboldt.hale.common.core.io.report.IOReporter; -import eu.esdihumboldt.hale.common.schema.model.PropertyDefinition; -import eu.esdihumboldt.hale.common.schema.model.Schema; -import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; -import eu.esdihumboldt.hale.common.schema.model.constraint.property.Cardinality; - -/** - * The mapping context provides access to the {@link Alignment} and holds all - * {@link FeatureTypeMapping}s. - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public final class MappingContext { - - /** - * ADV Modellart - */ - public final static String PROPERTY_ADV_MODELLART = "ADV_MODELLART"; - - /** - * INSPIRE namespace - */ - public final static String PROPERTY_INSPIRE_NAMESPACE = "INSPIRE_NAMESPACE"; - - private final Alignment alignment; - private final Map transformationProperties; - private final static Pattern projectVarPattern = Pattern.compile("\\{\\{project:([^}]+)\\}\\}"); - - private final Map featureTypeMappings = new LinkedHashMap<>(); - private FeatureTypeMappingBuilder currentFeatureTypeMapping; - private String currentFeatureTypeMappingName; - private final Map currentMappingTables = new LinkedHashMap<>(); - private final Set missingAssociationTargets = new TreeSet(); - private final URI applicationSchemaUri; - private final ProjectInfo projectInfo; - private final URI projectLocation; - private final IOReporter reporter; - - /** - * Constructor Only the first schema is used - * - * @param alignment the Alignment with all cells - * @param schemaspace the target schema - * @param transformationProperties Properties used in transformations - * @param projectInfo project info - * @param projectLocation project file - * @param reporter reporter - */ - public MappingContext(final Alignment alignment, final SchemaSpace schemaspace, - final Map transformationProperties, final ProjectInfo projectInfo, - final URI projectLocation, final IOReporter reporter) { - this.alignment = Objects.requireNonNull(alignment); - this.transformationProperties = Objects.requireNonNull(transformationProperties); - - final Iterator it = Objects - .requireNonNull(schemaspace, "Schemaspace not provided").getSchemas().iterator(); - if (!it.hasNext()) { - throw new IllegalArgumentException("Schemaspace does not contain a schema"); - } - final Schema schema = it.next(); - this.applicationSchemaUri = schema.getLocation(); - this.projectInfo = projectInfo; - this.projectLocation = projectLocation; - this.reporter = reporter; - } - - /** - * Add a new FeatureTypeMapping to the mapping context - * - * @param featureTypeName feature type name - * @return the same FeatureTypeMapping for chaining method calls - */ - FeatureTypeMappingBuilder addNextFeatureTypeMapping(final QName featureTypeName) { - buildAndClearCurrentTables(); - - final String key = Objects.requireNonNull(featureTypeName, "Feature Type name is null") - .toString(); - currentFeatureTypeMapping = featureTypeMappings.get(key); - if (currentFeatureTypeMapping == null) { - currentFeatureTypeMapping = new FeatureTypeMappingBuilder() - .qualifiedName(featureTypeName); - featureTypeMappings.put(key, currentFeatureTypeMapping); - } - - this.currentFeatureTypeMappingName = featureTypeName.getLocalPart(); - - return currentFeatureTypeMapping; - } - - void addCurrentMappingTable(final String tableName, final MappingTableBuilder mappingTable) { - this.currentMappingTables.put(tableName, mappingTable); - } - - Collection getCurrentMappingTables() { - return this.currentMappingTables.values(); - } - - void buildAndClearCurrentTables() { - if (this.currentFeatureTypeMapping == null) { - return; - } - - // reset target path for merged tables - this.currentMappingTables.values().forEach(tableBuilder -> { - if (tableBuilder.buildDraft().getQualifiedTargetPath() - .equals(ImmutableList.of(new QName("__MERGE__")))) { - tableBuilder.qualifiedTargetPath(ImmutableList.of()); - } - }); - - // connect joining tables - Lists.reverse(Lists.newArrayList(this.currentMappingTables.values())).stream() - .filter(isJoinTable()).map(MappingTableBuilder::build).forEach(table -> { - if (this.currentMappingTables - .containsKey(table.getJoinPaths().iterator().next().getSourceTable())) { - this.currentMappingTables - .get(table.getJoinPaths().iterator().next().getSourceTable()) - .joiningTable(table); - } - }); - - final Optional primaryTable = this.currentMappingTables.values().stream() - .map(MappingTableBuilder::build).filter(table -> table.isPrimary()).findFirst(); - - if (primaryTable.isPresent()) { - this.currentFeatureTypeMapping.primaryTable(primaryTable.get()); - } - - this.currentMappingTables.clear(); - } - - private Predicate isValidJoinTable() { - return tableBuilder -> tableBuilder.buildDraft().isJoined() - && tableBuilder.buildDraft().getAllValuesStream().findFirst().isPresent() - && tableBuilder.buildDraft().getAllValuesStream() - .allMatch(value -> value.getQualifiedTargetPath().get(0) - .equals(tableBuilder.buildDraft().getQualifiedTargetPath().get(0))); - } - - private Predicate isInvalidJoinTableWithoutTarget() { - return tableBuilder -> !tableBuilder.buildDraft().getJoinPaths().isEmpty() - && tableBuilder.buildDraft().getAllValuesStream().findFirst().isPresent() - && (tableBuilder.buildDraft().getQualifiedTargetPath().isEmpty() || tableBuilder - .buildDraft().getAllValuesStream() - .anyMatch(value -> !value.getQualifiedTargetPath().get(0).equals( - tableBuilder.buildDraft().getQualifiedTargetPath().get(0)))); - } - - private Predicate isJoinTable() { - return tableBuilder -> (tableBuilder.buildDraft().isJoined() - && tableBuilder.buildDraft().getAllValuesStream().findFirst().isPresent() - && tableBuilder.buildDraft().getAllValuesStream() - .allMatch(value -> value.getQualifiedTargetPath().get(0) - .equals(tableBuilder.buildDraft().getQualifiedTargetPath().get(0)))) - || (!tableBuilder.buildDraft().getJoinPaths().isEmpty() - && tableBuilder.buildDraft().getAllValuesStream().findFirst().isPresent() - && (tableBuilder.buildDraft().getQualifiedTargetPath().isEmpty() - || tableBuilder.buildDraft().getAllValuesStream() - .anyMatch(value -> !value.getQualifiedTargetPath().get(0) - .equals(tableBuilder.buildDraft() - .getQualifiedTargetPath().get(0))))); - } - - /** - * Returns the name of the currently processed Feature Type Mapping - * - * @return Feature Type Mapping name - */ - public String getFeatureTypeName() { - return currentFeatureTypeMappingName; - } - - /** - * Return all property paths for which no association target could be found - * in the schema. - * - * @return list of properties with missing association targets - */ - public Set getMissingAssociationTargets() { - return this.missingAssociationTargets; - } - - void addMissingAssociationTarget(final String associationTarget) { - this.missingAssociationTargets.add(associationTarget); - } - - Value getTransformationProperty(final String name) { - final Value val = this.transformationProperties.get(name); - if (val != null) { - return val; - } - return Value.NULL; - } - - /** - * Retrieve table from current FeatureTypeMapping - * - * @param tableName Mapping Table name - * @return MappingTable - */ - Optional getTable(String tableName) { - return Optional.ofNullable(currentMappingTables.get(tableName)); - } - - void addValueMappingToTable(final Property target, final MappingValue value, - final String tableName) { - - final MappingTableBuilder tableBuilder = getTable(tableName).orElseThrow( - () -> new IllegalArgumentException("Table " + tableName + " not found")); - final MappingTableDraft tableDraft = tableBuilder.buildDraft(); - - // if joinPaths and no target path and multiple, set target path -> - // joined table - // if joinPaths and target path and not multiple, clear target path -> - // merged table - // ignore merged tables in JaxbWriter, transform to virtual tables in - // transformer - if (!tableDraft.getJoinPaths().isEmpty() - && target.getDefinition().getPropertyPath() != null) { - // Target is set in value mapping, check if the property is multiple - // and the - // target must be added to the table - - boolean alreadyHasTargetPath = !tableDraft.getQualifiedTargetPath().isEmpty(); - List targetPath = new ArrayList<>(); - boolean multiple = false; - for (final Iterator it = target.getDefinition().getPropertyPath() - .iterator(); it.hasNext();) { - final ChildContext segment = it.next(); - final PropertyDefinition property = segment.getChild().asProperty(); - targetPath.add(segment.getChild().getName()); - if (property != null) { - final Cardinality cardinality = property.getConstraint(Cardinality.class); - if (cardinality.mayOccurMultipleTimes()) { - - if (!alreadyHasTargetPath && tableDraft.getValues().isEmpty()) { - tableBuilder.qualifiedTargetPath(targetPath); - } - if (alreadyHasTargetPath - && !targetPath.equals(tableDraft.getQualifiedTargetPath())) { - tableBuilder - .qualifiedTargetPath(ImmutableList.of(new QName("__MERGE__"))); - } - multiple = true; - break; - } - } - } - if (!multiple && alreadyHasTargetPath) { - tableBuilder.qualifiedTargetPath(ImmutableList.of(new QName("__MERGE__"))); - } - // set target path for connection table - if (multiple && !targetPath.isEmpty()) { - String connectionTable = tableDraft.getJoinPaths().iterator().next() - .getSourceTable(); - final Optional tableBuilder2 = getTable(connectionTable); - if (tableBuilder2.isPresent()) { - final MappingTableDraft tableDraft2 = tableBuilder2.get().buildDraft(); - if (tableDraft2.getQualifiedTargetPath().isEmpty() - && tableDraft2.getValues().isEmpty() - && !tableDraft2.getJoinPaths().isEmpty()) { - tableBuilder2.get().qualifiedTargetPath(targetPath); - } - } - } - } - - tableBuilder.value(value); - } - - IOReporter getReporter() { - return reporter; - } - - /** - * Return the property cells for a type cell - * - * @param typeCell the type cell - * @return the property cells associated with type cell - */ - Collection getPropertyCells(final Cell typeCell) { - return this.alignment.getPropertyCells(typeCell); - } - - /** - * Return the XtraServerMapping containing all FeatureTypeMappings that were - * propagated - * - * @return XtraServerMapping containing all FeatureTypeMappings - */ - public XtraServerMapping getMapping() { - buildAndClearCurrentTables(); - - final XtraServerMappingBuilder xtraServerMappingBuilder = new XtraServerMappingBuilder(); - - xtraServerMappingBuilder.description("\n Source:\n - hale " - + projectInfo.getHaleVersion().toString() + "\n - " - + (projectLocation != null ? projectLocation.toString() : projectInfo.getName()) - + "\n"); - - featureTypeMappings.values().stream().map(FeatureTypeMappingBuilder::build) - .forEach(xtraServerMappingBuilder::featureTypeMapping); - - XtraServerMapping fannedOutmapping = XtraServerMappingTransformer - .forMapping(xtraServerMappingBuilder.build()) - .applySchemaInfo(this.applicationSchemaUri).fanOutInheritance() - .ensureRelationNavigability().fixMultiplicity().virtualTables().transform(); - - return fannedOutmapping; - } - - /** - * Replace project variables in a string - * - * @param str input string - * @return string with replaced project variables, unresolved variables are - * replaced with 'PROJECT_VARIABLE__NOT_SET' - */ - public String resolveProjectVars(final String str) { - final Matcher m = projectVarPattern.matcher(str); - String repStr = str; - while (m.find()) { - final String varName = m.group(1); - final Value val = transformationProperties.get(varName); - final String replacement; - if (val != null && !val.isEmpty()) { - replacement = val.as(String.class); - } - else { - replacement = "PROJECT_VARIABLE_" + varName + "_NOT_SET"; - } - repStr = repStr.replaceAll("\\{\\{project:" + varName + "\\}\\}", - Matcher.quoteReplacement(replacement)); - } - return repStr; - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MathematicalExpressionHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MathematicalExpressionHandler.java deleted file mode 100644 index e4dab005e6..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/MathematicalExpressionHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Collection; -import java.util.List; -import java.util.Optional; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.cst.functions.numeric.MathematicalExpressionFunction; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; - -/** - * Transforms the {@link MathematicalExpressionFunction} to a - * {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class MathematicalExpressionHandler extends AbstractPropertyTransformationHandler { - - MathematicalExpressionHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - // Get mathematical expression from parameters - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - final List expressions = parameters.get("expression"); - if (expressions.isEmpty()) { - throw new IllegalArgumentException("Expression not set"); - } - else if (expressions.size() > 1) { - throw new IllegalArgumentException("Only one expression is supported"); - } - String expression = expressions.get(0).getStringRepresentation(); - // Replace variables in the expression with our expression syntax - final Collection variables = propertyCell.getSource().asMap().get("var"); - for (Entity var : variables) { - final String varName = var.getDefinition().getDefinition().getName().getLocalPart(); - expression = expression.replaceAll(varName, "\\$T\\$." + varName); - } - - final MappingValue mappingValue = new MappingValueBuilder().expression() - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value(expression).build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandler.java deleted file mode 100644 index e9805df691..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; - -/** - * Handler for Property transformations - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -@FunctionalInterface -public interface PropertyTransformationHandler extends TransformationHandler { - - /** - * Create a new {@link PropertyTransformationHandlerFactory} object - * - * @param mappingContext Mapping Context - * @return new Property Transformation Handler Factory object - */ - public static PropertyTransformationHandlerFactory createFactory( - final MappingContext mappingContext) { - return new PropertyTransformationHandlerFactory(mappingContext); - } - - /** - * Check if a transformation is supported by the - * {@link PropertyTransformationHandlerFactory} - * - * @param typeTransformationIdentifier the hale identifier of the transformation - * @return true if the transformation is supported, false otherwise - */ - public static boolean isTransformationSupported(final String typeTransformationIdentifier) { - return PropertyTransformationHandlerFactory.SUPPORTED_TYPES - .contains(typeTransformationIdentifier); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandlerFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandlerFactory.java deleted file mode 100644 index 28e3b06e4d..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/PropertyTransformationHandlerFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - -import eu.esdihumboldt.cst.functions.numeric.MathematicalExpressionFunction; -import eu.esdihumboldt.cst.functions.string.RegexAnalysisFunction; -import eu.esdihumboldt.hale.common.align.model.functions.AssignFunction; -import eu.esdihumboldt.hale.common.align.model.functions.ClassificationMappingFunction; -import eu.esdihumboldt.hale.common.align.model.functions.FormattedStringFunction; -import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; - -/** - * Factory for creating Property Transformation Handlers - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class PropertyTransformationHandlerFactory - extends AbstractTransformationHandlerFactory { - - private final static String SQL_EXPRESSION_ID = "eu.esdihumboldt.hale.io.xtraserver.sqlExpression"; - - private final static String[] supportedTypes = { RenameFunction.ID, - MathematicalExpressionFunction.ID, AssignFunction.ID, AssignFunction.ID_BOUND, - FormattedStringFunction.ID, RegexAnalysisFunction.ID, ClassificationMappingFunction.ID, - CustomFunctionAdvToGeographicalNameSimple.FUNCTION_ID, - CustomFunctionAdvToIdentifier.FUNCTION_ID, CustomFunctionAdvToLocalId.FUNCTION_ID, - CustomFunctionAdvToNamespace.FUNCTION_ID, CustomFunctionAdvToUCUM.FUNCTION_ID, - SQL_EXPRESSION_ID }; - final static Set SUPPORTED_TYPES = Collections - .unmodifiableSet(new HashSet(Arrays.asList(supportedTypes))); - - @SuppressWarnings("serial") - PropertyTransformationHandlerFactory(final MappingContext mappingContext) { - super(mappingContext, new HashMap() { - - { - int i = 0; - put(supportedTypes[i++], new RenameHandler(mappingContext)); - put(supportedTypes[i++], new MathematicalExpressionHandler(mappingContext)); - put(supportedTypes[i++], new AssignHandler(mappingContext)); - put(supportedTypes[i++], new AssignHandler(mappingContext)); - put(supportedTypes[i++], new FormattedStringHandler(mappingContext)); - put(supportedTypes[i++], new RegexHandler(mappingContext)); - put(supportedTypes[i++], new ClassificationMappingHandler(mappingContext)); - put(supportedTypes[i++], - new CustomFunctionAdvToGeographicalNameSimple(mappingContext)); - put(supportedTypes[i++], new CustomFunctionAdvToIdentifier(mappingContext)); - put(supportedTypes[i++], new CustomFunctionAdvToLocalId(mappingContext)); - put(supportedTypes[i++], new CustomFunctionAdvToNamespace(mappingContext)); - put(supportedTypes[i++], new CustomFunctionAdvToUCUM(mappingContext)); - put(supportedTypes[i++], new SqlExpressionHandler(mappingContext)); - } - }); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RegexHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RegexHandler.java deleted file mode 100644 index 66cb90516b..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RegexHandler.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Iterator; -import java.util.List; -import java.util.Optional; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.cst.functions.string.RegexAnalysisFunction; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ChildContext; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the {@link RegexAnalysisFunction} to a {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class RegexHandler extends AbstractPropertyTransformationHandler { - - RegexHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.AbstractPropertyTransformationHandler#doHandle(eu.esdihumboldt.hale.common.align.model.Cell, - * eu.esdihumboldt.hale.common.align.model.Property) - */ - @Override - protected Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - final List regexParam = parameters.get("regexPattern"); - if (regexParam.isEmpty()) { - throw new IllegalArgumentException("Regular expression not set"); - } - final String regex = regexParam.get(0).as(String.class); - - final List outputFormatParam = parameters.get("outputFormat"); - if (outputFormatParam.isEmpty()) { - throw new IllegalArgumentException("Output format for regular expression not set"); - } - final String outputFormat = outputFormatParam.get(0).as(String.class); - - final Iterator it = XtraServerMappingUtils.getSourceProperty(propertyCell) - .getDefinition().getPropertyPath().iterator(); - ChildContext lastItem = null; - while (it.hasNext()) { - lastItem = it.next(); - } - if (lastItem == null) { - throw new IllegalArgumentException("Invalid target for regular expression"); - } - - final String regexpTargetProperty = lastItem.getChild().getName().getLocalPart(); - // Replace {number} with escaped-escaped-escaped \\number - final MappingValue mappingValue = new MappingValueBuilder() - .expression() - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value("regexp_replace($T$." + regexpTargetProperty + ", '" + regex + "', '" - + outputFormat.replaceAll("\\{(\\d)\\}", "\\\\$1") + "', 'g')").build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RenameHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RenameHandler.java deleted file mode 100644 index 98e6c5f8f9..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RenameHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Optional; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; -import eu.esdihumboldt.hale.io.xtraserver.writer.XtraServerMappingUtils; - -/** - * Transforms the {@link RenameFunction} to a {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class RenameHandler extends AbstractPropertyTransformationHandler { - - RenameHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - final MappingValue mappingValue = new MappingValueBuilder() - .column() - .qualifiedTargetPath(buildPath(targetProperty.getDefinition().getPropertyPath())) - .value(propertyName(XtraServerMappingUtils.getSourceProperty(propertyCell) - .getDefinition().getPropertyPath())).build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RetypeHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RetypeHandler.java deleted file mode 100644 index 0fd631e13b..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/RetypeHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Collection; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.Entity; -import eu.esdihumboldt.hale.common.align.model.functions.RetypeFunction; - -/** - * Transforms the {@link RetypeFunction} to a {@link FeatureTypeMapping} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class RetypeHandler extends AbstractTypeTransformationHandler { - - RetypeHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TypeTransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public void doHandle(final Collection sourceTypes, final Entity targetType, - final Cell typeCell) { - createTableIfAbsent(sourceTypes.iterator().next().getDefinition()); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/SqlExpressionHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/SqlExpressionHandler.java deleted file mode 100644 index ce691ed5a4..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/SqlExpressionHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.List; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import com.google.common.collect.ListMultimap; - -import de.interactive_instruments.xtraserver.config.api.MappingValue; -import de.interactive_instruments.xtraserver.config.api.MappingValueBuilder; -import eu.esdihumboldt.hale.common.align.model.Cell; -import eu.esdihumboldt.hale.common.align.model.ParameterValue; -import eu.esdihumboldt.hale.common.align.model.Property; -import eu.esdihumboldt.hale.common.align.model.functions.RenameFunction; - -/** - * Transforms the {@link RenameFunction} to a {@link MappingValue} - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -class SqlExpressionHandler extends AbstractPropertyTransformationHandler { - - final static String PARAMETER_VALUE = "sql"; - - SqlExpressionHandler(final MappingContext mappingContext) { - super(mappingContext); - } - - /** - * @see eu.esdihumboldt.hale.io.xtraserver.writer.handler.TransformationHandler#handle(eu.esdihumboldt.hale.common.align.model.Cell) - */ - @Override - public Optional doHandle(final Cell propertyCell, final Property targetProperty) { - - // Assign expression value from parameters - final ListMultimap parameters = propertyCell - .getTransformationParameters(); - final List valueParams = parameters.get(PARAMETER_VALUE); - final String value = valueParams.get(0).getStringRepresentation(); - - final List path = buildPath(targetProperty.getDefinition().getPropertyPath()); - - final MappingValue mappingValue = new MappingValueBuilder().expression() - .qualifiedTargetPath(path).value(mappingContext.resolveProjectVars(value)).build(); - - return Optional.of(mappingValue); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TransformationHandler.java deleted file mode 100644 index 4a532a08bd..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TransformationHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import eu.esdihumboldt.hale.common.align.model.Cell; - -/** - * Transformation Handler - * - * @param output type to transform to - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -@FunctionalInterface -public interface TransformationHandler { - - /** - * Transforms a alignment cell into an output type - * - * @param cell the alignment cell - * @return output type to transform to - */ - T handle(final Cell cell); -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandler.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandler.java deleted file mode 100644 index a90387b67b..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import de.interactive_instruments.xtraserver.config.api.FeatureTypeMapping; - -/** - * Handler for Type transformations - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -@FunctionalInterface -public interface TypeTransformationHandler extends TransformationHandler { - - /** - * Create a new {@link TypeTransformationHandlerFactory} object - * - * @param mappingContext Mapping Context - * @return new Type Transformation Handler Factory object - */ - public static TypeTransformationHandlerFactory createFactory( - final MappingContext mappingContext) { - return new TypeTransformationHandlerFactory(mappingContext); - } - - /** - * Check if a transformation is supported by the - * {@link TypeTransformationHandlerFactory} - * - * @param typeTransformationIdentifier the hale identifier of the transformation - * @return true if the transformation is supported, false otherwise - */ - public static boolean isTransformationSupported(final String typeTransformationIdentifier) { - return TypeTransformationHandlerFactory.SUPPORTED_TYPES - .contains(typeTransformationIdentifier); - } -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandlerFactory.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandlerFactory.java deleted file mode 100644 index 41445ec6c3..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/TypeTransformationHandlerFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - -import eu.esdihumboldt.hale.common.align.model.functions.JoinFunction; -import eu.esdihumboldt.hale.common.align.model.functions.RetypeFunction; - -/** - * Factory for creating Type Transformation Handlers - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -public class TypeTransformationHandlerFactory - extends AbstractTransformationHandlerFactory { - - private final static String[] supportedTypes = { RetypeFunction.ID, JoinFunction.ID }; - final static Set SUPPORTED_TYPES = Collections - .unmodifiableSet(new HashSet(Arrays.asList(supportedTypes))); - - @SuppressWarnings("serial") - TypeTransformationHandlerFactory(final MappingContext mappingContext) { - super(mappingContext, new HashMap() { - - { - int i = 0; - put(supportedTypes[i++], new RetypeHandler(mappingContext)); - put(supportedTypes[i++], new JoinHandler(mappingContext)); - // GroovyJoins are partially transformed with warnings - put("eu.esdihumboldt.cst.functions.groovy.join", - new GroovyJoinHandler(mappingContext)); - } - }); - } - -} diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/UnsupportedTransformationException.java b/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/UnsupportedTransformationException.java deleted file mode 100644 index 9837996410..0000000000 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/src/eu/esdihumboldt/hale/io/xtraserver/writer/handler/UnsupportedTransformationException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2017 interactive instruments 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: - * interactive instruments GmbH - */ - -package eu.esdihumboldt.hale.io.xtraserver.writer.handler; - -/** - * Exception to indicate that a type or a property transformation is not - * supported - * - * @author Jon Herrmann ( herrmann aT interactive-instruments doT de ) - */ -@SuppressWarnings("serial") -public class UnsupportedTransformationException extends Exception { - - private final String transformationIdentifier; - - /** - * Constructor - * - * @param transformationIdentifier the hale type or property transformation - * identifier - */ - public UnsupportedTransformationException(final String transformationIdentifier) { - super("The transformation is not supported: " + transformationIdentifier); - this.transformationIdentifier = transformationIdentifier; - } - - /** - * Returns the unsupported transformation - * - * @return the transformation identifier - */ - public String getTransformationIdentifier() { - return transformationIdentifier; - } - -} diff --git a/platform/hale-platform.target b/platform/hale-platform.target index 97c80cb54e..588da287d0 100644 --- a/platform/hale-platform.target +++ b/platform/hale-platform.target @@ -47,9 +47,9 @@ - - - - + + + + diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.dropins/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.dropins/feature.xml index ef8f33c2d6..4df7513beb 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.dropins/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.dropins/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.linux/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.linux/feature.xml index bb5a1ac81d..7dfa720ba1 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.linux/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.linux/feature.xml @@ -2,7 +2,7 @@ diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.liveeditor/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.liveeditor/feature.xml index 7e164d0b19..c696a97799 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.liveeditor/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.liveeditor/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.macosx/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.macosx/feature.xml index 878c8ef71c..94636e62f6 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.macosx/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.macosx/feature.xml @@ -2,7 +2,7 @@ diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.rcp/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.rcp/feature.xml index dba7db1967..f723a24091 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.rcp/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.rcp/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.updates/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.updates/feature.xml index 35acb95083..04a8a65396 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.updates/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.updates/feature.xml @@ -2,7 +2,7 @@ diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.win32/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.win32/feature.xml index 30fd9627d5..ec8bffdf3c 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.win32/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.win32/feature.xml @@ -2,7 +2,7 @@ diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature.zest/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature.zest/feature.xml index a78354d31d..2646be3d0e 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature.zest/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature.zest/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. diff --git a/ui/features/eu.esdihumboldt.hale.ui.feature/feature.xml b/ui/features/eu.esdihumboldt.hale.ui.feature/feature.xml index 9b367a698c..8c4156b534 100644 --- a/ui/features/eu.esdihumboldt.hale.ui.feature/feature.xml +++ b/ui/features/eu.esdihumboldt.hale.ui.feature/feature.xml @@ -2,7 +2,7 @@ @@ -511,11 +511,4 @@ version="0.0.0" unpack="false"/> - - diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.application.help.external/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.application.help.external/META-INF/MANIFEST.MF index 950bd4ffbc..b7c1ce4eb0 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.application.help.external/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.application.help.external/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: External Browser for Help Bundle-SymbolicName: eu.esdihumboldt.hale.ui.application.help.external -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Fragment-Host: eu.esdihumboldt.hale.ui.application;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.application.help.internal/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.application.help.internal/META-INF/MANIFEST.MF index ceb643a71a..4ac2db8dee 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.application.help.internal/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.application.help.internal/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Internal Browser for Help Bundle-SymbolicName: eu.esdihumboldt.hale.ui.application.help.internal -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Fragment-Host: eu.esdihumboldt.hale.ui.application;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.application/HALE.product b/ui/plugins/eu.esdihumboldt.hale.ui.application/HALE.product index fdca14355c..c3de1d9005 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.application/HALE.product +++ b/ui/plugins/eu.esdihumboldt.hale.ui.application/HALE.product @@ -1,7 +1,7 @@ - + diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.application/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.application/META-INF/MANIFEST.MF index 43093471ab..cc78bde64d 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.application/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.application/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Application Bundle-SymbolicName: eu.esdihumboldt.hale.ui.application;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0", org.eclipse.ui;bundle-version="3.6.2", @@ -40,6 +40,7 @@ Import-Package: com.google.common.collect;version="15.0.0", eu.esdihumboldt.hale.ui.views.tasks, eu.esdihumboldt.hale.ui.views.typehierarchy, org.apache.commons.io, + org.apache.commons.lang3;version="3.8.1", org.eclipse.e4.ui.css.swt.theme, org.geotools.referencing, org.slf4j;version="1.5.11", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.application/plugin.xml b/ui/plugins/eu.esdihumboldt.hale.ui.application/plugin.xml index fd85afc477..5c7dbece1e 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.application/plugin.xml +++ b/ui/plugins/eu.esdihumboldt.hale.ui.application/plugin.xml @@ -100,7 +100,7 @@ + value="© 2021 wetransform GmbH » www.wetransform.to"> getRepresentationType() { } @Override - public boolean supportsRemoval() { + public boolean supportsRemoval(String resourceId) { return true; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.common.definition.editors/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.common.definition.editors/META-INF/MANIFEST.MF index c173cbd439..e7b335ae1d 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.common.definition.editors/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.common.definition.editors/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Attribute Editor Bundle Bundle-SymbolicName: eu.esdihumboldt.hale.ui.common.definition.editors;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension, de.fhg.igd.osgi.util, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.common.graph/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.common.graph/META-INF/MANIFEST.MF index c1eee85b72..d92f5eb4e5 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.common.graph/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.common.graph/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Common Graph UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.common.graph;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.ui.common.graph.content, eu.esdihumboldt.hale.ui.common.graph.figures, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.common/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.common/META-INF/MANIFEST.MF index d5bd27c45f..a580969f75 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.common/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.common/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Common UI Utilities Bundle-SymbolicName: eu.esdihumboldt.hale.ui.common;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.cst.debug/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.cst.debug/META-INF/MANIFEST.MF index d489883cc5..88f28c6f68 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.cst.debug/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.cst.debug/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST Debug UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.cst.debug;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.ui.cst.debug.internal.CSTDebugBundle Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.cst/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.cst/META-INF/MANIFEST.MF index d1f03ab048..1abbc07ce2 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.cst/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.cst/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CST UI Components Bundle-SymbolicName: eu.esdihumboldt.hale.ui.cst;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.cst;bundle-version="2.5.0", org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.examples/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.examples/META-INF/MANIFEST.MF index fa3e617487..5da5ef9bec 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.examples/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.examples/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Examples UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.examples;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", org.eclipse.ui;bundle-version="3.7.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.filter/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.filter/META-INF/MANIFEST.MF index 28db0d00a1..3df6c0a6cf 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.filter/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.filter/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Filter UI Components Bundle-SymbolicName: eu.esdihumboldt.hale.ui.filter;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension, eu.esdihumboldt.hale.common.align.model, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.firststeps/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.firststeps/META-INF/MANIFEST.MF index e5906023e6..498d716d2b 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.firststeps/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.firststeps/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Firststeps Bundle-SymbolicName: eu.esdihumboldt.hale.ui.firststeps;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.ui, org.eclipse.help.ui, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.core/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.core/META-INF/MANIFEST.MF index 0958ee4c3f..14de306a4c 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.core/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI for CST core functions Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.core;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.custom/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.custom/META-INF/MANIFEST.MF index ecb1d7c060..ea4a96af3f 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.custom/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.custom/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Custom Functions UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.custom;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.106.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.geometric/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.geometric/META-INF/MANIFEST.MF index f3fb44b09d..4cddd56a72 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.geometric/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.geometric/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI for CST geometric functions Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.geometric;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.ui, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.groovy/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.groovy/META-INF/MANIFEST.MF index cb46779a87..51cbf00adf 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.groovy/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI for CST Groovy functions Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui, com.google.guava, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.inspire/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.inspire/META-INF/MANIFEST.MF index 9f3be15290..e88b35561a 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.inspire/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.inspire/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Inspire Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.inspire;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0", com.google.guava;bundle-version="9.0.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.functions.numeric/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.functions.numeric/META-INF/MANIFEST.MF index 69ba9c95e9..aaa8fbe6f7 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.functions.numeric/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.functions.numeric/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI for CST numeric functions Bundle-SymbolicName: eu.esdihumboldt.hale.ui.functions.numeric;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.align, eu.esdihumboldt.hale.ui, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.geometry/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.geometry/META-INF/MANIFEST.MF index 0d64281cea..84c2c76d80 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.geometry/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.geometry/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE UI Geometry Support Bundle-SymbolicName: eu.esdihumboldt.hale.ui.geometry;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.ui.geometry.internal.GeometryUIBundle Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.index/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.index/META-INF/MANIFEST.MF index 5830360d6b..7200fde027 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.index/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.index/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Instance index Bundle-SymbolicName: eu.esdihumboldt.hale.ui.index;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="17.0.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.instancevalidation/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.instancevalidation/META-INF/MANIFEST.MF index a5e40dd055..b18d9009df 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.instancevalidation/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.instancevalidation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Statusbar component showing instance validation results Bundle-SymbolicName: eu.esdihumboldt.hale.ui.instancevalidation;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.launchaction/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.launchaction/META-INF/MANIFEST.MF index 44c662f20e..886c29925f 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.launchaction/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.launchaction/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE UI Launch Action Extension Point Bundle-SymbolicName: eu.esdihumboldt.hale.ui.launchaction;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.logback.config/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.logback.config/META-INF/MANIFEST.MF index a4799d94f1..ec00dc2bd8 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.logback.config/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.logback.config/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Logback Configuration Bundle-SymbolicName: eu.esdihumboldt.hale.ui.logback.config -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: ch.qos.logback.classic;bundle-version="0.9.19.v20100519-1505" Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.2 Automatic-Module-Name: eu.esdihumboldt.hale.ui.logback.config diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.lookup/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.lookup/META-INF/MANIFEST.MF index 1011fbb2e5..ad57bf307c 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.lookup/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.lookup/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Lookup Table UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.lookup;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.common.lookup;bundle-version="2.5.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.lookup/src/eu/esdihumboldt/hale/ui/lookup/LookupTableUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui.lookup/src/eu/esdihumboldt/hale/ui/lookup/LookupTableUIAdvisor.java index ab925e9573..7470256ba3 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.lookup/src/eu/esdihumboldt/hale/ui/lookup/LookupTableUIAdvisor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.lookup/src/eu/esdihumboldt/hale/ui/lookup/LookupTableUIAdvisor.java @@ -33,7 +33,7 @@ public Class getRepresentationType() { } @Override - public boolean supportsRemoval() { + public boolean supportsRemoval(String resourceId) { return true; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.quickaccess/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.quickaccess/META-INF/MANIFEST.MF index 204fa8278e..0a5f79e592 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.quickaccess/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.quickaccess/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Adds Quickaccess to toolbar Bundle-SymbolicName: eu.esdihumboldt.hale.ui.quickaccess;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: data harmonisation panel Require-Bundle: org.eclipse.e4.ui.workbench, org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.12.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.schema.presets/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.schema.presets/META-INF/MANIFEST.MF index 2747d1f4f7..51a91e55aa 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.schema.presets/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.schema.presets/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Prefedined Schema Source Bundle-SymbolicName: eu.esdihumboldt.hale.ui.schema.presets;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: eu.esdihumboldt.hale.ui;bundle-version="2.5.0", eu.esdihumboldt.hale.common.schema;bundle-version="2.5.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.scripting/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.scripting/META-INF/MANIFEST.MF index 2452a7a224..fdab97ee75 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.scripting/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.scripting/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Scripting UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.scripting;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui, eu.esdihumboldt.hale.common.scripting, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.style/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.style/META-INF/MANIFEST.MF index 86a451450c..c5840109e6 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.style/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.style/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Style UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui.style;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.ui.style, eu.esdihumboldt.hale.ui.style.dialog, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.style/src/eu/esdihumboldt/hale/ui/style/service/internal/StyleServiceImpl.java b/ui/plugins/eu.esdihumboldt.hale.ui.style/src/eu/esdihumboldt/hale/ui/style/service/internal/StyleServiceImpl.java index de236c13cd..4a74728376 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.style/src/eu/esdihumboldt/hale/ui/style/service/internal/StyleServiceImpl.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.style/src/eu/esdihumboldt/hale/ui/style/service/internal/StyleServiceImpl.java @@ -115,6 +115,11 @@ public void schemaAdded(SchemaSpaceID spaceID, Schema schema) { update(); } + @Override + public void schemaRemoved(SchemaSpaceID spaceID) { + update(); + } + @Override public void schemasCleared(SchemaSpaceID spaceID) { update(); @@ -465,11 +470,9 @@ private Collection findTypes(Set featureTypeNames) { Collection result = new ArrayList(); // search source... - result.addAll( - findTypes(schemaService.getSchemas(SchemaSpaceID.SOURCE), qnames, localnames)); + result.addAll(findTypes(schemaService.getSchemas(SchemaSpaceID.SOURCE), qnames, localnames)); // and target types - result.addAll( - findTypes(schemaService.getSchemas(SchemaSpaceID.TARGET), qnames, localnames)); + result.addAll(findTypes(schemaService.getSchemas(SchemaSpaceID.TARGET), qnames, localnames)); return result; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.templates/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.templates/META-INF/MANIFEST.MF index 7cfde22070..c2b1cddbd2 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.templates/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.templates/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Templates Bundle-SymbolicName: eu.esdihumboldt.hale.ui.templates;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.io;version="11.0.1", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.ttreeexporter/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.ttreeexporter/META-INF/MANIFEST.MF index 089f8b0359..ee1613049b 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.ttreeexporter/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.ttreeexporter/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Ttreeexporter Bundle-SymbolicName: eu.esdihumboldt.hale.ui.ttreeexporter;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: eu.esdihumboldt.cst.extension.hooks, eu.esdihumboldt.hale.common.align.model.transformation.tree, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util.graph/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.util.graph/META-INF/MANIFEST.MF index 4a6038105d..6c9388fd29 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util.graph/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util.graph/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Graph UI Utilities Bundle-SymbolicName: eu.esdihumboldt.hale.ui.util.graph -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0", org.eclipse.zest.core;bundle-version="2.0.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy.test/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy.test/META-INF/MANIFEST.MF index 940181ef40..9d02baea55 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy.test/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy UI Tests Bundle-SymbolicName: eu.esdihumboldt.hale.ui.util.groovy.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Fragment-Host: eu.esdihumboldt.hale.ui.util.groovy;bundle-version="2.8.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy/META-INF/MANIFEST.MF index b7f909fd50..059e8b865e 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Simple Groovy Source Viewer Support Bundle-SymbolicName: eu.esdihumboldt.hale.ui.util.groovy;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.ui.util.groovy.internal.GroovyUIPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.util/META-INF/MANIFEST.MF index fc22f62200..69988f30b8 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util/META-INF/MANIFEST.MF @@ -2,11 +2,12 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: UI Utilities Bundle-SymbolicName: eu.esdihumboldt.hale.ui.util;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.ui.util.internal.UIUtilitiesPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, - org.eclipse.jface.text;bundle-version="3.7.1" + org.eclipse.jface.text;bundle-version="3.7.1", + org.eclipse.core.net;bundle-version="1.3.800" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.ui.util, @@ -31,8 +32,9 @@ Export-Package: eu.esdihumboldt.hale.ui.util, eu.esdihumboldt.hale.ui.util.wizard Import-Package: com.google.common.base;version="11.0.1", com.google.common.util.concurrent;version="15.0.0", - de.fhg.igd.slf4jplus, de.fhg.igd.osgi.util;version="1.0.0", + de.fhg.igd.slf4jplus, + eu.esdihumboldt.hale.common.core, eu.esdihumboldt.util, eu.esdihumboldt.util.http, org.apache.http, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/ExtendedFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/ExtendedFileFieldEditor.java index 9a0689dc50..edff8a83cf 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/ExtendedFileFieldEditor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/ExtendedFileFieldEditor.java @@ -18,8 +18,10 @@ import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.preference.FileFieldEditor; @@ -34,10 +36,9 @@ public class ExtendedFileFieldEditor extends FileFieldEditor { private String[] extensions; - private String[] names; - - private int style; + private final int style; + private static final String LINE_SEPARATOR = "line.separator"; /** * Create a file field editor @@ -115,12 +116,22 @@ protected String changePressed() { if (!f.exists()) { f = null; } - File d = getFile(f); + List d = getFiles(f); if (d == null) { return null; } - return d.getAbsolutePath(); + StringBuffer absolutePaths = new StringBuffer(); + if (d.size() == 1) { + absolutePaths.append(d.get(0).getAbsolutePath()); + } + else { + d.forEach(file -> { + absolutePaths.append(file.getAbsolutePath()); + absolutePaths.append(System.getProperty(LINE_SEPARATOR)); + }); + } + return absolutePaths.toString(); } /** @@ -152,6 +163,47 @@ protected File getFile(File startingDirectory) { return null; } + /** + * Helper to open the file chooser dialog to select multiple files. + * + * @param startingDirectory the directory to open the dialog on. + * @return File List of file(s) the user selected or Empty list + * if they do not. + */ + protected List getFiles(File startingDirectory) { + + FileDialog dialog = new FileDialog(getShell(), style); + if (startingDirectory != null) { + dialog.setFileName(startingDirectory.getPath()); + } + if (extensions != null) { + dialog.setFilterExtensions(extensions); + } + if (names != null) { + dialog.setFilterNames(names); + } + + List files = new ArrayList<>(); + if (dialog.open() != null) { + String[] fileNames = dialog.getFileNames(); + String filterPath = dialog.getFilterPath(); + + Arrays.asList(fileNames).forEach(filename -> { + File f = new File(filename); + if (f.isAbsolute()) { + files.add(new File(filename)); + } + else if (filename != null) { + filename = filename.trim(); + if (filename.length() > 0) { + files.add(new File(filterPath + File.separator + filename)); + } + } + }); + } + return files; + } + /** * Sets this file field editor's file extension filter. * @@ -181,6 +233,10 @@ public void setFilterNames(String[] names) { * @param types the content types */ public void setContentTypes(Set types) { + + /** + * when loading for instance then enable multi selection for csv too. + */ List filters = new ArrayList(); List extensions = new ArrayList(); for (IContentType type : types) { @@ -211,7 +267,7 @@ public void setContentTypes(Set types) { } } - if ((style & SWT.OPEN) != 0) { + if (((style & SWT.OPEN) != 0) || ((style & SWT.MULTI) != 0)) { // insert filter for all supported files if (extensions.size() > 1) { StringBuffer supportedExtensions = new StringBuffer(); @@ -238,4 +294,19 @@ public void setContentTypes(Set types) { setFilterNames(filters.toArray(new String[filters.size()])); } + /** + * Method to return list of filepaths from filepath string delimited by + * System.getProperty(LINE_SEPARATOR). + * + * @return list of file paths after splitting. + */ + public List getStringValues() { + String stringValue = getStringValue(); + String[] split = stringValue.split(System.getProperty(LINE_SEPARATOR)); + + List collect = Arrays.asList(split).stream().filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); + return collect; + } + } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/OpenFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/OpenFileFieldEditor.java index bbb0f68756..73ff5fded4 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/OpenFileFieldEditor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/io/OpenFileFieldEditor.java @@ -51,6 +51,15 @@ public OpenFileFieldEditor(String name, String labelText, boolean enforceAbsolut super(name, labelText, enforceAbsolute, validationStrategy, parent, OPEN_STYLE); } + /** + * @see ExtendedFileFieldEditor#ExtendedFileFieldEditor(String, String, + * boolean, int, Composite, int ) + */ + public OpenFileFieldEditor(String name, String labelText, boolean enforceAbsolute, + int validationStrategy, Composite parent, int style) { + super(name, labelText, enforceAbsolute, validationStrategy, parent, style); + } + /** * @see FileFieldEditor#FileFieldEditor(String, String, Composite) */ diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/ProxySettings.java b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/ProxySettings.java index 53b3f82218..4906f09089 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/ProxySettings.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/ProxySettings.java @@ -17,13 +17,20 @@ package eu.esdihumboldt.hale.ui.util.proxy; import java.net.Authenticator; +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; +import org.eclipse.core.net.proxy.IProxyData; +import org.eclipse.core.net.proxy.IProxyService; +import org.eclipse.core.runtime.CoreException; import org.eclipse.equinox.security.storage.SecurePreferencesFactory; import org.eclipse.equinox.security.storage.StorageException; import org.eclipse.jface.preference.IPreferenceStore; import de.fhg.igd.slf4jplus.ALogger; import de.fhg.igd.slf4jplus.ALoggerFactory; +import eu.esdihumboldt.hale.common.core.HalePlatform; import eu.esdihumboldt.hale.ui.util.internal.UIUtilitiesPlugin; import eu.esdihumboldt.hale.ui.util.proxy.preferences.PreferenceConstants; import eu.esdihumboldt.util.http.ProxyUtil; @@ -37,6 +44,10 @@ public class ProxySettings { private static ALogger log = ALoggerFactory.getLogger(ProxySettings.class); + private static final IProxyService PROXY_SERVICE = HalePlatform.getService(IProxyService.class); + private static final List HTTP_PROXY_TYPES = Arrays.asList(IProxyData.HTTP_PROXY_TYPE, + IProxyData.HTTPS_PROXY_TYPE); + /** * Install the proxy settings for them to be initialized when a proxy is * used from {@link ProxyUtil} @@ -51,7 +62,11 @@ public static void install() { @Override public void run() { - applyCurrentSettings(); + try { + applyCurrentSettings(); + } catch (CoreException e) { + log.error("Proxy settings could not be applied", e); //$NON-NLS-1$ + } } }); } @@ -59,8 +74,10 @@ public void run() { /** * Apply the current proxy settings to the system + * + * @throws CoreException if the proxy settings cannot be applied */ - public static void applyCurrentSettings() { + public static void applyCurrentSettings() throws CoreException { // update proxy system properties IPreferenceStore prefs = UIUtilitiesPlugin.getDefault().getPreferenceStore(); String host = prefs.getString(PreferenceConstants.CONNECTION_PROXY_HOST); @@ -76,40 +93,27 @@ public static void applyCurrentSettings() { nonProxyHosts = nonProxyHosts.replaceAll(";", "|"); //$NON-NLS-1$ //$NON-NLS-2$ } + List proxyData = Arrays.asList(PROXY_SERVICE.getProxyData()); if (host == null || host.isEmpty()) { - System.clearProperty("http.proxyHost"); //$NON-NLS-1$ - System.clearProperty("https.proxyHost"); //$NON-NLS-1$ - - System.clearProperty("http.proxyPort"); //$NON-NLS-1$ - System.clearProperty("https.proxyPort"); //$NON-NLS-1$ - - System.clearProperty("http.nonProxyHosts"); //$NON-NLS-1$ - // http.nonProxyHost is used also by https - - System.clearProperty("http.proxyUser"); //$NON-NLS-1$ - System.clearProperty("https.proxyUser"); //$NON-NLS-1$ - - System.clearProperty("http.proxyPassword"); //$NON-NLS-1$ - System.clearProperty("https.proxyPassword"); //$NON-NLS-1$ + disableProxy(); } else { - System.setProperty("http.proxyHost", host); //$NON-NLS-1$ - System.setProperty("https.proxyHost", host); //$NON-NLS-1$ + forEachHttpProxyType(proxyData, p -> { + p.setHost(host); + p.setPort(port); + }); - System.setProperty("http.proxyPort", String.valueOf(port)); //$NON-NLS-1$ - System.setProperty("https.proxyPort", String.valueOf(port)); //$NON-NLS-1$ if (nonProxyHosts == null || nonProxyHosts.isEmpty()) { - System.clearProperty("http.nonProxyHosts"); //$NON-NLS-1$ + PROXY_SERVICE.setNonProxiedHosts(new String[] {}); } else { - System.setProperty("http.nonProxyHosts", nonProxyHosts); //$NON-NLS-1$ + PROXY_SERVICE.setNonProxiedHosts(nonProxyHosts.split("\\|")); } // only check user/password if host is set String proxyUser = prefs.getString(PreferenceConstants.CONNECTION_PROXY_USER); if (proxyUser != null && !proxyUser.isEmpty()) { - System.setProperty("http.proxyUser", proxyUser); //$NON-NLS-1$ - System.setProperty("https.proxyUser", proxyUser); //$NON-NLS-1$ + forEachHttpProxyType(proxyData, p -> p.setUserid(proxyUser)); try { String password = SecurePreferencesFactory.getDefault() @@ -117,27 +121,41 @@ public static void applyCurrentSettings() { .get(PreferenceConstants.CONNECTION_PROXY_PASSWORD, null); if (password != null) { - System.setProperty("http.proxyPassword", password); //$NON-NLS-1$ - System.setProperty("https.proxyPassword", password); //$NON-NLS-1$ + forEachHttpProxyType(proxyData, p -> p.setPassword(password)); Authenticator.setDefault(new HttpAuth(proxyUser, password)); } else { - System.clearProperty("http.proxyPassword"); //$NON-NLS-1$ - System.clearProperty("https.proxyPassword"); //$NON-NLS-1$ + forEachHttpProxyType(proxyData, p -> p.setPassword("")); } } catch (StorageException e) { log.error("Error accessing secure preferences for proxy password"); //$NON-NLS-1$ } } else { - System.clearProperty("http.proxyUser"); //$NON-NLS-1$ - System.clearProperty("https.proxyUser"); //$NON-NLS-1$ - - System.clearProperty("http.proxyPassword"); //$NON-NLS-1$ - System.clearProperty("https.proxyPassword"); //$NON-NLS-1$ + forEachHttpProxyType(proxyData, p -> { + p.setUserid(""); + p.setPassword(""); + }); } + + applyProxyData(proxyData); } } + private static void forEachHttpProxyType(List proxyData, + Consumer action) { + proxyData.stream().filter(p -> HTTP_PROXY_TYPES.contains(p.getType())).forEach(action); + } + + private static void applyProxyData(List proxyData) throws CoreException { + PROXY_SERVICE.setProxyData((IProxyData[]) proxyData.toArray()); + PROXY_SERVICE.setProxiesEnabled(true); + PROXY_SERVICE.setSystemProxiesEnabled(false); + } + + private static void disableProxy() { + PROXY_SERVICE.setProxiesEnabled(false); + PROXY_SERVICE.setSystemProxiesEnabled(false); + } } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/preferences/ProxyPreferencePage.java b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/preferences/ProxyPreferencePage.java index e50bebacea..59c9672d06 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/preferences/ProxyPreferencePage.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.util/src/eu/esdihumboldt/hale/ui/util/proxy/preferences/ProxyPreferencePage.java @@ -16,6 +16,7 @@ package eu.esdihumboldt.hale.ui.util.proxy.preferences; +import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IntegerFieldEditor; @@ -27,6 +28,8 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; +import de.fhg.igd.slf4jplus.ALogger; +import de.fhg.igd.slf4jplus.ALoggerFactory; import eu.esdihumboldt.hale.ui.util.components.PasswordFieldEditor; import eu.esdihumboldt.hale.ui.util.internal.Messages; import eu.esdihumboldt.hale.ui.util.internal.UIUtilitiesPlugin; @@ -37,10 +40,10 @@ * * @author Michel Kraemer */ -public class ProxyPreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { +public class ProxyPreferencePage extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { -// private static final ALogger _log = ALoggerFactory.getLogger(ProxyPreferencePage.class); + private static final ALogger log = ALoggerFactory.getLogger(ProxyPreferencePage.class); /** * Default constructor @@ -95,7 +98,12 @@ public boolean performOk() { return false; } - ProxySettings.applyCurrentSettings(); + try { + ProxySettings.applyCurrentSettings(); + } catch (CoreException e) { + log.userError("Proxy settings could not be applied", e); + return false; + } return true; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.data/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.data/META-INF/MANIFEST.MF index b5663aba58..f61d68cb08 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.data/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.data/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Data Views Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.data;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0", org.eclipse.ui;bundle-version="3.6.2", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.data/src/eu/esdihumboldt/hale/ui/views/data/internal/filter/InstanceServiceSelector.java b/ui/plugins/eu.esdihumboldt.hale.ui.views.data/src/eu/esdihumboldt/hale/ui/views/data/internal/filter/InstanceServiceSelector.java index 39fa784c0b..e2de2ef74a 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.data/src/eu/esdihumboldt/hale/ui/views/data/internal/filter/InstanceServiceSelector.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.data/src/eu/esdihumboldt/hale/ui/views/data/internal/filter/InstanceServiceSelector.java @@ -233,6 +233,18 @@ public void run() { }); } + @Override + public void schemaRemoved(SchemaSpaceID spaceID) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateTypesSelection(); + } + }); + } + @Override public void schemasCleared(SchemaSpaceID spaceID) { final Display display = PlatformUI.getWorkbench().getDisplay(); diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.functions/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.functions/META-INF/MANIFEST.MF index 05b79640be..a1b32b4ea5 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.functions/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.functions/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Functions View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.functions;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Activator: eu.esdihumboldt.hale.ui.views.functions.internal.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.mapping/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.mapping/META-INF/MANIFEST.MF index 06bd17a7ee..478b2ef9d5 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.mapping/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.mapping/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Mapping View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.mapping;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0", org.eclipse.ui;bundle-version="3.6.2", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.properties/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.properties/META-INF/MANIFEST.MF index ed5c4a8a45..75eb85dcb1 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.properties/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.properties/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Properties View Contributions Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.properties;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.6.2", org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.100", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.report/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.report/META-INF/MANIFEST.MF index 63d39675cc..218d17c214 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.report/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.report/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Report View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.report;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="9.0.0", de.fhg.igd.eclipse.util.extension, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/META-INF/MANIFEST.MF index 37cfb118ed..3b8982bfc0 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Project Resources View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.resources;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0", @@ -16,9 +16,14 @@ Import-Package: com.google.common.collect;version="15.0.0", eu.esdihumboldt.hale.common.core.io.extension, eu.esdihumboldt.hale.common.core.io.project, eu.esdihumboldt.hale.common.core.io.project.model, + eu.esdihumboldt.hale.common.instance.model, + eu.esdihumboldt.hale.common.schema, + eu.esdihumboldt.hale.common.schema.model, eu.esdihumboldt.hale.ui.common, eu.esdihumboldt.hale.ui.io.action, + eu.esdihumboldt.hale.ui.service.instance, eu.esdihumboldt.hale.ui.service.project, + eu.esdihumboldt.hale.ui.service.schema, eu.esdihumboldt.hale.ui.util.viewer, eu.esdihumboldt.hale.ui.views.properties, org.eclipse.ui.views.properties.tabbed, diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/ResourcesView.java b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/ResourcesView.java index 5929a851c1..1947f4d892 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/ResourcesView.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/ResourcesView.java @@ -15,6 +15,7 @@ package eu.esdihumboldt.hale.ui.views.resources; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -25,8 +26,16 @@ import eu.esdihumboldt.hale.common.core.io.project.ProjectInfo; import eu.esdihumboldt.hale.common.core.io.project.model.Resource; +import eu.esdihumboldt.hale.common.instance.model.DataSet; +import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; +import eu.esdihumboldt.hale.ui.service.instance.InstanceService; +import eu.esdihumboldt.hale.ui.service.instance.InstanceServiceAdapter; import eu.esdihumboldt.hale.ui.service.project.ProjectService; import eu.esdihumboldt.hale.ui.service.project.ProjectServiceAdapter; +import eu.esdihumboldt.hale.ui.service.schema.SchemaService; +import eu.esdihumboldt.hale.ui.service.schema.SchemaServiceListener; import eu.esdihumboldt.hale.ui.util.viewer.ViewerMenu; import eu.esdihumboldt.hale.ui.views.properties.PropertiesViewPart; import eu.esdihumboldt.hale.ui.views.resources.internal.ProjectToken; @@ -42,6 +51,8 @@ public class ResourcesView extends PropertiesViewPart { private TreeViewer viewer; private ProjectServiceAdapter projectServiceListener; + private SchemaServiceListener ssListener; + private InstanceServiceAdapter isa; @Override protected void createViewControl(Composite parent) { @@ -75,6 +86,7 @@ public void projectInfoChanged(ProjectInfo info) { @Override public void run() { viewer.update(ProjectToken.TOKEN, null); + updateInDisplayThread(); } }); } @@ -88,6 +100,82 @@ public void run() { new ViewerMenu(getSite(), viewer); getSite().setSelectionProvider(viewer); + + // adding listener to refresh the resource view when any schema, + // instance is added or cleared. + SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class); + ssListener = new SchemaServiceListener() { + + @Override + public void schemaRemoved(SchemaSpaceID spaceID) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateInDisplayThread(); + } + }); + } + + @Override + public void schemasCleared(final SchemaSpaceID spaceID) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateInDisplayThread(); + } + }); + } + + @Override + public void schemaAdded(final SchemaSpaceID spaceID, Schema schema) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateInDisplayThread(); + } + }); + } + + @Override + public void mappableTypesChanged(final SchemaSpaceID spaceID, + Collection types) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateInDisplayThread(); + } + }); + } + + }; + + ss.addSchemaServiceListener(ssListener); + + InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class); + is.addListener(isa = new InstanceServiceAdapter() { + + @Override + public void datasetChanged(DataSet type) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + updateInDisplayThread(); + } + }); + } + + }); + } /** @@ -100,6 +188,7 @@ protected void updateInDisplayThread() { @Override public void run() { update(); + refreshInDisplayThread(); } }); } @@ -120,6 +209,7 @@ protected void update() { @Override public void setFocus() { viewer.getTree().setFocus(); + refreshInDisplayThread(); } @Override @@ -128,8 +218,41 @@ public void dispose() { if (projectServiceListener != null) { ps.removeListener(projectServiceListener); } - + SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class); + if (ssListener != null) { + ss.removeSchemaServiceListener(ssListener); + } + InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class); + if (isa != null) { + is.removeListener(isa); + } super.dispose(); } + /** + * Refresh tree viewer in the display thread + */ + protected void refreshInDisplayThread() { + if (Display.getCurrent() != null) { + refresh(); + } + else { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + refresh(); + } + }); + } + } + + /** + * Refresh the tree viewer. + */ + public void refresh() { + viewer.refresh(true); + } + } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/internal/ResourcesLabelProvider.java b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/internal/ResourcesLabelProvider.java index 8d9029cff1..7f8a750dd2 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/internal/ResourcesLabelProvider.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.resources/src/eu/esdihumboldt/hale/ui/views/resources/internal/ResourcesLabelProvider.java @@ -52,18 +52,21 @@ public void update(ViewerCell cell) { Object element = cell.getElement(); cell.setImage(getImage(element)); - StyledString text = new StyledString(getText(element)); - - if (element instanceof Resource) { - Resource resource = (Resource) element; - if (resource.getContentType() != null) { - text.append(" (" + resource.getContentType().getName() + ")", - StyledString.DECORATIONS_STYLER); + String elementText = getText(element); + // avoid NPE when relative path check box selected. + if (elementText != null) { + StyledString text = new StyledString(elementText); + if (element instanceof Resource) { + Resource resource = (Resource) element; + if (resource.getContentType() != null) { + text.append(" (" + resource.getContentType().getName() + ")", + StyledString.DECORATIONS_STYLER); + } } - } - cell.setText(text.getString()); - cell.setStyleRanges(text.getStyleRanges()); + cell.setText(text.getString()); + cell.setStyleRanges(text.getStyleRanges()); + } super.update(cell); } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/META-INF/MANIFEST.MF index e52276bf98..d6cc089722 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Schema Views Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.schemas;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.hale.ui.views.schemas, eu.esdihumboldt.hale.ui.views.schemas.internal;x-internal:=true diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/SchemaExplorer.java b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/SchemaExplorer.java index bbe0c5df79..7062dc6e84 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/SchemaExplorer.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/SchemaExplorer.java @@ -224,6 +224,7 @@ public TreeViewer getTreeViewer() { public void setSchema(TypeIndex schema) { this.schema = schema; tree.setInput(schema); + refreshInDisplayThread(); } /** diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/ServiceSchemaExplorer.java b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/ServiceSchemaExplorer.java index e0488541d5..30483a93ab 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/ServiceSchemaExplorer.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.schemas/src/eu/esdihumboldt/hale/ui/views/schemas/explorer/ServiceSchemaExplorer.java @@ -17,6 +17,7 @@ import java.util.Collection; import java.util.Map; +import java.util.stream.StreamSupport; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; @@ -25,6 +26,7 @@ import eu.esdihumboldt.hale.common.align.model.EntityDefinition; import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.ui.common.service.population.PopulationListener; import eu.esdihumboldt.hale.ui.common.service.population.PopulationService; @@ -78,6 +80,29 @@ public ServiceSchemaExplorer(final SchemaExplorer explorer, final SchemaSpaceID schemaService = PlatformUI.getWorkbench().getService(SchemaService.class); schemaService.addSchemaServiceListener(schemaListener = new SchemaServiceListener() { + @Override + public void schemaRemoved(SchemaSpaceID spaceID) { + final Display display = PlatformUI.getWorkbench().getDisplay(); + display.syncExec(new Runnable() { + + @Override + public void run() { + if (spaceID.equals(schemaSpace)) { + SchemaSpace schemas = schemaService.getSchemas(spaceID); + if (StreamSupport.stream(schemas.getSchemas().spliterator(), false) + .count() == 0) { + explorer.setSchema(null); + } + else { + explorer.setSchema(schemaService.getSchemas(spaceID)); + } + } + refreshInDisplayThread(); + } + }); + + } + @Override public void schemasCleared(final SchemaSpaceID spaceID) { final Display display = PlatformUI.getWorkbench().getDisplay(); @@ -87,6 +112,7 @@ public void schemasCleared(final SchemaSpaceID spaceID) { public void run() { if (spaceID.equals(schemaSpace)) { explorer.setSchema(null); + refreshInDisplayThread(); } } }); @@ -102,6 +128,7 @@ public void run() { if (spaceID.equals(schemaSpace)) { explorer.setSchema(schemaService.getSchemas(spaceID)); } + refreshInDisplayThread(); } }); } @@ -117,6 +144,7 @@ public void run() { if (spaceID.equals(schemaSpace)) { explorer.setSchema(schemaService.getSchemas(spaceID)); } + refreshInDisplayThread(); } }); } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.tasks/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.tasks/META-INF/MANIFEST.MF index 10e4dbf0b2..bbca1ce3dd 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.tasks/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.tasks/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tasks View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.tasks;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0", eu.esdihumboldt.hale.ui.views.properties;bundle-version="3.3.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.transformation/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.transformation/META-INF/MANIFEST.MF index d5712bbbd3..3fad841781 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.transformation/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.transformation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Transformation View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.transformation;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0", org.eclipse.core.runtime;bundle-version="3.7.0", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui.views.typehierarchy/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui.views.typehierarchy/META-INF/MANIFEST.MF index 1ed412607a..25aaf7fee1 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui.views.typehierarchy/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui.views.typehierarchy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Type Hierarchy View Bundle-SymbolicName: eu.esdihumboldt.hale.ui.views.typehierarchy; singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.ui.forms;bundle-version="3.5.2" diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/META-INF/MANIFEST.MF b/ui/plugins/eu.esdihumboldt.hale.ui/META-INF/MANIFEST.MF index 79c173f753..9ff43ba661 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/META-INF/MANIFEST.MF +++ b/ui/plugins/eu.esdihumboldt.hale.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HALE Main UI Bundle-SymbolicName: eu.esdihumboldt.hale.ui;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0", org.eclipse.ui;bundle-version="3.5.1", diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/plugin.xml b/ui/plugins/eu.esdihumboldt.hale.ui/plugin.xml index d13e2402cb..e504355111 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/plugin.xml +++ b/ui/plugins/eu.esdihumboldt.hale.ui/plugin.xml @@ -689,6 +689,7 @@ label="Source schema..." priority="-10" projectResource="true" + ui-advisor="eu.esdihumboldt.hale.ui.io.schema.SourceSchemaActionUIAdvisor" wizard="eu.esdihumboldt.hale.ui.io.schema.SchemaImportWizard"> + + + + - * the {@link IOProvider} type used in the wizard + * @param

    the {@link IOProvider} type used in the wizard * * @author Simon Templer * @partner 01 / Fraunhofer Institute for Computer Graphics Research @@ -98,6 +105,8 @@ public abstract class IOWizard

    extends Wizard private final List mainPages = new ArrayList(); + private Queue uriLocations = null; + /** * Create an I/O wizard * @@ -518,132 +527,176 @@ public boolean performFinish() { return false; } - // create default report - IOReporter defReport = provider.createReporter(); + if (initializeUsedLocations() == null && provider instanceof ImportProvider) { + // could not find any URIs in the provider. + return false; + } - // validate and execute provider - try { - // validate configuration - provider.validate(); - - ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class); - URI projectLoc = ps.getLoadLocation() == null ? null : ps.getLoadLocation(); - boolean isProjectResource = false; - if (actionId != null) { - // XXX instead move project resource to action? - ActionUI factory = ActionUIExtension.getInstance().findActionUI(actionId); - isProjectResource = factory.isProjectResource(); + URI uriLoc = null; + // To avoid NPE in the case of export provider. + if (uriLocations != null) { + uriLoc = uriLocations.poll(); + } + // either have to process all files or export provider + while (uriLoc != null || !(provider instanceof ImportProvider)) { + + // If multiple files were selected then for every file + // initialize/reset FileIOSupplier in the provider. For the first + // loop it will be FilesIOSupplier (or FileIOSupplier when single + // file is selected) and from the second loop onwards + // FileIOSupplier + if (provider instanceof ImportProvider) { + ImportProvider importProvider = (ImportProvider) provider; + LocatableInputSupplier source = importProvider.getSource(); + + // XXX Hack to support GZip-compressed sources + // If other classes were used here that wrap the original input + // supplier, the import will likely fail + if (source instanceof GZipInputSupplier) { + source = ((GZipInputSupplier) source).getSource(); + } + + if (source instanceof FilesIOSupplier || source instanceof FileIOSupplier) { + // always set FileIOSupplier to avoid huge impacts. + importProvider.setSource(new FileIOSupplier(new File(uriLoc))); + } } + // else it is a non-file source or export provider and proceed with + // the code without updating the provider. - // prevent loading of duplicate resources - if (isProjectResource && provider instanceof ImportProvider - && !getProviderFactory().allowDuplicateResource()) { + IOReporter defReport = provider.createReporter(); - String currentResource = ((ImportProvider) provider).getSource().getLocation() - .toString(); - URI currentAbsolute = URI.create(currentResource); - if (projectLoc != null && !currentAbsolute.isAbsolute()) { - currentAbsolute = projectLoc.resolve(currentAbsolute); + // validate and execute provider + try { + // validate configuration + provider.validate(); + + ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class); + URI projectLoc = ps.getLoadLocation() == null ? null : ps.getLoadLocation(); + boolean isProjectResource = false; + if (actionId != null) { + // XXX instead move project resource to action? + ActionUI factory = ActionUIExtension.getInstance().findActionUI(actionId); + isProjectResource = factory.isProjectResource(); } - for (IOConfiguration conf : ((Project) ps.getProjectInfo()).getResources()) { - Value otherResourceValue = conf.getProviderConfiguration() - .get(ImportProvider.PARAM_SOURCE); - if (otherResourceValue == null) { - continue; - } + // prevent loading of duplicate resources + if (isProjectResource && provider instanceof ImportProvider + && !getProviderFactory().allowDuplicateResource()) { + + String currentResource = ((ImportProvider) provider).getSource().getLocation() + .toString(); + URI currentAbsolute = URI.create(currentResource); - String otherResource = otherResourceValue.as(String.class); - URI otherAbsolute = URI.create(otherResource); - if (projectLoc != null && !otherAbsolute.isAbsolute()) { - otherAbsolute = projectLoc.resolve(otherAbsolute); + if (projectLoc != null && !currentAbsolute.isAbsolute()) { + currentAbsolute = projectLoc.resolve(currentAbsolute); } - String action = conf.getActionId(); - // resource is already loaded into the project - if (currentAbsolute.equals(otherAbsolute) && Objects.equal(actionId, action)) { - // check if the resource is loaded with a provider that - // allows duplicates - boolean allowDuplicate = false; - IOProviderDescriptor providerFactory = IOProviderExtension.getInstance() - .getFactory(conf.getProviderId()); - if (providerFactory != null) { - allowDuplicate = providerFactory.allowDuplicateResource(); + + for (IOConfiguration conf : ((Project) ps.getProjectInfo()).getResources()) { + Value otherResourceValue = conf.getProviderConfiguration() + .get(ImportProvider.PARAM_SOURCE); + if (otherResourceValue == null) { + continue; } - if (!allowDuplicate) { - log.userError( - "Resource is already loaded. Loading duplicate resources is aborted!"); - return false; + String otherResource = otherResourceValue.as(String.class); + URI otherAbsolute = URI.create(otherResource); + if (projectLoc != null && !otherAbsolute.isAbsolute()) { + otherAbsolute = projectLoc.resolve(otherAbsolute); + } + String action = conf.getActionId(); + // resource is already loaded into the project + if (currentAbsolute.equals(otherAbsolute) + && Objects.equal(actionId, action)) { + // check if the resource is loaded with a provider + // that allows duplicates + boolean allowDuplicate = false; + IOProviderDescriptor providerFactory = IOProviderExtension.getInstance() + .getFactory(conf.getProviderId()); + if (providerFactory != null) { + allowDuplicate = providerFactory.allowDuplicateResource(); + } + + if (!allowDuplicate) { + log.userError( + "Resource is already loaded. Loading duplicate resources is aborted!"); + // should not proceed with the loop else + // duplicate resource will be uploaded. + return false; + } } } } - } - - // enable provider internal caching - if (isProjectResource && provider instanceof CachingImportProvider) { - ((CachingImportProvider) provider).setProvideCache(); - } - IOReport report = execute(provider, defReport); - - if (report != null) { - // add report to report server - ReportService repService = PlatformUI.getWorkbench() - .getService(ReportService.class); - repService.addReport(report); + // enable provider internal caching + if (isProjectResource && provider instanceof CachingImportProvider) { + ((CachingImportProvider) provider).setProvideCache(); + } + IOReport report = execute(provider, defReport); + + if (report != null) { + // add report to report server + ReportService repService = PlatformUI.getWorkbench() + .getService(ReportService.class); + repService.addReport(report); + + // show message to user + if (report.isSuccess()) { + // no message, we rely on the report being + // shown/processed + + // let advisor handle results + try { + getContainer().run(true, false, new IRunnableWithProgress() { + + @Override + public void run(IProgressMonitor monitor) + throws InvocationTargetException, InterruptedException { + monitor.beginTask("Completing operation...", + IProgressMonitor.UNKNOWN); + try { + advisor.handleResults(provider); + } finally { + monitor.done(); + } + } - // show message to user - if (report.isSuccess()) { - // no message, we rely on the report being shown/processed + }); + } catch (InvocationTargetException e) { + log.userError("Error processing results:\n" + + e.getCause().getLocalizedMessage(), e.getCause()); + return false; + } catch (Exception e) { + log.userError("Error processing results:\n" + e.getLocalizedMessage(), + e); + return false; + } - // let advisor handle results - try { - getContainer().run(true, false, new IRunnableWithProgress() { - - @Override - public void run(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - monitor.beginTask("Completing operation...", - IProgressMonitor.UNKNOWN); - try { - advisor.handleResults(getProvider()); - } finally { - monitor.done(); - } - } + // add to project service if necessary + if (isProjectResource) + ps.rememberIO(actionId, getProviderFactory().getIdentifier(), provider); - }); - } catch (InvocationTargetException e) { - log.userError( - "Error processing results:\n" + e.getCause().getLocalizedMessage(), - e.getCause()); - return false; - } catch (Exception e) { - log.userError("Error processing results:\n" + e.getLocalizedMessage(), e); + } + else { + // error message + log.userError(report.getSummary() + "\nPlease see the report for details."); return false; } - - // add to project service if necessary - if (isProjectResource) - ps.rememberIO(actionId, getProviderFactory().getIdentifier(), provider); - - return true; - } - else { - // error message - log.userError(report.getSummary() + "\nPlease see the report for details."); - return false; } + } catch (IOProviderConfigurationException e) { + // user feedback + log.userError("Validation of the provider configuration failed:\n" + + e.getLocalizedMessage(), e); + return false; + } + if (uriLocations != null) { + uriLoc = uriLocations.poll(); + } + else { + break; } - else - return true; - } catch (IOProviderConfigurationException e) { - // user feedback - log.userError( - "Validation of the provider configuration failed:\n" + e.getLocalizedMessage(), - e); - return false; } + return true; } /** @@ -705,7 +758,17 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ATransaction trans = log.begin(defaultReporter.getTaskName()); try { - IOReport result = provider.execute(new ProgressMonitorIndicator(monitor)); + + IOReport result = null; + if ((provider instanceof ImportProvider) + && ((ImportProvider) provider).getResourceIdentifier() != null) { + result = ((ImportProvider) provider) + .execute(new ProgressMonitorIndicator(monitor), null); + } + else { + + result = provider.execute(new ProgressMonitorIndicator(monitor)); + } if (result != null) { report.set(result); } @@ -803,4 +866,43 @@ private void fireContentTypeChanged(IContentType contentType) { } } + /** + * Method to initialize used locations. It initializes usedLocations as a + * list in case multiple files were selected otherwise as a single resource + * in case of non-file source like HTTP/HTTPS or JDBC URIs. + * + * @return the usedLocations + */ + private Queue initializeUsedLocations() { + List uris = new ArrayList<>(); + if (provider instanceof ImportProvider) { + LocatableInputSupplier source = ((ImportProvider) getProvider()) + .getSource(); + + // XXX Hack to handle the special case when source is a + // GZipInputSupplier + // In case of other wrapper classes, this method will only return + // the first selected file + if (source instanceof GZipInputSupplier) { + source = ((GZipInputSupplier) source).getSource(); + } + + if (source instanceof FilesIOSupplier) { + uris = ((FilesIOSupplier) source).getLocations(); + } + else { + // non-file locations like HTTP/HTTPS or JDBC URIs or when a + // single file is selected. + URI location = ((ImportProvider) getProvider()).getSource().getLocation(); + uris = Arrays.asList(location); + } + // in case of any error dialog is shown during the import and the + // user again clicks on the finish then this queue won't be + // initialized and the dialog will close. To prevent this, the + // queue is initialized every time this function is called. + uriLocations = new LinkedList<>(uris); + } + return uriLocations; + } + } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/AbstractActionUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/AbstractActionUIAdvisor.java index aea5dba31b..0955a090a3 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/AbstractActionUIAdvisor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/AbstractActionUIAdvisor.java @@ -24,7 +24,7 @@ public abstract class AbstractActionUIAdvisor implements ActionUIAdvisor { @Override - public boolean supportsRemoval() { + public boolean supportsRemoval(String resourceId) { return false; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/ActionUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/ActionUIAdvisor.java index c5ffc67682..1315ff1cc7 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/ActionUIAdvisor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/ActionUIAdvisor.java @@ -25,10 +25,11 @@ public interface ActionUIAdvisor { /** * States if resource removal is supported. + * @param resourceId the resource identifier * * @return if removal of a single resource based on its ID is supported */ - public boolean supportsRemoval(); + public boolean supportsRemoval(String resourceId); /** * Remove the resource with the given ID. diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/handler/RemoveResourceHandler.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/handler/RemoveResourceHandler.java index fc732c8a8c..3a54fc6a8a 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/handler/RemoveResourceHandler.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/handler/RemoveResourceHandler.java @@ -62,7 +62,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { if (actionUI != null) { IOAction action = IOActionExtension.getInstance().get(resource.getActionId()); ActionUIAdvisor advisor = actionUI.getUIAdvisor(); - if (advisor != null && advisor.supportsRemoval()) { + if (advisor != null && advisor.supportsRemoval(resource.getResourceId())) { String name = null; if (resource.getSource() != null) { String location = resource.getSource().toString(); diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/tester/ResourceTester.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/tester/ResourceTester.java index 688f814231..8f29342753 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/tester/ResourceTester.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/action/tester/ResourceTester.java @@ -61,7 +61,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe private boolean testAllowRemove(Resource resource) { ActionUIAdvisor advisor = findAdvisor(resource.getActionId()); if (advisor != null) { - return advisor.supportsRemoval(); + return advisor.supportsRemoval(resource.getResourceId()); } return false; } diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/AbstractSchemaActionUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/AbstractSchemaActionUIAdvisor.java new file mode 100644 index 0000000000..2f423b6302 --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/AbstractSchemaActionUIAdvisor.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 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.ui.io.schema; + +import org.eclipse.ui.PlatformUI; + +import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; +import eu.esdihumboldt.hale.common.schema.model.Schema; +import eu.esdihumboldt.hale.ui.io.action.AbstractActionUIAdvisor; +import eu.esdihumboldt.hale.ui.service.align.AlignmentService; +import eu.esdihumboldt.hale.ui.service.instance.InstanceService; +import eu.esdihumboldt.hale.ui.service.schema.SchemaService; + +/** + * Base implementation for schema action UI advisors. + * + * @param the resource representation type + * + * @author Kapil Agnihotri. + */ +public abstract class AbstractSchemaActionUIAdvisor extends AbstractActionUIAdvisor { + + /** + * Schema service field for currently loaded schemas. + */ + protected final SchemaService schemaService; + + /** + * Instance service field for different data sets. + */ + protected InstanceService instanceService; + + /** + * Alignment service field for currently loaded alignment. + */ + protected AlignmentService alignmentService; + + /** + * Constructor. + */ + public AbstractSchemaActionUIAdvisor() { + super(); + this.schemaService = PlatformUI.getWorkbench().getService(SchemaService.class); + this.instanceService = PlatformUI.getWorkbench().getService(InstanceService.class);; + this.alignmentService = PlatformUI.getWorkbench().getService(AlignmentService.class); + } + + /** + * Constructor. + * + * @param schemaService schema service. + * @param instanceService instance service. + * @param alignmentService alignment service. + */ + public AbstractSchemaActionUIAdvisor(SchemaService schemaService, + InstanceService instanceService, AlignmentService alignmentService) { + super(); + this.schemaService = schemaService; + this.instanceService = instanceService; + this.alignmentService = alignmentService; + } + + /** + * Method to remove the specified resource. + * + * @param resourceId the resource identifier + * @param schemaSpaceId schema space identifier. + * @return true if the schema was removed, false otherwise. + */ + public boolean removeResource(String resourceId, SchemaSpaceID schemaSpaceId) { + return schemaService.removeSchema(resourceId, schemaSpaceId); + } + + @Override + public boolean supportsRetrieval() { + return true; + } + + @Override + public Class getRepresentationType() { + return Schema.class; + } + + /** + * Method to retrieve the specified schema based on resource ID. + * + * @param resourceId the resource identifier. + * @param schemaSpaceId schema space identifier. + * @return schema. + */ + public Schema retrieveResource(String resourceId, SchemaSpaceID schemaSpaceId) { + return schemaService.getSchema(resourceId, schemaSpaceId); + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SchemaImportAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SchemaImportAdvisor.java index 2970a9e7ce..979f8870f0 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SchemaImportAdvisor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SchemaImportAdvisor.java @@ -68,7 +68,7 @@ public void handleResults(SchemaReader provider) { Schema schema = provider.getSchema(); SchemaService ss = getService(SchemaService.class); - ss.addSchema(schema, spaceID); + ss.addSchema(provider.getResourceIdentifier(), schema, spaceID); if (ss.getSchemas(spaceID).getMappingRelevantTypes().isEmpty()) { // if no types are present after loading, open editor for mapping diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SourceSchemaActionUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SourceSchemaActionUIAdvisor.java new file mode 100644 index 0000000000..6bb55f3e03 --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/SourceSchemaActionUIAdvisor.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 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.ui.io.schema; + +import eu.esdihumboldt.hale.common.instance.model.DataSet; +import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; +import eu.esdihumboldt.hale.common.schema.model.Schema; + +/** + * Source Schema action UI advisor. + * + * @author Kapil Agnihotri. + */ +public class SourceSchemaActionUIAdvisor extends AbstractSchemaActionUIAdvisor { + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#supportsRemoval(java.lang.String) + */ + @Override + public boolean supportsRemoval(String resourceId) { + boolean supportRemoval = true; + Schema schema = schemaService.getSchema(resourceId, SchemaSpaceID.SOURCE); + + // check if the source schema is associated with any instance, then + // it can't be removed. + supportRemoval = !instanceService.getInstanceTypes(DataSet.SOURCE).stream() + .anyMatch(type -> schema.getType(type.getName()) != null); + + // if the data is loaded then return false. As from the alignment + // condition it might become true if the alignment is not + // loaded. + if (!supportRemoval) { + return supportRemoval; + } + + // check if the target schema is mapped to any alignment, then it cannot + // be removed. + // ! is applied because an empty stream will return false and when an + // alignment is present, the condition will return true. However, when + // the alignment is mapped then the function should return false. + supportRemoval = !alignmentService.getAlignment().getCells().stream() + .anyMatch(alignmentCells -> alignmentCells.getSource() != null + ? alignmentCells.getSource().entries().stream() + .anyMatch(k -> schema.getType( + k.getValue().getDefinition().getType().getName()) != null) + : false); + + return supportRemoval; + + } + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#removeResource(java.lang.String) + */ + @Override + public boolean removeResource(String resourceId) { + return removeResource(resourceId, SchemaSpaceID.SOURCE); + } + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#retrieveResource(java.lang.String) + */ + @Override + public Schema retrieveResource(String resourceId) { + return retrieveResource(resourceId, SchemaSpaceID.SOURCE); + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/TargetSchemaActionUIAdvisor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/TargetSchemaActionUIAdvisor.java new file mode 100644 index 0000000000..0cb4a29282 --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/schema/TargetSchemaActionUIAdvisor.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 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.ui.io.schema; + +import eu.esdihumboldt.hale.common.schema.SchemaSpaceID; +import eu.esdihumboldt.hale.common.schema.model.Schema; + +/** + * Target Schema action UI advisor. + * + * @author Kapil Agnihotri. + */ +public class TargetSchemaActionUIAdvisor extends AbstractSchemaActionUIAdvisor { + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#supportsRemoval(java.lang.String) + */ + @Override + public boolean supportsRemoval(String resourceId) { + boolean supportRemoval = true; + Schema schema = schemaService.getSchema(resourceId, SchemaSpaceID.TARGET); + + // check if the target schema is mapped to any alignment, then it cannot + // be removed. + // ! is applied because an empty stream will return false and when an + // alignment is present, the condition will return true. However, when + // the alignment is mapped then the function should return false. + supportRemoval = !alignmentService.getAlignment().getCells().stream() + .anyMatch(alignmentCells -> alignmentCells.getTarget() != null + ? alignmentCells.getTarget().entries().stream() + .anyMatch(k -> schema.getType( + k.getValue().getDefinition().getType().getName()) != null) + : false); + + return supportRemoval; + } + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#removeResource(java.lang.String) + */ + @Override + public boolean removeResource(String resourceId) { + return removeResource(resourceId, SchemaSpaceID.TARGET); + } + + /** + * @see eu.esdihumboldt.hale.ui.io.action.ActionUIAdvisor#retrieveResource(java.lang.String) + */ + @Override + public Schema retrieveResource(String resourceId) { + return retrieveResource(resourceId, SchemaSpaceID.TARGET); + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSource.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSource.java new file mode 100644 index 0000000000..a7d9f52527 --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSource.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.io.File; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.content.IContentType; +import org.eclipse.jface.dialogs.DialogPage; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.jface.viewers.ComboViewer; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.PlatformUI; + +import eu.esdihumboldt.hale.common.core.io.HaleIO; +import eu.esdihumboldt.hale.common.core.io.IOProvider; +import eu.esdihumboldt.hale.common.core.io.ImportProvider; +import eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor; +import eu.esdihumboldt.hale.common.core.io.supplier.FilesIOSupplier; +import eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier; +import eu.esdihumboldt.hale.ui.io.ImportSource; +import eu.esdihumboldt.hale.ui.service.project.ProjectService; +import eu.esdihumboldt.util.io.IOUtils; + +/** + * Abstract class to have common functionality to import multiple files at once. + * + * @param

    the supported {@link IOProvider} type + * + * @author Kapil Agnihotri + */ +public abstract class AbstractMultipleFilesSource

    + extends AbstractProviderSource

    { + + /** + * The file field editor for the source file + */ + private AbstractMultipleFilesSourceFileFieldEditor sourceFile; + + /** + * The set of supported content types + */ + private Set supportedTypes; + + private URI projectLocation; + + /** + * @return the projectLocation + */ + public URI getProjectLocation() { + return projectLocation; + } + + /** + * @param projectLocation the projectLocation to set + */ + public void setProjectLocation(URI projectLocation) { + this.projectLocation = projectLocation; + } + + /** + * @param parent parent + * @param projectLocation location the current project was loaded from. May + * be null. + * @return + */ + abstract public AbstractMultipleFilesSourceFileFieldEditor getSourceFile(Composite parent, + URI projectLocation); + + /** + * @see ImportSource#createControls(Composite) + */ + @Override + public void createControls(Composite parent) { + parent.setLayout(new GridLayout(4, false)); + + ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class); + projectLocation = ps.getLoadLocation() == null ? null : ps.getLoadLocation(); + boolean projectLocAvailable = projectLocation != null + && "file".equals(projectLocation.getScheme()); + + sourceFile = getSourceFile(parent, projectLocation); + + sourceFile.setEmptyStringAllowed(false); + sourceFile.setPage(getPage()); + + // set content types for file field + Collection factories = getConfiguration().getFactories(); + supportedTypes = new HashSet(); + for (IOProviderDescriptor factory : factories) { + supportedTypes.addAll(factory.getSupportedTypes()); + } + + sourceFile.setContentTypes(supportedTypes); + sourceFile.setPropertyChangeListener(new IPropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent event) { + if (event.getProperty().equals(FieldEditor.IS_VALID)) { + sourceFile.getStringValues().forEach(k -> updateState(true)); + } + else if (event.getProperty().equals(FieldEditor.VALUE)) { + sourceFile.getStringValues().forEach(k -> updateState(true)); + } + } + + }); + + Label providerLabel = new Label(parent, SWT.NONE); + providerLabel.setText("Import as"); + // create provider combo + ComboViewer providers = createProviders(parent); + providers.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1)); + + final Button relativeCheck = new Button(parent, SWT.CHECK); + String text = "Use relative paths if possible."; + relativeCheck.setText("Use relative paths if possible."); + relativeCheck.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + sourceFile.setUseRelativeIfPossible(relativeCheck.getSelection()); + } + }); + if (!projectLocAvailable) { + relativeCheck.setEnabled(false); + text += " Only available once the project is saved to a file."; + } + relativeCheck.setText(text); + relativeCheck.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 4, 1)); + + // initial state update + updateState(true); + } + + /** + * @see AbstractProviderSource#updateContentType() + */ + @Override + protected void updateContentType() { + + if (sourceFile.isValid()) { + // determine content type + LocatableInputSupplier source = getSource(); + Collection filteredTypes = HaleIO.findContentTypesFor(supportedTypes, + source, sourceFile.getStringValues().get(0)); + IContentType contentType = null; + if (!filteredTypes.isEmpty()) { + contentType = filteredTypes.iterator().next(); + } + + getConfiguration().setContentType(contentType); + if (contentType != null) { + getPage().setMessage(contentType.getName(), DialogPage.INFORMATION); + } + else { + getPage().setMessage(null); + } + + super.updateContentType(); + } + } + + /** + * @see AbstractProviderSource#isValidSource() + */ + @Override + protected boolean isValidSource() { + return sourceFile.isValid(); + } + + /** + * @see AbstractSource#onActivate() + */ + @Override + public void onActivate() { + sourceFile.setFocus(); + } + + /** + * @see eu.esdihumboldt.hale.ui.io.source.AbstractProviderSource#getSource() + */ + @Override + protected LocatableInputSupplier getSource() { + List stringValues = sourceFile.getStringValues(); + List files = new ArrayList(); + List uris = new ArrayList<>(); + File file = new File(stringValues.get(0)); + if (file.isAbsolute()) { + for (String s : stringValues) { + files.add(new File(s)); + uris.add(new File(s).toURI()); + } + } + else { + for (String path : stringValues) { + URI relativeURI = IOUtils.relativeFileToURI(new File(path)); + File absoluteFile = new File(projectLocation.resolve(relativeURI)); + files.add(absoluteFile); + uris.add(relativeURI); + } + } + FilesIOSupplier filesIOSupplier = new FilesIOSupplier(files, uris); + return filesIOSupplier; + } + + /** + * Update the provider selector when the content type has changed. This is + * based on the content type stored in the source configuration. + */ + @Override + protected void updateProvider() { + IContentType contentType = getConfiguration().getContentType(); + if (contentType != null) { + IOProviderDescriptor lastSelected = null; + ISelection provSel = getProviders().getSelection(); + if (!provSel.isEmpty() && provSel instanceof IStructuredSelection) { + lastSelected = (IOProviderDescriptor) ((IStructuredSelection) provSel) + .getFirstElement(); + } + + List supported = HaleIO + .filterFactories(getConfiguration().getFactories(), contentType); + getProviders().setInput(supported); + + if (lastSelected != null && supported.contains(lastSelected)) { + // reuse old selection + getProviders().setSelection(new StructuredSelection(lastSelected), true); + } + else if (!supported.isEmpty()) { + // select first provider + getProviders().setSelection(new StructuredSelection(supported.get(0)), true); + } + + getProviders().getControl().setEnabled(supported.size() > 1); + } + else { + getProviders().setInput(null); + getProviders().getControl().setEnabled(false); + } + + } + + /** + * Update the page state. This includes setting a provider factory on the + * wizard if applicable and setting the complete state of the page.
    + *
    + * This should be called in {@link #createControls(Composite)} to initialize + * the page state. + * + * @param updateContentType if true the content type and the + * supported providers will be updated before updating the page + * state + */ + @Override + protected void updateState(boolean updateContentType) { + if (updateContentType) { + updateContentType(); + } + + // update provider factory + ISelection provSel = getProviders().getSelection(); + if (!provSel.isEmpty() && provSel instanceof IStructuredSelection) { + getConfiguration().setProviderFactory( + (IOProviderDescriptor) ((IStructuredSelection) provSel).getFirstElement()); + } + else { + getConfiguration().setProviderFactory(null); + } + + getPage().setPageComplete(isValidSource() && getConfiguration().getContentType() != null + && getConfiguration().getProviderFactory() != null); + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSourceFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSourceFileFieldEditor.java new file mode 100644 index 0000000000..5de0afeb7b --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/AbstractMultipleFilesSourceFileFieldEditor.java @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.io.File; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.content.IContentType; +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; + +import eu.esdihumboldt.hale.ui.common.CommonSharedImages; +import eu.esdihumboldt.hale.ui.service.project.RecentProjectsMenu; +import eu.esdihumboldt.hale.ui.service.project.RecentResources; +import eu.esdihumboldt.hale.ui.util.io.ExtendedFileFieldEditor; +import eu.esdihumboldt.hale.ui.util.io.OpenFileFieldEditor; +import eu.esdihumboldt.util.Pair; +import eu.esdihumboldt.util.io.IOUtils; + +/** + * Abstract class to have common functionalities for the implementation of + * {@link OpenFileFieldEditor} with support for relative URIs with regard to the + * current project's location. Applicable when importing multiple files. + * + * @author Kapil Agnihotri + */ +public abstract class AbstractMultipleFilesSourceFileFieldEditor extends OpenFileFieldEditor { + + private final URI projectURI; + private boolean useRelative; + private Button historyButton; + private Text textField; + private final int validationStrategy; + private static final String LINE_SEPARATOR = "line.separator"; + + /** + * @see ExtendedFileFieldEditor#ExtendedFileFieldEditor(String, String, + * boolean, int, Composite, int ) + */ + @SuppressWarnings("javadoc") + public AbstractMultipleFilesSourceFileFieldEditor(String name, String labelText, + int validationStrategy, Composite parent, URI projectURI, int style) { + super(name, labelText, false, validationStrategy, parent, style); + this.validationStrategy = validationStrategy; + this.projectURI = projectURI; + } + + /** + * Sets the editor to allow relative values. The projectURI has to be + * supplied during construction to support this feature. + * + * @param useRelative the new value + */ + public void setUseRelativeIfPossible(boolean useRelative) { + List filepaths = getFilepathsAsList(getTextControl().getText().trim()); + StringBuffer paths = new StringBuffer(); + if (this.useRelative && !useRelative) { + // incase user toggles relative path check box. + for (String path : filepaths) { + File f = new File(path); + String absolutePath = resolve(f).getAbsolutePath(); + paths.append(absolutePath).append(System.getProperty(LINE_SEPARATOR)); + } + this.useRelative = false; + } + else if (!this.useRelative && useRelative && projectURI != null) { + this.useRelative = true; + for (String path : filepaths) { + File f = new File(path); + URI absoluteSelected = f.toURI(); + URI relativeSelected = IOUtils.getRelativePath(absoluteSelected, projectURI); + if (!relativeSelected.isAbsolute()) { + f = new File(relativeSelected.toString()); + paths.append(f.getPath()).append(System.getProperty(LINE_SEPARATOR)); + } + } + } + getTextControl().setText(paths.toString()); + // here it is important to trigger the value changed event otherwise, + // toggling relative path check box shows weird behavior and throws NPE. + getTextControl().setFocus(); + valueChanged(); + } + + /** + * @see FileFieldEditor#changePressed() + */ + @Override + protected String changePressed() { + String filepaths = getTextControl().getText(); + List filepathsAsList = getFilepathsAsList(filepaths); + File f = null; + if (filepathsAsList != null && filepathsAsList.size() > 0) { + f = new File(filepathsAsList.get(0)); + f = resolve(f); + } + List d = getFiles(f); + StringBuffer sb = new StringBuffer(); + List processedFiles = processFiles(d); + processedFiles.forEach(k -> sb.append(k).append(System.getProperty(LINE_SEPARATOR))); + return sb.toString(); + } + + /** + * Process a selected file and produce the path to use. + * + * @param files List of files to be processed. + * + * @return the list of paths. + */ + protected List processFiles(List files) { + if (files == null) { + return null; + } + List paths = new ArrayList(); + if (useRelative) { + files.forEach(k -> { + File d = k.getAbsoluteFile(); + URI absoluteSelected = d.toURI(); + URI relativeSelected = IOUtils.getRelativePath(absoluteSelected, projectURI); + if (!relativeSelected.isAbsolute()) { + File file = new File(relativeSelected.toString()); + paths.add(file.getPath()); + } + }); + } + else { + files.forEach(k -> { + File d = k.getAbsoluteFile(); + paths.add(d.getPath()); + }); + } + return paths; + } + + @Override + protected boolean checkState() { + String msg = null; + + String path = getTextControl().getText(); + if (path != null) { + path = path.trim(); + } + else { + path = "";//$NON-NLS-1$ + } + if (path.length() == 0) { + if (!isEmptyStringAllowed()) { + msg = getErrorMessage(); + } + } + else { + String errorMsg = restrictExtensions(path); + if (errorMsg != null && !errorMsg.isEmpty()) { + showErrorMessage(errorMsg); + return false; + } + Optional invalidFilePath = getFilepathsAsList(path).stream() + .filter(k -> (resolve(new File(k)) == null) || !(resolve(new File(k))).isFile()) + .findAny(); + if (invalidFilePath.isPresent()) { + msg = getErrorMessage(); + } + } + + if (msg != null) { // error + showErrorMessage(msg); + return false; + } + + if (doCheckState()) { // OK! + clearErrorMessage(); + return true; + } + msg = getErrorMessage(); // subclass might have changed it in the + // #doCheckState() + if (msg != null) { + showErrorMessage(msg); + } + return false; + } + + /** + * Method to restrict files with specific extensions. + * + * @param path file path. + * @return response message based on the checks. + */ + protected String restrictExtensions(String path) { + String msg = null; + List filepaths = getFilepathsAsList(path); + + // check if the selected files are with different extensions. + Set allSelectedFileExtensions = filepaths.stream() + .map(p -> p.substring(p.lastIndexOf("."))).collect(Collectors.toSet()); + if (allSelectedFileExtensions.size() > 1) { + msg = "All files must be of the same format!"; + return msg; + } + return msg; + + } + + /** + * Resolve a files existence. + * + * @param f file. + * @return null if file does not exists else the file. + */ + private File resolve(File f) { + // first find absolute + File resolved; + if (f.isAbsolute()) + resolved = f; + else if (useRelative) + resolved = new File(projectURI.resolve(IOUtils.relativeFileToURI(f))); + else + resolved = null; + + // then check existence + if (resolved != null && resolved.exists()) + return resolved; + else + return null; + } + + // recent resources support + + @Override + protected void adjustForNumColumns(int numColumns) { + ((GridData) getTextControl().getLayoutData()).horizontalSpan = numColumns - 2; + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + super.doFillIntoGrid(parent, numColumns - 1); + } + + @Override + public Text getTextControl(Composite parent) { + // ensure resource control is added before the text control + historyButton = new Button(parent, SWT.PUSH | SWT.FLAT); + historyButton.setToolTipText("Choose from recent files"); + historyButton.setImage( + CommonSharedImages.getImageRegistry().get(CommonSharedImages.IMG_HISTORY)); + historyButton.setEnabled(false); + + if (textField == null) { + textField = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + textField.setFont(parent.getFont()); + + switch (validationStrategy) { + case VALIDATE_ON_KEY_STROKE: + textField.addKeyListener(new KeyAdapter() { + + @Override + public void keyReleased(KeyEvent e) { + valueChanged(); + } + }); + textField.addFocusListener(new FocusAdapter() { + + // Ensure that the value is checked on focus loss in case we + // missed a keyRelease or user hasn't released key. + // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=214716 + @Override + public void focusLost(FocusEvent e) { + valueChanged(); + } + }); + + break; + case VALIDATE_ON_FOCUS_LOST: + textField.addKeyListener(new KeyAdapter() { + + @Override + public void keyPressed(KeyEvent e) { + clearErrorMessage(); + } + }); + textField.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { + refreshValidState(); + } + + @Override + public void focusLost(FocusEvent e) { + valueChanged(); + } + }); + break; + default: + Assert.isTrue(false, "Unknown validate strategy");//$NON-NLS-1$ + } + textField.addDisposeListener(event -> textField = null); + textField.setTextLimit(UNLIMITED); + + } + else { + checkParent(textField, parent); + } + + return textField; + } + + @Override + public void setContentTypes(Set types) { + super.setContentTypes(types); + + RecentResources rr = PlatformUI.getWorkbench().getService(RecentResources.class); + if (rr != null) { + final List> files = rr.getRecent(types, true); + + if (!files.isEmpty()) { + historyButton.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + Menu filesMenu = new Menu(historyButton); + for (Pair pair : files) { + final File file; + try { + file = new File(pair.getFirst()); + if (file.exists()) { + // only offer existing files + + MenuItem item = new MenuItem(filesMenu, SWT.PUSH); + item.setText(RecentProjectsMenu.shorten(file.toString(), 80, + file.getName().length())); + item.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + List texts = processFiles(Arrays.asList(file)); + if (texts != null) { + StringBuffer selectedFiles = new StringBuffer( + getTextControl().getText()); + selectedFiles.append(texts.get(0)) + .append(System.getProperty(LINE_SEPARATOR)); + getTextControl().setText(selectedFiles.toString()); + getTextControl().setFocus(); + valueChanged(); + + } + } + }); + } + } catch (Exception e1) { + // ignore + } + } + + Point histLoc = historyButton.getParent() + .toDisplay(historyButton.getLocation()); + filesMenu.setLocation(histLoc.x, histLoc.y + historyButton.getSize().y); + filesMenu.setVisible(true); + } + }); + historyButton.setEnabled(true); + } + } + } + + @Override + public int getNumberOfControls() { + return super.getNumberOfControls() + 1; + } + + /** + * @return the historyButton + */ + public Button getHistoryButton() { + return historyButton; + } + + /** + * Method to return the list of filepaths from filepath string delimited by + * System.getProperty(LINE_SEPARATOR). + * + * @param filepaths file path string, delimited by + * System.getProperty(LINE_SEPARATOR). + * @return list of file paths after splitting. + */ + protected List getFilepathsAsList(String filepaths) { + String[] split = filepaths.trim().split(System.getProperty(LINE_SEPARATOR)); + + List collect = Arrays.asList(split).stream().filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); + return collect; + + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/FileSourceFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/FileSourceFileFieldEditor.java index ce36c52bf8..68cd58190c 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/FileSourceFileFieldEditor.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/FileSourceFileFieldEditor.java @@ -103,10 +103,12 @@ public FileSourceFileFieldEditor(String name, String labelText, int validationSt */ public void setUseRelativeIfPossible(boolean useRelative) { if (this.useRelative && !useRelative) { + // incase user toggles relative path check box. File f = new File(getTextControl().getText()); f = resolve(f); - if (f != null) + if (f != null) { getTextControl().setText(f.getAbsolutePath()); + } this.useRelative = false; } else if (!this.useRelative && useRelative && projectURI != null) { @@ -114,10 +116,15 @@ else if (!this.useRelative && useRelative && projectURI != null) { File f = new File(getTextControl().getText()); URI absoluteSelected = f.toURI(); URI relativeSelected = IOUtils.getRelativePath(absoluteSelected, projectURI); - if (!relativeSelected.isAbsolute()) + if (!relativeSelected.isAbsolute()) { f = new File(relativeSelected.toString()); - getTextControl().setText(f.getPath()); + getTextControl().setText(f.getPath()); + } } + // here it is important to trigger the value changed event otherwise, + // toggling relative path check box shows weird behavior and throws NPE. + getTextControl().setFocus(); + valueChanged(); } /** @@ -125,7 +132,7 @@ else if (!this.useRelative && useRelative && projectURI != null) { */ @Override protected String changePressed() { - File f = new File(getTextControl().getText()); + File f = new File(getTextControl().getText().trim()); f = resolve(f); File d = getFile(f); diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSource.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSource.java new file mode 100644 index 0000000000..f7cac79e7f --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSource.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.net.URI; + +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; + +import eu.esdihumboldt.hale.common.core.io.ImportProvider; +import eu.esdihumboldt.hale.common.instance.io.InstanceReader; + +/** + * File import source for importing multiple instance files. + * + * @author Kapil Agnihotri + */ +public class MultipleInstanceFilesSource

    + extends AbstractMultipleFilesSource { + + /** + * @see eu.esdihumboldt.hale.ui.io.source.AbstractMultipleFilesSource#getSourceFile(org.eclipse.swt.widgets.Composite, + * java.net.URI) + */ + @Override + public AbstractMultipleFilesSourceFileFieldEditor getSourceFile(Composite parent, + URI projectLocation) { + return new MultipleInstanceFilesSourceFileFieldEditor("sourceFile", "Source files:", + FileFieldEditor.VALIDATE_ON_KEY_STROKE, parent, projectLocation, + SWT.MULTI | SWT.SHEET); + } +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSourceFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSourceFileFieldEditor.java new file mode 100644 index 0000000000..15b3d8aded --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleInstanceFilesSourceFileFieldEditor.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.net.URI; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.eclipse.swt.widgets.Composite; + +import eu.esdihumboldt.hale.ui.util.io.ExtendedFileFieldEditor; + +/** + * Implementation of {@link AbstractMultipleFilesSourceFileFieldEditor} for + * importing multiple instances with support for relative URIs with regard to + * the current project's location. + * + * @author Kapil Agnihotri + */ +public class MultipleInstanceFilesSourceFileFieldEditor + extends AbstractMultipleFilesSourceFileFieldEditor { + + /** + * @see ExtendedFileFieldEditor#ExtendedFileFieldEditor(String, String, + * boolean, int, Composite, int ) + */ + @SuppressWarnings("javadoc") + public MultipleInstanceFilesSourceFileFieldEditor(String name, String labelText, + int validationStrategy, Composite parent, URI projectURI, int style) { + super(name, labelText, validationStrategy, parent, projectURI, style); + } + + /** + * @see eu.esdihumboldt.hale.ui.io.source.AbstractMultipleFilesSourceFileFieldEditor#restrictExtensions(java.lang.String) + */ + @Override + protected String restrictExtensions(String path) { + // return an empty string as for now as all the extensions are allowed + // for reading multiple instances at once. + + List filepaths = getFilepathsAsList(path); + + // check if the selected files are with different extensions. + Set allSelectedFileExtensions = filepaths.stream() + .map(p -> p.substring(p.lastIndexOf("."))).collect(Collectors.toSet()); + if (allSelectedFileExtensions.size() > 1) { + return "All files must be of the same format!"; + } + + // return empty string if everything is perfect. Cannot return null as + // it will be returned from the + // MultipleSchemaFilesSourceFileFieldEditor. + return ""; + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSource.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSource.java new file mode 100644 index 0000000000..f1670b3c7d --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSource.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.net.URI; + +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; + +import eu.esdihumboldt.hale.common.core.io.IOProvider; +import eu.esdihumboldt.hale.common.core.io.ImportProvider; +import eu.esdihumboldt.hale.common.schema.io.SchemaReader; + +/** + * File import source to import multiple schema files. + * + * @param

    the supported {@link IOProvider} type + * + * @author Kapil Agnihotri + */ +public class MultipleSchemaFilesSource

    + extends AbstractMultipleFilesSource { + + /** + * + * @see eu.esdihumboldt.hale.ui.io.source.AbstractMultipleFilesSource#getSourceFile(org.eclipse.swt.widgets.Composite, + * java.net.URI) + */ + @Override + public AbstractMultipleFilesSourceFileFieldEditor getSourceFile(Composite parent, + URI projectLocation) { + return new MultipleSchemaFilesSourceFileFieldEditor("sourceFile", "Source files:", + FileFieldEditor.VALIDATE_ON_KEY_STROKE, parent, projectLocation, + SWT.MULTI | SWT.SHEET); + } +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSourceFileFieldEditor.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSourceFileFieldEditor.java new file mode 100644 index 0000000000..62af66c09c --- /dev/null +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/io/source/MultipleSchemaFilesSourceFileFieldEditor.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021 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.ui.io.source; + +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.eclipse.swt.widgets.Composite; + +import eu.esdihumboldt.hale.ui.util.io.ExtendedFileFieldEditor; + +/** + * Implementation of {@link AbstractMultipleFilesSourceFileFieldEditor} for + * importing multiple Schema(s). + * + * @author Kapil Agnihotri + */ +public class MultipleSchemaFilesSourceFileFieldEditor + extends AbstractMultipleFilesSourceFileFieldEditor { + + /** + * @see ExtendedFileFieldEditor#ExtendedFileFieldEditor(String, String, + * boolean, int, Composite, int ) + */ + @SuppressWarnings("javadoc") + public MultipleSchemaFilesSourceFileFieldEditor(String name, String labelText, + int validationStrategy, Composite parent, URI projectURI, int style) { + super(name, labelText, validationStrategy, parent, projectURI, style); + } + + /** + * + * @see eu.esdihumboldt.hale.ui.io.source.AbstractMultipleFilesSourceFileFieldEditor#restrictExtensions(java.lang.String) + */ + @Override + protected String restrictExtensions(String path) { + String msg = null; + + List filepaths = getFilepathsAsList(path); + // check if the selected files are with different extensions. + Set allSelectedFileExtensions = filepaths.stream() + .map(p -> p.substring(p.lastIndexOf("."))).collect(Collectors.toSet()); + if (allSelectedFileExtensions.size() > 1) { + msg = "All files must be of the same format!"; + return msg; + } + + // check if selected files are of the extensions that doesn't allow + // multiple schema imports. + List extensions = Arrays.asList(".csv", ".xml"); + long count = filepaths.stream().filter(p -> extensions.stream().anyMatch(p::contains)) + .count(); + if (filepaths.size() > 1 && count > 1) { + msg = String.format("Cannot import multiple files of %s extension.", + allSelectedFileExtensions.iterator().next()); + } + return msg; + } + +} diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaService.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaService.java index 757505f47c..f5515ffcf4 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaService.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaService.java @@ -44,14 +44,36 @@ public interface SchemaService extends TransformationSchemas { @Override public SchemaSpace getSchemas(SchemaSpaceID spaceID); + /** + * Get schema for a specified resourceId. + * + * @param resourceID resource Id of the schema to find. + * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} + * or {@link SchemaSpaceID#TARGET} + * @return schema. + */ + public Schema getSchema(String resourceID, SchemaSpaceID spaceID); + /** * Add a schema to the source or target schema space. * + * @param resourceID resource id of the schema to be added. + * * @param schema the schema to add * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} * or {@link SchemaSpaceID#TARGET} */ - public void addSchema(Schema schema, SchemaSpaceID spaceID); + public void addSchema(String resourceID, Schema schema, SchemaSpaceID spaceID); + + /** + * Removes a schema to the source schema space from the project view. + * + * @param resourceID of the schema to be removed. + * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} + * or {@link SchemaSpaceID#TARGET} + * @return true if the schema was removed, false otherwise. + */ + public boolean removeSchema(String resourceID, SchemaSpaceID spaceID); /** * Removes all schemas from the source or target schema space. diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceAdapter.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceAdapter.java index 58891ca217..423ef03017 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceAdapter.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceAdapter.java @@ -38,6 +38,14 @@ public void schemaAdded(SchemaSpaceID spaceID, Schema schema) { // override me } + /** + * @see eu.esdihumboldt.hale.ui.service.schema.SchemaServiceListener#schemaRemoved(eu.esdihumboldt.hale.common.schema.SchemaSpaceID) + */ + @Override + public void schemaRemoved(SchemaSpaceID spaceID) { + // override me + } + /** * @see SchemaServiceListener#schemasCleared(SchemaSpaceID) */ diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceListener.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceListener.java index 81f67a55b8..62a20898d5 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceListener.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/SchemaServiceListener.java @@ -39,6 +39,15 @@ public interface SchemaServiceListener { */ public void schemaAdded(SchemaSpaceID spaceID, Schema schema); + /** + * Called when the source or target schema have been removed from the + * project(resources) view. + * + * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} + * or {@link SchemaSpaceID#TARGET} + */ + public void schemaRemoved(SchemaSpaceID spaceID); + /** * Called when the source or target schema space have been cleared. * diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/AbstractSchemaService.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/AbstractSchemaService.java index 574763a74b..735998fa5b 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/AbstractSchemaService.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/AbstractSchemaService.java @@ -89,6 +89,18 @@ protected void notifySchemaAdded(SchemaSpaceID spaceID, Schema schema) { } } + /** + * Called when a single source or a target schema has been cleared. + * + * @param spaceID the schema space ID, either {@link SchemaSpaceID#SOURCE} + * or {@link SchemaSpaceID#TARGET} + */ + protected void notifySchemaRemoved(SchemaSpaceID spaceID) { + for (SchemaServiceListener listener : listeners) { + listener.schemaRemoved(spaceID); + } + } + /** * Called when the source or target schema space have been cleared. * diff --git a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/SchemaServiceImpl.java b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/SchemaServiceImpl.java index f975774ec9..eb76ab94f6 100644 --- a/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/SchemaServiceImpl.java +++ b/ui/plugins/eu.esdihumboldt.hale.ui/src/eu/esdihumboldt/hale/ui/service/schema/internal/SchemaServiceImpl.java @@ -44,7 +44,7 @@ import eu.esdihumboldt.hale.common.schema.model.SchemaSpace; import eu.esdihumboldt.hale.common.schema.model.TypeDefinition; import eu.esdihumboldt.hale.common.schema.model.constraint.type.MappingRelevantFlag; -import eu.esdihumboldt.hale.common.schema.model.impl.DefaultSchemaSpace; +import eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace; import eu.esdihumboldt.hale.ui.service.project.ProjectService; import eu.esdihumboldt.hale.ui.service.project.internal.AbstractRemoveResourcesOperation; import eu.esdihumboldt.hale.ui.service.schema.SchemaService; @@ -62,7 +62,7 @@ public class SchemaServiceImpl extends AbstractSchemaService { /** * Maps schema space IDs to schema spaces */ - private static final Map spaces = new HashMap(); + private static final Map spaces = new HashMap(); /** * @see AbstractSchemaService#AbstractSchemaService(ProjectService) @@ -71,6 +71,23 @@ public SchemaServiceImpl(ProjectService projectService) { super(projectService); } + /** + * @see eu.esdihumboldt.hale.ui.service.schema.SchemaService#getSchema(java.lang.String, + * eu.esdihumboldt.hale.common.schema.SchemaSpaceID) + */ + @Override + public Schema getSchema(String resourceID, SchemaSpaceID spaceID) { + Preconditions.checkNotNull(resourceID); + + synchronized (spaces) { + ResourceSchemaSpace space = spaces.get(spaceID); + if (space != null) { + return space.getSchemas(resourceID); + } + return null; + } + } + /** * @see SchemaService#getSchemas(SchemaSpaceID) */ @@ -79,9 +96,9 @@ public SchemaSpace getSchemas(SchemaSpaceID spaceID) { Preconditions.checkNotNull(spaceID); synchronized (spaces) { - DefaultSchemaSpace space = spaces.get(spaceID); + ResourceSchemaSpace space = spaces.get(spaceID); if (space == null) { - space = new DefaultSchemaSpace(); + space = new ResourceSchemaSpace(); spaces.put(spaceID, space); } return space; @@ -89,21 +106,38 @@ public SchemaSpace getSchemas(SchemaSpaceID spaceID) { } /** - * @see SchemaService#addSchema(Schema, SchemaSpaceID) + * @see eu.esdihumboldt.hale.ui.service.schema.SchemaService#addSchema(java.lang.String, + * eu.esdihumboldt.hale.common.schema.model.Schema, + * eu.esdihumboldt.hale.common.schema.SchemaSpaceID) */ @Override - public void addSchema(Schema schema, SchemaSpaceID spaceID) { + public void addSchema(String resourceID, Schema schema, SchemaSpaceID spaceID) { Preconditions.checkNotNull(spaceID); SchemaIO.loadMappingRelevantTypesConfig(schema, spaceID, getProjectService() .getConfigurationService()); - DefaultSchemaSpace space = (DefaultSchemaSpace) getSchemas(spaceID); - space.addSchema(schema); + ResourceSchemaSpace space = (ResourceSchemaSpace) getSchemas(spaceID); + space.addSchema(resourceID, schema); notifySchemaAdded(spaceID, schema); } + /** + * @see eu.esdihumboldt.hale.ui.service.schema.SchemaService#removeSchema(java.lang.String, + * eu.esdihumboldt.hale.common.schema.SchemaSpaceID) + */ + @Override + public boolean removeSchema(String resourceID, SchemaSpaceID spaceID) { + Preconditions.checkNotNull(spaceID); + + ResourceSchemaSpace space = (ResourceSchemaSpace) getSchemas(spaceID); + Schema removedSchema = space.removeSchema(resourceID); + notifySchemaRemoved(spaceID); + notifyMappableTypesChanged(spaceID, space.getTypes()); + return removedSchema != null ? true : false; + } + /** * @see SchemaService#clearSchemas(SchemaSpaceID) */ diff --git a/util/features/eu.esdihumboldt.util.feature.resource/feature.xml b/util/features/eu.esdihumboldt.util.feature.resource/feature.xml index 8499845b02..aa29b51457 100644 --- a/util/features/eu.esdihumboldt.util.feature.resource/feature.xml +++ b/util/features/eu.esdihumboldt.util.feature.resource/feature.xml @@ -2,7 +2,7 @@ + version="4.1.0.qualifier"> Licenses of the individual features and plug-ins apply. @@ -32,4 +32,11 @@ install-size="0" version="0.0.0"/> + + diff --git a/util/plugins/eu.esdihumboldt.util.cli/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.cli/META-INF/MANIFEST.MF index 00a225ab34..0aeda76d32 100644 --- a/util/plugins/eu.esdihumboldt.util.cli/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.cli/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: hale CLI API Bundle-SymbolicName: eu.esdihumboldt.util.cli;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension, diff --git a/util/plugins/eu.esdihumboldt.util.config.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.config.test/META-INF/MANIFEST.MF index 3d2d8dac6a..7993cd43f3 100644 --- a/util/plugins/eu.esdihumboldt.util.config.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.config.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Configuration utilities tests Bundle-SymbolicName: eu.esdihumboldt.config.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.util.config;bundle-version="3.5.0" Automatic-Module-Name: eu.esdihumboldt.config.test Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/util/plugins/eu.esdihumboldt.util.config/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.config/META-INF/MANIFEST.MF index af959df49a..65ffad19ee 100644 --- a/util/plugins/eu.esdihumboldt.util.config/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.config/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Configuration Utilities Bundle-SymbolicName: eu.esdihumboldt.util.config -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Automatic-Module-Name: eu.esdihumboldt.util.config Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/util/plugins/eu.esdihumboldt.util.geometry.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.geometry.test/META-INF/MANIFEST.MF index 827389b3ec..8963f6aaea 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.geometry.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Geometry utilities tests Bundle-SymbolicName: eu.esdihumboldt.util.geometry.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.util.geometry;bundle-version="3.2.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.cache;version="17.0.0", diff --git a/util/plugins/eu.esdihumboldt.util.geometry/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.geometry/META-INF/MANIFEST.MF index dafd24f8c7..6242486743 100644 --- a/util/plugins/eu.esdihumboldt.util.geometry/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.geometry/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Geometry Utilities Bundle-SymbolicName: eu.esdihumboldt.util.geometry;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.locationtech.jts;version="1.13.0", org.locationtech.jts.algorithm;version="1.13.0", diff --git a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/META-INF/MANIFEST.MF index bbe94aaf93..4ad72e4da5 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy.meta.extension/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Meta Class Extension Bundle-SymbolicName: eu.esdihumboldt.util.groovy.meta.extension;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0" Import-Package: de.fhg.igd.eclipse.util.extension, diff --git a/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/META-INF/MANIFEST.MF index bb3d1ab295..a438120396 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy.meta.fragment/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Meta Class Extension Fragment Bundle-SymbolicName: eu.esdihumboldt.util.groovy.meta.fragment -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: groovy;bundle-version="2.1.5" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.eclipse.util.extension.simple, diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy.sandbox.test/META-INF/MANIFEST.MF index e99b7ae152..9a12bf6790 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Interceptor Test Bundle-SymbolicName: eu.esdihumboldt.util.groovy.sandbox.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: . Require-Bundle: groovy;bundle-version="2.1.5", diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/META-INF/MANIFEST.MF index 7eb6a19a27..f5dbb0b33d 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Sandbox Bundle-SymbolicName: eu.esdihumboldt.util.groovy.sandbox;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: groovy;bundle-version="2.1.5", org.kohsuke.groovy.sandbox;bundle-version="1.5.0" diff --git a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java index f7c20b1573..29ee65f084 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java +++ b/util/plugins/eu.esdihumboldt.util.groovy.sandbox/src/eu/esdihumboldt/util/groovy/sandbox/internal/RestrictiveGroovyInterceptor.java @@ -22,6 +22,21 @@ import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.text.SimpleDateFormat; +import java.time.DayOfWeek; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.Month; +import java.time.Year; +import java.time.YearMonth; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.FormatStyle; +import java.time.format.SignStyle; +import java.time.format.TextStyle; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -111,6 +126,25 @@ public class RestrictiveGroovyInterceptor extends GroovyInterceptor { allowedClasses.add(Locale.class); // allowedClasses.add(Boolean.class); + // Java 8 date/time classes + allowedClasses.add(DayOfWeek.class); + allowedClasses.add(Month.class); + allowedClasses.add(Year.class); + allowedClasses.add(YearMonth.class); + allowedClasses.add(Instant.class); + + allowedClasses.add(LocalDate.class); + allowedClasses.add(LocalDateTime.class); + allowedClasses.add(LocalTime.class); + allowedClasses.add(ZonedDateTime.class); + allowedClasses.add(ZoneId.class); + + allowedClasses.add(DateTimeFormatter.class); + allowedClasses.add(DateTimeFormatterBuilder.class); + allowedClasses.add(FormatStyle.class); + allowedClasses.add(TextStyle.class); + allowedClasses.add(SignStyle.class); + // helper classes allowedClasses.add(SimpleDateFormat.class); allowedClasses.add(UUID.class); diff --git a/util/plugins/eu.esdihumboldt.util.groovy.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy.test/META-INF/MANIFEST.MF index a5675e1ea3..c55a415244 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Utils Tests Bundle-SymbolicName: eu.esdihumboldt.util.groovy.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: Data Harmonisation Panel Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit;bundle-version="4.12.0", diff --git a/util/plugins/eu.esdihumboldt.util.groovy/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.groovy/META-INF/MANIFEST.MF index c06ba6ed9a..4c76c3c438 100644 --- a/util/plugins/eu.esdihumboldt.util.groovy/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.groovy/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Groovy Utilities Bundle-SymbolicName: eu.esdihumboldt.util.groovy -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: eu.esdihumboldt.util.groovy.builder, eu.esdihumboldt.util.groovy.collector, diff --git a/util/plugins/eu.esdihumboldt.util.http/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.http/META-INF/MANIFEST.MF index 98f01e5c79..97dfac78ed 100644 --- a/util/plugins/eu.esdihumboldt.util.http/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.http/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Http Utilities Bundle-SymbolicName: eu.esdihumboldt.util.http -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: de.fhg.igd.slf4jplus, diff --git a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/META-INF/MANIFEST.MF index 204da598c6..8f7c044ebb 100644 --- a/util/plugins/eu.esdihumboldt.util.orient.embedded.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.orient.embedded.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Embedded OrientDB Test Bundle Bundle-SymbolicName: eu.esdihumboldt.util.orient.embedded.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: com.orientechnologies.common;bundle-version="1.5.1", com.orientechnologies.orientdb-core;bundle-version="1.5.1" diff --git a/doc/plugins/eu.esdihumboldt.hale.doc.xtraserver/.project b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/.project similarity index 88% rename from doc/plugins/eu.esdihumboldt.hale.doc.xtraserver/.project rename to util/plugins/eu.esdihumboldt.util.resource.schemas.end/.project index 8e1f45679a..1e5a6da170 100644 --- a/doc/plugins/eu.esdihumboldt.hale.doc.xtraserver/.project +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/.project @@ -1,6 +1,6 @@ - eu.esdihumboldt.hale.doc.xtraserver + eu.esdihumboldt.util.resource.schemas.end diff --git a/util/plugins/eu.esdihumboldt.util.resource.schemas.end/.settings/org.eclipse.jdt.core.prefs b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..f29e940a00 --- /dev/null +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/util/plugins/eu.esdihumboldt.util.resource.schemas.end/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..6b6a08cbad --- /dev/null +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Bundled Environmental Noise Directive (END) Schemas +Bundle-SymbolicName: eu.esdihumboldt.util.resource.schemas.end;singleton:=true +Bundle-Version: 4.1.0.qualifier diff --git a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/build.properties b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/build.properties similarity index 50% rename from io/plugins/eu.esdihumboldt.hale.io.xtraserver/build.properties rename to util/plugins/eu.esdihumboldt.util.resource.schemas.end/build.properties index e9863e281e..8ad51cb85c 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.xtraserver/build.properties +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/build.properties @@ -1,5 +1,2 @@ -source.. = src/ -output.. = bin/ bin.includes = META-INF/,\ - .,\ plugin.xml diff --git a/util/plugins/eu.esdihumboldt.util.resource.schemas.end/plugin.xml b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/plugin.xml new file mode 100644 index 0000000000..97b0af2ba7 --- /dev/null +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.end/plugin.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/util/plugins/eu.esdihumboldt.util.resource.schemas.inspire.annex1/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.resource.schemas.inspire.annex1/META-INF/MANIFEST.MF index 39d2b924cd..f22cc99834 100644 --- a/util/plugins/eu.esdihumboldt.util.resource.schemas.inspire.annex1/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.resource.schemas.inspire.annex1/META-INF/MANIFEST.MF @@ -2,6 +2,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Bundled Inspire Annex I Schemas Bundle-SymbolicName: eu.esdihumboldt.util.resource.schemas.inspire.annex1;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Require-Bundle: eu.esdihumboldt.util.resource.schemas.opengis.net;bundle-version="1.0.0", eu.esdihumboldt.util.resource;bundle-version="2.6.0" diff --git a/util/plugins/eu.esdihumboldt.util.resource/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.resource/META-INF/MANIFEST.MF index 5e635f39ff..313ad0c9f8 100644 --- a/util/plugins/eu.esdihumboldt.util.resource/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.resource/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Resource Utilities Bundle-SymbolicName: eu.esdihumboldt.util.resource;singleton:=true -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.collect;version="9.0.0", de.fhg.igd.slf4jplus, diff --git a/util/plugins/eu.esdihumboldt.util.svg.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.svg.test/META-INF/MANIFEST.MF index 69fe6d7786..7628028b1a 100644 --- a/util/plugins/eu.esdihumboldt.util.svg.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.svg.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Test Utility Bundle with SVG tools Bundle-SymbolicName: eu.esdihumboldt.util.svg.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-Vendor: wetransform GmbH Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: ., diff --git a/util/plugins/eu.esdihumboldt.util.test/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util.test/META-INF/MANIFEST.MF index 25beaca2c4..47617d9b95 100644 --- a/util/plugins/eu.esdihumboldt.util.test/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Utilities Tests Bundle-SymbolicName: eu.esdihumboldt.util.test -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Fragment-Host: eu.esdihumboldt.util;bundle-version="2.5.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.junit;version="4.12.0" diff --git a/util/plugins/eu.esdihumboldt.util/META-INF/MANIFEST.MF b/util/plugins/eu.esdihumboldt.util/META-INF/MANIFEST.MF index 209d408a48..48177097ca 100644 --- a/util/plugins/eu.esdihumboldt.util/META-INF/MANIFEST.MF +++ b/util/plugins/eu.esdihumboldt.util/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Utilities Bundle Bundle-SymbolicName: eu.esdihumboldt.util -Bundle-Version: 4.0.0.qualifier +Bundle-Version: 4.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.common.base;version="9.0.0", com.google.common.collect;version="9.0.0",