Rob
Rob

Reputation: 7216

How to Create an OpenFire Plugin

I'm very new to java and feel very confused. I'm trying to create a VERY basic plugin for the OpenFire server, but have no idea how to get started. I read the Developer Guide, but it doesn't explain how to set everything up in eclipse. Do you have any good tutorials on how to create plugins for other applications in java? Like, how do I import all the openfire classes for instance? I get errors for all these lines of code:

package org.jivesoftware.openfire.plugin; //error is: The declared package "org.jivesoftware.openfire.plugin" does not match the expected package ""

import org.jivesoftware.admin.AuthCheckFilter; //errors are: The import org.jivesoftware cannot be resolved
import org.jivesoftware.openfire.MessageRouter;
import org.jivesoftware.openfire.XMPPServer;

My background is in C# so the syntax all looks nearly identical, but I have no idea how to use eclipse or how java works for plugins (seems very different than DLLs).

Thank you so much!

Upvotes: 3

Views: 8462

Answers (3)

Ahmad Satiri
Ahmad Satiri

Reputation: 459

Hi you can follow my steps

  1. get openfire code
  2. within the source you'll get plugins folder, you should put your plugin there. follow openfire plugin structure. or just copy and modify one of the plugin for simplicity
  3. then you can follow this link to compile it . http://community.igniterealtime.org/docs/DOC-1200

Upvotes: 5

Rob
Rob

Reputation: 7216

Realized I needed to use Ant to compile as opposed to Eclipse, now everything is working without a hitch. Hopefully the plugin will be done in a few days =)

Upvotes: 0

Marc
Marc

Reputation: 586

From what you've written above, I would strongly suggest getting a better general understanding of Java first, before going straight in to develop an Openfire plugin.

The first line suggests a misunderstanding about packages. I would suggest looking at a tutorial such as Java Package Tutorial but essentially the package statement should match the folder structure you have where you have placed this source file.

The import errors suggest you don't understand the concept of the classpath. Google is your friend here but one source of information would be this

As I said, I really think you should get a handle on the basics of Java first, by writing simple and small programs, and then work your way up to an Openfire plugin - where you have to interact with 3rd party code.

Upvotes: 0

Related Questions