Merge branch 'mkoller/contextdata' into mkoller/contrib

Change-Id: I8e4aa5f7c44d71f63caece30e9e7eb6775c68978
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..8f51d10
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,54 @@
+# Contributing to Eclipse MDM|BL
+
+Thanks for your interest in this project.
+
+## Project description
+
+* https://projects.eclipse.org/projects/technology.mdmbl
+
+## Developer resources
+
+Information regarding source code management, builds, coding standards, and
+more.
+
+* https://projects.eclipse.org/projects/technology.mdmbl/developer
+
+The project maintains the following source code repositories
+
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.api.base
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.api.default
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.api.odsadapter
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.mdfsorter
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.nucleus
+* https://git.eclipse.org/r/plugins/gitiles/mdmbl/org.eclipse.mdm.openatfx.mdf
+
+This project uses Bugzilla to track ongoing development and issues.
+
+* Search for issues: https://bugs.eclipse.org/bugs/buglist.cgi?product=MDMBL
+* Create a new report:
+   https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDMBL
+
+Be sure to search for existing bugs before you create another one. Remember that
+contributions are always welcome!
+
+## Eclipse Contributor Agreement
+
+Before your contribution can be accepted by the project team contributors must
+electronically sign the Eclipse Contributor Agreement (ECA).
+
+* http://www.eclipse.org/legal/ECA.php
+
+Commits that are provided by non-committers must have a Signed-off-by field in
+the footer indicating that the author is aware of the terms by which the
+contribution has been provided to the project. The non-committer must
+additionally have an Eclipse Foundation account and must have a signed Eclipse
+Contributor Agreement (ECA) on file.
+
+For more information, please see the Eclipse Committer Handbook:
+https://www.eclipse.org/projects/handbook/#resources-commit
+
+## Contact
+
+Contact the project developers via the project's "dev" list.
+
+* https://dev.eclipse.org/mailman/listinfo/mdmbl-dev
diff --git a/NOTICE.txt b/NOTICE.txt
index 05b1024..56281c6 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -16,14 +16,15 @@
 For more information regarding authorship of content, please consult the listed
 source code repository logs.
 
-Copyright (c) 2016-2018 Gigatronik Ingolstadt GmbH
-Copyright (c) 2016-2019 Peak Solution GmbH
+Copyright (c) 2016-2019 Gigatronik Ingolstadt GmbH
+Copyright (c) 2016-2020 Peak Solution GmbH
 Copyright (c) 2017-2018 science + computing AG Tuebingen (ATOS SE)
 Copyright (c) 2017-2018 Canoo Engineering AG
 Copyright (c) 2017 Florian Schmitt
-Copyright (c) 2017-2019 Angelika Wittek
-Copyright (c) 2018 Elektronische Fahrwerksysteme GMBH
-Copyright (c) 2018-2019 Karakun AG
+Copyright (c) 2017-2020 Angelika Wittek
+Copyright (c) 2018-2019 Elektronische Fahrwerksysteme GMBH
+Copyright (c) 2018-2020 Karakun AG
+Copyright (c) 2018-2020 Alexander Nehmer
 
 ## Declared Project Licenses
 
@@ -37,7 +38,7 @@
 
 The project maintains the following source code repositories:
 
-org.eclipse.mdm.api.base.git	      - The openMDM(R) API.
+org.eclipse.mdm.api.base.git	    - The openMDM(R) API.
 org.eclipse.mdm.api.default.git	    - Extension of the openMDM(R) API containing default elements.
 org.eclipse.mdm.api.odsadapter.git	- ODS implementation of persistence adapter.
 org.eclipse.mdm.nucleus.git	        - Core building blocks for the openMDM Business Logic and Web Frontend.
@@ -67,9 +68,6 @@
 commons-text-1.6.jar (1.6)
     * License: Apache License, 2.0
 
-commons-math-2.2.jar (2.2)
-    * License: Apache License, 2.0
-
 gson-2.7.jar (2.7)
     * License: Apache License, 2.0
 
