[annotator-dev] beforeAnnotationsLoaded event

Riccardo Tasso riccardo.tasso at gmail.com
Thu Dec 19 11:23:53 UTC 2013


Thank you Randall, your mail is really motivating. I'll give you soon a
feedback on what you are saying, but in the meanwhile I ask you an hopinion
on the following solution.

I needed to solve the problem as soon as possible, so I decided to write a
plugin which does essentially two things.

The first one is to register to the "annotationCreated" event, to adapt the
annotator format to my backend format. The Store plugin is still active,
since it's still usefull. In my plugin I have only to handle the conversion
of formats, whithout doing any call.

The second one has to do with this thread, since I make an asynchronous
ajax call to my backend, then I manipulate the results to obtain the
annotator format, and finally I call the annotator.loadAnnotations
function. To avoid the conflict with the Store plugin, I configured the
following uri: search:  'mock/emptyList.json'. It is an empty JSON.

The solution seems to work well, I'm happy that it didn't require to touch
the core and the Store plugin code. Do you think it's safe?

Thank you,
   Riccardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20131219/e776dc2a/attachment-0004.html>


More information about the annotator-dev mailing list