albertjuhe / annotator_nodejs_store

Annotation application with annotatorjs and nodejs, with users, roles, import/ export files and search capabilities.
Other
16 stars 8 forks source link

error message "Sorry we could not create this annotation" #16

Open garik-pilot opened 9 years ago

garik-pilot commented 9 years ago

It seems like the annotations can not be stored in mySQl database.

here is the config.json:
{ "materials": "http://localhost/annotation/", "server": "localhost", "user": "myuser", "password": "mypassword", "database": "test",
"database_port":3306, "connectionLimit":10, "port": 3000 }

mysql works fine and I can connect to database "test" from command line. All tables have been created according to the installation guidelines. node started the application on port 3000 successfully. What's wrong?

I have tried to open in http://10.xx.xx.xx/annotation/demo.html in firefox (or http://localhost/..) and I can annotate the test but I can not save them to database.

albertjuhe commented 9 years ago

You need to execute the aplication via nodejs, with http://10.xx.xx.xx:port, in this case port=3000, because the nodejs application controls de annotations and store it. http://10.xx.xx.xx:3000/annotation/demo.html

garik-pilot commented 9 years ago

hi Albert, how I can call RESTful service directly from third-party tools? Which destination url I need to use?

Regards, Igor

On Mon, Jul 6, 2015 at 1:54 PM, Albert Juhe Brugué <notifications@github.com

wrote:

You need to execute the aplication via nodejs, with http://10.xx.xx.xx:port, in this case port=3000, because the nodejs application controls de annotations and store it. http://10.xx.xx.xx:3000/annotation/demo.html

— Reply to this email directly or view it on GitHub https://github.com/albertjuhe/annotator_nodejs_store/issues/16#issuecomment-118938652 .

garik-pilot commented 9 years ago

Ok, I've got it:

  1. installed POSTMAN app for Google Chrome to call RESTful services for testing;
  2. typed http://localhost:3000/annotation/get/testuser/demo, selected "GET"
  3. here is the response from WS:

{ "permissions": { "read": [ "testuser" ], "update": [ "testuser" ], "delete": [ "testuser" ], "admin": [ "testuser" ] }, "user": "testuser", "ranges": [ { "start": "/div[1]/div[1]/div[3]/div[1]/h1[1]", "startOffset": 0, "end": "/div[1]/div[1]/div[3]/div[1]/h1[1]", "endOffset": 6 } ], "quote": "Franke", "text": "

my annotation test1

\n

 

", "section": null, "section_title": null, "order": "content", "category": "errata", "id": 5, "state": "0", "propietary": 1, "data_creacio": "2015-07-06T21:50:19.000Z" },

On Mon, Jul 6, 2015 at 1:58 PM, Igor Yegunov yegunov@gmail.com wrote:

hi Albert, how I can call RESTful service directly from third-party tools? Which destination url I need to use?

Regards, Igor

On Mon, Jul 6, 2015 at 1:54 PM, Albert Juhe Brugué < notifications@github.com> wrote:

You need to execute the aplication via nodejs, with http://10.xx.xx.xx:port, in this case port=3000, because the nodejs application controls de annotations and store it. http://10.xx.xx.xx:3000/annotation/demo.html

— Reply to this email directly or view it on GitHub https://github.com/albertjuhe/annotator_nodejs_store/issues/16#issuecomment-118938652 .

albertjuhe commented 9 years ago

Hi,

The application follows the REST service defined by annotatorjs in teh store plugin: http://docs.annotatorjs.org/en/v1.2.x/plugins/store.html

The get method return all the annotations that belongs to the testuser and the document demo http://localhost:3000/annotation/get/testuser/demo this implementation is a demo, normaly this must be encrypted.