[annotator-dev] annotator / storage.js

Nick Stenning nick at whiteink.com
Wed Jun 24 11:09:53 UTC 2015


Hi Andrew,

Hopefully this part of the documentation for 2.x will be useful for you:

http://docs.annotatorjs.org/en/latest/upgrading.html#store-plugin

It includes an example of how to migrate `annotationData` and `loadFromSearch` to the new API.

I've also CCed the [annotator-dev mailing list](https://lists.okfn.org/mailman/listinfo/annotator-dev)
which you might find useful if you have any other questions!

-N

On 23 Jun 2015, at 17:05, andrew simpson wrote:

> Hi Nick.. I've been using Annotator 12x for a while and have begun to
> migrate to 2.x.
>
> I'm looking for an equivalent to the loadFromSearch argument in the
> following file, which loads all annotations with a specific URL on
> annotator start-up.  I need this to handle page refresh.
>
> https://github.com/openannotation/annotator/blob/master/src/storage.js
>
> Is there something equivalent in the 2.x annotator classes?  I can see
> search, but I'm not sure whether it can be used to achieve the same thing...
>
> Below is the configuration I'm using, 12x format migrated to 2.x format as
> far as I can. annotationData and loadFromSearch don't seem to be in the new
> UI..
>
> Thanks..
>
> Andrew
>
>              var elem = document.querySelector( '#regionToAnnotateId' );
>
>              var uiOptions = {
>                      element : elem,
>              };
>
>              var storageOptions = {
>                      prefix: RestFactory.getRestBaseUrl(),
>                      headers: {
>                          'Authorization':
> sessionStorage.session.authentication
>                      },
>                      urls: {
>                          create:  '/annotations',
>                          update:  '/annotations/{id}',
>                          destroy: '/annotations/{id}',
>                          search:  '/annotations/search'
>                      }
>                      annotationData: {
>                          'uri': sessionStorage.uuid
>                      },
>                      loadFromSearch: {
>                          'limit': 100,
>                          'uri':  sessionStorage.uuid
>                      },
>              };
>
>              $scope.app = new annotator.App()
>              .include(annotator.ui.main, uiOptions)
>              .include(annotator.storage.http, storageOptions)
>              .start();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150624/138a4cfa/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150624/138a4cfa/attachment-0003.sig>


More information about the annotator-dev mailing list