This is a project meant to be used as a starting point for creating an opensocial gadget that can interact with ClearQuest using OSLC API.
This project was bootstrapped with Web app generator.
Before following the below steps, please refer to Getting started with OpenSocial gadget development to make sure you are ready to follow the below steps.
First install Node
Then fork and clone this repository on your machine
Then open a command prompt to switch to the directory containing the repository that you cloned in the previous step.
Now install Node dependencies, this may take a few minutes.
npm install
Then install frontend dependencies
bower install
Run gulp serve to preview and watch for changes
gulp serve
You can now access the gadget from http://localhost:9000.
Run gulp serve:test to run the tests in the browser
gulp serve:test
Run gulp to build your webapp for production
gulp
Run gulp serve:dist to preview the production build
gulp serve:dist
Adding to DevOps Dashboards)
To add this gadget to the dashboards
- Goto the Add Gadget section and specify the URL to the gadget.xml file served by this application, e.g. http://localhost:9000/gadget.xml
- Create an OAuth friend in the dashboards Administration section to establish friendship between ClearQuest and Dashboards as this gadget uses OAuth as the authentication mechanism while communicating with ClearQuest.
- Add the gadget on a page in your dashboard
- For more details on how to follow the above steps, refer to the Devops Dashboards doucmentation
- If you change the host/port, make sure you edit the gadget.xml and App.js file accordingly.
It contains the bolierplate code that you are most likely going to need to write any gadget for ClearQuest. Whenever a user accesses any CQ gadget for the first time, he will need to login to CQ and then select the CQ user db that he wants to work with. Also since it involves sending requests to CQ over network and then waiting for the response, we also need to show a loading message to indicate that the gadget is waiting for loading something. This gadget provides these basic functionalities out of the box so that you can directly start writing the core functionality. Below is the description about these out of the box functionalities provided by this gadget:
- OAuth based authentication with CQ: This gadget contains the necessary code that is required to let you login to CQ using OAuth. However, before you can login to CQ, you need to establish OAuth friendship of the DevOps Dashboards with CQ and to do that you need to add an OAuth friend entry for your CQ deployment in the Administration section of the DevOps Dashboards. Refer to section 7. OAuth Friends in DevOps Dashboards regarding the details on how to add an OAuth friend. The code that handles the login part is present in
- gadget-cq-basic\app\scripts\cqutil.js: makeRequest method
- gadget-cq-basic\app\index.html: loginMessage div
- UI for selecting CQ user db: Renders a list of the available CQ servers (schema repositories) that have OAuth friendship with Dashboards as well as the list of user dbs for the selected schema repository. The code that handles it is located in:
- gadget-cq-basic\app\index.html: servers-container and databases-container div elements
- gadget-cq-basic\app\scripts\cqutil.js: fetchOAuthFriends, loadDatabases, handleLoadDatabases, handleOAuthFromServer methods
Refer to cq-utils API documentation for a set of utility methods that help consume the ClearQuest OSLC API