Connection

Connection

Corpus connections by default define a set of web services which are used by that corpus, generally on one server. However, over time and use the user might move their audio data to different servers etc making it more conveint to provide a configuration object which by convention is the same server, but can be overriden and read by any of the client apps or webservices. The central authority for a users" corpus is in the user's details on the user's authentication server. This class contains basic functions to manipulate CorpusConection json and schema, can be used as a shared model between clients and servers

Constructor

new Connection(optionalRequestedConnection, dbname, corpusid, dbname, protocol, domain, port, path, userFriendlyServerName, clientUrls, corpusUrls, audioUrls, activityUrls, authUrls, lexiconUrls, searchUrls)

Source:
Parameters:
Name Type Description
optionalRequestedConnection Connection a object with minimally a dbname
dbname string a name space for the database also a url friendly permanent datbase name (composed of a username and an identifier)
corpusid string a uuid of the corpus doc within the database which defines the corpus
dbname string @deprecated use dbname instead
protocol string @deprecated [https:, http] use corpusUrls instead
domain string @deprecated use corpusUrls instead
port string @deprecated use corpusUrls instead
path string @deprecated use corpusUrls instead was used for McGill server
userFriendlyServerName string a server name that represents where (most of) the user's resources are for this corpus [Default, Beta, Original, Mcgill Prosody, Localhost, etc]
clientUrls array an array of objects {"userFriendlyClientName" : [Spreadsheet, Prototype Online, Localhost Chrome App, Public Url, Acivity Feed, etc], url": completeUrlThatCouldBringSomeoneStraightToThisCorpus}
corpusUrls array an array of urls which could "compose" this corpus either by overllapping or by union (for the users who want to have meta corpora which combine multiple smaller corpora, or users with large corpora who would like to shard it across servers)
audioUrls array an array of audio/video/speech webservice urls which can be used with this corpus, could be youtube, sound cloud or other storage with or without a one-to-one mapping of namespace with this corpus
activityUrls array an array of activity feed urls where this corpus"s activities should be stored (usually only one, but oculd have the active one in position 0 and other older ones afterwards)
authUrls array an array of strings indicating where a user could login to get to this corpus
lexiconUrls array an array of lexicon urls which can be used with this corpus
searchUrls array an array of search urls which can be used with this corpus

Extends

Members

(static) baseSchema :Object

Source:
This is the base schema of a corpus connection, other fields may be added. This schema is used by the API docs, it should be updated as the above newConnection changes.
Type:
  • Object

(static) otherwise

Source:
Set otherwise to be the default connection of this app. By Default, apps will try to contact NODE_ENV, if in a browser they will try to contact beta unless you specify Connection.otherwise

Methods

(static) validateIdentifier(originalIdentifier) → {object}

Source:
Ensures that dbnames can be used inside of corpus identifiers, which are couchdb database names.
Parameters:
Name Type Description
originalIdentifier string the desired dbname or username
Returns:
the resulting dbname or username, the original dbname, and the changes that were applied.
Type
object

Connection

Connection

Constructor

new Connection()

Source:
The Corpora is a minimal customization of the Collection to add an internal model of a corpus Connection. Collection of Corpuses in the form of Connection which are the conneciton part of CorpusMasks

Extends

Members

(static) baseSchema :Object

Source:
This is the base schema of a corpus connection, other fields may be added. This schema is used by the API docs, it should be updated as the above newConnection changes.
Type:
  • Object

(static) otherwise

Source:
Set otherwise to be the default connection of this app. By Default, apps will try to contact NODE_ENV, if in a browser they will try to contact beta unless you specify Connection.otherwise

Methods

(static) validateIdentifier(originalIdentifier) → {object}

Source:
Ensures that dbnames can be used inside of corpus identifiers, which are couchdb database names.
Parameters:
Name Type Description
originalIdentifier string the desired dbname or username
Returns:
the resulting dbname or username, the original dbname, and the changes that were applied.
Type
object