API Docs for: 1.3.12
Show:

EcRepository Class

Repository object used to interact with the CASS Repository web services. Should be used for all CRUD and search operations

Methods

_delete

(
  • data
  • success
  • failure
)
static

Attempts to delete a piece of data.

Uses a signature sheet informed by the owner field of the data.

Parameters:

  • data EcRemoteLinkedData

    Data to save to the location designated by its id.

  • success Callback1

    Callback triggered on successful delete

  • failure Callback1

    Callback triggered if error during delete

_save

(
  • data
  • success
  • failure
)
static

Attempts to save a piece of data. Does some checks before saving to ensure the data is valid. This version does not send a console warning,

Uses a signature sheet informed by the owner field of the data.

Parameters:

  • data EcRemoteLinkedData

    Data to save to the location designated by its id.

  • success Callback1

    Callback triggered on successful save

  • failure Callback1

    Callback triggered if error during save

_saveWithoutSigning

(
  • data
  • success
  • failure
)
static

Attempts to save a piece of data without signing it.

Uses a signature sheet informed by the owner field of the data.

Parameters:

  • data EcRemoteLinkedData

    Data to save to the location designated by its id.

  • success Callback1

    Callback triggered on successful save

  • failure Callback1

    Callback triggered if error during save

autoDetectRepository

()

Searches known repository endpoints to set the server configuration for this repositories instance

autoDetectRepository

()

Searches known repository endpoints to set the server configuration for this repositories instance

autoDetectRepositoryActual

(
  • guess
)
Boolean private

Handles the actual detection of repository endpoint /ping service

Parameters:

  • guess String

    The server prefix

Returns:

Boolean:

Whether the detection successfully found the endpoint

autoDetectRepositoryAsync

(
  • guess
)
Boolean private

Handles the actual detection of repository endpoint /ping service

Parameters:

  • guess String

    The server prefix

Returns:

Boolean:

Whether the detection successfully found the endpoint

backup

(
  • serverSecret
  • success
  • failure
)

Backs up the skyrepo elasticsearch database to the server backup directory

