-
Notifications
You must be signed in to change notification settings - Fork 1
Configuring Annotations in Mirador
Jack Reed edited this page May 19, 2020
·
1 revision
Manifests that contain valid Annotation Lists will automatically be displayed in Mirador
You can use any annotation database to store/retrieve annotations for Mirador. This requires writing an adaptor in Mirador to communicate with your database (see Enabling Mirador to Communicate With a Backend)
- CATCH
- SimpleAnnotationServer
- Elastic Search
- Triannon
If you are using an annotation database that does not already have an available adaptor module, you will need to write an adaptor by extending endpoint.js. Mirador requires all annotations to use the Open Annotation Data Model. If your database does not use this model, your adaptor will need to handle converting between OA and the database format.
-
annotationsList
- a current list of open annotations -
dfd
- a Deferred object that is resolved when searches are complete
-
init()
: initializes any adaptor-specific properties -
search(options, successCallback, errorCallback)
: searches the endpoint given a set of key/value pair options. On success of the AJAX call, this function updatesannotationsList
with the latest set of open annotations and resolves thedfd
object. If the endpoint does not return open annotations, use the optional methodgetAnnotationInOA
.- Currently, Mirador only passes in {"uri" : "[canvas-id]"} as the options object
-
create(oaAnnotation, successCallback, errorCallback)
: passes a new annotation to the endpoint. If the endpoint does not use the OA model, use the optional methodgetAnnotationInEndpoint
. Upon successful creation of the annotation, this method passes the open annotation tosuccessCallback
. Mirador supplies success and error callbacks when it calls this method. -
update(oaAnnotation, successCallback, errorCallback)
: passes an existing OA annotation that needs to be updated in the endpoint. If the endpoint does not use the OA model, use the optional methodgetAnnotationInEndpoint
. Mirador supplies success and error callbacks when it calls this method. -
deleteAnnotation(annotationID, successCallback, errorCallback)
: deletes an existing annotation in the endpoint by the annotation's id. Mirador supplies success and error callbacks when it calls this method. -
set(prop, value, options)
: setter for adaptor properties.
If your database does not use OA, you will need to write the following methods
-
getAnnotationInOA(annotation)
: converts an endpoint annotation to OA -
getAnnotationInEndpoint(oaAnnotation)
: converts an open annotation to the endpoint model - any other methods your endpoint needs
"annotationEndpoint" :
{
"name" : "Name of backend",
"module" : "NameEndpoint" (e.g. CatchEndpoint)
}
"annotationEndpoint" :
{
"name" : "Name of backend",
"module" : "NameEndpoint", //e.g. CatchEndpoint
"options" : {
key1 : value1, //whatever the endpoint needs, such as URL, API Key, etc
key2 : value2
}
}