powered by Jive Software

Plugin Problems

I am writing a plugin to allow users to be created, deleted, and updated programatically from a JSP application residing on a web server on the same machine as Jive Messenger.

I used the Presence plugin as a guide and have created a simple plugin which recieves requests via the plugin’'s servlet and then processes them.

My servlets init method looks like this.

private UserAdminPlugin plugin;

public void init(ServletConfig servletConfig) throws ServletException {

super.init(servletConfig);

plugin = (UserAdminPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(“userAdmin”);

}

Since the plugin manager can’'t find my userAdmin plugin, my plugin object is set to null.

The presence plugin uses the same logic, and fetches the plugin like this

plugin =

(PresencePlugin) XMPPServer.getInstance().getPluginManager().getPlugin(“presence”);

However there seems to be no place where I can map the string “userAdmin” to the UserAdminPlugin plugin. Presumably the folder name which contains the plugin in the plugins directory performs this function, but in my case it doesn’'t seem to work.

The servlet mapping works correctly so my plugin seems to be loaded OK.

So my question is how can I get the reference to my plugin from within my servlet?

(I suppose it is a bit unlikely, but if my application resides on the same server as Jive Messenger, is it possible just to call

XMPPServer.getInstance()

from within my app and bypass the need to create a special plugin? I read somewhere about only one instance of XMPPServer being created per JVM)

Thanks

justinhunt, whether view this thread(http://www.jivesoftware.org/community/thread.jspa?threadID=15620&start=0&tstart= 0[/u]),Ryan have a single web plugin for user registration,you can referenced it.(webregistration_10-OCT-05.zip)

-Tom

Tom

The web registration module, doesn’'t quite do what I require. But after looking over the web registration module source, it appears I could access the UserManager object directly from my web app without having to write a plugin. That is a much cleaner way of doing things, so I will try that. Thanks for the information

For the record though, if someone knows the answer to the question I posed, it would be nice to get an answer.

OK I solved it.

You can’'t have Upper case letters in your plugin name. I changed the name of the jar file to useradmin.jar and loaded it with

XMPPServer.getInstance().getPluginManager().getPlugin(“useradmin”)

Then it worked fine. I would post the source and jar file here but there doesn’'t seem to be a way to?

justinhunt:

you maybe send info to Matt ,he can get your a attatch file function in forum.or you also send email to me after i will post it in here.

–Tom

justinhunt:

i already received your email.now post it in here.this is goods user register servlet and document very very similar jive format document:) hopeful everybody fond it.

-tom
useradminplugin.zip (23057 Bytes)

Hi Justin/Tom,

The case issue with the plugins has already been fixed in the 2.3.0 branch of Messenger, you can see the change url=http://www.jivesoftware.org/fisheye/changelog/svn-org?cs=1755here[/url].

Hope that helps,

Ryan