Jump to content
Changes to the Jaspersoft community edition download ×

Include plugins made with Eclipse


2005 IR Help

Recommended Posts

By: Dudu - eduasturias2003

Include plugins made with Eclipse

2005-03-08 04:25

Hello,

 

I would know if it's posible to include plugins made with Eclipse, and in that case, how to do it.

 

I had read the iReport manual where explains how to make plugin, but are all XML-made, and I want to know how implement a .jar plugin.

 

Thanks in advance.

 

 

 

 

By: C-Box - c-box

RE: Include plugins made with Eclipse

2005-03-08 04:36

Very simple...

 

you just have to name the startClass in your pluginXML (look at the other xml-files in the plugin directory) that implements the iReportPlugin (like: public class C-BoxDBPlugin extends it.businesslogic.ireport.plugin.IReportPlugin)

 

then put your JAR that contains the whole plugin (including the startclass) either to the LIB-Dir of IReport or add the path manually to the iReport class-path variable.

 

afterwards you have your own plugin within the iReport menubar.

 

hth

C-Box

 

 

 

 

By: Dudu - eduasturias2003

RE: Include plugins made with Eclipse

2005-03-09 03:36

 

I've done the next:

 

1 - I've created a very simple plugin in Eclipse with this code:

 

(AzulPlugin.java)

-----------------

 

package Azul;

 

import it.businesslogic.ireport.plugin.IReportPlugin;

 

/**

* The main plugin class to be used in the desktop.

*/

public class AzulPlugin extends it.businesslogic.ireport.plugin.IReportPlugin {

//The shared instance.

 

/**

* The constructor.

*/

public AzulPlugin() {

}

 

public void call(){

javax.swing.JOptionPane.showMessageDialog(this.getMainFrame(),"Mensaje de prueba

 

azul");

}

}

 

In "Plug-in Dependencies" I added to the existing .jar, the file "iReport.jar" of my iReport

 

directory, to make the import ans extend "it.businesslogic.ireport.plugin.IReportPlugin". Then I

 

use the "Export wizard" to create a "Azul.jar" file. Next step, I copy "Azul.jar" to my iReport

 

"lib" directory, and in the directory "plugins" I create "Azul.xml" with this code:

 

<iReportPlugin

name="Azul"

class="Azul.AzulPlugin"

loadOnStartup="false"

hide = "false"

configurable = "false">

 

<IconFile>/it/businesslogic/ireport/icons/menu/new.gif</IconFile>

 

<Description>Plugin de ejemplo.</Description>

 

</iReportPlugin>

 

 

 

When I try to run the plugin in iReport, doesn't works...and I'm not sure why: Am I calling worng the "class" in the xmnl file? It's worng the declaration of the file .java?

 

Thanks in advance, and specials thanks to C-Box for his previous response.

 

 

 

 

By: C-Box - c-box

RE: Include plugins made with Eclipse

2005-03-09 04:10

Well, sounds okay so far... the "configure" method is missing perhaps... but I guess you just didn't post it.

 

So here the first lines of my "call" method:

 

it.businesslogic.ireport.gui.MainFrame iReportMainFrame = it.businesslogic.ireport.gui.MainFrame.getMainInstance();

 

if (iReportMainFrame == null) {

JOptionPane.showMessageDialog(null, "Kein IReport Gefunden! nPlugin funktioniert aber nur mit laufender IReport-Instanz!", "Fehler", JOptionPane.ERROR_MESSAGE, null);

return;

}

....// otherwise start my plugin functions ......

 

 

So perhaps call your MessageDialog not with "this.getMainFrame" but with "null" or with the code:

 

it.businesslogic.ireport.gui.MainFrame.getMainInstance()

 

Otherwise send me your ".java" and I will test it here.

(I don't work with Eclipse, so perhaps the JAR is not working)

 

hth

C-Box

 

 

 

 

By: Dudu - eduasturias2003

RE: Include plugins made with Eclipse

2005-03-10 00:10

I had included a "configure" method (I missed to create it), used your lines in the "call" method, but the result i'ts the same...I agree with you that the problem may be in the .JAR creation, so I ll try to investigate about how to create JAR's in Eclipse and the try it again.

 

Thank you very much C-Box...by the way, wich program do you use to create plugins?

 

 

 

 

By: C-Box - c-box

RE: Include plugins made with Eclipse

2005-03-10 00:23

I'm using JBuilder2005.

 

I think you could also put your class-files into a dir and add that dir to the classpath in iReport's startup-bat... so the plugin needn't be within a JAR-file. (at least I think so)

 

hth

C-Box

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...