[annotator-dev] How to bypass AnnotateIt and use local storage

David Fox dvdfox at gmail.com
Thu Aug 21 20:41:09 UTC 2014


Hello all,

I'm having trouble getting the Store plugin up and running. Here's what
I've managed to do so far:

   - Downloaded annotator-full.1.2.7
   - Installed annotator-store and pointed it at my local Elasticsearch
   - Verified that all of the Storage API endpoints are working, e.g.
   http://localhost:5000/search
   - Added the plugin to the page with the following javascript

jQuery(function ($) {
var content =
$('#content').annotator().annotator('setupPlugins').data('annotator');
content.annotator('addPlugin', 'Store', {
      prefix: 'http://localhost:5000',
      annotationData: {
        'uri': 'http://localhost/test'
      },
      loadFromSearch: {
        'limit': 20,
        'uri': 'http://localhost/test'
      },
      urls: {
        create:  '/annotations',
        update:  '/annotations/:id',
        destroy: '/annotations/:id',
        search:  '/search'
      }
    });
});

And here's what works:

   - I can make annotations to my content
   - The navigate and filter menus appear on my page
   - If I'm logged into my AnnotateIt account my annotations are saved with
   my AnnotateIt account and can be retrieved

It's this last point that I'm struggling with - I'm not sure why it is
defaulting to AnnotateIt storage. If I log out of my AnnotateIt account it
will no longer allow me to create annotations. I thought all I needed to do
was to point the Plugin at my Search API via the prefix property, but
evidently I missed a step. Any ideas what I'm missing?

Please forgive me if the Javascript is way off; it's not something I'm
totally comfortable with yet.

Thanks for the help!
David Fox
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140821/1cc8b2a4/attachment-0003.html>


More information about the annotator-dev mailing list