Writing Java class for Extension

How do I write a new Java class for a Java Extension?
Also is it possible to create a new class from Workbench ODE?

thanks a lot
Manvinder

Manvinder,

Percussion CM extensions are normal Java classes. You do have to implement specific interfaces for each type of extension. See the Technical Reference for the details about which interfaces to implement for each extension type.

The Percussion Workbench itself is not designed to be a code development environment, but it is built on Eclipse, and you can plug it into an Eclipse installation. For details, in Installing Rhythmyx (Version 6.6 link), see “Workbench Options”, p. 62.

RLJII

OK…What I did was:

a). I did a fresh install of eclipse 3.1.
b). Then Downloaded the WST zip file.
c). Unzipped the WST zip file, and these 2 workbench files:
RhythmyxWorkbench.zip
RhythmyxWorkbenchHelp.zip

d). Unzipped All 3 zip files in the eclipse folder.
e). Then I started the eclipse.

But I donot see the Rhythmyx perspective in the eclipse IDE. Not sure, which step I am missing. Please Help!!

thanks
manvinder

Ignore this post

Well…what I did was that I pulled out all the files from features folder of eclipse under the Rhytmyx installation, and copied them to features folder for the Eclipse Installation. I did the same thing for plugin folder.

Now, when I start my eclipse then I see the Rhytmyx perspective. First of all, is this ok or there can be any potential issues to it.

My next question is how do I setup the project to build a new java extension to work with percussion.

Are there any document to tell on how to setup Percussion extension project in eclipse?

manvinder

I’ve already answered much of this in the other thread.

You set up your Eclipse for normal Java development. You do NOT need the Rhythmyx perspective for extension development. In fact, most of us run with 2 Eclipse instances: a “Workbench” and a Java Eclipse. In theory you can combine them, but there’s no real advantage to doing so.

You need to copy the jars from the /AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/lib folder that were listed in the thread I sent you. These JARs must be added to the classpath.

You need to build ordinary classes that implement the IPSJexlExpression interface (and optionally extend PSJexlUtilBase). This is all covered in the API recommendations document.

There is no official documentation.

Dave

After we write a Java class for the Extension I believe we need to manually go and update Extensions.xml. There is no Ant Target or utility that can automatically updates the Extensions.xml in the project folder.

Is this correct? I wanted to make sure that I am not missing anything.

thanks
Manvinder

If you look at the PSOToolkit, you will see that it contains an Extensions.xml and a Deploy.xml. The Deploy.xml is the Ant script that (amongst other things) registers the extensions defined in Extensions.xml against the server.

What I usually do is the follow:

  1. Register the extension using the workbench. (This is in the system view)

  2. Go to the Extensions.xml on the server, and copy the Extension definition nodes

  3. Open the Extensions.xml in my Java Project and paste the Extension definition.

This approach works best if you are going to deploy the same code to many servers (as in the PSOToolkit). If you only have one or 2 servers to update, then you can register the extension in the Workbench.

Dave

Yes…that sounds definitely a good approach instead of manually typing in the Extensions in the xml file.

However, in the Rhythmxy server, I did a search on Extensions.xml. It yielded a bunch of Extensions.xml in various folders. Can you pl. give the patch on server to the Extensions.xml that you recommend to go to grab the configurations.

manvinder

Sorry for the typo…I meant path to the Extensions.xml

The Extensions.xml that is actually used is in

/Rhythymx/Extensions/Handlers/Java/n

where n is the highest number (starts at 1 for a clean installation, and goes up from there).

thanks a ton Dave

Yes…I was able to grab the extensions…but if I was to write a bunch of Extension classes, then I would need to register them individually to the Workbench in order to grab the Extensions.xml. Is this true? Or is there any way we can register all extensions in a batch from the Workbench.

There are 2 ways to register extensions:

  1. Manually in the workbench

  2. with the ExtensionInstallTool, which requires an XML file. We usually run this from Apache Ant.

The purpose of you registering the extension in the workbench and then copying and pasting the XML entries is so you can use method #2 when you deploy your extension to a new server. Look at the deploy.xml that comes with the PSOToolkit for an example of this.

In 6.7, it might be simpler to use the packaging tool, unless you already have the infrastructure for deploying with Ant.