[annotator-dev] annotator2/master storage configuration

Robert Casties casties at mpiwg-berlin.mpg.de
Sat Jan 31 13:43:48 UTC 2015

Hi Randall and Benjamin,

On 30.01.15 20:51, Benjamin Young wrote:
> 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.

I see it the same way. Some current documentation would help a lot.

I read the Annotator sources but it was still not obvious to me what's
the best way to interact with it when setting it up or writing a plugin.

I had my doubts about poking around in the .registry member when I first
tried to set the prefix for the storage plugin. Then I found Benjamins
post about the setup function. So I thought there would be a something
like that for load() too...

> 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*.

The 1.2.x API is easier to approach that way. But it has its own
pitfalls and I fully understand why everything was rewritten.

> 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

Yeah, I have code like that now, too ;-)

Maybe we need something easy to setup for the most common use cases.
Somewhat like the old kitchensink module.

In the meantime I'm happy with some documentation or sample code. I
would even venture to write some when I know what the intended way of
doing things is :-)

Maybe we could have an Annotator call and talk about this?


P.S. Next week we have a little programming sprint to create a prototype
Annotator installation for the DARIAH research infrastructure for the
Humanities. I think we'll start with the 1.2.x branch :-)

> 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. 

Dr. Robert Casties -- Information Technology Group
Max Planck Institute for the History of Science
Boltzmannstr. 22, D-14195 Berlin
Tel: +49/30/22667-342

More information about the annotator-dev mailing list