Dynamic Creation of Groups & Notification

Hi all,

Using the Wildfire API, I’'m currently trying to programmatically create some users and group them into several groups, at the server-side.

The creation of users and groups are okay, as I checked it with the Wildfire Admin Web Page.

Now, at the client-side, I would also like for the Wildfire client (Spark) of each user,

to be ‘‘notified’’ about the (newly created) groups they belong to.

My question is: what are the mechanisms to use if I want to dynamically

notify the shared groups in users’’ rosters after their creation?

So far, I have experienced the following:

  • when user1 is added into group A , its roster doesn’'t display the group A

  • when user2 and user3 are added to group A, their roster are instantly updated and show group A.

  • when I re-add or re-log in user1, its roster is updated.

So simply adding members to groups seems not to be sufficient to update each member rosters.

To perform dynamical notification of group members, Do I have to manage some kinds of ‘‘wildfire events’’ (dispatchEvent()?,…),

or maybe change some of the group properties (group.getProperties().put(…))?;…) or ???

Any idea?

Cheers,

Hey HC,

Which Wildfire version are you using? I would recommend using the latest one that was released today.

By using Group#getMembers()#add(aUser) things should work fine. That code will trigger an event that will be caught by RosterManager#memberAdded(Group, Map) that in turn will update rosters and push roster to connected clients. Note that this logic will occur only if the group is configured as a shared group.

Hope that helps.

Regards,

– Gato

Hi Gato,

Thank you for these infos.

I was in fact, exactly using Group#getMembers()#add(aUser)[/i] while sharing the group.

I’'m currently running wildfire 2.5.1 as webapp, and will install and do some other tests using the latest version asap, hoping that the rosters update will work .

Regards,

Hervé