cq-utils
v1.0.0
Published
JavaScript library for working with ClearQuest OSLC API
Downloads
10
Readme
JavaScript library for working with ClearQuest OSLC API
Functions
Typedefs
getBasePath() ⇒ string
Get base URL i.e. everything till the port number, e.g. http://localhost:8080
Kind: global function Returns: string - base URL
adjustHeight()
Adjusts the gadget height by calling the gadget api after adding a delay
Kind: global function
setVisibilityOf(divId, visible)
Sets the visibility of an element. Also adjusts the height of the gadget after changing the visibility
Kind: global function
| Param | Type | | --- | --- | | divId | string | | visible | boolean |
getRepoNameFromDbUrl(dbUrl) ⇒ string
Get name of the schema repository from user database URL
Kind: global function Returns: string - schema repository name
| Param | Type | Description | | --- | --- | --- | | dbUrl | string | The url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL |
getDbNameFromDbUrl(dbUrl) ⇒ string
Get name of the user database from its URL
Kind: global function Returns: string - user database name
| Param | Type | Description | | --- | --- | --- | | dbUrl | string | The url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL |
getRecordPreviewHtml(recordUrl, callback)
Get the html preview of a record
Kind: global function
| Param | Type | Description | | --- | --- | --- | | recordUrl | string | The record URL e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104 | | callback | htmlCallback | callback to process the response. Response will contain the HTML representing the record |
doGet(url, callback, isOSLCv2)
Send a proxied async GET request to the given URL using OAuth
Kind: global function
| Param | Type | Description | | --- | --- | --- | | url | string | URL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104 | | callback | requestCallback | callback to process the response. Response will be in the form of json | | isOSLCv2 | boolean | flag to indicate which version of CQ OSLC API needs to be used. By default version 1 will be used if nothing is provided |
doGetXML(url, callback, isOSLCv2)
Send a proxied async GET request to the given URL using OAuth
Kind: global function
| Param | Type | Description | | --- | --- | --- | | url | string | URL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104 | | callback | requestCallback | callback to process the response. Response will be in the form of XML | | isOSLCv2 | boolean | flag to indicate which version of CQ OSLC API needs to be used. By default version 1 will be used if nothing is provided |
doPost(url, callback, postData)
Send a proxied async POST request to the given URL using OAuth
Kind: global function
| Param | Type | Description | | --- | --- | --- | | url | string | URL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104 | | callback | requestCallback | callback to process the response. Response will be in the form of json | | postData | boolean | data for the POST body |
getOAuthFriendsApiUrl() ⇒
Get the URL to fetch ClearQuest OAuthFriends
Kind: global function Returns: URL to fetch ClearQuest OAuthFriends
checkIfFTSenabled(dbUrl, callback)
Checks if Full text search (FTS) is enabled
Kind: global function
| Param | Type | Description | | --- | --- | --- | | dbUrl | string | The url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL | | callback | boolean | callback to do handle the response |
getSchemaRepositories(cqWebUrl, callback)
Get all schema repositories of CQWeb
Kind: global function
| Param | Type | Description | | --- | --- | --- | | cqWebUrl | string | The url of CQWeb e.g. http://localhost:9080/cqweb | | callback | arrayCallback | callback to process the response. Response will contain an array of objects, each object representing a schema repository |
getUserDatabases(repoUrl, callback)
Get all user databases of a schema repository
Kind: global function
| Param | Type | Description | | --- | --- | --- | | repoUrl | string | The url of the schema repository e.g. http://localhost:9080/cqweb/oslc/repo/reponame | | callback | arrayCallback | callback to process the response. Response will contain an array of objects, each object representing a user database |
getRecordTypes(dbUrl, callback)
Get all record types of a user database
Kind: global function
| Param | Type | Description | | --- | --- | --- | | dbUrl | string | The url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL | | callback | arrayCallback | callback to process the response. Response will contain an array of objects, each object representing a record type |
getRecord(dbUrl, recordType, name, callback)
Get a record by name.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | dbUrl | string | The url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL | | recordType | string | type of record e.g. defect, customer etc. | | name | string | name of the record | | callback | singleObjectCallback | callback to process the response. Response will contain a single object representing the record |
singleObjectCallback : function
A callback to process only a single object
Kind: global typedef
| Param | Type | | --- | --- | | object | Object |
arrayCallback : function
A callback to process an array of objects
Kind: global typedef
| Param | Type | | --- | --- | | arr | Array.<Object> |
htmlCallback : function
A callback to process html as a string
Kind: global typedef
| Param | Type | | --- | --- | | html | string |
requestCallback : function
A callback to process response of a AJAX request
Kind: global typedef
| Param | Type | | --- | --- | | response | object |