Re: [Google Wave APIs] Is there a way to scroll blip from a gadget

2010-02-21 Thread Данил Сомсиков
Thank you, Сhris.
Unfortunately, adding bot to support scrolling is not suitable
solution from user experience point of view.
Anyway, thanks again.

2010/2/22 Chris :
> Hi.  Because your gadget is in an iframe hosted at a different domain that
> Wave itself, to give your gadget control over the wave's scrollbar you need
> some JavaScript in the wave itself which will talk with your gadget.  The
> only way I know to achieve this is by a bot (and I'm not sure how to do it
> exactly).  See these threads:
>
> http://groups.google.com/group/google-wave-api/browse_thread/thread/e655cab80c0d4b8a/bf7f528427157a63?hl=en&lnk=gst
>
> http://groups.google.com/group/google-wave-api/browse_thread/thread/b7c1af7defd410d4/dd749040fde0bc0d?hl=en&lnk=gst
>
> In ALL things, strive for ><>,
> Chris
>
>
> On Sat, Feb 20, 2010 at 10:41 AM, danilsomsikov 
> wrote:
>>
>> I'm making gadget with dynamic height content, which may be taller
>> than screen. Is there a way that I can scroll container blip to ensure
>> that certain part of content in my gadget is visible?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Wave API" group.
>> To post to this group, send email to google-wave-...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-wave-api+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-wave-api?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Wave API" group.
> To post to this group, send email to google-wave-...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-wave-api+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-wave-api?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.



Re: [Google Wave APIs] Is there a way to scroll blip from a gadget

2010-02-21 Thread Chris
Hi.  Because your gadget is in an iframe hosted at a different domain that
Wave itself, to give your gadget control over the wave's scrollbar you need
some JavaScript in the wave itself which will talk with your gadget.  The
only way I know to achieve this is by a bot (and I'm not sure how to do it
exactly).  See these threads:

http://groups.google.com/group/google-wave-api/browse_thread/thread/e655cab80c0d4b8a/bf7f528427157a63?hl=en&lnk=gst

http://groups.google.com/group/google-wave-api/browse_thread/thread/b7c1af7defd410d4/dd749040fde0bc0d?hl=en&lnk=gst

In ALL things, strive for ><>,
Chris


On Sat, Feb 20, 2010 at 10:41 AM, danilsomsikov wrote:

> I'm making gadget with dynamic height content, which may be taller
> than screen. Is there a way that I can scroll container blip to ensure
> that certain part of content in my gadget is visible?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Wave API" group.
> To post to this group, send email to google-wave-...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-wave-api+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-wave-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.



Re: [Google Wave APIs] Navigate in a wave by code

2010-02-21 Thread Chris
Pamela: Here is the thread:
http://groups.google.com/group/google-wave-api/browse_thread/thread/b7c1af7defd410d4/dd749040fde0bc0d?hl=en&lnk=gst

I asked Ravinder for the source to that and got an overview of his approach:

