Primefaces – calling java method from javascript

If you want to call a java method from javascript you can do it with:

 

Openfire Bot / Listener Plugin Tutorial

If you want to create an openfire plugin which is listening for some packets / messages and should react based on message content e.g. Bot. Then you are right here. In my example plugin I want to listen for a message which contains packet extensions and parse the data from XML.

The message looks like:

And the Openfire Plugin code to log the data looks like this:

You can also download the whole plugin here: bot plugin

REST API Plugin for Openfire

In the meantime, I developed a new plugin for Openfire named „REST API“.
It combines all available plugins, which manage openfire over REST/HTTP, to provide consistent API.
REST API is made up of User Serivce and MUC Service plugins. Additionally the REST API provides some more features outside of named plugins. See the feature list:

  • Get overview over all or specific user and to create, update or delete a user
  • Get overview over all or specific group and to create, update or delete a group
  • Get overview over all user roster entries and to add, update or delete a roster entry
  • Add user to a group and remove a user from a group
  • Lockout, unlock or kick the user (enable / disable)
  • Get overview over all or specific system properties and to create, update or delete system property
  • Get overview over all or specific chat room and to create, update or delete a chat room
  • Get overview over all or specific user sessions
  • Send broadcast message to all online users

Link to the REST API documentation:
https://www.igniterealtime.org/projects/openfire/plugins/restapi/readme.html

Link to the plugins download site:
https://www.igniterealtime.org/projects/openfire/plugins.jsp

Primefaces command button execution order (p:commandButton)

  1. User clicks button
  2. onclick is fired
  3. Ajax request is prepared based on process
  4. onstart is fired
  5. Ajax request is sent
  6. actionListener is fired
  7. action is fired
  8. Ajax response is prepared based on update
  9. Ajax response is returned
  10. if HTTP response status is 200, onsuccess is fired
  11. if HTTP response status is 500, onerror is fired
  12. update is performed based on ajax response
  13. oncomplete is fired