Parameters:

  • serverSecret String

    Secret string stored on the server to authenticate administrative rights

  • success Callback1

    Success event

  • failure Callback1

    Failure event.

  • DELETE

    (
    • data
    • success
    • failure
    )
    static

    Attempts to delete a piece of data.

    Uses a signature sheet informed by the owner field of the data.

    Parameters:

    • data EcRemoteLinkedData

      Data to save to the location designated by its id.

    • success Callback1

      Callback triggered on successful delete

    • failure Callback1

      Callback triggered if error during delete

    DELETE

    (
    • data
    • success
    • failure
    )
    static

    Attempts to delete a piece of data.

    Uses a signature sheet informed by the owner field of the data.

    Parameters:

    • data EcRemoteLinkedData

      Data to save to the location designated by its id.

    • success Callback1

      Callback triggered on successful delete

    • failure Callback1

      Callback triggered if error during delete

    escapeSearch

    (
    • query
    )
    String static

    Escapes a search query

    Parameters:

    • query String

      Query string to escape

    Returns:

    String:

    Escaped query string

    fetchServerAdminKeys

    (
    • success
    • failure
    )

    Fetches the admin keys from the server to compare for check if current user is an admin user

    Parameters:

    • success Callback1

      Callback triggered when the admin keys are successfully returned, returns an array of the admin public keys

    • failure Callback1

      Callback triggered if error occurs fetching admin keys

    get

    (
    • url
    • success
    • failure
    )
    static

    Gets a JSON-LD object from the place designated by the URI.

    Uses a signature sheet gathered from {@link EcIdentityManager}.

    Parameters:

    • url String

      URL of the remote object.

    • success Callback1

      Event to call upon successful retrieval.

    • failure Callback1

      Event to call upon spectacular failure.

    getBlocking

    (
    • url
    )
    EcRemoteLinkedData static

    Retrieves a piece of data synchronously from the server, blocking until it is returned

    Parameters:

    • url String

      URL ID of the data to be retrieved

    Returns:

    EcRemoteLinkedData:

    Data retrieved, corresponding to the ID

    handleSearchResults

    (
    • results
    • eachSuccess
    • success
    • failure
    )
    private

    Handles the search results in search by params, before returning them with the callback passed into search method

    Parameters:

    • results EcRemoteLinkedData[]

      Results to handle before returning

    • eachSuccess Callback1

      Callback function to trigger for each search result

    • success Callback1

      Callback function to trigger with all search results

    • failure Object

    listTypes

    (
    • success
    • failure
    )

    Lists all types visible to the current user in the repository

    Uses a signature sheet gathered from {@link EcIdentityManager}.

    Parameters:

    • success Callback1

      Success event

    • failure Callback1

      Failure event.

    • multiget

      (
      • urls
      • success
      • failure
      • cachedValues
      )

      Returns an array of JSON-LD objects from the places designated by the given URIs.

      Uses a signature sheet gathered from {@link EcIdentityManager}.

      Parameters:

      • urls Array

        URLs of the remote objects.

      • success Callback1>

        Event to call upon successful retrieval.

      • failure Callback1

        Event to call upon spectacular failure.

      • cachedValues Callback1>

        Event to call upon successful retrieval from cache.

      multiput

      (
      • data
      • success
      • failure
      )
      static

      Attempts to save many pieces of data. Does some checks before saving to ensure the data is valid. This version does not send a console warning,

      Uses a signature sheet informed by the owner field of the data.

      Parameters:

      • data Array

        Data to save to the location designated by its id.

      • success Callback1

        Callback triggered on successful save

      • failure Callback1

        Callback triggered if error during save

      precache

      (
      • urls
      • success
      )

      Retrieves data from the server and caches it for use later during the application. This should be called before the data is needed if possible, so loading displays can be faster.

      Parameters:

      • urls String

        List of Data ID Urls that should be precached

      • success Callback0

        Callback triggered once all of the data has been retrieved

      precachePost

      (
      • urls
      • success
      )

      Retrieves data from the server and caches it for use later during the application. This should be called before the data is needed if possible, so loading displays can be faster.

      Parameters:

      • urls String

        List of Data ID Urls that should be precached

      • success Callback0

        Callback triggered once all of the data has been retrieved

      restoreBackup

      (
      • serverSecret
      • success
      • failure
      )

      Restores the skyrepo elasticsearch backup from the server backup directory

      Parameters:

      • serverSecret String

        Secret string stored on the server to authenticate administrative rights

      • success Callback1

        Success event

      • failure Callback1

        Failure event.

      • save

        (
        • data
        • success
        • failure
        )
        static

        Attempts to save a piece of data. If the @id of the data is not of this server, will register the data to the server.

        Uses a signature sheet informed by the owner field of the data.

        Parameters:

        • data EcRemoteLinkedData

          Data to save to the location designated by its id.

        • success Callback1

          Callback triggered on successful save

        • failure Callback1

          Callback triggered if error during save

        save

        (
        • data
        • success
        • failure
        )
        static

        Attempts to save a piece of data.

        Uses a signature sheet informed by the owner field of the data.

        Parameters:

        • data EcRemoteLinkedData

          Data to save to the location designated by its id.

        • success Callback1

          Callback triggered on successful save

        • failure Callback1

          Callback triggered if error during save

        searchWithParams

        (
        • query
        • paramObj
        )

        Search a repository for JSON-LD compatible data synchronously.

        Uses a signature sheet gathered from {@link EcIdentityManager}.

        Parameters:

        • query String

          ElasticSearch compatible query string, similar to Google query strings.

        • paramObj Object

          Additional parameters that can be used to tailor the search.

        Returns:

        EcRemoteLinkedData[]

        searchWithParams

        (
        • query
        • paramObj
        • eachSuccess
        • success
        • failure
        )

        Search a repository for JSON-LD compatible data.

        Uses a signature sheet gathered from {@link EcIdentityManager}.

        Parameters:

        • query String

          ElasticSearch compatible query string, similar to Google query strings.

        • paramObj Object

          Additional parameters that can be used to tailor the search.

        • eachSuccess Callback1

          Success event for each found object.

        • success Callback1

          Success event, called after eachSuccess.

        • failure Callback1

          Failure event.

        wipe

        (
        • serverSecret
        • success
        • failure
        )

        Wipes all data from the the skyrepo elasticsearch, can only be restored by using backup restore

        Parameters:

        • serverSecret String

          Secret string stored on the server to authenticate administrative rights

        • success Callback1

          Success event

        • failure Callback1

          Failure event.