Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d88c4c3
Refactored directives before testing
jfmartinez Mar 3, 2016
60f859b
Saving working state of directives
jfmartinez Mar 4, 2016
6466123
Removing the name directives from the file name, directives are in a …
jfmartinez Mar 4, 2016
9c9d0d2
Starting new ui directive structure -> Folders endpoint-provider, end…
jfmartinez Mar 7, 2016
cff4aba
Updating finished tests for video, chat, register and endpoint-status…
jfmartinez Mar 8, 2016
a998f64
Adding test updates and new tests for config.controller nad alert-modal
jfmartinez Mar 11, 2016
5ef947b
Saving state for ui components, TODO ~ Need to add unit tests for ses…
jfmartinez Mar 15, 2016
82f1336
Adding endpoint-controller directory
jfmartinez Mar 15, 2016
8b24d13
Split rtcommConfig and RtcommService into separate files, added test …
jfmartinez Mar 16, 2016
78a11d9
Adding a simple test file for call-modal, fixing dependency injection…
jfmartinez Mar 17, 2016
4d86243
Adding a simple test file for call-modal, fixing dependency injection…
jfmartinez Mar 17, 2016
6d42b28
Updating license headers on source files
jfmartinez Mar 17, 2016
864144e
Updating bower.json to version 1.0.3 -> 1.0.4, updated dependencies t…
jfmartinez Mar 17, 2016
30a41fa
Initial refactoring to rtcomm-service.js
jfmartinez Mar 17, 2016
b1bd54e
Added minor fixes to the rtcomm-service for equality, added the serv…
jfmartinez Mar 23, 2016
6b4c11b
Fixing chat service
jfmartinez Mar 23, 2016
bc70759
Fixing endpoint controller
jfmartinez Mar 23, 2016
9c61e88
Restructuring service file structure
jfmartinez Mar 23, 2016
e52449a
Adding basic integration tests, modified Gruntfile to automatically p…
jfmartinez Mar 24, 2016
d45a99f
Adding unit test for endpoint controller
jfmartinez Mar 25, 2016
2a9e1b7
Added basic e2e integration testing (moved test to the root directory…
jfmartinez Mar 29, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.settings
/bower_components
/node_modules
.project
.project
*.swp
166 changes: 95 additions & 71 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,74 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

meta: {
banner: '/**\n' +
' * Copyright 2014 IBM Corp.\n' +
' *\n' +
' * Licensed under the Apache License, Version 2.0 (the "License");\n' +
' * you may not use this file except in compliance with the License.\n' +
' * You may obtain a copy of the License at\n' +
' *\n' +
' * http://www.apache.org/licenses/LICENSE-2.0\n' +
' *\n' +
' * Unless required by applicable law or agreed to in writing, software\n' +
' * distributed under the License is distributed on an "AS IS" BASIS,\n' +
' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' +
' * See the License for the specific language governing permissions and\n' +
' * limitations under the License.\n' +
' *\n' +
' * <%= pkg.description %>\n' +
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * @link <%= pkg.homepage %>\n' +
' * @author <%= pkg.author %>\n' +
' */\n'
' * Copyright 2014 IBM Corp.\n' +
' *\n' +
' * Licensed under the Apache License, Version 2.0 (the "License");\n' +
' * you may not use this file except in compliance with the License.\n' +
' * You may obtain a copy of the License at\n' +
' *\n' +
' * http://www.apache.org/licenses/LICENSE-2.0\n' +
' *\n' +
' * Unless required by applicable law or agreed to in writing, software\n' +
' * distributed under the License is distributed on an "AS IS" BASIS,\n' +
' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' +
' * See the License for the specific language governing permissions and\n' +
' * limitations under the License.\n' +
' *\n' +
' * <%= pkg.description %>\n' +
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * @link <%= pkg.homepage %>\n' +
' * @author <%= pkg.author %>\n' +
' */\n'
},

dirs: {
src: 'src',
dest: 'dist'
},

concat: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
// src: ['<%= dirs.src %>/*.js', '<%= dirs.src %>/**/*.js'],
src: ['<%= dirs.src %>/js/angular-rtcomm.js', '<%= dirs.src %>/js/rtcomm-services.js', '<%= dirs.src %>/js/rtcomm-directives.js', '<%= dirs.src %>/js/rtcomm-presence.js'],
// src: ['<%= dirs.src %>/*.js', '<%= dirs.src %>/**/*.js'],
src: ['<%= dirs.src %>/js/**/*.module.js', '<%= dirs.src %>/js/**/*.js', '!**/*.spec.js'],
dest: '<%= dirs.dest %>/<%= pkg.name %>.js'
}
},

copy: {
main: {
expand: true,
cwd: '<%= dirs.src %>',
src: ['css/*.css'],
dest: '<%= dirs.dest %>',
}
main: {
expand: true,
cwd: '<%= dirs.src %>',
src: ['css/*.css'],
dest: '<%= dirs.dest %>',
}
},

