Added custom_icons attribute to autogenerated TOSCA for dashboards

Change-Id: I277eebc1913f71eeef798cee661d5fbe4d9fd544
diff --git a/views/ngXosLib/generator-xos/app/templates/gulp/build.js b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
index f916212..6eb20af 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulp/build.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
@@ -28,6 +28,7 @@
 var csswring = require('csswring');
 var yaml = require('js-yaml');
 var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.<%= name %>')
@@ -76,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/<%= name %>-icon.png`,`${options.icon}/<%= name %>-icon-active.png`])
+    return gulp.src([`${options.icon}/<%= name %>-icon.png`, `${options.icon}/<%= name %>-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -167,6 +168,15 @@
         url: 'template:xos<%= fileName %>'
       }
     };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/<%= name %>-icon.png`) &&
+      fs.existsSync(`${options.icon}/<%= name %>-icon-active.png`)
+    ){
+      dashboardJson['<%= fileName %>'].properties.custom_icon = true;
+    }
+
     const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
 
     // TOSCA to add the dashboard to the user
diff --git a/views/ngXosViews/ceilometerDashboard/gulp/build.js b/views/ngXosViews/ceilometerDashboard/gulp/build.js
index 4608dff..1d050fb 100644
--- a/views/ngXosViews/ceilometerDashboard/gulp/build.js
+++ b/views/ngXosViews/ceilometerDashboard/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.ceilometerDashboard')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/ceilometerDashboard-icon.png`,`${options.icon}/ceilometerDashboard-icon-active.png`])
+    return gulp.src([`${options.icon}/ceilometerDashboard-icon.png`, `${options.icon}/ceilometerDashboard-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['CeilometerDashboard'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosCeilometerDashboard'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/ceilometerDashboard-icon.png`) &&
+      fs.existsSync(`${options.icon}/ceilometerDashboard-icon-active.png`)
+    ){
+      dashboardJson['CeilometerDashboard'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['ceilometerDashboard_dashboard'] = {
+      node: 'CeilometerDashboard',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/ceilometerDashboard/package.json b/views/ngXosViews/ceilometerDashboard/package.json
index 1aa661d..1f85623 100644
--- a/views/ngXosViews/ceilometerDashboard/package.json
+++ b/views/ngXosViews/ceilometerDashboard/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/contentProvider/gulp/build.js b/views/ngXosViews/contentProvider/gulp/build.js
index c560e4a..b2dd6ca 100644
--- a/views/ngXosViews/contentProvider/gulp/build.js
+++ b/views/ngXosViews/contentProvider/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.contentProvider')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/contentProvider-icon.png`,`${options.icon}/contentProvider-icon-active.png`])
+    return gulp.src([`${options.icon}/contentProvider-icon.png`, `${options.icon}/contentProvider-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['ContentProvider'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosContentProvider'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/contentProvider-icon.png`) &&
+      fs.existsSync(`${options.icon}/contentProvider-icon-active.png`)
+    ){
+      dashboardJson['ContentProvider'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['contentProvider_dashboard'] = {
+      node: 'ContentProvider',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/contentProvider/package.json b/views/ngXosViews/contentProvider/package.json
index b626ef7..ec2e401 100644
--- a/views/ngXosViews/contentProvider/package.json
+++ b/views/ngXosViews/contentProvider/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/dashboardManager/gulp/build.js b/views/ngXosViews/dashboardManager/gulp/build.js
index 9789be8..df8dcc1 100644
--- a/views/ngXosViews/dashboardManager/gulp/build.js
+++ b/views/ngXosViews/dashboardManager/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.dashboardManager')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/dashboardManager-icon.png`,`${options.icon}/dashboardManager-icon-active.png`])
+    return gulp.src([`${options.icon}/dashboardManager-icon.png`, `${options.icon}/dashboardManager-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['DashboardManager'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosDashboardManager'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/dashboardManager-icon.png`) &&
+      fs.existsSync(`${options.icon}/dashboardManager-icon-active.png`)
+    ){
+      dashboardJson['DashboardManager'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['dashboardManager_dashboard'] = {
+      node: 'DashboardManager',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/dashboardManager/package.json b/views/ngXosViews/dashboardManager/package.json
index 5f562df..fcf051f 100644
--- a/views/ngXosViews/dashboardManager/package.json
+++ b/views/ngXosViews/dashboardManager/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/developer/gulp/build.js b/views/ngXosViews/developer/gulp/build.js
index 4ad71d4..afc9c90 100644
--- a/views/ngXosViews/developer/gulp/build.js
+++ b/views/ngXosViews/developer/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.developer')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/developer-icon.png`,`${options.icon}/developer-icon-active.png`])
+    return gulp.src([`${options.icon}/developer-icon.png`, `${options.icon}/developer-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['Developer'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosDeveloper'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/developer-icon.png`) &&
+      fs.existsSync(`${options.icon}/developer-icon-active.png`)
+    ){
+      dashboardJson['Developer'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['developer_dashboard'] = {
+      node: 'Developer',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/developer/package.json b/views/ngXosViews/developer/package.json
index 9a6eff2..8b3ac4e 100644
--- a/views/ngXosViews/developer/package.json
+++ b/views/ngXosViews/developer/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/diagnostic/gulp/build.js b/views/ngXosViews/diagnostic/gulp/build.js
index 716d301..e95e62d 100644
--- a/views/ngXosViews/diagnostic/gulp/build.js
+++ b/views/ngXosViews/diagnostic/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.diagnostic')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/diagnostic-icon.png`,`${options.icon}/diagnostic-icon-active.png`])
+    return gulp.src([`${options.icon}/diagnostic-icon.png`, `${options.icon}/diagnostic-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['Diagnostic'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosDiagnostic'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/diagnostic-icon.png`) &&
+      fs.existsSync(`${options.icon}/diagnostic-icon-active.png`)
+    ){
+      dashboardJson['Diagnostic'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['diagnostic_dashboard'] = {
+      node: 'Diagnostic',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/diagnostic/package.json b/views/ngXosViews/diagnostic/package.json
index d916ea0..7eb7458 100644
--- a/views/ngXosViews/diagnostic/package.json
+++ b/views/ngXosViews/diagnostic/package.json
@@ -5,9 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
-    "dev": "NODE_ENV=mock gulp serve",
-    "local": "NODE_ENV=local gulp serve",
-    "server": "easy-mocker -c ./mocks/diagnostic.conf.json -d ./mocks/data",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -20,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -49,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/hpc/gulp/build.js b/views/ngXosViews/hpc/gulp/build.js
index 64fdaf3..a3ebe09 100644
--- a/views/ngXosViews/hpc/gulp/build.js
+++ b/views/ngXosViews/hpc/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.hpc')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/hpc-icon.png`,`${options.icon}/hpc-icon-active.png`])
+    return gulp.src([`${options.icon}/hpc-icon.png`, `${options.icon}/hpc-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['Hpc'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosHpc'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/hpc-icon.png`) &&
+      fs.existsSync(`${options.icon}/hpc-icon-active.png`)
+    ){
+      dashboardJson['Hpc'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['hpc_dashboard'] = {
+      node: 'Hpc',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/hpc/package.json b/views/ngXosViews/hpc/package.json
index ab43380..96b985c 100644
--- a/views/ngXosViews/hpc/package.json
+++ b/views/ngXosViews/hpc/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/mcordTopology/gulp/build.js b/views/ngXosViews/mcordTopology/gulp/build.js
index f4c5534..c0fe5a7 100644
--- a/views/ngXosViews/mcordTopology/gulp/build.js
+++ b/views/ngXosViews/mcordTopology/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.mcordTopology')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/mcordTopology-icon.png`,`${options.icon}/mcordTopology-icon-active.png`])
+    return gulp.src([`${options.icon}/mcordTopology-icon.png`, `${options.icon}/mcordTopology-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['McordTopology'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosMcordTopology'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/mcordTopology-icon.png`) &&
+      fs.existsSync(`${options.icon}/mcordTopology-icon-active.png`)
+    ){
+      dashboardJson['McordTopology'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['mcordTopology_dashboard'] = {
+      node: 'McordTopology',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/package.json b/views/ngXosViews/mcordTopology/package.json
index 94bb877..060811d 100644
--- a/views/ngXosViews/mcordTopology/package.json
+++ b/views/ngXosViews/mcordTopology/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -17,11 +18,12 @@
     "XOSlib"
   ],
   "author": "Matteo Scandolo",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/openVPNDashboard/gulp/build.js b/views/ngXosViews/openVPNDashboard/gulp/build.js
index 26fc1fe..ec430e6 100644
--- a/views/ngXosViews/openVPNDashboard/gulp/build.js
+++ b/views/ngXosViews/openVPNDashboard/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.openVPNDashboard')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/openVPNDashboard-icon.png`,`${options.icon}/openVPNDashboard-icon-active.png`])
+    return gulp.src([`${options.icon}/openVPNDashboard-icon.png`, `${options.icon}/openVPNDashboard-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['OpenVPNDashboard'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosOpenVPNDashboard'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/openVPNDashboard-icon.png`) &&
+      fs.existsSync(`${options.icon}/openVPNDashboard-icon-active.png`)
+    ){
+      dashboardJson['OpenVPNDashboard'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['openVPNDashboard_dashboard'] = {
+      node: 'OpenVPNDashboard',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/openVPNDashboard/package.json b/views/ngXosViews/openVPNDashboard/package.json
index 09631e4..4dacdcb 100644
--- a/views/ngXosViews/openVPNDashboard/package.json
+++ b/views/ngXosViews/openVPNDashboard/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -16,12 +17,13 @@
     "Angular",
     "XOSlib"
   ],
-  "author": "Jeremy Mowery",
+  "author": "Matteo Scandolo",
   "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/serviceGrid/gulp/build.js b/views/ngXosViews/serviceGrid/gulp/build.js
index 471136b..41213d4 100644
--- a/views/ngXosViews/serviceGrid/gulp/build.js
+++ b/views/ngXosViews/serviceGrid/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.serviceGrid')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/serviceGrid-icon.png`,`${options.icon}/serviceGrid-icon-active.png`])
+    return gulp.src([`${options.icon}/serviceGrid-icon.png`, `${options.icon}/serviceGrid-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['ServiceGrid'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosServiceGrid'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/serviceGrid-icon.png`) &&
+      fs.existsSync(`${options.icon}/serviceGrid-icon-active.png`)
+    ){
+      dashboardJson['ServiceGrid'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['serviceGrid_dashboard'] = {
+      node: 'ServiceGrid',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/package.json b/views/ngXosViews/serviceGrid/package.json
index 4259a36..26ab093 100644
--- a/views/ngXosViews/serviceGrid/package.json
+++ b/views/ngXosViews/serviceGrid/package.json
@@ -5,12 +5,12 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
     "test:ci": "karma start --single-run",
-    "lint": "eslint src/js/",
-    "server": "easy-mocker -c ./mocks/diagnostic.conf.json -d ./mocks/data"
+    "lint": "eslint src/js/"
   },
   "keywords": [
     "XOS",
@@ -23,6 +23,7 @@
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -47,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/subscribers/gulp/build.js b/views/ngXosViews/subscribers/gulp/build.js
index a23d5be..dcd3fc3 100644
--- a/views/ngXosViews/subscribers/gulp/build.js
+++ b/views/ngXosViews/subscribers/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.subscribers')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/subscribers-icon.png`,`${options.icon}/subscribers-icon-active.png`])
+    return gulp.src([`${options.icon}/subscribers-icon.png`, `${options.icon}/subscribers-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['Subscribers'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosSubscribers'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/subscribers-icon.png`) &&
+      fs.existsSync(`${options.icon}/subscribers-icon-active.png`)
+    ){
+      dashboardJson['Subscribers'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['subscribers_dashboard'] = {
+      node: 'Subscribers',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/package.json b/views/ngXosViews/subscribers/package.json
index 812ca00..206b779 100644
--- a/views/ngXosViews/subscribers/package.json
+++ b/views/ngXosViews/subscribers/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -21,8 +22,8 @@
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
-    "babel-polyfill": "^6.9.0",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -47,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/tenant/gulp/build.js b/views/ngXosViews/tenant/gulp/build.js
index 2d2ec6b..7f8ade7 100644
--- a/views/ngXosViews/tenant/gulp/build.js
+++ b/views/ngXosViews/tenant/gulp/build.js
@@ -26,6 +26,9 @@
 var autoprefixer = require('autoprefixer');
 var mqpacker = require('css-mqpacker');
 var csswring = require('csswring');
+var yaml = require('js-yaml');
+var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.tenant')
@@ -74,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/tenant-icon.png`,`${options.icon}/tenant-icon-active.png`])
+    return gulp.src([`${options.icon}/tenant-icon.png`, `${options.icon}/tenant-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -155,6 +158,56 @@
     }, 1000);
   });
 
+  gulp.task('tosca', function (cb) {
+
+    // TOSCA to register the dashboard in the system
+    const dashboardJson = {};
+    dashboardJson['Tenant'] = {
+      type: 'tosca.nodes.DashboardView',
+      properties: {
+        url: 'template:xosTenant'
+      }
+    };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/tenant-icon.png`) &&
+      fs.existsSync(`${options.icon}/tenant-icon-active.png`)
+    ){
+      dashboardJson['Tenant'].properties.custom_icon = true;
+    }
+
+    const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
+
+    // TOSCA to add the dashboard to the user
+    const userDashboardJson = {};
+    userDashboardJson['tenant_dashboard'] = {
+      node: 'Tenant',
+      relationship: 'tosca.relationships.UsesDashboard'
+    };
+    const userJson = {
+      'padmin@vicci.org': {
+        type: 'tosca.nodes.User',
+        properties: {
+          'no-create': true,
+          'no-delete': true
+        },
+        requirements: [userDashboardJson]
+      }
+    };
+    const userTosca = yaml.dump(userJson).replace(/'/gmi, '');
+
+
+    // the output is in a timeout so that it get printed after the gulp logs
+    setTimeout(function () {
+      console.log(colors.cyan('\n\n# You can use this recipe to load the dashboard in the system:'));
+      console.log(colors.yellow(dashboardTosca));
+      console.log(colors.cyan('# And this recipe to activate the dashboard for a user:'));
+      console.log(colors.yellow(userTosca));
+    }, 1000);
+    cb();
+  });
+
   gulp.task('build', function() {
     runSequence(
       'clean',
@@ -167,7 +220,8 @@
       'copyCss',
       'copyImages',
       'copyHtml',
-      'cleanTmp'
+      'cleanTmp',
+      'tosca'
     );
   });
 };
\ No newline at end of file
diff --git a/views/ngXosViews/tenant/package.json b/views/ngXosViews/tenant/package.json
index d8da5f8..3633eec 100644
--- a/views/ngXosViews/tenant/package.json
+++ b/views/ngXosViews/tenant/package.json
@@ -5,6 +5,7 @@
   "scripts": {
     "prestart": "npm install && bower install",
     "start": "gulp serve",
+    "tosca": "gulp tosca",
     "prebuild": "npm install && bower install",
     "build": "gulp",
     "test": "karma start",
@@ -16,12 +17,13 @@
     "Angular",
     "XOSlib"
   ],
-  "author": "Arpit Agarwal",
+  "author": "Matteo Scandolo",
   "license": "Apache-2.0",
   "dependencies": {},
   "devDependencies": {
     "autoprefixer": "^6.3.3",
     "browser-sync": "^2.9.11",
+    "colors": "^1.1.2",
     "css-mqpacker": "^4.0.0",
     "csswring": "^4.2.1",
     "del": "^2.0.2",
@@ -46,6 +48,7 @@
     "http-proxy": "^1.12.0",
     "ink-docstrap": "^0.5.2",
     "jasmine-core": "~2.3.4",
+    "js-yaml": "^3.6.1",
     "karma": "^0.13.14",
     "karma-babel-preprocessor": "~5.2.2",
     "karma-coverage": "^0.5.3",
diff --git a/views/ngXosViews/truckroll/gulp/build.js b/views/ngXosViews/truckroll/gulp/build.js
index d71151b..17f3be1 100644
--- a/views/ngXosViews/truckroll/gulp/build.js
+++ b/views/ngXosViews/truckroll/gulp/build.js
@@ -28,6 +28,7 @@
 var csswring = require('csswring');
 var yaml = require('js-yaml');
 var colors = require('colors/safe');
+var fs =  require('fs');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.truckroll')
@@ -76,7 +77,7 @@
 
   // copy images in correct folder
   gulp.task('copyImages', ['wait'], function(){
-    return gulp.src([`${options.icon}/truckroll-icon.png`,`${options.icon}/truckroll-icon-active.png`])
+    return gulp.src([`${options.icon}/truckroll-icon.png`, `${options.icon}/truckroll-icon-active.png`])
     .pipe(gulp.dest(options.static + 'images/'))
   });
 
@@ -167,6 +168,15 @@
         url: 'template:xosTruckroll'
       }
     };
+
+    // check for custom icons
+    if(
+      fs.existsSync(`${options.icon}/truckroll-icon.png`) &&
+      fs.existsSync(`${options.icon}/truckroll-icon-active.png`)
+    ){
+      dashboardJson['Truckroll'].properties.custom_icon = true;
+    }
+
     const dashboardTosca = yaml.dump(dashboardJson).replace(/'/gmi, '');
 
     // TOSCA to add the dashboard to the user