>By following steps mentioned in my previuos reply i was able to store
> participant id and participant profile name only.I couldn`t get profile
> image.To show the profile images I had to use different workaround.
> Through bot I created a wave which has all the participants whose profile
> inforamtion was required and stored waveId in database for later use . In
> that wave there is a gadget which uses which retrieves profile
> information by using
>
> var participant = wave.getParticipantById(userId);
>
> imgUrl = participant.getThumbnailUrl();
>
> dispName = participant.getDisplayName();
>
> Now the whole scenario is like this
>
> 1. User creates a new wave and adds bot into the wave.(Let us name this
> wave as A)
>
> 2. bot checks whether waveid of wave which has all the participant whose
> profile information is required is present in the database.If it is not yet
> created it creates the wave and add all the userids as participant in
> it.Then it stores its id to get that wave later. (Let us name this wave
> as B).
>
> 3. then bot embeds a gadget in wave B (Let us call this gadget G1).In this
> gadget i had to show profile pictures.
>
> 4. then bot adds new gadget into wave A.(Let us call this gadget
> G2). Gadget G2 has html to embed wave B in it.
>
> In this way i was able to show profile information of users. In other way
> we can say that i used one wave which has all the participants whose profile
> information i needed
>

In ALL things, strive for ><>,
Chris


On Sat, Feb 20, 2010 at 1:53 AM, pamela (Google Employee) <
pamela...@gmail.com> wrote:

> I haven't seen that injection technique, so I can't comment on its
> feasability. If you find the particular piece of code, I'll take a look.
> Thanks!
>
> - pamela
>
> On Fri, Feb 19, 2010 at 1:24 PM, Chris  wrote:
>
>> @Pamela: I recall someone reporting that their bot could inject JavaScript
>> into the page to communicate across a gadget's iframe.  Would the same
>> injection technique not work in this case?
>>
>>
>> In ALL things, strive for ><>,
>> Chris
>>
>>
>> On Wed, Feb 17, 2010 at 6:14 PM, pamela (Google Employee) <
>> pamela...@gmail.com> wrote:
>>
>>> I'm not sure that it'd be easy to do that, given there's no explicit
>>> access to the Wave client's DOM. There would presumably have to be a gadget
>>> inside the page that was able to reach into the parent frame, find the wave
>>> div, and scroll that down. I don't think that an iframe can manipulate that
>>> much of the outside.
>>>
>>> Alternatively, a wave could me embedded, and that might make it easier to
>>> manipulate the embedded wave.
>>>
>>> Either way, its hacky.
>>>
>>> I would recommend making sure the blip-to-be-focused is unread, as then
>>> atleast people can easily spacebar to it. (And maybe one day the client will
>>> notify them of it).
>>>
>>> - pamela
>>>
>>> On Wed, Feb 17, 2010 at 2:13 AM, Chris  wrote:
>>>
 Oops, that would be 50 pixels five times.  *blush*


 In ALL things, strive for ><>,
 Chris


 On Tue, Feb 16, 2010 at 9:11 AM, Chris  wrote:

> You'll probably have to insert some JavaScript into the page and run
> it, as I doubt Google's API offers anything to do this directly.  See 
> these
> pages:
> http://javascript.wikia.com/wiki/Window#scroll
> http://www.quirksmode.org/js/findpos.html
>
> So you use the script at the second link to find the element's position
> and the function at the first link to send the browser there.  If you want
> the wave to scroll smoothly, you can scrollBy a certain increment until 
> you
> reach the element.  That increment could simply be a fraction of the
> distance to the element, or a constant speed.  For example, if the element
> is 280 pixels down the screen you could scrollBy 50 pixels every half a
> second, three times, and then 30 pixels (the modulus - 280 % 50).  The
> function to separate the calls to scrollBy would be window.setInterval:
> http://javascript.wikia.com/wiki/Window#setInterval
>
> In ALL things, strive for ><>,
> Chris
>
>
>
> On Mon, Feb 15, 2010 at 8:23 AM, vincent donzé <
> vincent.do...@gmail.com> wrote:
>
>> Hello everybody,
>>
>> I'm making a task manager robot for Google Wave but I encounter a
>> difficulty. I would like to navigate into the wave with java code. I
>> mean, I want to focus the view on a special blip. If the blip is at
>> the bottom of the page, I want the wave to scrol down until it reach
>> the blip. Is it possible ?
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Google Wave API" group.
>> To post to t

[Google Wave APIs] Re: How can I access Wave by it's ID from another waves event?

2010-02-21 Thread CAPS
Hi,
I didn't understand about the keyword 'context' there. Does it have
any relation with the Enum Context in the Wave API docs? Will you
please elaborate it as I am new to robot development.

Thanks a lot.

On Feb 4, 4:19 am, kyprizel  wrote:
> Values stored in database:
> wave_id = "googlewave.com!w+qilt5TMWR)"
> wavelet_id = "googlewave.com!conv+root"
> blip_id = "b+qilt5TMWS"
>
> code:
>
>     context.AddWave({'waveId': wave_id, 'waveletIds': [wavelet_id],})
>     collector_wave = context.GetWaveById(wave_id)
>     collector_wavelet = collector_wave.CreateWavelet
> (participants=context.GetRootWavelet().GetParticipants())
>     if not collector_wavelet:
>         return
>     blip = context.builder.BlipCreateChild(wave_id, wavelet_id,
> blip_id)
>     context.AddBlip(blip)
>     blip = context.GetBlipById(blip['blipId'])
>     blip.GetDocument().SetText("New wave created:
> "+context.GetRootWavelet().title+"\n")
>
> resulting json:
>
> {"operations": {"javaClass": "java.util.ArrayList", "list":
> [{"blipId": "", "index": -1, "waveletId": "", "javaClass":
> "com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
> +qilt5TMWR", "property": {"waveletId": "conv+root", "javaClass":
> "com.google.wave.api.impl.WaveletData", "participants": {"javaClass":
> "java.util.ArrayList", "list": ["kypri...@googlewave.com",
> "my...@appspot.com"]}, "rootBlipId": "TBD_conv+root_1", "waveId":
> "TBD_1"}, "type": "WAVELET_CREATE"}, {"blipId": "b+qilt5TMWS",
> "index": -1, "waveletId": "googlewave.com!conv+root", "javaClass":
> "com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
> +qilt5TMWR", "property": {"blipId": "TBD_googlewave.com!conv+root_2",
> "javaClass": "com.google.wave.api.impl.BlipData", "waveId":
> "googlewave.com!w+qilt5TMWR", "waveletId": "googlewave.com!conv
> +root"}, "type": "BLIP_CREATE_CHILD"}, {"blipId": "TBD_googlewave.com!
> conv+root_2", "index": -1, "waveletId": "googlewave.com!conv+root",
> "javaClass": "com.google.wave.api.impl.OperationImpl", "waveId":
> "googlewave.com!w+qilt5TMWR", "type": "DOCUMENT_DELETE"}, {"blipId":
> "TBD_googlewave.com!conv+root_2", "index": 0, "waveletId":
> "googlewave.com!conv+root", "javaClass":
> "com.google.wave.api.impl.OperationImpl", "waveId": "googlewave.com!w
> +qilt5TMWR", "property": "New wave created: test wave\n", "type":
> "DOCUMENT_INSERT"}]}, "javaClass":
> "com.google.wave.api.impl.OperationMessageBundle", "version": "1"}
>
> And no any new data added to the wave.
> What's wrong with the code?
>
> On 3 фев, 19:47, kyprizel  wrote:
>
> > Thank you for your answer.
> > Should I store all the existing wave/wavelet data, then construct it
> > and add blip there? Or there is an easy way?
> > What happen if Wavelet info changes while I'll add it from my storage
> > to context?
>
> > On 3 фев, 11:06, Stephen Gigante  wrote:
>
> > > if you have the raw_data, use
> > >   context.AddWave(raw_data)
> > >   context.GetWaveById(waveid)
>
> > > You'll need to manually add any waves, wavelets, and blips that you need
> > > outside the original context before adding them.
>
> > > This is (for reasons I don't quite understand), also necessary whenever 
> > > you
> > > use context.builder, which will give it's results as raw data.)
>
> > > Hence my code looks like this:
> > >   d = context.builder.BlipCreateChild(blip.GetWaveId(), 
> > > blip.GetWaveletId(),
> > > blip.GetId())
> > >   context.AddBlip(d)
> > >   d = context.GetBlipById(d['blipId'])
>
> > >  - Stephen
>
> > > On Wed, Feb 3, 2010 at 10:27 AM, kyprizel  wrote:
> > > > Trying to store waves id and then add data to the wave after getting
> > > > notices from another wave:
>
> > > > old_wave = context.GetWaveById(wave_id=waveid)
> > > > old_wave always returns None, I think b/c context is based on another
> > > > wave.
> > > > how can i access another wave from the current context? or should i
> > > > use cron?
>
> > > > Thank you.
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "Google Wave API" group.
> > > > To post to this group, send email to google-wave-...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-wave-api+unsubscr...@googlegroups.com
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-wave-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.



[Google Wave APIs] Is there a way to scroll blip from a gadget

2010-02-21 Thread danilsomsikov
I'm making gadget with dynamic height content, which may be taller
than screen. Is there a way that I can scroll container blip to ensure
that certain part of content in my gadget is visible?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.



[Google Wave APIs] Do simple things with a robot...

2010-02-21 Thread ly
I wanted to add 3 features to the robot from the tutorial here:
http://code.google.com/apis/wave/extensions/robots/python-tutorial.html

Before adding all these features, my robot is working as intended.
Now the odd features still shows up (with "v2" at the bck of the blip
content), but neither of the new features shows up!
I tried different ways alr, still doesn't work. So frustrating...
Below is the code tt i think looks more logically.
Can someone tell me why none seems to work? Thanks...

Feature 1 -- wanted to try out AppendText
Feature 2 -- wanted the robot to detect a blip is submitted
Feature 3 -- wanted the robot to add a blip with the content of the
old blip deleted.

from waveapi import events
from waveapi import model
from waveapi import robot
def OnParticipantsChanged(properties, context):
  """Invoked when any participants have been added/removed."""
  added = properties['participantsAdded']
  for p in added:
Notify(context)
def OnRobotAdded(properties, context):
  """Invoked when the robot has been added."""
  root_wavelet = context.GetRootWavelet()
  """feature 1"""
  root_wavelet.CreateBlip().GetDocument().SetText("I'm alive!
v2").GetDocument().AppendText("xxx")

def Notify(context):
  root_wavelet = context.GetRootWavelet()
  root_wavelet.CreateBlip().GetDocument().SetText("Hi everybody! v2")

  """feature 2"""
def OnBlipSubmitted(properties, context):
  blip = context.GetBlipById(properties['blipId'])
  blip.GetDocument().AppendText("xxx")

  """feature 3"""
def OnBlipDeleted(properties, context):
  blip = context.GetBlipById(properties['blipId'])
  contents = blip.GetDocument().GetText()
  root_wavelet = context.GetRootWavelet()
  root_wavelet.CreateBlip().GetDocument().SetText(contents)
if __name__ == '__main__':
  myRobot = robot.Robot('appName',
  image_url='http://appName.appspot.com/icon.png',
  version='1',
  profile_url='http://appName.appspot.com/')
  myRobot.RegisterHandler(events.WAVELET_PARTICIPANTS_CHANGED,
OnParticipantsChanged)
  myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, OnRobotAdded)
  """myRobot.RegisterHandler(events.BLIP_SUMBITTED, OnBlipSubmitted)
  myRobot.RegisterHandler(events.BLIP_DELETED, OnBlipDeleted)"""
  myRobot.Run()

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.



[Google Wave APIs] Embed Javascript API with custom local server

2010-02-21 Thread Antoine H.
Hello, googlers !

First of all, congratulations for you incredible work that'll bring
the Mindernet one step closer to us. ^^

I've recently been trying to use waves in my website as holders for
user-generated comments (and stuff). I've been facing many challenges
doing so, and some still instill a great deal of doubt regarding their
feasability. Searches, doc and manual hadn't the truth in them (well,
they had different ones, more precisely), so I'm asking here and
crossing my fingers both for an answer and for that answer to be the
one I want ;)

As I needed my webapp to create at least one wave per object to be
commented on I figured I'd find some way creating a robot that'll ask
my webapp for waves pending creation, create the waves and report
their urls back. I have not done that entirely yet, but I think it
might be possible, if not pretty. That's not the subject, so whatever.

The next uncertain task was to grant public access to all waves, which
I at first thought could be done by adding the infamous
pub...@a.gwave.com. Can't. All robot-created waves (let's say
thousands of them) would show up out of context in the with:public
search on your magnificent web interface. And that is a problem, cause
flash-floods ain't the way of a true virtual gentleman. So I said
"what the hell, i'll host my own wave server !". It's kinda as easily
done than said, and that's rare ! Let me repeat it : good work ! I had
the server and the command-line client working in a matter of minutes,
I toyed around a bit with it, and then I tried to somehow get my waves
from my own cherished server into the browser. I thought many a
developer would have achieved that by now ; I then read that it wasn't
quite ready, but I also read this message (http://groups.google.com/
group/google-wave-api/browse_thread/thread/
ab058de47a22b014/9f1fbe8abaf631db?lnk=gst&q=cordys#9f1fbe8abaf631db).

I sounded like someone achieved to change the wavepanel origin and the
server name, and Pamela hinted she managed it too.
I spent quite some time trying to embed the waves of my localhost wave
server on a webpage, using the embed API. I tried many combinations
for the WavePanel() and LoadWave() parameters. Hair puller.

I'm running Karmic with XAMPP. Curiously, the wave server crashes (it
shows an error log but still run) each time I access it through http
(port 9090). Something about Java heap size being not enouh, and the
java -Xms32m -Xmx128m fix found (through google, is it necessary to
mention it ;) is not working. I do not know if this has anything to do
with the rest.

I don't know anymore if I'm running in circles or after un unreachable
carrot.

Therefore, I'm asking the big question : can I pull waves from a
custom local server into the web embed API ?
Can those waves be made public too ? (without them showing in the
with:public)

Thanks for your time and attention,

Antoine

-- 
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.