cssmin: {
my_target: {
files: [{
expand: true,
cwd: '<%= dirs.src %>',
src: ['css/*.css'],
dest: '<%= dirs.dest %>',
ext: '.min.css'
}]
}
my_target: {
files: [{
expand: true,
cwd: '<%= dirs.src %>',
src: ['css/*.css'],
dest: '<%= dirs.dest %>',
ext: '.min.css'
}]
}
},

ngAnnotate: {
dist: {
files: {
'<%= dirs.dest %>/<%= pkg.name %>.js': ['<%= dirs.dest %>/<%= pkg.name %>.js']
}
dist: {
files: {
'<%= dirs.dest %>/<%= pkg.name %>.js': ['<%= dirs.dest %>/<%= pkg.name %>.js']
}
},
}
},

uglify: {
options: {
Expand Down Expand Up @@ -107,39 +107,63 @@ module.exports = function(grunt) {
}
}
},

watch: {
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
},
watch :{
configFile: 'karma.conf.js'
}

},
watch: {
dev: {
files: ['<%= dirs.src %>/**'],
tasks: ['build']
},
},

ngtemplates: {
'angular-rtcomm-ui': {
cwd: '<%= dirs.src %>',
src: ['templates/rtcomm/**.html', '!templates/rtcomm/rtcomm-presence.html'],
dest: '<%= dirs.dest %>/<%= pkg.name %>.js',
options: {
htmlmin: { collapseWhitespace: true, collapseBooleanAttributes: true },
append: 'true'
}
},
'angular-rtcomm-presence': {
cwd: '<%= dirs.src %>',
src: 'templates/rtcomm/rtcomm-presence.html',
dest: '<%= dirs.dest %>/<%= pkg.name %>.js',
options: {
htmlmin: { collapseWhitespace: true, collapseBooleanAttributes: true },
append: 'true'
}

}
}
wiredep: {
task: {
src: ['<%= dirs.src %>/test/**/*.html']
},
options: {
ignorePath: '../../..'
}
},
ngtemplates: {
'angular-rtcomm-ui': {
cwd: '<%= dirs.src %>',
src: ['templates/rtcomm/**.html', '!templates/rtcomm/rtcomm-presence.html'],
dest: '<%= dirs.dest %>/<%= pkg.name %>.js',
options: {
htmlmin: {
collapseWhitespace: true,
collapseBooleanAttributes: true
},
append: 'true'
}
},
'angular-rtcomm-presence': {
cwd: '<%= dirs.src %>',
src: 'templates/rtcomm/rtcomm-presence.html',
dest: '<%= dirs.dest %>/<%= pkg.name %>.js',
options: {
htmlmin: {
collapseWhitespace: true,
collapseBooleanAttributes: true
},
append: 'true'
}

}
},


});

// Build task.
grunt.registerTask('build', ['jshint', 'concat', 'ngtemplates', 'ngAnnotate', 'uglify', 'copy', 'cssmin']);
grunt.registerTask('build', ['karma:unit', 'jshint', 'concat', 'ngtemplates', 'ngAnnotate', 'uglify', 'copy', 'cssmin']);

