Although searching the API group gave some hint on what to do, it didn't show all the steps.
The robots I'm developing are using the Java API and I found the following the easiest method to add a profile image and name.
First of all you need to create a ProfileServlet. This extends the ProfileServlet class and is fairly well documented in the API.
Example code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package testbot; | |
import com.google.wave.api.ProfileServlet; | |
@SuppressWarnings("serial") | |
public class TestbotProfileServlet extends ProfileServlet{ | |
//Avatar | |
@Override | |
public String getRobotAvatarUrl() { | |
return "PathToImage.jpg"; | |
} | |
//Name | |
@Override | |
public String getRobotName() { | |
return "Robot Name"; | |
} | |
//URL | |
@Override | |
public String getRobotProfilePageUrl() { | |
return "http://robotpage.com/"; | |
} | |
} |
The final part (which is the part that held me up the most as I couldn't really find it mentioned anywhere) is to update the web.xml file to include the new servlet and to map the servlet.
The following code needs to be added to the web.xml file, replacing testbot.TestbotProfileServlet with your package name/ path to servlet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>profile</servlet-name> | |
<servlet-class>testbot.TestbotProfileServlet</servlet-class> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>profile</servlet-name> | |
<url-pattern>/_wave/robot/profile</url-pattern> | |
</servlet-mapping> |
After that, you can publish your robot to the appengine and it should now have a profile image and name. If your contact list doesn't update, you may wish to try removing and re-adding the robot as a contact.