@@ -85,7 +83,7 @@
 hk2-locator-2.5.0-b05.jar(2.5.0-b05)
     * License: CDDL
 
-hk2-utils-2.5.0-b05.jar  (2.5.0-b05)
+hk2-utils-2.5.0-b05.jar (2.5.0-b05)
     * License: CDDL
 
 jackson-annotations-2.9.0.jar  (2.9.0)
@@ -151,6 +149,9 @@
 logback-core-1.2.3.jar(1.2.3)
     * License: Eclipse Public License 1.0
 
+mimepull-1.9.6.jar (1.9.4)
+    * License: CDDL
+
 openatfx-0.7.4.jar (0.7.4)
     * License: Apache-2.0
 
@@ -175,12 +176,18 @@
     * Project URL: https://github.com/qos-ch/slf4j
     * Source URL:  https://github.com/qos-ch/slf4j/releases/tag/v_1.7.25
 
+stax2-api-3.1.4.jar (3.1.4)
+    * License: BSD-2-Clause
+
 validation-api-1.1.0.Final.jar (1.1.0.Final)
   * License: Apache License, 2.0
 
 vavr-0.9.1-sources.jar (0.9.1)
   * License: Apache License, 2.0
 
+vavr-match-0.9.1.jar (0.9.1)
+  * License: Apache License, 2.0
+
 woodstox-core-asl-4.4.1.jar (4.4.1)
   * License: Apache License, 2.0
 
@@ -294,6 +301,18 @@
     * Project: https://valor-software.com/ngx-bootstrap
     * Source:  https://github.com/valor-software/ngx-bootstrap/tree/v3.1.2
 
+@ngx-translate/core@11.0.1
+    * License: MIT 
+    * Licence Path:   https://github.com/ngx-translate/core/blob/v11.0.1/LICENSE  
+    * Project URL:    http://www.ngx-translate.com/
+    * Source URL:     https://github.com/ngx-translate/core
+
+@ngx-translate/http-loader@4.0.0
+    * License: MIT 
+    * Licence Path:   https://github.com/ngx-translate/http-loader/blob/v4.0.0/LICENSE  
+    * Project URL:    http://www.ngx-translate.com/
+    * Source URL:     https://github.com/ngx-translate/http-loader/tree/v4.0.0
+
 primeicons:1.0.0
     * License: MIT
     * Licence Path: https://github.com/primefaces/primeicons/blob/1.0.0/LICENSE
@@ -306,7 +325,7 @@
     * Project: https://www.primefaces.org/primeng
     * Source:  https://github.com/primefaces/primeng/tree/7.0.1
 
-rxjs@5.1.0
+rxjs@6.3.3
     * License: Apache-2.0
     * Project: https://rxjs-dev.firebaseapp.com/
     * Source:  https://github.com/ReactiveX/rxjs/tree/6.3.3
@@ -316,6 +335,10 @@
     * Project: https://rxjs-dev.firebaseapp.com/
     * Source:  https://github.com/ReactiveX/rxjs/tree/6.3.3/compat
 
+tslib@1.9.0
+    * License: Apache-2.0
+    * Project: https://github.com/Microsoft/tslib
+    * Source:  https://github.com/Microsoft/tslib/tree/1.9.0
 
 zone.js@0.8.26
     * License: MIT
@@ -336,17 +359,12 @@
 * Source: https://www.omg.org/spec/NOT/1.1/PDF
 
 ods530.idl
-Permission of use:
-From Hans-Georg Swolana, Chairman of the Board ASAM e.V.,
- Prof. Dr. Marcus Rieker, Member of the Board ASAM e.V.
 Date: Hoehenkirchen, 06/01/2016
 "The ASAM Board of Directors releases the IDL files for use under the EPL to the Eclipse IWG openMDM.
 This is valid for all versions of ASAM ODS 5.3.x.
 This permission is valid under the conditions of Eclipse will not modify the file."
 
 AvalonEvent.idl, CorbaFileServer.idl
