Hi Sergiu, see below
On 10/31/2009 10:21 PM, Sergiu Dumitriu wrote:
On 10/30/2009 04: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?
The problem with a context is that you must make it long enough to
properly determine the right position, and short enough not to require
too much storage space.
I agree, and that is why this algorithm should be easily improved and adapted
upon need.
How about XPath expressions for the start and end positions on the XDOM?
I think XPath expressions are almost as rigid as offsets. Imagine you have a
text displayed for a user but not for others, or a container of some sort.
Although the annotated text doesn't fall in this content, its presence in the
XDOM can influence the node resolution for the stored path and cause an
annotation to fail to display although the annotated text (the selection) is
well there.
Also, right now, I don't tend to like the idea of coupling the annotation model
with the XDOM one, I think an annotation should make sense on its own
(regardless of the other mechanisms behind a document rendering, an annotation
is just some text selected with some meta infos).
Which makes me think, this proposal about rendering annotations on the
transformed XDOM would only work for syntax 2.0. Is that an issue at this point?
Do we want to give up this solution because of this or find a workaround when
we'd need to for the 1.0 syntax documents?
Thanks,
Anca
This could fail for dynamic queries, where the number
and position of
entries would change. But do we want to annotate this kind of elements
anyway? Like, why would somebody make annotations on the results of a
search?