Hi Tomas,

I have created a blog about annotations 
http://www.masteringwave.com/2009/09/google-wave-annotations/,
hope this will help other learn about annotations.

/daniel

On Jul 23, 12:27 am, Tomas <[email protected]> wrote:
> Interestingly enough the first letter in the blip is not position 0,
> when counting range, but 2. So for example in the document "abcdef",
> the range 2:3 spans the letter 'a' and 3:5 spans the letters 'bc'.
>
> It took me a while to understand all this so perhaps you will find
> this helpful. Theannotationsspan something they call 'items' in the
> blip and an item is roughly an entire tag or a letter, for instance.
> Now I haven't found this spelled out, but gathered it from reading
> about the Wave protocoll, but for now it's the best explanation I have
> been able to come up with.
>
> Theannotationsspan items and thus the range is really counted across
> all items in the XML, tags as well as letters in this case so the
> reason we get 2 as starting index of the range is because the document
> really looks like this:
>
>              <blip><p>'A'
> Item no      0      1  2
>
> Normally you wouldn't care and just use the ranges supplied by the
> engine, but this is crucial to know if you want to calculate ranges on
> you own in your code.
>
> Tomas.
>
> On 22 Juli, 19:46, Tom Maaswinkel <[email protected]> wrote:
>
> > Hey Suhas,
> > I'm currently working on a bot that makes it possible to edit articles from
> > a mediawiki instalation (used by websites as Wikipedia) inside a wave.
> > Mediawiki supports templates (including other pages into your current page).
> > When ever a user tries to do this in my wave, I actually import that page,
> > but I put an annotation around it specifying that it is a template. This way
> > I can prevent people from editing this part of the wave and I can output
> > 'clean' wikitext. Because whenever the template changes, this should also
> > happen on the pages the template is included, so I don't want to include the
> > actual content but just a reference!
>
> > I'm currently working on a demo video on my robot, I guess it will be online
> > in a week. I think that will explain it a bit more.
>
> > - Tom
>
> > 2009/7/22 Suhas Nandakumar <[email protected]>
>
> > > Hello Tom,
> > >    Thank you for the information. The second case sounds interesting where
> > > in you store the information about something in annotation. If this is not
> > > too much of asking, can you provide me a use-case where you are using the
> > > annotation for this purpose
>
> > > Thanks
> > > Suhas
>
> > > On Wed, Jul 22, 2009 at 10:30 AM, Tom Maaswinkel <[email protected]
> > > > wrote:
>
> > >> Hey Suhas,
> > >> as there are 2 tom's I'll just answer and maybe the other guy will do 
> > >> too.
> > >>Annotationsare just for a lot of things! In the current Wave client made 
> > >>by
> > >> Google they are mainly used to specify text 'styles' (i.e. bold, italic,
> > >> underline, color, background-color, font-family etc) and it is used for
> > >> grammar checks (if it thinks something is spelled wrong, it will make an
> > >> annotation that specify's this).
>
> > >> I also use it to store information about a certain piece of text, as you
> > >> can assign any name and value (both Strings) to an annotation, so you can
> > >> use it for whatever you want.
>
> > >> - Tom
>
> > >> 2009/7/22 Suhas Nandakumar <[email protected]>
>
> > >> Hello Tom,
> > >>>       Can you provide some details of usage ofannotations. some examples
> > >>> that can get me started
>
> > >>> Thanks
> > >>> Suhas
>
> > >>> On Wed, Jul 22, 2009 at 7:15 AM, Tom Maaswinkel <
> > >>> [email protected]> wrote:
>
> > >>>> Hey Tomas,
> > >>>> I have already played a lot with this and the annotation will just
> > >>>> 'stretch'. As Henrique already mentions: Rich text are alsoannotations
> > >>>> (bold/italic etc)...
>
> > >>>> You can see this happening in your Editor Debug view!
> > >>>> - Tom
>
> > >>>> 2009/7/22 Henrique Pinheiro <[email protected]>
>
> > >>>> I think when someone presses 'done' to commit their blip, the engine
> > >>>>> translates Rich Text toannotations.
> > >>>>> So, the second option: The annotation gets changed to 4:11.
>
> > >>>>> BUT
>
> > >>>>> I'm assuming that's an annotation for text styling. As I've only used
> > >>>>>annotationsfor that for now. I only know they can handle 'lang' info as
> > >>>>> well, but I don't know about arbitrary data.
>
> > >>>>> Maybe if it's arbitrary, the engine could even discard your annotation
> > >>>>> when someone edits the blip.
> > >>>>> Will have to test, that.
>
> > >>>>> On Wed, Jul 22, 2009 at 10:13 AM, Tomas 
> > >>>>> <[email protected]>wrote:
>
> > >>>>>> When I put an annotation into a document, will it be affected by the
> > >>>>>> operational transform done on the document?
>
> > >>>>>> E.g. I have the following document:
>
> > >>>>>> "The quick brow fox"
>
> > >>>>>> I place an annotation with the range 4:9.
>
> > >>>>>> Someone changes the document to:
>
> > >>>>>> "The quicker brow fox"
>
> > >>>>>> Now, will the annotation still have the range 4:9 or has it been
> > >>>>>> changed to 4:11?
>
> > >>>>>> Tom.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to