Class: Endpoint

CTS.endpoint. Endpoint

new Endpoint(api_endpoint, inventory)

Prototype of CTS.endpoint
Parameters:
Name Type Argument Description
api_endpoint string URL of the API endpoint
inventory string <nullable>
Default inventory
Properties:
Name Type Argument Description
url string Url of the Endpoint
inventory string <nullable>
Default inventory to fallback on

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

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

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

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