217 | | === Responding GET api/annotations/00000000-0000-0000-0000-00000000002c (example usage for unresolvable target sources 1) === |
218 | | |
219 | | The respond for an annotation with unresolved target sources and the respond for an annotation with resolved target sources (see above) are both instances of the same schema element. However, the annotation refers to an obsolete version of the page. Next, having the target source references, the client will ask for the source versions saved in the DB. The last step: having the info about the version under consideration, the client asks for cached representations of the version. |
| 217 | === Responding GET api/annotations/00000000-0000-0000-0000-00000000002c (example usage for unresolvable targets 1) === |
| 218 | |
| 219 | The respond for an annotation with unresolved targets and the respond for an annotation with resolved targets (see above) are both instances of the same schema element. However, one of the targets of the first annotations annotation refers e.g. to an obsolete version of the page. Next, having the target eferences, the client will ask for the source versions saved in the DB. The last step: having the info about the version under consideration, the client asks for cached representations of the version. |
299 | | {{{#!xml |
300 | | <?xml version="1.0" encoding="UTF-8"?> |
301 | | <!-- the request body for POSTing a new annotation --> |
302 | | <annotation xmlns="http://www.dasish.eu/ns/addit" |
303 | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
304 | | xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd" |
305 | | URI="tempAIDgfgf" |
306 | | timeStamp="2013-05-29T18:13:51.0Z"> |
307 | | <owner ref="http://dasish.eu/users/UIde1fe1f"/> |
308 | | <headline>Comapring English and Catalan Wiki</headline> |
309 | | <body type="relation"> |
310 | | <relation>History</relation> |
311 | | <english ref="http://dasish.eu/sources/SIDaaabbb"/> |
312 | | <catalan ref="tmpSIDefef"/> |
| 299 | The new annotation URI, the owner reference will be replaced by the server. The new annotation URI is service URI + the UUID generated by the server. The owner reference is the service URI + logged-in user UUID. |
| 300 | |
| 301 | The targets's URI will be replaced if the target is new (has not been presented in the dtatabase yet). |
| 302 | |
| 303 | {{{#!xml |
| 304 | <?xml version="1.0" encoding="UTF-8"?> |
| 305 | <annotation |
| 306 | xmlns="http://www.dasish.eu/ns/addit" |
| 307 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 308 | xsi:schemaLocation="http://www.dasish.eu/ns/addit file:/Users/olhsha/repositories/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd" |
| 309 | xmlns:xhtml="http://www.w3.org/1999/xhtml/" |
| 310 | lastModified="2013-09-29T19:52:28.969+02:00" |
| 311 | URI="zzz" |
| 312 | ownerRef = "xxx" |
| 313 | headline = "Sagrada Famiglia Dutch 2" |
| 314 | > |
| 315 | <body> |
| 316 | <xmlBody mimeType="application/xml+xhtml"> |
| 317 | <xhtml:span style="background-color:rgb(0,0,153);color:rgb(255,255,255);border: thick solid rgb(0, 0, 153);">Some background information on Sagrada Família.</xhtml:span> |
| 318 | </xmlBody> |
314 | | <targetSources> |
315 | | <target> |
316 | | <source ref="http://dasish.eu/sources/SIDaaabbb"> |
317 | | <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#History</link> |
318 | | <version>20.04.2012</version> |
319 | | </source> |
320 | | </target> |
321 | | <target> |
322 | | <newSource xml:id="tmpSIDefef"> |
323 | | <link>http://ca.wikipedia.org/wiki/Temple_Expiatori_de_la_Sagrada_Fam%C3%ADlia#Hist.C3.B2tia</link> |
324 | | <version>20.04.2013</version> |
325 | | </newSource> |
326 | | </target> |
327 | | </targetSources> |
328 | | <permissions ref="tmpPermissionsListIDxyz"/> |
| 320 | <targets> |
| 321 | <targetInfo ref="http://localhost:8080/annotator-backend/api/targets/00000000-0000-0000-0000-0000000000cc" |
| 322 | link ="http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia" |
| 323 | version="Version 1.0"/> |
| 324 | </targets> |
| 325 | <permissions> |
| 326 | <userWithPermission permission="owner" ref="ZZZ"/> |
| 327 | </permissions> |
333 | | === Request body for POST api/annotations: another example === |
334 | | |
335 | | The serialization of the POST body for another example (UGOT): |
336 | | |
337 | | {{{#!xml |
338 | | <?xml version="1.0" encoding="UTF-8"?> |
339 | | <!-- the request body for POSTing a new annotation --> |
340 | | <annotation xmlns="http://www.dasish.eu/ns/addit" |
341 | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
342 | | xmlns:xhtml="http://www.w3.org/1999/xhtml" |
343 | | xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd" |
344 | | URI="tempAIDgfgf" |
345 | | timeStamp="2013-04-26T11:23:26.000Z"> |
346 | | <owner ref="http://dasish.eu/users/user123"/> |
347 | | <headline>Douglas Adams - Wikipedia, the free encyclopedia</headline> |
348 | | <body ref="tmpSIDxyxy" type="Note"> |
349 | | <xhtml:span style="background-color:rgb(253,49,31);color:rgb(0,0,0);">Adams was born 1952-03-11</xhtml:span> |
350 | | </body> |
351 | | <targetSources> |
352 | | <target> |
353 | | <newSource xml:id="tmpSIDxyxy"> |
354 | | <link>http://en.wikipedia.org/wiki/Douglas_adams#xpointer(start-point(string-range(//div[@id="mw-content-text"]/table[1]/tbody[1]/tr[3]/td[1]/text()[1],'',12))/range-to(string-range(//div[@id="mw-content-text"]/table[1]/tbody[1]/tr[3]/td[1]/text()[1],'',25)))</link> |
355 | | <version>2013-04-26T11:23:26.000Z</version> |
356 | | </newSource> |
357 | | </target> |
358 | | </targetSources> |
359 | | <permissions ref="tmpPermissionsListIDabcd"/> |
| 332 | |
| 333 | |
| 334 | === Response body (envelope) for POST api/annotations === |
| 335 | |
| 336 | The temporary URIs/references are replaced with permanent references. However, no cahced representation is found for the target. Therefore, in the action part of the envelope there is an action CREATE_CACHED_REPRESENTATION for the object which is the target for the web-page. |
| 337 | |
| 338 | {{{#!xml |
| 339 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| 340 | <responseBody xmlns="http://www.dasish.eu/ns/addit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dasish.eu/ns/addit https://svn.clarin.eu/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd"> |
| 341 | <annotation headline="Sagrada Famiglia Dutch 2" ownerRef="http://localhost:8080/annotator-backend/api/users/00000000-0000-0000-0000-000000000113" lastModified="2013-12-18T09:50:43.803706Z" URI="http://localhost:8080/annotator-backend/api/annotations/7e7609d9-a04e-41bc-b773-337a11210336"> |
| 342 | <body> |
| 343 | <xmlBody mimeType="application/xml+xhtml"> |
| 344 | <xhtml:span xmlns:xhtml="http://www.w3.org/1999/xhtml/" style="background-color:rgb(0,0,153);color:rgb(255,255,255);border: thick solid rgb(0, 0, 153);">Some background information on Sagrada Família.</xhtml:span> |
| 345 | </xmlBody> |
| 346 | </body> |
| 347 | <targets> |
| 348 | <targetInfo version="Version 1.0" link="http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia" ref="http://localhost:8080/annotator-backend/api/targets/1ad5928a-8957-42ea-be67-02eb9f334647"/> |
| 349 | </targets> |
| 350 | <permissions> |
| 351 | <userWithPermission permission="owner" ref="http://localhost:8080/annotator-backend/api/users/00000000-0000-0000-0000-000000000113"/> |
| 352 | </permissions> |
361 | | }}} |
362 | | |
363 | | |
364 | | === Response body (envelope) for POST api/annotations === |
365 | | |
366 | | The temporary id is replaced with the permanent reference. However, no cahced representation is found for the catalan web-page. Therefore, in the action part of the envelope there is an action CREATE_CACHED_REPRESENTATION for the object which is the source for catalan web-page. |
367 | | |
368 | | {{{#!xml |
369 | | <?xml version="1.0" encoding="UTF-8"?> |
370 | | <respondNewAnnotation xmlns="http://www.dasish.eu/ns/addit" |
371 | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
372 | | xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd"> |
373 | | <annotationResponse> |
374 | | <content> |
375 | | <annotation xmlns="http://www.dasish.eu/ns/addit" |
376 | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
377 | | xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd" |
378 | | URI="http://dasish.eu/annotations/AIDeegf" |
379 | | timeStamp="2013-05-29T18:13:51.0Z"> |
380 | | <owner ref="http://dasish.eu/users/UIde1fe1f"/> |
381 | | <headline>Comapring English and Catalan Wiki</headline> |
382 | | <body type="relation"> |
383 | | <relation>History</relation> |
384 | | <english ref="http://dasish.eu/sources/SIDaaabbb"/> |
385 | | <catalan ref="http://dasish.eu/sources/SIDcxcx"/> |
386 | | </body> |
387 | | <targetSources> |
388 | | <target> |
389 | | <source ref="http://dasish.eu/sources/SIDaaabbb"> |
390 | | <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#History</link> |
391 | | <version>20.04.2012</version> |
392 | | </source> |
393 | | </target> |
394 | | <target> |
395 | | <source ref="http://dasish.eu/sources/SIDcxcx"> |
396 | | <link>http://ca.wikipedia.org/wiki/Temple_Expiatori_de_la_Sagrada_Fam%C3%ADlia#Hist.C3.B2tia</link> |
397 | | <version>20.04.2013</version> |
398 | | </source> |
399 | | </target> |
400 | | </targetSources> |
401 | | <permissions ref="http://dasish.eu/permissions/PermissionsListIDxyz"/> |
402 | | </annotation> |
403 | | </content> |
404 | | <actions> |
405 | | <action action="CREATE_CACHED_REPRESENTATION" object="http://dasish.eu/sources/SIDcxcx"/> |
406 | | </actions> |
407 | | </annotationResponse> |
408 | | </respondNewAnnotation> |
| 354 | <actionList> |
| 355 | <action message="CREATE_CACHED_REPRESENTATION" object="http://localhost:8080/annotator-backend/api/targets/1ad5928a-8957-42ea-be67-02eb9f334647"/> |
| 356 | </actionList> |
| 357 | </responseBody> |