[annotator-dev] annotator2/master storage configuration

Benjamin Young bigbluehat at hypothes.is
Fri Jan 30 19:51:51 UTC 2015


For the short term, it's certainly a lack of documentation--took me quite
awhile to find what Rob just wrote when I was trying to do the same.

Long term, I think the API should be more obvious. It feels strange to have
`.load()` so "far away" from the object I expect to have all the smarts.

It's similar to how the `addPlugin` and `setStorage` as method calls
*feels* vs. how passing in a config object of some kind *feels*.

Really just a syntax choice, but when I found what I needed to do what I
wanted it was in a different place than I'm used to and looked different in
the end than I'd expected it to look:
https://github.com/hypothesis/annotator-couchapp/blob/master/couchapp/_attachments/index.html#L114-L150

But maybe that's just me. ;)

On Fri, Jan 30, 2015 at 2:01 PM, Randall Leeds <tilgovi at hypothes.is> wrote:

>
> On Jan 30, 2015 1:49 PM, "Robert Casties" <casties at mpiwg-berlin.mpg.de>
> wrote:
> >
> > Hi Banjamin,
> >
> > I was having the same problem as Andrew so your information helped me a
> lot.
> >
> > On 26.01.15 15:32, Benjamin Young wrote:
> > > I'm guessing your wanting to use the HTTP Storage implementation
> (since you
> > > mention endpoint configuration). If that guess is correct, you would
> do it
> > > something like this:
> > >
> > > ```
> > > anno.setStorage(function() {
> > >   return new HTTPStorage({
> > >     prefix: '/url/to/your/endpoint'
> > >   });
> > > });
> > > ```
> >
> > I was just wondering about the next step, namely how to get Annotator to
> > do the initial load of the annotations for a page.
> >
> > I came up with
> >
> > anno.registry.annotations.load({uri: uri})
> >
> > after the setStorage above which worked for me but it seems not like the
> > official way :-)
> >
> > Is there an official way to start the initial load?
> >
>
> I think that would be the way, currently.
>
> Do you think it's a lack of documentation which makes you feel unsure
> about this, or is it altogether too "deep" in the namespace?
>
> This is valuable feedback for refining the APIs as we get ready to
> finalize for 2.0.
>
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150130/9240842e/attachment-0003.html>


More information about the annotator-dev mailing list