Hi Anca,
Here's my understanding of what you suggest:
Document text:
"word1 word2 word3 word4 word5 word6."
Annotation on "word4" results in:
- Selection: "word4" (unique within the context)
- Context: "word3 word4 word5" (unique within this document)
Then all you need to do to mark this annotation, is to locate the
document-unique context and then to mark the selection within the
document-area defined by the context.
I see 2 major issues here:
1. The selection must be itself unique within the context, otherwise you
just have the same big problem, at a smaller scale. This directly
restricts the context's size.
2. How can the document-uniqueness of a context be ensured?
- Fixed size context is not that practical.
- Computing the context size at creation time with the js client
becomes a must, but if it fails to identify such an unique context, you
risc having all the document as context. Example document text: "word4
word4 word4 word4 word4 word4"
- The matching is done *after* the dynamic part of the document
finishes to execute. That dynamic part could potentially generate a copy
of the context and confuse the matching algorithm.
Maybe I misunderstood the proposal or missed some key detail, otherwise,
please let me know.
P.S.: I like examples :)
Thanks,
Eduard
On 10/30/2009 05:21 PM, Anca Luca wrote:
Hi devs,
following a discussion with Fabio about the second desired feature for the
annotations, namely the ability to add annotations on any document, no matter
how its content is generated, we came up with the solution described at
http://dev.xwiki.org/xwiki/bin/view/Design/AnnotationFeature#HSolution1stor…
, the main idea being that annotations would be defined by their selected text
and a context (as opposed to offsets) and would be identified to be rendered in
a document on a serialization of the transformed XDOM of the document, this way
taking into account any macro rendering, document inclusion, etc.
WDYT about this solution?
Also, because the implementation of this, though relatively localized, comes
together with refactor and cleanup of the annotations module (update everything
so that annotations don't store and use offsets anymore, remove classes&
functions which are not needed in this simplified process), I propose to include
this improvement in version 1.0 of the annotations module (so that we don't
cleanup and release what we know for sure we'll delete) and push the 1.0 version
further to mid to end December.
here's my +1 for this,
WDYT?
Happy coding,
Anca
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs