Class: XQ

CTS.endpoint. XQ

new XQ(api_endpoint, inventory)

CTS API using simple xQuery rest system.
Parameters:
Name Type Argument Description
api_endpoint string URL of the API endpoint
inventory string <nullable>
Default inventory

Extends

Methods

getCapabilities(inventory)

Do a GetCapabilities request
Parameters:
Name Type Argument Description
inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

getCapabilitiesURL(inventory) → {string}

Create the GetCapabilities URL
Parameters:
Name Type Argument Description
inventory string <nullable>
Name of the inventory
Returns:
URL of the request
Type
string

getFirstPassagePlus(urn)

Do a GetFirstPassagePlus request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

GetFirstPassagePlus(urn)

Do a GetFirstPassagePlus request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback
Inherited From:

getFirstPassagePlusURL(urn)

Do a GetFirstPassagePlus url
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

getLabel(urn)

Performs a GetLabel request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback to which the response is sent
options.error function <nullable>
Error callback

getLabelURL(urn, inventory) → {string}

Create a GetLabel url
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
inventory string <nullable>
Inventory name
Returns:
URL representation of the GetLabel request
Type
string

getPassage(urn)

Do a GetPassage request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

getPassagePlus(urn)

Do a GetPassagePlus request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

getPassagePlusURL(urn, inventory) → {string}

Create the GetPassagePlus URL
Parameters:
Name Type Argument Description
urn urn Urn of the Text's passage
inventory string <nullable>
Name of the inventory
Returns:
URL of the request
Type
string

getPassageURL(urn, inventory) → {string}

Create the GetPassage URL
Parameters:
Name Type Argument Description
urn urn Urn of the Text's passage
inventory string <nullable>
Name of the inventory
Returns:
URL of the request
Type
string

getRequest(url)

Make an XHR Request using CTS.utils.xhr
Parameters:
Name Type Description
url string URL to call
options.success function Success Callback function
options.error function Error Callback function
Inherited From:

getUrl(params) → {string}

Small helper to create urls
Parameters:
Name Type Description
params Object.<string, any> Object representing parameters name
Returns:
The URL
Type
string

getValidReff(urn)

Do a GetValidReff request
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.level string <nullable>
Level of reference to retrieve
options.inventory string <nullable>
Inventory name
options.success function <nullable>
Success callback
options.error function <nullable>
Error callback

getValidReffURL(urn) → {string}

Create the GetValidReff URL
Parameters:
Name Type Argument Description
urn string Urn of the text's passage
options.level string <nullable>
Level of reference to retrieve
options.inventory string <nullable>
Name of the inventory
Returns:
URL of the request
Type
string

postRequest(url)

Make an XHR POST Request using CTS.utils.xhr
Parameters:
Name Type Description
url string URL to call
options.success function Success Callback function
options.error function Error Callback function
options.data function Error Callback function
options.type function Data type
Inherited From: