[annotator-dev] Annotations Not getting loaded on initializing annotator

Apurva Jalit apurva.jalit at gmail.com
Fri Mar 27 16:10:52 UTC 2015


I am using chrome. I am picking up the response details from the chrome dev
tools (from the response of the api request generated on annotator load).

On Fri, Mar 27, 2015 at 9:39 PM, Randall Leeds <tilgovi at hypothes.is> wrote:

> Very strange.. I think the data looks right.
>
> I do notice that your page has a file: URL. Some browser's won't make XHR
> requests from those pages.
>
> When you say this is the response, do you mean annotator gets this
> response and then nothing happens or that your server sends that response
> when you test it with another tool?
>
> What browser are you using?
> On Mar 27, 2015 9:06 AM, "Apurva Jalit" <apurva.jalit at gmail.com> wrote:
>
>> That didn't help too. I just tried. The new response:
>>
>> {"total":1,"rows":[{"id":0,"annotator_schema_version":"v1.0","created":"2015-03-27T16:05:21Z","updated":"2015-03-27T16:05:21Z","text":"save","quote":"extension","uri":"file:///C:/Users/apurva.jalit/work/NotocolExtension/Google%20Chrome%20Extension1/index.htm","ranges":[{"start":"/p[3]","startoffset":37,"end":"/p[3]","endoffset":47}],"user":"aps","consumer":"","tags":[],"permission":{"read":["group:__world__"],"admin":null,"update":null,"delete":null}}]}
>>
>> On Fri, Mar 27, 2015 at 9:33 PM, Randall Leeds <tilgovi at hypothes.is>
>> wrote:
>>
>>> I think, in your response, you want to use the key "rows" rather than
>>> "annotations".
>>> On Mar 27, 2015 8:58 AM, "Apurva Jalit" <apurva.jalit at gmail.com> wrote:
>>>
>>>> Hello,
>>>> I am implementing the REST APIs required to support annotatorjs. My
>>>> server is SQL server and APIs are written in C#.
>>>> I have been able to write APIs for search and create. Everything
>>>> execute perfectly fine without any error being seen on the browser page.
>>>> But after creation, I am testing the loading of previously created
>>>> annotations but I fail to see any of these annotations and no error as well.
>>>> When I initialize the annotator, I have included the following :
>>>> content.annotator('addPlugin', 'Store', {
>>>>
>>>>             // The endpoint of the store on your server.
>>>>             prefix: 'http://localhost:5555/api/Annotation',
>>>>
>>>>             // Attach the uri of the current page to all annotations to
>>>> allow search.
>>>>             annotationData: {
>>>>                 'uri': pageURL
>>>>             },
>>>>
>>>>             // This will perform a "search" action when the plugin
>>>> loads. Will
>>>>             // request the last 20 annotations for the current url.
>>>>             // eg. /store/endpoint/search?limit=20&uri=
>>>> http://this/document/only
>>>>             loadFromSearch: {
>>>>                 'count': 20,
>>>>                 'uri': pageURL
>>>>             }
>>>>         });
>>>>
>>>> The response I get is as follows:
>>>> {
>>>> "total":1,
>>>> "annotations":[
>>>>        {"id":0,
>>>>         "annotator_schema_version":"v1.0",
>>>>          "created":"2015-03-27T15:32:48Z",
>>>>          "updated":"2015-03-27T15:32:48Z",
>>>>          "text":"asdsad",
>>>>          "quote":"extension",
>>>>
>>>> "uri":"file:///C:/Users/apurva.jalit/work/NotocolExtension/Google%20Chrome%20Extension1/index.htm",
>>>>
>>>>  "ranges":[{"start":"/p[3]","startoffset":37,"end":"/p[3]","endoffset":47}],
>>>>          "user":"aps",
>>>>          "consumer":"",
>>>>           "tags":[],
>>>>           "permission":
>>>>           {"read":["group:__world__"],
>>>>            "admin":null,
>>>>            "update":null,
>>>>            "delete":null
>>>>            }
>>>>          }
>>>>         ]
>>>>  }
>>>>
>>>> Is this not enough? Do I have to explicitly make a call to some
>>>> function to load this annotation?
>>>>
>>>> Thanks,
>>>> Apurva Jalit
>>>>
>>>> _______________________________________________
>>>> 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/20150327/b5b01863/attachment-0004.html>


More information about the annotator-dev mailing list