Hi Yuri,
Thank you for your email.
I tested a sample hello world robot in waveinabox and it worked.
I tried to use your TestRobot example
(https://github.com/vega113/TestRobot ). However, it is not working as
expected.
I used your code to create a new robot in http://waveaids2.appspot.com/.
The application seems to be deployed ok.
Then I register the robot in waveinabox.com/robot/register/create
<http://yourwavedomain.com/robot/register/create>, get the Consumer
Token and Consumer Token Secret then update it in TestRobot.java ,
redeploy the application.
public TestRobot() {
String consumerKey = "[email protected]";
String consumerSecret =
"tGC6thKkSlP1V-OstvOpbzWZYGsXc9gEkhnpaBXADGmOhpJG";
setupOAuth(consumerKey, consumerSecret, PREVIEW_RPC_URL);
setAllowUnsignedRequests(true);
}
Finally, I go to waveinabox.net, create a new wave and add waveaids3
there but it does not do anything, I suppose it should create a new wave
and include me in that wave right?
After walking around for a while, I create a new robot with new function
createNewWave:
public class TestRobot extends AbstractRobot {
private static final Logger LOG =
Logger.getLogger(TestRobot.class.getName());
public static final String PREVIEW_RPC_URL =
"http://gmodules.com/api/rpc";
public static final String PREVIEW_DOMAIN = "waveinabox.net";
@Override
protected String getRobotName() {
return "Test Wave robot";
}
@Override
protected String getRobotProfilePageUrl() {
return null;
}
public TestRobot() {
String consumerKey = "[email protected]";
String consumerSecret =
"pvuRqvGbN9RNPe6l-5j9CNh3VmU86jFaxucZ3Q0STG9wKtzk";
setupOAuth(consumerKey, consumerSecret, PREVIEW_RPC_URL);
setAllowUnsignedRequests(true);
LOG.warning("------------------- test robot is deploy OK
-----------------");
}
public String createNewWave(Set<String> emails){
Wavelet wavelet = newWave(PREVIEW_DOMAIN, emails);
wavelet.getRootBlip().append("welcome to google wave");
wavelet.setTitle("Test: new wave");
try {
submit(wavelet, PREVIEW_RPC_URL);
LOG.warning("create wave ok");
return "ok";
} catch (IOException e) {
LOG.warning("create wave failed");
return "fail";
}
}
}
Then create a servlet to call the robot to create new wave:
public class WaveCreation2Servlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("This a a wave servlet");
TestRobot robot = new TestRobot();
Set<String> emails = new HashSet<String>();
emails.add("[email protected]");
robot.createNewWave(emails);
}
}
But the function createNewWave does not work!
Do you know what is the problem? do I need to register my consumer in
http://gmodules.com/api/rpc?
BR,Lam
On 1/17/2012 10:00 PM, Yuri Z wrote:
Hello
Yuri is my real name.
Almost all information on the original Google Wave API at
http://code.google.com/apis/wave/extensions/robots/java-tutorial.html is
still relevant for WIAB as it supports the same API with little
differences. The robot forms are not supported yet, and the
onGadgetEvent is also not supported. The robot client API is now part
of WIAB, you should you this updated client instead of old Google Wave
clients. But everything else should work as previously with Google Wave.
For a sample robot that does authentication and creates Waves - take a
look at https://github.com/vega113/TestRobot
You can also take a look at
https://github.com/vega113/microbox/tree/master/src/com/wavylabs/microbox/dance to
learn how to perform OAuth authentication so robots can perform
actions on behalf of human users.
Good luck
On Tue, Jan 17, 2012 at 4:33 PM, Lam Le <[email protected]
<mailto:[email protected]>> wrote:
Hi Yuri,
Sorry I dont know if that is your real name.
I am kinda late starting to work with waves and it seems there is
not much help out there, I hope you can give me some hints.
My target is to create a robot for remotely creation of new waves
in our local WIAB.
However, I cannot find any java sample code for a robot which can
create new wave.
Can you help /give me a sample code please.
Can we still test the functionality of robots in google wave?
Thank you in advance.
BR,Lam
On 1/12/2012 10:26 PM, Yuri Z wrote:
Regarding persistence - the waves can only be saved into
files. Please
verify in the server.config file that you specified
delta_store_type = file
As for Robot API - WIAB supports about 90% of GWave
functionality. You can
register the robots at
yourwavedomain.com/robot/register/create
<http://yourwavedomain.com/robot/register/create> and then
use them pretty much in same way as in GWave. But you need to
add the robot
to wave by its registered name.
On Thu, Jan 12, 2012 <tel:2012> at 10:11 PM, Davide Carnovale<
[email protected]
<mailto:[email protected]>> wrote:
Lam,
there are no errors in your logs, so i can't tell what's
wrong with wiab.
as for persistance, you need to install the mongodb
server, launch it and
configure wiab to use it. for configuring wiab, open the
server.config file
and read though it, it's very simple, it's just a matter
of writing
"mongodb" on some parameter =)
as for the robot, the wave api is supposed to be abandoned
i think, not
sure about it... there's a series of videos on the
incubator page, one of
them talks about it, i suggest you to see it:
https://cwiki.apache.org/WAVE/wave-summit-talks.html (full
list, look for
"Wave API Future")
HTH
D
Il giorno 12 gennaio 2012 <tel:2012> 09:33, Lam
Le<[email protected] <mailto:[email protected]>> ha scritto:
Hi Davide,
Attached is the log file. Thanks in advance. Do you
know how can we set
up
the server to save mongodb database when the server
restarts? now i
always
lose everything after restarting the server.
And, I found this link for client API
http://code.google.com/p/wave-**robot-java-client/downloads/**list<
http://code.google.com/p/wave-robot-java-client/downloads/list>
but there is no such sample or any docs to start, the
google codes have
been deprecated.
My purpose is just to find a way to create a new wave
from my website.
How
can it be so hard?
BR,Lam
On 1/12/2012 1:28 AM, Davide Carnovale wrote:
Hi Lam,
I don't know about the robot, but if you post what
you see in the wiab
log
I might be able to help you with the turbulence
problem
D
Il giorno 11/gen/2012 <tel:2012> 16:57, "Lam
Le"<[email protected] <mailto:[email protected]>>
ha scritto:
Hi all,
I am having a little problem with Apache wave
and I am sending this
with
the hope that you can help me out.
I have already one existing robot in App
Engine. I use it to create new
wave through http.
Now as google wave is shutting down, I have
installed my own wave in a
box. How can I use my robot in app engine to
create new waves in my
WIAB?
Is there any API in java to create new wave?
After login to my WIAB I often have this warning
"A turbulence detected! Please save your last
changes to somewhere and
reload the wave"
Then I got offline status and can never do
anything else. WHat is the
problem?
--
Best regards,
Lam Le
--
Best regards,
Lam Le
--
Best regards,
Lam Le
--
Best regards,
Lam Le