-Permission of use:
-From Dr. Ralph Noerenberg
 Date: 08/15/2016
 "Herewith, we release the generated Client-Source-Code generated from our CORBA IDLs, namely
 * CORBANotification Service (generated from „AvalonEvent.idl”)
diff --git a/build.gradle b/build.gradle
index 5e04e9f..d79ce1d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -146,15 +146,16 @@
 
 task distribute(type: Zip) {
 	archiveName = "openMDM_application-${version}.zip"
-	
+
 	from "${project.projectDir}/LICENSE.txt"
 	from "${project.projectDir}/NOTICE.txt"
+	from "${project.projectDir}/CONTRIBUTING.md"
 	from "${project.projectDir}/readme.md"
 	from "${project.projectDir}/release_notes.md"
-	
+
 	from "${project.projectDir}/doc/GettingStarted_mdmbl.pdf"
 	from "${project.projectDir}/doc/Installation Guide for the openMDM5 Application.pdf"
-	
+
 	from "${project.projectDir}/build/tmp/openmdm_application"
 	from "${project.projectDir}/build/libs/"
 }
@@ -172,13 +173,14 @@
 	from ("${project.projectDir}/src/main/webapp/") {
 		include('**/*')
 	}
-	
+
 
 	webXml = file('org.eclipse.mdm.application/src/main/webconfig/web.xml')
 	webInf  {from 'org.eclipse.mdm.application/src/main/webconfig/glassfish-web.xml'}
-	
+
 	metaInf { from 'NOTICE.txt' }
 	metaInf { from 'LICENSE.txt' }
+	metaInf { from 'CONTRIBUTING.md' }
 }
 
 war.finalizedBy(distribute)
