new Text(urn, endpoint, inventory)
Create a text object representing either a passage or a full text
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
urn |
string | URN identifying the text | |
endpoint |
string | CTS.endpoint.Endpoint |
<nullable> |
CTS API Endpoint. |
inventory |
inventory |
<nullable> |
Inventory Identifier |
Properties:
Name | Type | Argument | Description |
---|---|---|---|
urn |
string | URN identifying the passage | |
reffs |
Object.<string, CTS.text.Passage> | Passage and reffs | |
validReffs |
Object.<string, Object.<string, string>> | List of levels of mapping | |
validReffs[0] |
Object.<string, string> | Pair of Text (Identifier of the passage, urn) | |
inventory |
inventory |
<nullable> |
Inventory containing the text |
endpoint |
CTS.endpoint.Endpoint | Endpoint to get the text | |
title |
Object.<string, string> | Text titles object | |
title[lang] |
string | Title in a given lang | |
textgroup |
Object.<string, string> | Text titles object | |
textgroup[lang] |
string | Title in a given lang |
Methods
-
getFirstPassagePlus(options)
-
Make a request for the first passage on the API
Parameters:
Name Type Description options
Object.<String, function()> Options object Properties
Name Type Description success
function Success callback (Pass the urn and the Passage as arguments) error
function Error Callback -
getLabel(options)
-
Make a getValidReff request
Parameters:
Name Type Description options
Object.<String, function()> Options object Properties
Name Type Description success
function Success callback (Pass the this object as callback) error
function Error Callback -
getPassage(start, end) → {CTS.text.Passage}
-
Get the passage from a test
Parameters:
Name Type Description start
Array.Any Array representation of the passage's start end
Array.Any Array representation of the passage's end Returns:
Passage object- Type
- CTS.text.Passage
-
getTextgroup(lang) → {string}
-
Get a textgroup given a lang
Parameters:
Name Type Argument Description lang
string <nullable>
Lang of the Textgroup Returns:
The textgroup- Type
- string
-
getTitle(lang) → {string}
-
Get a title given a lang
Parameters:
Name Type Argument Description lang
string <nullable>
Lang of the title Returns:
The title- Type
- string
-
getValidReff(options)
-
Make a getValidReff request
Parameters:
Name Type Description options
Object.<String, function()> Options object Properties
Name Type Description level
function Level depth success
function Success callback (Pass the urn and the Passage as arguments) error
function Error Callback -
makePassageUrn(start, end) → {string}
-
Create a Passage urn given two lists of identifiers for start and end of the passage
Parameters:
Name Type Description start
Array.Any Array representation of the passage's start end
Array.Any Array representation of the passage's end Returns:
CTS Urn of the passage- Type
- string