[annotator-dev] How to prompt to delete the annotations?
Rouan Wilsenach
rwilsen at thoughtworks.com
Wed Sep 25 06:02:50 UTC 2013
Hi
I don't think the library supports this out of the box. I'd say you have
two options:
a) Download and modify the annotator source so that it prompts as required.
You can find details of how to develop on annotator here:
https://github.com/okfn/annotator/blob/master/HACKING.markdown
b) Try using some jQuery to switch off or remove the existing event
handling on the "x" button and then add your own. Your own event handling
could then either hook into the existing annotator code or make the ajax to
the server call itself.
Rouan
On 24 September 2013 06:15, Gong Huaiyu James (NCS) <jamesh at ncs.com.sg>wrote:
>
> 1. when I click Annotation viewer icon "x" to delete the annotation,
> prompt "Do you really want to delete the annotation"?
> If Yes, to delete it. If No, cancel it
> 2. How to do it? I used the hook,
> .subscribe("annotationDeleted", function
> (annotation) {
> var retVal = confirm("Do you want to delete it
> ?");
> if( retVal == true ){
>
> }else
> return (false);
> })
>
> But alwayse go to delete it.
> 3. How to block to delete it?
>
>
> Thanks
>
>
>
> -----Original Message-----
> From: annotator-dev-bounces at lists.okfn.org [mailto:
> annotator-dev-bounces at lists.okfn.org] On Behalf Of
> annotator-dev-request at lists.okfn.org
> Sent: Monday, 23 September, 2013 7:00 PM
> To: annotator-dev at lists.okfn.org
> Subject: annotator-dev Digest, Vol 29, Issue 6
>
> Send annotator-dev mailing list submissions to
> annotator-dev at lists.okfn.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.okfn.org/mailman/listinfo/annotator-dev
> or, via email, send a message with subject or body 'help' to
> annotator-dev-request at lists.okfn.org
>
> You can reach the person managing the list at
> annotator-dev-owner at lists.okfn.org
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of annotator-dev digest..."
>
>
> Today's Topics:
>
> 1. Re: Annotator Store With SQL Server (Rouan Wilsenach)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 23 Sep 2013 09:54:53 +0200
> From: Rouan Wilsenach <rwilsen at thoughtworks.com>
> Subject: Re: [annotator-dev] Annotator Store With SQL Server
> To: Mifla Mashood <mifla17 at gmail.com>
> Cc: "annotator-dev at lists.okfn.org" <annotator-dev at lists.okfn.org>
> Message-ID:
> <
> CAH1DQr9-r2OXPe3k7cpo3ktiSc3q4Gporjyng0BHOefbnQqFHA at mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> Hi Mifla
>
> See my answers inline. Hope it helps.
>
> Rouan
>
> On 17 September 2013 07:18, Mifla Mashood <mifla17 at gmail.com> wrote:
>
> > Hi,
> >
> > From the following statement I made out that it was possible to have
> > my own storage system to store the annotations.
> > *?**You'll need to store your data somewhere, luckily we've made this
> > very simple to do using AnnotateIt <http://annotateit.org/>, a hosted
> > web service for storing annotations.Alternatively if you'd like to
> > integrate the annotator with your own storage system check out the
> > Docs<http://github.com/okfn/annotator/wiki/> for more information on
> > the annotation format and store plugin.?* *Would it be possible for me
> > to use SQL Server? If yes, how should I go about doing it? I referred
> the links given. They look very generic and found a few 3rdparty tools but
> didn?t quite fit my requirements.
> > *
> >
> It's completely possible to use MS SQL Server (I'm assuming that's what you
> mean) or any other DB. You'll just have to write your own store server
> that can accept the REST calls and interact with your DB appropriately.
>
>
> > *My main requirements are,*
> > *1. I should be able to store data in my sql server db and query them
> > by using methods in the Annotator API*
> >
>
> The Annotator JQuery plugin will make its usual RESTful AJAX calls. It's
> up to you to provide the endpoints for these to call. This page documents
> the API you'll have to implement:
> https://github.com/okfn/annotator/wiki/Storage.
> You offer this API and point the annotator Store plugin to it (
> https://github.com/okfn/annotator/wiki/Store-Plugin) using the 'prefix'
> option.
>
> *
> > *
> > *2. So essentially my database schema should be compliant with
> > AnnotateIt, so that I can share my annotations with others who use
> > Annotator.*
> >
>
> How you deal with this is up to you. If you use SQL, you obviously won't
> be able to store the annotation data as JSON, but you could store it as
> plain text in a normal VARCHAR column and do all the necessary
> encoding/parsing in your app to deal with converting to and from JSON.
>
>
> > *
> > *
> > *3. I would also like to use these data to draw conclusions, produce
> > charts using various conditions etc... Can I do these If I use
> > AnnotateIt instead of my own db?*
> >
>
> This is possible but not optimal. If you want to draw conclusions based on
> the annotation data, it really would be ideal if you could use a document
> store so that you could query the individual fields. Alternatives to MS SQL
> here could be MongoDB, RavenDB, ElasticSearch (which is what AnnotateIt
> uses) or even Postgres with its JSON column.
>
> If you use MS SQL, you'll have to pull all the data into memory and run
> your analytics there.
>
> *
> > *
> > *4. How can I customize the AnnotateIt store to include additional
> > fields I would like to save?*
> >
>
> Using the 'annotationData' option of the Store plugin (
> https://github.com/okfn/annotator/wiki/Store-Plugin)
>
> *
> > *
> > *Regards,*
> > *Mifla*
> > *
> > **Any guidance would be deeply appreciated.*
> >
> >
> > --
> > Kind Regards,
> > Mifla
> >
> > _______________________________________________
> > annotator-dev mailing list
> > annotator-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/annotator-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/annotator-dev
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.okfn.org/pipermail/annotator-dev/attachments/20130923/ff784ecf/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: http://lists.okfn.org/mailman/optionss/annotator-dev
>
>
> End of annotator-dev Digest, Vol 29, Issue 6
> ********************************************
>
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/annotator-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20130925/609ececf/attachment-0002.html>
More information about the annotator-dev
mailing list