Your quote plugin is valuable for me.I also want to write spark plugin.But I am very newer about plugin.Can you help me about steps of making plugin for spark.Alought I used Sparkplug kit,it is not ok.Let me know how do you make quote plugin.Thank in advance.
I make a plugin to appear button.At my spark,I made two class ‘Utf8PropertyResourceBundle.java and Utf8ResourceBundle.java’ to use my language at Spark.To appear my plugin button’s text,I make ‘Resoruce.java’ like your ‘QuoteResource.java’.When I run my plugin from command prompt,I get errors at Resource.java.
Thank a lot for your help.I don’t have errors with your instructions.I also have two properties files.But my plugin work for test_i18n.properties(for english language).Don’t work for test_i18n_mm.properties(for my language).Alought change spark’s IM language,my plugin’s text appear from test_i18n.properties.Don’t appear from test_i18n_mm.properties.Where will I wrong?Pls help me again.Thank in advance.
This files will work only with i18n tags for example for Russian it will be test_i18n_ru_Ru.properties or est_i18n_ru.properties. If such file didn’t find, java will use default file test_i18n.properties
The problem that I am facing is that I am trying to build a simple plugin like the ones presented in the tutorial but I when I put the jar file of my plugin in in Spark’s plugins directory I cannot see it. I am using Eclipse to program the plugins and is there a way to try/debug the plugin that I am developing without putting the jar file in the Spark plugins directory, till I am sure that it has no bugs.
Also, in the initial steps of the tutorial where I am specified to do the following:
It is required that you use the 1.4 JRE to build Spark.
Add all *.jar files in the Sparkplugs/spark/lib and Sparkplugs/spark/lib/windows directories to your classpath.
Add the resource directory (Sparkplugins/spark/resource) to your classpath for the native libraries.
Main Class - org.jivesoftware.Spark
VM Parameters - -Dplugin=path_to_your_plugin.xml file. This allows you to run your plugins within your IDE without deploying.
That’s it.
the resources directory has to be put as you did in your Plugin?
If you have sources of spark. You could compile
it for plugins development using
** ant development **
command.
Then you will have a platform where you could debug
and work with your newly created plugins.
you will see target/sparkplugs directory. And then you could follow steps you have seen into spark_plugs document.
First of all thanks for your reply I really appreciate it.
What I have done so far are the following steps:
It is required that you use the 1.4 JRE to build Spark.
Add all *.jar files in the Sparkplugs/spark/lib and Sparkplugs/spark/lib/windows directories to your classpath.
Add the resource directory (Sparkplugins/spark/resource) to your classpath for the native libraries.
Main Class - org.jivesoftware.Spark
VM Parameters - -Dplugin=path_to_your_plugin.xml file. This allows you to run your plugins within your IDE without deploying.
That’s it.
I am not sure on the third option when I am asked to add the resource directory to my classpath. I added this to my project like I added the jar files that I found from the Sparkplugs/spark/lib and Sparkplugs/spark/lib/windows, is that correct?
I did not understand where I have to perform the ‘ant development’ command but in Eclipse I managed to add a new External Tools configuration so that when I want to package my project as a jar file I perform an Ant build by just press the Run -> External Tools -> Build All Plugins (this is the configuration that I added). And the project is being packaged correctly but when I input it into the plugins folder of Spark IM I am not being able to view my plugin. I have tried to log in and out several times but still I cannot see it.
(where I replaced the JTabbedPane with SparkTabbedPane as it is in the examples.jar) and when I run it it gives me Null Pointer Exception.
Thus what I am asking is do you think that I am doing something wrong from what I told you, and will I be able to run my programs in Eclipse and check if they work before I try my plugin in Spark - since I am not being able to view the myplugin.jar that I enter.
Sorry for the long email and I appreciate your help. myplugin.jar (7912373 Bytes)
Thanks for your contact I sent you mine via a private message.
I tried to follow the how-to-build.txt but I did not understand the last step. But how I am still using the ANT script now to build my plugin into a jar file where the jar file is then placed in the builder folder.
The exception is as follows:
Exception in thread “main” java.lang.NullPointerException
at org.jivesoftware.spark.ui.status.StatusBar.(StatusBar.java:98)
at org.jivesoftware.spark.Workspace.(Workspace.java:166)
at org.jivesoftware.spark.Workspace.getInstance(Workspace.java:109)
at org.jivesoftware.spark.SparkManager.getWorkspace(SparkManager.java:213)
at org.jivesoftware.spark.ExamplePlugin.addTabToSpark(ExamplePlugin.java:87)
at org.jivesoftware.spark.ExamplePlugin.initialize(ExamplePlugin.java:50)
at org.jivesoftware.spark.SparkMain.main(SparkMain.java:11)
In my last message I uploaded a copy of how the plugin jar file is being packaged.