diff --git a/org.eclipse.mdm.application/src/main/webapp/package.json b/org.eclipse.mdm.application/src/main/webapp/package.json
index 64fcfc6..b01762e 100644
--- a/org.eclipse.mdm.application/src/main/webapp/package.json
+++ b/org.eclipse.mdm.application/src/main/webapp/package.json
@@ -1,9 +1,9 @@
 {
   "name": "openMDM-Web",
-  "version": "1.0.0",
+  "version": "5.1.0M8",
   "description": "MDM web client",
   "repository": "http://git.eclipse.org/c/mdmbl/org.eclipse.mdm.nucleus.git",
-  "license": "EPL-1.0",
+  "license": "EPL-2.0",
   "scripts": {
     "ng": "ng",
     "start": "ng serve",
diff --git a/org.eclipse.mdm.application/src/main/webapp/src/app/NOTICE.html b/org.eclipse.mdm.application/src/main/webapp/src/app/NOTICE.html
index 1142f69..1bf6a90 100644
--- a/org.eclipse.mdm.application/src/main/webapp/src/app/NOTICE.html
+++ b/org.eclipse.mdm.application/src/main/webapp/src/app/NOTICE.html
@@ -17,14 +17,15 @@
 For more information regarding authorship of content, please consult the listed
 source code repository logs.
 
-Copyright (c) 2016-2018 Gigatronik Ingolstadt GmbH
-Copyright (c) 2016-2019 Peak Solution GmbH
+Copyright (c) 2016-2019 Gigatronik Ingolstadt GmbH
+Copyright (c) 2016-2020 Peak Solution GmbH
 Copyright (c) 2017-2018 science + computing AG Tuebingen (ATOS SE)
 Copyright (c) 2017-2018 Canoo Engineering AG
 Copyright (c) 2017 Florian Schmitt
-Copyright (c) 2017-2019 Angelika Wittek
-Copyright (c) 2018 Elektronische Fahrwerksysteme GMBH
-Copyright (c) 2018-2019 Karakun AG
+Copyright (c) 2017-2020 Angelika Wittek
+Copyright (c) 2018-2019 Elektronische Fahrwerksysteme GMBH
+Copyright (c) 2018-2020 Karakun AG
+Copyright (c) 2018-2020 Alexander Nehmer
 
 ## Declared Project Licenses
 
@@ -153,6 +154,19 @@
     * Licence Path: https://github.com/valor-software/ngx-bootstrap/blob/v3.1.2/LICENSE
     * Project: https://valor-software.com/ngx-bootstrap
     * Source:  https://github.com/valor-software/ngx-bootstrap/tree/v3.1.2
+    
+@ngx-translate/core@11.0.1
+    * License: MIT 
+    * Licence Path:   https://github.com/ngx-translate/core/blob/v11.0.1/LICENSE  
+    * Project URL:    http://www.ngx-translate.com/
+    * Source URL:     https://github.com/ngx-translate/core
+
+@ngx-translate/http-loader@4.0.0
+    * License: MIT 
+    * Licence Path:   https://github.com/ngx-translate/http-loader/blob/v4.0.0/LICENSE  
+    * Project URL:    http://www.ngx-translate.com/
+    * Source URL:     https://github.com/ngx-translate/http-loader/tree/v4.0.0
+    
 
 primeicons:1.0.0
     * License: MIT
@@ -176,6 +190,10 @@
     * Project: https://rxjs-dev.firebaseapp.com/
     * Source:  https://github.com/ReactiveX/rxjs/tree/6.3.3/compat
 
+tslib@1.9.0
+    * License: Apache-2.0
+    * Project: https://github.com/Microsoft/tslib
+    * Source:  https://github.com/Microsoft/tslib/tree/1.9.0
 
 zone.js@0.8.26
     * License: MIT
diff --git a/org.eclipse.mdm.businessobjects/src/main/java/org/eclipse/mdm/businessobjects/boundary/ValuesResource.java b/org.eclipse.mdm.businessobjects/src/main/java/org/eclipse/mdm/businessobjects/boundary/ValuesResource.java
index 2348b03..cff97c3 100644
--- a/org.eclipse.mdm.businessobjects/src/main/java/org/eclipse/mdm/businessobjects/boundary/ValuesResource.java
+++ b/org.eclipse.mdm.businessobjects/src/main/java/org/eclipse/mdm/businessobjects/boundary/ValuesResource.java
@@ -32,6 +32,7 @@
 import io.swagger.v3.oas.annotations.Parameter;

 import io.swagger.v3.oas.annotations.media.Content;

 import io.swagger.v3.oas.annotations.media.Schema;

+import io.swagger.v3.oas.annotations.parameters.RequestBody;

 import io.swagger.v3.oas.annotations.responses.ApiResponse;

 import io.swagger.v3.oas.annotations.tags.Tag;

 

@@ -49,9 +50,9 @@
 	@Operation(summary = "Read measurement data", description = "Read measurement specified by a ReadRequest.", responses = {

 			@ApiResponse(description = "A list with MeasuredValues. Each MeasuredValues represents the values of a Channel.", content = @Content(schema = @Schema(implementation = Mdm.MeasuredValuesList.class))),

 			@ApiResponse(responseCode = "400", description = "Error") })

-	public Response find(

+	public Response read(

 			@Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName,

-			@Parameter(description = "ReadRequest specifying the Channels and the portion of the Channel's data to read.", required = true, content = @Content(schema = @Schema(implementation = Mdm.ReadRequest.class))) Mdm.ReadRequest protoReadRequest) {

+			@RequestBody(description = "ReadRequest specifying the Channels and the portion of the Channel's data to read.", required = true, content = @Content(schema = @Schema(implementation = Mdm.ReadRequest.class))) Mdm.ReadRequest protoReadRequest) {

 

 		return Response.ok(valuesService.load(sourceName, protoReadRequest)).build();

 	}

@@ -61,9 +62,9 @@
 	@Operation(summary = "Write measurement data", description = "Write measurement data for the specified ChannelGroup and Channels. Both ChannelGroup and Channels must exist.", responses = {

 			@ApiResponse(description = "An empty response"),

 			@ApiResponse(responseCode = "400", description = "Error") })

-	public Response find(

+	public Response write(

 			@Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName,

-			Mdm.WriteRequestList protoWriteRequestList) {

+			@RequestBody(description = "WriteRequestList specifying the Channels and measurement data to write.", required = true, content = @Content(schema = @Schema(implementation = Mdm.WriteRequestList.class))) Mdm.WriteRequestList protoWriteRequestList) {

 

 		valuesService.write(sourceName, protoWriteRequestList);

 

@@ -77,7 +78,7 @@
 			@ApiResponse(responseCode = "400", description = "Error") })

 	public Response preview(

 			@Parameter(description = "Name of the MDM datasource", required = true) @PathParam(REQUESTPARAM_SOURCENAME) String sourceName,

-			@Parameter(description = "PreviewRequest specifying the Channels and number of chunks to read.", required = true, content = @Content(schema = @Schema(implementation = Mdm.PreviewRequest.class))) Mdm.PreviewRequest previewRequest) {

+			@RequestBody(description = "PreviewRequest specifying the Channels and number of chunks to read.", required = true, content = @Content(schema = @Schema(implementation = Mdm.PreviewRequest.class))) Mdm.PreviewRequest previewRequest) {

 

 		return Response.ok(valuesService.preview(sourceName, previewRequest)).build();

 	}

diff --git a/org.eclipse.mdm.openatfx/build.gradle b/org.eclipse.mdm.openatfx/build.gradle
index 974dc4f..38e4910 100644
--- a/org.eclipse.mdm.openatfx/build.gradle
+++ b/org.eclipse.mdm.openatfx/build.gradle
@@ -33,6 +33,11 @@
 	testCompile 'org.apache.commons:commons-math:2.2'
 }
 
+configurations.all {
+	// stax-api is included in Java 6 or higher
+	exclude group: 'javax.xml.stream', module: 'stax-api'
+}
+
 task downloadOpenATFX(type: Download) {
 	acceptAnyCertificate true
 	overwrite false
diff --git a/release_notes.md b/release_notes.md
index e69cf5b..f8081c1 100644
--- a/release_notes.md
+++ b/release_notes.md
@@ -22,7 +22,7 @@
 * New method: o.e.m.a.d.m.EnttiyFactory#createTestStep(String, Test, Classification)
 * New method: o.e.m.a.d.m.EntityFactory#createTestStep(String, Test, TemplateTestStep, Classification)
 * Renamed classes in org.eclipse.mdm.nucleus.api.copy
-
+* New method: o.e.m.a.b.q.Query#limit(int limit)
 
 ### Changes ###
 
@@ -33,9 +33,14 @@
 * [553162](https://bugs.eclipse.org/bugs/show_bug.cgi?id=553162) - Webclient: Add Quantity and Unit to DetailView
 * [553163](https://bugs.eclipse.org/bugs/show_bug.cgi?id=553163) - Implement a session check / reconnect for Freetextindexer
 * [553164](https://bugs.eclipse.org/bugs/show_bug.cgi?id=553164) - Improve template resolving in apicopy
+* [550002](https://bugs.eclipse.org/bugs/show_bug.cgi?id=550002) - Add relation information to REST-API
+* [549844](https://bugs.eclipse.org/bugs/show_bug.cgi?id=549844) - [REST] Add unit info on /channels response
+* [544850](https://bugs.eclipse.org/bugs/show_bug.cgi?id=544850) - Allow to limit number of search results
 
 ### Bugzilla Bugs fixed ###
 
+* [553369](https://bugs.eclipse.org/bugs/show_bug.cgi?id=553369) - ATFX Import fails if multiple version of a Quantity exist 
+* [559366](https://bugs.eclipse.org/bugs/show_bug.cgi?id=559366) - [REST] Swagger Codegen leads to an error when using the provided openAPI files
 * [553266](https://bugs.eclipse.org/bugs/show_bug.cgi?id=553266)) - Contributions of Peak Solution (2019/11)
   - ATFX export now correctly includes Context Data
   - Fixed EntityService#satisfiesParameters