1.0.0 • Published 6 years ago

cq-utils v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

JavaScript library for working with ClearQuest OSLC API Build Status

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

ParamType
divIdstring
visibleboolean

getRepoNameFromDbUrl(dbUrl) ⇒ string

Get name of the schema repository from user database URL

Kind: global function Returns: string - schema repository name

ParamTypeDescription
dbUrlstringThe 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

ParamTypeDescription
dbUrlstringThe 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

ParamTypeDescription
recordUrlstringThe record URL e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104
callbackhtmlCallbackcallback 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

ParamTypeDescription
urlstringURL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104
callbackrequestCallbackcallback to process the response. Response will be in the form of json
isOSLCv2booleanflag 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

ParamTypeDescription
urlstringURL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104
callbackrequestCallbackcallback to process the response. Response will be in the form of XML
isOSLCv2booleanflag 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

ParamTypeDescription
urlstringURL to send the request to. e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL/record/16777224-33602104
callbackrequestCallbackcallback to process the response. Response will be in the form of json
postDatabooleandata 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

ParamTypeDescription
dbUrlstringThe url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL
callbackbooleancallback to do handle the response

getSchemaRepositories(cqWebUrl, callback)

Get all schema repositories of CQWeb

Kind: global function

ParamTypeDescription
cqWebUrlstringThe url of CQWeb e.g. http://localhost:9080/cqweb
callbackarrayCallbackcallback 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

ParamTypeDescription
repoUrlstringThe url of the schema repository e.g. http://localhost:9080/cqweb/oslc/repo/reponame
callbackarrayCallbackcallback 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

ParamTypeDescription
dbUrlstringThe url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL
callbackarrayCallbackcallback 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

ParamTypeDescription
dbUrlstringThe url of the user database in which the record is stored e.g. http://localhost:9080/cqweb/oslc/repo/reponame/db/SAMPL
recordTypestringtype of record e.g. defect, customer etc.
namestringname of the record
callbacksingleObjectCallbackcallback 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

ParamType
objectObject

arrayCallback : function

A callback to process an array of objects

Kind: global typedef

ParamType
arrArray.<Object>

htmlCallback : function

A callback to process html as a string

Kind: global typedef

ParamType
htmlstring

requestCallback : function

A callback to process response of a AJAX request

Kind: global typedef

ParamType
responseobject