=== The following notes should collect some tips and tricks for the development for and with the Eclipse SmartHome framework.

Maven Bundle Plugin

The Eclipse SmartHome framework follows the Manifest first approach and Tycho is been used to build eclipse-plugins using maven. Sometimes it could be useful to use the maven-bundle-plugin (and so the bnd tools) to inspect a generated manifest file and compare this one with the one that is used by Tycho (e.g. to identify missing imports, etc.). The manifest generation could be triggered by:

mvn bundle:manifest -DniceManifest=true

The “nice manifest” option will add line breaks after every imported package. Now you can have a look at the manifest that would be generated by the bndtool using:

cat target/classes/META-INF/MANIFEST.MF

Paper UI development (JS/HTML)

The initial setup of PaperUI can be done in two ways:

  1. By running the maven build.
  2. Running an npm install followed by npm run build.

The JS/HTML files of Paper UI are packaged using the ‘Gulp’ plugin. There are two important gulp tasks needed for development. For normal development you need to run the following command on console:

npm start

This will automatically inject all the needed files to index.html and will launch a browsersync instance running on http://localhost:3000/ (default). The calls to rest end-point are also proxied by this gulp task. After running this, any changes made into the files of folder ‘web-src’ will be available in the browser after refreshing the page. The distribution version of Paper UI can be seen using the command:

npm run build

This will minify the files and copy all the sources to ‘web’ folder. The changes can be seen at ‘http://localhost:8080/’ (default port for smarthome web server).

Paper UI Location Support

Paper UI supports the rendering for location configuration parameters as well as LocationItems in a map view. For licensing reasons the map component provided by the framework does not render any map but defines the extension point mapSourceService which can be used to provide a map source. Using the OpenLayers API (v4.2.0) a solution may provide an existing or even its own implementation of a map source.

This example configures the OpenStreetMap map source and provides it via the Paper UI extensions module:

angular.module('PaperUI.extensions', []) //
.service('mapSourceService', function() {
    return {
        getMapSource : function() {
            return new ol.source.OSM()