Hi Dave,
Thanks for the help… I realize something’s null. I was hoping to get the data back that I had sent in the past. I’m gonna give it another try today, and take notes here in case they help anyone help me.
I’ve verified in the openfire admin interface that I have Private Data enabled set to true.
So First, I save the data I’m interested in… when the user chooses a different avatar to represent themselves I create my payload which looks like:
public class AChosenAvatar implements IPrivatePayload
{
private var kAvatarName:String;
private var kAvatarURL:String;
public function get avatarName():String {
return kAvatarName;
}
public function set avatarName(name:String):void {
kAvatarName = name;
}
…
I use the following to send this payload to Openfire:
var key:String = “chosenAvatarFor” + kLocalJID.bareJid.node;
var payload:data.AChosenAvatar = new data.AChosenAvatar();
payload.avatarName = avatarSelector.selectedItem.name;
payload.avatarURL = avatarSelector.selectedItem.avatarURL;
SparkManager.privateDataManager.setPrivateData(key, “projectname”, payload);
And I don’t get any errors there…
How do I verify that the data made it to Openfire? Is there a place to browse this in the admin interface?
I can see in the source that the data is stored using the namespace and a username… how does it know
what username to use?
Next, I try to get the data out…
SparkManager.privateDataManager.getPrivateData(key, “projectname”, new Callback(this, retrievedChosenAvatar, false));
and then in retrievedChosenAvatar I have:
protected function retrievedChosenAvatar(isMe:Boolean, chosenAvatarsIq:XMPPStanza):void {
var privateData:PrivateDataExtension = chosenAvatarsIq.getAllExtensionsByNS(“jabber:iq:private”)[0];
if (null == privateData.payload) {
return;
}
var av:data.AChosenAvatar = data.AChosenAvatar(privateData.payload);
if (null == av) {
return;
}
Unfortunately, the privateData.payload always returns null.
The stanza shows the embedded excetpion from the server side is:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
I see this in the errorCode field of the stanza… and most other fields are null.
I’m following SparkWeb and how it handles its Chat Room Bookmarks to get this far…
If all of this looks right, then the next question is: How can I set up a debugging session for openfire running on the remote server?
Thanks!
-Jim