A kind of smorgasbord, this plugin includes several simple examples designed to show how plugins and macros work.
The samples here include:
An macro that displays the name of the user currently logged in.
To test: Create a wiki document, add to the document, then publish the document.
A "Hello World" tab in the admin console.
To test: Display the admin console, then click the Hello World tab. You'll get a new "Hello World" page.
An "Example Test" menu in the user bar.
To test: Display the Clearspace UI, click the Example Test menu, then click the Example command. You'll get a new page displaying results from actions included in this plugin.
An "Example Plugin" link in the community Actions box.
To test: Display the Clearspace UI, navigate to a sub-community, then click the link. You'll get a new page displaying results from actions included in this plugin.
An "EchoService" web service that returns text submitted to it.
To test: Write a web service client that calls the echo operation with some string. The service returns that string, prepended with the name of the user who sent it.
ExamplePlugin.java
HelloWorldAction.java
IncludedPageAction.java
SimpleAction.java
AuthorsNameMacro.java
EchoService.java
examples.css
example.ftl
helloword.ftl
included-page.ftl
The Ant build.xml file at the root of the plugin includes a build.plugins target you can use to compile the code and package it into a JAR file. There's also a deploy.plugins target that copies the JAR into the <jiveHome>/plugins directory that accompanies your Clearspace distribution. Paths into your test Clearspace distribution assume that this plugin project is in the standalone Clearspace distribution at: <root>/plugins/plugins/helloworld. Be sure to update the targets if you're testing another way, such as with the Clearspace WAR distribution.
Be sure to read the notes below about dependencies. The JAR files you'll need are included as part of Clearspace.
If you'd rather deploy the plugin manually, you can do that in one of two ways:
Just copy the plugin JAR file into the <jiveHome>/plugins directory. Your running Clearspace instance will deploy it automatically.
Open the admin console and navigate to System > Settings > Plugins, then browse for your plugin JAR file.
In addition to requiring Java 1.5, this code requires a few of the libraries you'll find in the WEB-INF/lib directory of your Clearspace installation, listed below.
clearspace-<version>.jar
webwork.jar
xwork.jar
rife-continuations.jar
xfire-jsr181.jar
Hi Andrew,
I have downloaded the plugin and am reading the source. I have one question. In the plugin.xml we have the jspa extension for helloworld url and no extension for the other two URLs. So when do we need to add an extension and when should we not?
hmm.. Perhaps the 1.4 versions was uploaded instead, I will look at getting the 1.3 version up. In the mean time you can download 1.4 beta here: http://dev.jivesoftware.com/downloads/index.jsp
The final version of 1.4 will be out at the end of next week.
Andrew,
I understand you have the plugin_i18n.properties in your plugin. That works great. But if I have 2 plugins with the plugin_i18n.propertites each containing the properties for that plugin, only one is getting loaded. The other one is not.I tried putting that file in a package and that does not get loaded either.
The admin component DOES add a new tab to the admin panel, but I do not see any of the submenus appearing (ie. the 2nd level menus, and items on the left do NOT appear). I would like to have several submenus - how can I get this?
thanks,
james
In order to get this working for my version of Jive SBS (3.0.3) I had to make the following changes:
I think this was all I had to change.
Hi Andrew,
Look like this is 1.4.0 only? The Macro.java file is not included in the 1.3.0 distribution and it seems to be required to compile this plugin.
Cheers!