// Default task.
//grunt.registerTask('default', ['build', 'watch']);
Expand Down
68 changes: 45 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,55 @@ This repository contains the Rtcomm Angular.js module. The Rtcomm Angular module
This module is built on the [rtcomm.js](https://github.com/WASdev/lib.rtcomm.clientjs) open source JavaScript library which wraps [WebRTC](http://www.webrtc.org/) with call
signaling and a number of advanced real-time communications capabilities like presence and chat.

##Requirements
## Requirements
Rtcomm utilizes MQTT for call signaling so at a minimum you will need an MQTT message broker that supports web sockets. There are many open source and productized versions of MQTT message brokers available. A great option is to download the WebSphere Liberty Server which includes an embedded MQTT broker and a number of backend Rtcomm services such as call queueing. The WebSphere Liberty server is free for development and the beta version that includes support for MQTT can be downloaded from [here](https://developer.ibm.com/wasdev/downloads/liberty-profile-beta/).

##Install
## Install
To install the angular-rtcomm module for use in an AngularJS application, you can use bower:

**bower install angular-rtcomm**

##Build
To build the angular-rtcomm module, you can use npm:
## Build

To build the angular-rtcomm module, you can use npm and [Grunt](http://gruntjs.com/):
```
npm install
grunt build
```
This is useful if you want to modify the angular-rtcomm templates.

##Test
This repository relies on Karma for testing. To run the test framework you can type the following in the root lib.angular-rtcomm directory:
## Test

This repository relies on [Karma](https://github.com/karma-runner/karma) and [Protractor](http://www.protractortest.org/) for Unit and Integration testing respectively.

To run Unit Tests against this project:

**karma start**
```
karma start karma.conf.js
```

Note that the test framework assumes the MQTT broker is running on localhost:9080. There is also currently a dependency on the WebSphere Liberty server (which includes an embedded MQTT broker) for some of the Rtcomm features. The link to download a version of WebSphere Liberty for development and testing can be found at the top of the page.
Integration Testing requires more previous configuration. First you'll want to update and start a Selenium Webdriver server on your machine:

We are working on an npm install of the development environment so stay tuned.
```
$ node_modules/.bin/webdriver-manager update
$ node_modules/.bin/webdriver-manager start
```

Once that is setup you can simply start the MQTT broker + Static Server combo:

```
npm start
```

And finally, run the integration test:
```
npm test
```

A sample page is also included in the test directory along with a sample config file that can be used to run the test.

##Usage
## Usage

###Initialization
### Initialization
To use the module, you will need to include the following js and css files with your project:

First the angular-rtcomm related files:
Expand Down Expand Up @@ -64,12 +86,12 @@ The above dependencies can be accessed via CDN as above or via your bower_compon
We are also working to reduce the number of dependencies (or to at least provide more flexibility in when these dependencies are required).


###Module injection
### Module injection
AngularJS applications inject the angular-rtcomm module as follows:

var sampleModule = angular.module('sampleModule', ['angular-rtcomm']);

###RtcommService
### RtcommService
The RtcommService is the singleton that controls all aspects of the Rtcomm module. Its the only service AngularJS applications need to inject when using the angular-rtcomm module.

The RtcommService broadcasts all its related events to the $rootScope. The events published by the RtcommService are a combination of events generated by the angular-rtcomm module and the rtcomm.js library described above that this module wraps. Here is the list of events:
Expand Down Expand Up @@ -128,53 +150,53 @@ And the methods exposed by the RtcommService include the following:
* setVideoView


###List of AngularJS directives
### List of AngularJS directives
Here is a complete list of all the currently supported directives.

####rtcomm-register:
#### rtcomm-register:
Directive used to register an endpoint. Registration implies creation of a user record as a retained message on the configured presence topic which can be accessed by any endpoint or service that has permissions to subscribe on the registration topic. This is registration is required after initialization. If the user name is specified in advance, for example via a cookie, the userid can be specified when initializing the RtcommService:
```html
<rtcomm-register></rtcomm-register>
```
No init parameters.

####rtcomm-queues:
#### rtcomm-queues:
Directive used to view and join any available call queue. Can be used by helpdesk agents (only availble when working with WebSphere):
```html
<rtcomm-queues></rtcomm-queues>
```

####rtcomm-presence:
#### rtcomm-presence:
Directive used to view presence information:
```html
<rtcomm-presence></rtcomm-presence>
```

####rtcomm-chat:
#### rtcomm-chat:
Directive used to display a chat window:
```html
<rtcomm-chat></rtcomm-chat>
```

####rtcomm-video:
#### rtcomm-video:
Directive that contains a WebRTC video window (both self and remote views):
```html
<rtcomm-video></rtcomm-video>
```

####rtcomm-endpoint-status:
#### rtcomm-endpoint-status:
Directive that displays status about the active endpoint:
```html
<rtcomm-endpoint-status></rtcomm-endpoint-status>
```

####rtcomm-sessionmgr:
#### rtcomm-sessionmgr:
Directive that manages multiple endpoints and their associated sessions. For instance, used by a helpdesk agent to manage multiple sessions:
```html
<rtcomm-sessionmgr></rtcomm-sessionmgr>
```

###List of AngularJS Controllers
### List of AngularJS Controllers

This controller can read configuration from a specified JSON file:
**RtcommConfigController**
Expand Down
19 changes: 10 additions & 9 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "angular-rtcomm",
"version": "1.0.3",
"version": "1.0.4",
"description": "Angular module for Rtcomm",
"main": [
"dist/angular-rtcomm.js",
"dist/angular-rtcomm.min.js",
"dist/css/angular-rtcomm.css",
"dist/css/angular-rtcomm.min.css"
"dist/css/angular-rtcomm.css"
],
"keywords": [
"webrtc",
Expand All @@ -30,11 +28,14 @@
"package.json"
],
"dependencies": {
"jquery": "~2.1.1",
"angular-tree-control": "~0.2.7",
"bootstrap": "~3.3.1",
"angular": "^1.4.6",
"angular-bootstrap": "~0.13.0",
"jquery": "~2.2.x",
"angular-tree-control": "~0.2.x",
"bootstrap": "~3.3.6",
"angular": "~1.4.0",
"angular-bootstrap": "1.2.x",
"rtcomm": "^1.0.0"
},
"devDependencies": {
"angular-mocks": "~1.4.0"
}
}
Loading