[annotator-dev] Loading Annotations Asynchronously
Jamie M Folsom
jfolsom at MIT.EDU
Wed Jan 29 20:06:33 UTC 2014
OK. What I’ve seen is that if I am loading data from a new, different query using a new loadOptions object, and loadFromSearch, the query works (data are visible in the Chrome console), but the annotator makes no change, or at least no reliable change to the highlights in the DOM. I’ve added the Store plugin on Annotator init. The Annotator trying to load only annotations that weren’t loaded already (based on annotations stored in a hash keyed by id?) — might explain what I’m seeing.
Our use case calls for the user to be able to redo any of these queries at will, and if those annotations change in the interim, they should be reloaded freshly. Also, currently my sidebar loads its data from annotator.plugins.store.annotations, so if those don’t update, neither does the sidebar. I am moving to a model where any event fired by the annotator will trigger a refresh directly from the API by my sidebar, but in the interim, this dependency complicates keep things in sync.
Thanks again.
On Jan 28, 2014, at 6:09 PM, Randall Leeds <tilgovi at hypothes.is> wrote:
> As of v1.2.9 it still does call loadAnnotations on the annotator instance. However, if those annotations were loaded previously, they will not be passed to loadAnnotations a second time.
>
> It sounds to me like you might be loading the Store plugin without any options initially, and it's doing a search that returns all annotations in the DB? That would explain why the reload thinks those are already loaded.
>
> You may wish to delay adding the Store plugin until you know the search. There's also an open issue about not triggering an implicit load when the plugin is added. This will be adrdessed in 2.0.
>
> Does this sound like what is going on for you? Do you see an extra search request fire earlier than your explicit loadAnnotationsFromSearch call?
>
> (Apologies for the duplicate e-mail, Jamie. I forgot to include the mailing list when I replied.)
>
>
>
> On Tue, Jan 28, 2014 at 2:46 PM, Jamie M Folsom <jfolsom at mit.edu> wrote:
> Hi Randall,
>
> Thanks for following up. I’ve been meaning to myself.
>
> I think I figured out where the issue was, thanks to your reply. It seems that loadAnnotationsFromSearch used to trigger loadAnnotations, and no longer does — does that make sense? In any case, explicitly calling that post-reload fixed it. I refactored that view, so those steps are handled in order.
>
> https://github.com/hyperstudio/Annotation-Studio/blob/master/app/views/documents/_annotator-setup.html.erb#L181
>
> Best,
>
> Jamie
>
>
>
> On Jan 28, 2014, at 3:55 PM, Randall Leeds <tilgovi at hypothes.is> wrote:
>
>> I think we should maybe have a chat about this in real time so I can better assist.
>>
>> On Jan 25, 2014 7:48 PM, "Jamie M Folsom" <jfolsom at mit.edu> wrote:
>> No content changes. Is there a way to trigger annotator to do a completely fresh async reload with a new set of load options?
>>
>> Thanks Randall!
>> _______________________________________________
>> 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/20140129/0d274926/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1579 bytes
Desc: not available
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140129/0d274926/attachment-0004.bin>
More information about the annotator-dev
mailing list