-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8dfb32f
Showing
10 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
.idea | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
repo: ab64366960a6c2ff3f7f03d34fdd856cd59e30d7 | ||
node: 87b64cb4450c2ae26e6d1ad5397a6eeaaf1691b3 | ||
branch: default | ||
latesttag: null | ||
latesttagdistance: 26 | ||
changessincelatesttag: 26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = function (grunt) { | ||
'use strict'; | ||
|
||
var DEFAULT_HOST = 'developer.cumulocity.com', | ||
DEFAULT_PROTOCOL = 'https', | ||
host = DEFAULT_HOST, | ||
protocol = DEFAULT_PROTOCOL; | ||
|
||
if (grunt.option('host')) { | ||
host = grunt.option('host'); | ||
} | ||
|
||
if (grunt.option('protocol')) { | ||
protocol = grunt.option('protocol'); | ||
} | ||
|
||
grunt.config('cumulocity.host', host); | ||
grunt.config('cumulocity.protocol', protocol); | ||
|
||
grunt.config('paths.root', './'); | ||
grunt.config('paths.temp', '.tmp'); | ||
grunt.config('paths.build', 'build'); | ||
grunt.config('paths.plugins', 'plugins'); | ||
grunt.config('paths.bower', 'bower_components'); | ||
|
||
//Load cumulocity grunt tasks | ||
grunt.loadNpmTasks('grunt-cumulocity-ui-tasks'); | ||
|
||
grunt.registerTask('server', [ | ||
'pluginPreAll', | ||
'connect', | ||
'watch' | ||
]); | ||
|
||
grunt.registerTask('build', [ | ||
'pluginBuildAll' | ||
]); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2015 Cumulocity GmbH | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Boilerplate to create a cumulocity ui plugin | ||
|
||
- Get the plugin boilerplate here: https://bitbucket.org/m2m/cumulocity-ui-plugin | ||
- Run *npm install* | ||
- Configure the *cumulocity.json* for application (Select an application name unique in your tenant) | ||
- Register application: *grunt appRegister* | ||
- Configure the *cumulocity.json* for plugin (optional) | ||
- Register plugin: *grunt pluginRegister:<pluginName>* or *grunt pluginRegisterAll* | ||
- Edit the application *cumulocity.json* manifest to include the newly created plugin as an import. | ||
- Re register the application: *grunt appRegister* | ||
- Run local server: *grunt server* | ||
- Open in browser: *http://localhost:8000/apps/<appname>/index.html* | ||
- Code your plugin. Iterate. | ||
- Build your plugin: *grunt build* | ||
- Make sure to re-register if you make changes to manifests: *grunt appRegister*, *grunt pluginRegisterAll* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"availability": "PRIVATE", | ||
"contextPath" : "myapplication", | ||
"key" : "myapplication-appkey", | ||
"name" : "My application", | ||
"resourcesUrl": "https://raw.githubusercontent.com/dwiyatci/cumulocity-plugin-helloworld/master/build", | ||
"type" : "HOSTED", | ||
"imports" : [ | ||
"core/c8yBranding" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name" : "cumulocity-plugin-helloworld", | ||
"version" : "0.0.1", | ||
"dependencies": { | ||
"grunt" : "^0.4.5", | ||
"grunt-contrib-clean" : "^0.5.0", | ||
"grunt-contrib-connect" : "^0.7.1", | ||
"grunt-contrib-copy" : "^0.5.0", | ||
"grunt-contrib-cssmin" : "^0.9.0", | ||
"grunt-contrib-less" : "^0.11.1", | ||
"grunt-contrib-uglify" : "^0.4.0", | ||
"grunt-contrib-watch" : "^0.6.1", | ||
"grunt-angular-templates" : "^0.5.5", | ||
"grunt-cumulocity-ui-tasks": "1.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name" : "Hello world plugin testing", | ||
"description": "Simple hello world plugin.", | ||
"ngModules" : [ | ||
"myapp.helloworld" | ||
], | ||
"js" : [ | ||
"index.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//Main module name must be defined in ngModules of the plugin manifest | ||
angular.module('myapp.helloworld', []).config( | ||
['c8yNavigatorProvider', 'c8yViewsProvider', | ||
function (c8yNavigatorProvider, c8yViewsProvider) { | ||
'use strict'; | ||
|
||
c8yNavigatorProvider.addNavigation({ | ||
name : 'New plugin', | ||
icon : 'cube', | ||
priority: 100000, | ||
path : 'hello' | ||
}); | ||
|
||
c8yViewsProvider.when('/hello', { | ||
// Please use this string placeholder where you want to refer you plugin path. | ||
templateUrl: ':::PLUGIN_PATH:::/views/index.html', | ||
controller : 'mh_MainCtrl' | ||
}); | ||
|
||
}]); | ||
|
||
angular.module('myapp.helloworld').controller('mh_MainCtrl', | ||
['$scope', function ($scope) { | ||
'use strict'; | ||
|
||
$scope.hello = 'Hello world!'; | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>{{hello}}</h1> |