Free Plugins

Hay all !

I am writed four plugin of jive-messenger, i think free the source code to jive softwareware.

ShareGroupManagerServlet

RosterManagerServlet

UserManagerServlet

VCardManagerServlet

Can I get those plugins?

Where can I download them?

Thx.

Hey,zhuam ,

you can attach your plugin in here or send it to Matt,he can release it in JM.

-tom

Hay comm !

Free roster management plugin source code in the tomorrow.

Any idea when the ShareGroupManagerServlet might be available?

Thanks.

Hey Caleb !

This is ShareGroupServlet plugin of wildfire , i am not able to free source code ,because of i am current not testing . sorry !

-zhuam

any update on the ShareGroupServlet ?

I actually wrote my own plugin for managing groups for use in our custom user registration page.

It has the ability to add a user to a specific group:

http://example.com:9090/plugins/groupAdmin/admin?type=add&username=foo@bar.com&g roup=Group_19090/plugins/groupAdmin/admin?type=add&username=foo@bar.com&group=Group_1

/code

And the ability to remove a user from all the groups they belong to:

http://example.com:9090/plugins/userAdmin/admin?type=remove&username=foo@bar.com9090/plugins/userAdmin/admin?type=remove&username=foo@bar.com

/code

If you are interested, I could post a link to it.

shared groups?

Is there any other type of groups on Wildfire?

silly jerm

i was thinking as opposed to just roster additions, though that’'d be silly as we already have that

i’'m quite interested… thanks

I’'m not sure how to attach files to this forum, does anybody else know?

But I can post the code now:

package org.jivesoftware.wildfire.plugin;

import org.jivesoftware.wildfire.container.Plugin;

import org.jivesoftware.wildfire.container.PluginManager;

import org.jivesoftware.wildfire.group.Group;

import org.jivesoftware.wildfire.group.GroupManager;

import org.jivesoftware.wildfire.group.GroupNotFoundException;

import org.jivesoftware.util.Log;

import org.xmpp.packet.JID;

import java.io.File;

/**

  • Plugin that includes a servlet that adds a user to a group or removes a user from all the

  • groups they belong to.

*/

public class GroupAdminPlugin implements Plugin {

private String message;

public void initializePlugin(PluginManager manager, File pluginDirectory) {

}

public void destroyPlugin() {

}

/**

  • Try and add a user to a group, if the group does not exist, log an error.

*/

public String addUserToGroup(String userName, String groupName) {

try {

JID jid = new JID(userName);

GroupManager groupManager = GroupManager.getInstance();

Group group = groupManager.getGroup(groupName);

group.getMembers().add(jid);

Log.debug("Added user: " + userName + " to group: " + groupName);

message = “User: " userName " was not found.”;

}

return message;

}

/**

  • Try and remove a user from all the groups they belong to.

*/

public String removeUserFromGroup(String userName) {

JID jid = new JID(userName);

GroupManager groupManager = GroupManager.getInstance();

for (Group group : groupManager.getGroups()) {

group.getMembers().remove(jid);

Log.debug("Removed user: " + userName + " from group: " + group);

message = “”;

}

return message;

}

}

/code

package org.jivesoftware.wildfire.plugin.groupAdmin;

import org.jivesoftware.wildfire.XMPPServer;

import org.jivesoftware.wildfire.plugin.GroupAdminPlugin;

import org.jivesoftware.admin.AuthCheckFilter;

import javax.servlet.ServletConfig;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import java.io.IOException;

import java.io.PrintWriter;

public class GroupAdminServlet extends HttpServlet {

private GroupAdminPlugin plugin;

public void init(ServletConfig servletConfig) throws ServletException {

super.init(servletConfig);

plugin = (GroupAdminPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(“groupadmin”);

AuthCheckFilter.addExclude(“groupAdmin/admin”);

}

public void destroy() {

super.destroy();

AuthCheckFilter.removeExclude(“groupAdmin/admin”);

}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

String type = request.getParameter(“type”);

String userName = request.getParameter(“username”);

String groupName = request.getParameter(“group”);

PrintWriter out = response.getWriter();

try {

if (“add”.equals(type)) {

String message = plugin.addUserToGroup(userName, groupName);

returnMessage(message,response, out);

}

else if (“remove”.equals(type)) {

String message = plugin.removeUserFromGroup(userName);

returnMessage(message,response, out);

}

else {

errorMessage(“The groupAdmin servlet received and invalid request of: " + type +”.",response, out);

}

}

catch (IllegalArgumentException e) {

errorMessage(“Illegal argument error.”,response, out);

}

catch (Exception e) {

errorMessage(“Exception error.”,response, out);

}

}

private void returnMessage(String message,HttpServletResponse response, PrintWriter out){

response.setContentType(“text/xml”);

out.println(message);

out.flush();

}

private void errorMessage(String message,HttpServletResponse response, PrintWriter out){

response.setContentType(“text/xml”);

out.println("");

out.flush();

}

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

doGet(request, response);

}

}

/code

when someone leys you know how, can you post the jar/source tree?

I’'ll post the jar.