Tuesday May 06, 2008

Tips for creating a GlassFish Admin Console Plugin

If you're at JavaOne 2008 you've probably already heard about the "Plug into GlassFish v3 Contest".  I'm going to give a few hints here to help get you started.

First, attend the "Plugin into GlassFish with JavaServer Faces and jMaki" lab.  Unfortunately this lab is difficult to get into, but don't worry!  If you are unable to attend the lab on Wednesday night from 6:30PM - 8:30PM, you can visit booth #175 and ask for a copy of the lab.  You can then do the lab exercises on your own time.  Or, if you attend another Hands-on Lab during JavaOne 2008, you can find the GlassFish plugin lab on the DVD (lab #4520).

Ok, now that you've worked on the lab, let me point out a few important things you need to know to be successful.

  1. Come up with a great idea.  In order to win the contest, you will need to have interesting content that appeals to GlassFish users and developers.  Plugins which add-on to GlassFish or highlight existing GlassFish features are also more likely to be picked.
  2. Be aware of your "plugin id."  The plugin id is specified in your "console-config.xml" file.  The value of the "id" attribute on the "console-config" element specifies your "plugin id".  This same value shows up in all urls to pages, images, CSS, and JavaScript.  If you include an aboslute path, you will need to know this value.  For example if your plugin id is "jeopardy," you might have something like this:

    <img src="#{request.contextPath}/resource/jeopardy/glassfish.gif" />

    So obviously your plugin id must be unique.  So make sure you change this value if you're copying code from the plugin lab.

  3. Load your resources from a jar file.  The plugin you create will be an OSGi bundle, which is a jar file.  This means a normal request for a resource (JavaScript, images, etc.) will fail.  However, simply adding "/resource" after your context path will solve this.  See the url in the image tag above for an example.
  4. Adding new Java code is broken.  We have not yet fixed some issues related to finding new Java code added via your OSGi plugin jar file.  To get around this, you must place your new code inside a jar and put the jar in the "<install-root>/lib/install/applications/__admingui/WEB-INF/lib" directory.

If you get stuck, get help.  You can post a question on this blog, email admin@glassfish.dev.java.net, or visit the GlassFish Pod #175.  We'll be happy to help get you unstuck.

For those of you not at JavaOne, you won't be able to participate in this contest, however, this may be a good way to contribute to GlassFish.  By contributing to GlassFish you may qualify for the GlassFish Awards Program.  Check the GAP program rules for details and earn your share of the $175,000.

Good luck!

About

paulsen

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today