Sunday, February 07, 2010

Cowley - A Hudson plugin for RTC (v.1.0.0) - Part 2 - IBM, meet Maven

Introduction
In my previous post, I introduced version 1.0.0 of Cowley, a Hudson plugin for IBM's Rational Team Concert (RTC) SCM system. I'd love for the plugin to be a simple one-click install like many others in the ecosystem, but unfortunately it currently relies on the RTC Build System Toolkit which is freely available, but isn't in any public Maven repositories. This means, in order to simply use the plugin, or to build it from source, you need to do a little Maven / Ant / Jar magic. This post in the series will tell you how.

Note: This post is specifically geared towards getting the required pieces of the Build Toolkit into a Maven-usable state. However, there is nothing here which couldn't be taken and reused in many other circumstances.

Pre-Requisites
I'm assuming for the rest of the instructions that you have Java 1.6 and Maven 2.x installed. If not, why not? Get to it!

Obtaining the RTC Build System Toolkit
Job 1 is to get the Jazz RTC Build System Toolkit. You can download it from jazz.net (Windows) (Linux) (registration required).

NOTE: The rest of the instructions are based on the Windows version of the toolkit. I guess, as its all Java based, it's really similar. Post comments on this blog if there is additional info I need to add here.

Once you have the Build System Toolkit downloaded, unzip it somewhere temporary.

The Maven / Ant / Jar Magic
Next you need to get all the jars which come with the IBM Toolkit, wrap them up as a single jar, and add it to Maven for quick access and reuse. To do this, you'll need the following maven pom.xml. Cut and paste it into a file for use.

Now if you create a directory, put this new pom.xml file into it, edit the property "rtc.build.toolkit.plugins.dir" property and run the "mvn install" command. This will get the maven plugins and dependencies required, create your uber-jar, and "install" (i.e. copy) it into your local maven repository.

Congratulations!
You now have the required elements of the RTC Build Toolkit installed in maven, ready to either be added direct to your Hudson install to enable your Cowley plugin, or so you can compile my RTC Proxy API from source.

Either way, look out for the later posts in this series to find out how to obtain and use the Cowley Plugin without looking at any more code, as well as the gory details of the plugin development (if you're feeling sadistic).

Saturday, January 23, 2010

OpenOffice 3.1.1 in a Java 6 Applet

There is a tantalising set of documents on the OpenOffice.org wiki about how you can use the officebean.jar which comes with all OpenOffice installations to display documents in an applet. The problem is, its out of date, and the link to the source is dead. But don't let that stop you...

Note
These are instructions for Windows XP / Java 6 / OpenOffice 3.1.1. I'm sure they can be adapted for other operating systems / platforms.

Pre-Requisites
The Code
Firstly I created a new Java Class Library project in Netbeans called OOoApplet. To this I added a single class which I called "OOoBeanViewer.java". I then (lazily) went looking for the example code. I found it on Koders.com here. I cut and pasted this into my OOoBeanViewer.java stub in Netbeans.

The Dependencies
In order for this to compile and run I had to add the following dependencies:
  • C:\Program Files\OpenOffice.org 3\Basis\program\classes\officebean.jar
  • C:\Program Files\OpenOffice.org 3\Basis\program\classes\unoil.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\ridl.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\jurt.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\juh.jar
The Environment
Because Open Office doesn't really run in the applet (rather we start it, and then redirect its display to the applet) we need so set things up so that the OOoBean knows where to look. This wa the hardest part as the assumption in the docs I could find was that this demo should just work. It didn't for me.

To get it to work I needed to add a Windows environment variable called UNO_PATH and set its value to be the path to the program directory of your OpenOffice install. I set mine to: "C:\Program Files\OpenOffice.org 3\program"

To get this to stick I then had to reboot. A check "echo %UNO_PATH%" at the command line showed that this had worked.

Running It
All that was left was to compile and run. This was done simply using Netbeans. The result is a mostly empty Applet window with some buttons down the side. Fear not! You need to create a new document to see what you desire. This is what you get if you select "New Document ... > Text Document":

Wednesday, December 23, 2009

Cowley - A Hudson plugin for Rational Team Concert (v.1.0.0) - Part 1 - It's Alive!

Version 1.0.0...
Over the past 9 months I've been working on my first Hudson plugin - a plugin to allow me to build my code stored in my Rational Team Concert (RTC) Source Code Management (SCM) system, all the while keeping the RTC server up to date with the builds which were running. Because RTC likes to keep up to date with CI builds, this latter piece is where the complications lie, especially because once a build is "done" I wanted some nice integration such as pushing the results back (artefacts, logs, links to the Hudson build result etc.)

Well, finally I've reached version 1.0.0. I've only put it through testing in my dev and project's CI environment but this has been enough to get it stable for us. I therefore thought this would be a good stage to let others see what I'd produced, and perhaps even get some free testing and input to boot.

Unfortunately, It's Not That Simple...
Ideally I want to be able to have the plugin available with the Hudson distro, and I've been having discussions on the Hudson newsgroups concerning this.

However, due to the fact that Cowley depends entirely on libraries in the RTC Build System Toolkit provided by IBM, the contents of which are not currently not available in any public Maven 2.0 repository, building and packaging are not so simple, and because they're not available under an open source licence. (They are however free to download from the jazz.net site.)

Bundling them as a binary plug is also currently not an option (though I'm pursuing this with IBM at the moment) as to obtain the libraries a prospective user needs to accept the IBM RTC EULA before downloading them.

So where does this leave us? Sadly, you need to get all the Cowley plugin itself and the IBM Build System Toolkit bits and package them up yourself. The hope is that this will change (especially as the REST API for RTC begins to come online from version RTC v.3.0 onwards) but until then, please accept my apologies.

So how do you do this? Well, jump to "part 2" of this series to find out.

Tuesday, November 24, 2009

Hacking Oracle SOA Suite (11.1.1) builds to work with Ivy and Artifactory

As discussed in a few previous posts, I’m on a mission to get my project’s SOA Suite builds to work without having to rely on a local installation of JDeveloper 11g with the added SOA Extension.

I’ve continued to make progress (with the help of Mayur – thanks) and we’ve now got compilation, packaging, deployment, and Unit Testing to work. We’ve still to tidy up our scripts so that they’re ready for publishing for public consumption, but in the meantime, I thought I’d put out some snippets which will help the enthusiastic to get to where we have.

Getting your Jar dependencies into Artifactory

My aim was to depend on Maven (and JFrog Artifactory) for our dependencies as much as possible. Where we could use publicly available Jars from the standard repositories we did. Sadly this turned out to be very infrequent. It did mean however that there was another reason to download and install Artifactory. This was very simple. We downloaded the Standalone version and ran it using the embedded Jetty. The only thing I needed to change from the default settings was to set a proxy (we’re behind a firewall.)

I then had to manually add all the Oracle dependencies which I had identified to ext-releases-local (Artifactory’s default Local repository for third party libraries). I had logged in as an Admin, and using the “Deploy” tab added them one at a time.

When I’d finished, it looked like this (apologies for the crappy screen grabs):

artifactory-structure-1 

artifactory-structure-2

artifactory-structure-6 artifactory-structure-3

artifactory-structure-4

 artifactory-structure-5

NOTE: It might be nice to bundle all these up as an artifacts bundle. I’ve not had the time to do this yet.

This meant we were now ready to link Ivy up to all of this.

Connecting Ivy and Artifactory

Next we had to tell Ivy to use either its local cache, or Artifactory, for all its dependency lookups. To do this, I created a new ivysettings.xml file with the following content:

<ivysettings>
    <settings defaultResolver="chain" />
    <resolvers>
        <chain name="chain" returnFirst="true">
            <filesystem name="local">
                <ivy pattern="C:/Documents and Settings/aharmel/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </filesystem>
            <url name="shared">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
            <url name="public">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
        </chain>
    </resolvers>
</ivysettings>

This meant that when an ivy:resolve target was called, the local Ivy cache would be looked up first, and if that was not successful, then artifactory would be checked for both shared and public lookups. This meant that we would cache those dependencies which were available publicly in Maven, speeding up the second, and all subsequent lookups.

Using Ivy to get the dependencies in the Ant files

Penultimately (is that a word? I doubt it), we created an ivy.xml file containing all our dependencies and different configurations:

<ivy-module version="2.0">
    <info organisation="example" module="example-dummy" />

    <configurations>
        <conf name="base" description="Jars required at both compile and runtime" />
        <conf name="taskdefs" description="Jars required for Ant Taskdefs" />
        <conf name="compile" description="Jars required at compile / package time" />
        <conf name="deploy" description="Jars required at deploy time" />
        <conf name="test" description="Jars required at test time" />
    </configurations>

    <dependencies>
        <dependency org="oracle/soa/bpel" name="orabpel" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-validator" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-thirdparty" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/fabric" name="fabric-runtime" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/mgmt" name="soa-infra-mgmt" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="soa-infra-tools" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="testfwk-xbeans" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/xdk" name="xmlparserv2" rev="11.1.0" conf="compile->default" />
        <dependency org="commons-logging" name="commons-logging" rev="1.0.4" conf="compile->default" />
        <dependency org="commons-digester" name="commons-digester" rev="1.7" conf="compile->default" />
        <dependency org="commons-beanutils" name="commons-beanutils" rev="1.6" conf="compile->default" />
        <dependency org="commons-collections" name="commons-collections" rev="3.2.1" conf="compile->default" />
        <!--dependency org="commons-cli" name="commons-cli" rev="1.1" conf="compile,deploy->default" /-->
        <dependency org="oracle/commonj-sdo" name="commonj-sdo" rev="2.1.0" conf="compile->default" /> <!-- This is a hack as the Oracle JDeveloper one is different from the one in M2 repositories -->
        <dependency org="oracle/logging-utils" name="oracle.logging-utils" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/dms" name="dms" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/webservices" name="orawsdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/mds" name="mdsrt" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/jmx" name="jmxframework" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-share-base" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-logging-handler" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/odl" name="ojdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/http-client" name="oracle-httpclient" rev="11.1.1" conf="compile,deploy->default" />
        <dependency org="oracle/wsm/common" name="wsm-policy-core" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/classloader" name="oracle-classloader" rev="11.1.1" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-apache-commons-lang" rev="2.1.0" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-xml-xmlbeans" rev="2.2.0.0" conf="compile->default" />
    </dependencies>
</ivy-module>

NOTE: I haven’t managed to get Ivy to load configurations for the taskdefs yet (see below). I’ll update this post when I get it to work

NOTE: Only the configurations for compile/package and deploy are included in this. It’s pretty easy to add the declarations for the other paths you need to set. I’ll repost this once it’s complete.

The final step was to add Ivy support to the out-of-the-box ant files.  To do this we;

  1. Added the ivy.jar to our ant/lib directory
  2. Added the Ivy namespace to the ant file: 
  3. <project xmlns:ivy="antlib:org.apache.ivy.ant"
             name="ant-scac"
             default="scac">

  4. Removed the elements setting all classpaths (e.g. scac.tasks.class.path in ant-scac-compile.xml)
  5. Added a new path declaration just for the taskdefs. E.g.: 
  6. <!-- Set the Path we need for the Ant Taskdefs -->
        <property name="oracle.ant.taskdef.path" refid="oracle.ant.taskdef.path"/>
        <path id="oracle.ant.taskdef.path">
            <fileset dir="${applications.home}/lib">
                <include name="fabric-runtime.jar"/>
                <include name="soa-infra-mgmt.jar"/>
                <include name="soa-infra-tools.jar"/>
            </fileset>
        </path>

  7. Updated the taskdef declaration elements to use this new path. E.g:  <taskdef name="scac" classname="oracle.soa.scac.scac" classpath="${oracle.ant.taskdef.path}" />
  8. Added a new “init” task which sets the path we removed earlier (e.g. scac.tasks.class.path in ant-scac-compile.xml):
  9. <target name="init" description="Sets up the compilation classpath">
            <ivy:resolve />
            <ivy:cachepath conf="compile" pathid="scac.tasks.class.path" />
            <property name="scac.tasks.class.path" refid="scac.tasks.class.path"/>
        </target>

  10. Updated the targets to have a dependency on “init”. E.g.:
  11. <target name="scac" description="Compile and validate a composite" depends="init">
            <scac input="${scac.input}"
                  outXml="${scac.output}"
                  error="${scac.error}"
                  appHome="${compositeDir}"
                  failonerror="true"
                  displayLevel="${scac.displayLevel}">
            </scac>
        </target>

And that’s it. Unfortunately there’s not a zip file you can download with a few bat/sh files to run, but maybe I’ll get there one day. In the meantime, this should help you to get where we have.

Wednesday, November 18, 2009

The Goods Delivered – SOA Suite “ant-sca-compile.xml” File Simplified (Plus Ivy Dependency Management)

As promised in my last post, I’ve been continuing to work on getting Oracle SOA Suite (11g) projects to build outside the JDeveloper IDE.  I’ve spent some time getting the ant-sca-compile.xml file to work first and thought I’d share the results.

I’ve rushed a little to publish this so there are still a few things you’ll have to do manually if you want this to work for you, but it does work. Trust me.  If I get a chance, I’ll keep blogging things as I progress and hopefully you’ll have to do less and less work if you want to do the same as us.

What I have now comes in three parts:

1. A simplified ant-sca-compile.xml file

<?xml version="1.0" encoding="iso-8859-1"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant"
         name="ant-scac"
         default="scac">

    <!-- Set all the Properties we need -->
    <property file="build.properties"/>
    <!--propertycopy name="proj.revision" from="${project}.revision"/-->
    <property name="oracle.home" value="${applications.home}/lib"/> <!-- Monkey patch to remove need for full JDeveloper install -->
    <property name="config.dir" value="C:/oracle/Middleware/jdeveloper/integration/seed/soa/configuration/" />  
    <property name="compositeDir" value="${applications.home}/${compositeName}" />
    <property name="scac.input" value="${compositeDir}/composite.xml"/>
    <condition property="scac.displayLevel" value="3">
        <not>
            <isset property="scac.displayLevel"/>
        </not>
    </condition>
    <condition property="scac.overwrite" value="true">
        <not>
            <isset property="scac.overwrite"/>
        </not>
    </condition>
    <condition property="scac.error" value="${tmp.output.dir}/${compositeName}.error">
        <not>
            <isset property="scac.error"/>
        </not>
    </condition>
    <condition property="scac.output" value="${tmp.output.dir}/${compositeName}.xml" >
        <not>
            <isset property="scac.output"/>
        </not>
    </condition>
    <condition property="scac.sar" value="${tmp.output.dir}/${compositeName}.sar" > 
        <not>
            <isset property="scac.sar"/>
        </not>
    </condition>
    <condition property="scac.plan" value="${tmp.output.dir}/${compositeName}.plan" >
        <not>
            <isset property="scac.plan"/>
        </not>
    </condition>

    <!-- Set the Path we need for the Ant Taskdefs -->
    <property name="oracle.ant.taskdef.path" refid="oracle.ant.taskdef.path"/>
    <path id="oracle.ant.taskdef.path">
        <fileset dir="${applications.home}/lib">
            <include name="fabric-runtime.jar"/>
            <include name="soa-infra-mgmt.jar"/>
            <include name="soa-infra-tools.jar"/>
        </fileset>
    </path>

    <!-- Oracle SOA Suite Project Compilation Targets -->
    <target name="generateplanfromsar" description="Generate soa config plan from a soa archive">
        <ivy:resolve />
        <generateplan sar="${scac.sar}"
                      planfile="${scac.plan}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>

    <target name="generateplan" description="Generate soa config plan from a composite">
        <ivy:resolve />
        <generateplan composite="${scac.input}"
                      planfile="${scac.plan}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>
    <target name="attachplan" description="Attach a soa config plan to a soa archive">
        <ivy:resolve />
        <attachplan planfile="${scac.plan}"
                    sar="${scac.sar}"
                    verbose="true"
                    overwrite="${scac.overwrite}"/>
    </target>

    <target name="extractplan" description="Extract a soa config plan from a soa archive">
        <ivy:resolve />
        <extractplan planfile="${scac.plan}"
                     sar="${scac.sar}"
                     verbose="true"
                     overwrite="${scac.overwrite}"/>
    </target>

    <target name="validateplanfromsar" description="Validate a soa config plan for a soa archive">
        <ivy:resolve />
        <validateplan sar="${scac.sar}"
                      planfile="${scac.plan}"
                      reportfile="${scac.output}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>

    <target name="validateplan" description="Validate a soa config plan for a composite">
        <ivy:resolve />
        <validateplan composite="${scac.input}"
                      planfile="${scac.plan}"
                      reportfile="${scac.output}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>
    <target name="scac" description="Compile and validate a composite" depends="init">
        <property name="scac.tasks.class.path" refid="scac.tasks.class.path"/>
        <scac input="${scac.input}"
              outXml="${scac.output}"
              error="${scac.error}"
              appHome="${compositeDir}"
              failonerror="true"
              displayLevel="${scac.displayLevel}">
        </scac>
    </target>

    <target name="init" description="Sets up the compilation classpath">
        <property name="ivy.local.default.root" value="C:/Documents and Settings/aharmel/.m2/repository" />
        <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        <ivy:resolve />
        <ivy:cachepath conf="compile" pathid="scac.tasks.class.path" />
    </target>

    <!-- taskdefs mapping script Ant targets to Oracle Ant implementataion classes -->
    <taskdef name="scac" classname="oracle.soa.scac.scac" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="attachplan" classname="oracle.soa.deployplan.task.attachPlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="extractplan" classname="oracle.soa.deployplan.task.extractPlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="generateplan" classname="oracle.soa.deployplan.task.generatePlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="validateplan" classname="oracle.soa.deployplan.task.reportPlan" classpath="${oracle.ant.taskdef.path}" />
</project>

NOTE: I haven’t yet figured out how to get Ivy to manage the three dependencies for the  Oracle Ant Tasks themselves. I’ll update later once I have time to fix this.  Until then you also need to copy the three required jars into a new “lib” directory in your Composite Project

NOTE: The Monkey patch requires that you create a new “lib” directory in your Composite Project and add “./soa/modules/oracle.soa.bpel_11.1.1/orabpel.jar” to it. You’ll find this in your JDeveloper install

2. Dependencies managed in a new ivy.xml file

<ivy-module version="2.0">
    <info organisation="copfs" module="cmrs-dummy" />

    <configurations>
        <conf name="base" description="JARs required at both compile and runtime" />
        <conf name="taskdefs" description="JARs required for Ant Taskdefs" />
        <conf name="compile" description="JARs required at compile time" />
        <conf name="runtime" description="JARs required at runtime" />
    </configurations>

    <dependencies>
        <dependency org="oracle.soa.bpel" name="orabpel" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-validator" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-thirdparty" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.fabric" name="fabric-runtime" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.mgmt" name="soa-infra-mgmt" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.fabric" name="soa-infra-tools" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.fabric" name="testfwk-xbeans" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.xdk" name="xmlparserv2" rev="11.1.0" conf="compile->default" />
        <dependency org="commons-logging" name="commons-logging" rev="1.0.4" conf="compile->default" />
        <dependency org="commons-digester" name="commons-digester" rev="1.7" conf="compile->default" />
        <dependency org="oracle.commonj-sdo" name="commonj-sdo" rev="2.1.0" conf="compile->default" /> <!-- This is a hack as the Oracle JDeveloper one is different from the one in M2 repositories -->
        <dependency org="oracle.logging-utils" name="oracle.logging-utils" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.dms" name="dms" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.webservices" name="orawsdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.mds" name="mdsrt" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.jmx" name="jmxframework" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.adf.share" name="adf-share-base" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.adf.share" name="adf-logging-handler" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.odl" name="ojdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.http-client" name="oracle-httpclient" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.wsm.common" name="wsm-policy-core" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.classloader" name="oracle-classloader" rev="11.1.1" conf="compile->default" />
        <dependency org="com.bea.core" name="com-bea-core-apache-commons-lang" rev="2.1.0" conf="compile->default" />
        <dependency org="com.bea.core" name="com-bea-core-xml-xmlbeans" rev="2.2.0.0" conf="compile->default" />
    </dependencies>
</ivy-module>

NOTE: These are only the dependencies for the “scac” target. More may be required for the other targets.

NOTE: I used a local maven 2 repository as my Ivy repository. I had to import the JARs which came with JDeveloper into this in the structure indicated by the “dependency” entries.  The aim was to keep things structured nicely, add version info to JARs which lacked this.

NOTE: I tried to reuse standard external JARs from the various M2 repositories where possible. In the case of the com-bea-core libraries and oracle.commonj-sdo library this was not possible.  It seems for example that the latter has an additional package added to it (“helper”) even though the version number and name of this JAR is the same as you find on the web.

3. A Pared-down build-properties file

# temp
tmp.output.dir=c:/

# Project
applications.home=C:/Jazz/MyWorkspace-16-09-2009/WpfAutoDeployTestApp/TestApplication/
compositeName=GetEmployeeName
revision=1.0

deployment.plan.environment=dev

# dev deployment server weblogic
bea.home=C:/oracle/Middleware
dev.serverURL=
http://10.23.7.66:8001
dev.overwrite=true
dev.user=weblogic
dev.password=welcome1
dev.forceDefault=true

# acceptance deployment server weblogic
# acc.serverURL=
http://10.23.7.66:8001
# acc.overwrite=true
# acc.user=weblogic
# acc.password=welcome1
# acc.forceDefault=true

NOTE: See, the #global properties are gone. Nice eh?

NOTE: You’ll need to set the applications.home yourself as applicable. Not the nicest I know, but I’m moving fast here…

NOTE: I’ve hacked things so I need to provide the compositeName. This is not how it worked out of the box, and you could fix it to get this from your [App Name].properties file

Tuesday, November 17, 2009

Monkey-Patching Oracle SOA Suite 11g Ant Files to Build Without JDeveloper

I hate having to have more than the bare minimum installed on my build boxes. We’re using SOA Suite 11g and JDeveloper on our current project and much to my annoyance it seemed as if I’d have to install the Oracle IDE on all my build boxes in order to run the Ant scripts which it can generate. I didn’t like the idea of that, so I did some hacking and monkey patched them.

The Problem

I started at the beginning - with ant-sca-compile.xml and build.xml from JDeveloper.  Using these I could run Ant targets such as “scac” which meant my composite was compiled and verified.  The problem was, I needed to tell Ant where JDeveloper was installed. This in turn hid a mass of dependencies. 

I don’t like unmanaged dependencies. I like to know what goes into the various steps of my build.

The Solution

The first task was to move all the dependencies out of the JDeveloper install and into a project-local location. I created a “lib” directory in my Composite project for this purpose.  I then worked my way down through all the dependencies listed in “FileSet” elements in path “scac.tasks.class.path” in ant-sca-compile.xml  and copied them to ./lib.

Now I had to surgically extract all the references from ant-sca-compile.xml to the JDeveloper install.  I tackled all references to “oracle.home” first as I found this particularly galling. I created a new property called “applications.home” and set it to be the directory where ant-sca-compile.xml lived. I then worked down the definition of “scac.tasks.class.path” and changed all references from “${oracle.home}/…” to “${applications.home}/lib”, removing the additional directories as I went. (i.e. I ended up with “include name=”orabpel.jar””, etc.)

Every time I moved a large chunk of references I ran my built with Ant to check I’d not broken anything.  (Slowly, slowly, catchee monkee…)

Once I’d done this, I did the same for all the other elements in this path declaration. With this done, I then simplified things by removing all the checking of properties from the top of the file.

Now I was able to focus on the actual taskdef I was interested in: “scac”.  Firstly, I again simplified by removing the property checking. this left me with a single line; a call to the Oracle Ant task “scac”.

One by one, I took each of the parameters, and set them manually to extricate them from the mass of JDeveloper Ant complexity.  This involved:

  • creating my own version of scac.input – myscac.input which I set to point at the location of my composite.xml file
  • setting compositeName to the name of my SOA Suite Composite project (“GetEmployeeName” in my case)
  • setting compositeDir to the path to my SOA Suite Composite project
  • replacing scac.output with tmp.output.dir (pointing at “./”) combined with ${compositeName}.xml
  • replacing scac.error with tmp.output.dir combined with ${compositeName}.error
  • replacing scac.application.home with ${compositeDir}
  • setting displayLevel manually to be “3” (the maximum)

I was almost there. It all worked. All I needed to do was remove the now redundant properties.

The Real Problem

This is where the monkey patching came in. I realised as I removed the now redundant properties that something, somewhere still needed to be told what oracle.home was.  I guess this is buried deep in the Oracle Ant tasks themselves. I tried to take a look but a decompiler was no help. (I guess they’re obfuscated.)

The Real Solution

But I didn’t want to give up (and here comes the monkey patch.)  To find out what actually was in oracle.home (effectively the JDeveloper install which was needed for a successful build and validation I took a copy of all the files, pointed oracle.home at this copy, and then piece by piece removed bits until I had the barest minimum needed for the target to run. The end result?  All you needed was orabpel.jar. The thing was, it needed to be in a directory like this: ${oracle.home}/soa/modules/oracle.soa.bpel_11.1.1

Problem solved! All then had to do was create this directory structure in my project’s ./lib directory, copy orabpel.jar into it, and then set ${oracle.home} to point to ${applications.home}/lib and we were up and running.

Where Now?

Next step is to get all the other SOA Suite Ant scripts (ant-scac-package.xml, ant-scac-upgrade.xml, ant-scac-dploy.xml and ant-scac-test.xml) to work without being umbillically attached to a JDeveloper install.

After that I’m going to use some Ivy and put all these dependencies (with some meaningful jar names including version numbers) into a Maven repository.

Finally I hope to wrap up the Ant targets themselves as Maven 2.x plugins.  It’d be really nice if Oracle put all these dependencies in the Maven repositories already, but knowing how long it’s taken/taking Sun, and how non-open to the idea IBM are I’m not holding my breath.  I guess this means there will need to be a little setup script which you’ll need to run against JDeveloper to get all the bits you need in a Local Maven repo.

Expect more blog posts as I progress.  There will also (hopefully) be some Ant source once I tidy things up.

Wednesday, November 11, 2009

RSA 7.5.4 and RTC 2.0.0.1 – Getting them to play nice too

Following on from my last post, we’re unfortunately unable to have everyone on a single tools. Our architects and BA’s, who are going to use Rational Software Architect for UML modelling also need access to Rational Team Concert. I had a genius plan that I could install RSA on top of SpringSource Tool Suite or vice versa. No joy I’m afraid. I did however manage to install RTC 2.0.0.1 on top of RSA 7.5.4.  I managed it as follows:

Firstly I obtained RSA 7.5.4 (all 100 gigs of it…).  Then I copied all the zips to my desktop and unzipped them all. NOTE: if you have them unzipped but running from a CD they won’t work. (That’s a free tip for you).

Then I started the IBM Installer. The first thing it did was want to update itself from 1.3.1 to 1.3.2 (i.e. the IBM Installer, not RSA.) I let it go off and do its thing. (You might need to go to the “Help” menu item and set your proxy info if you’re behind a firewall at this point).

Once the Installer had updated it let me install RSA 7.5.4 itself. I made sure the RTC 1.0 client was installed. (I don’t know if this made a difference to the later upgrade to 2.0.0.1, but it’s worth having if you want to follow these steps exactly.)

After the RSA install was finished I was ready to lay my RTC 2.0.0.1 install over it. For this I needed to download the RTC Client Installer (NOT the zip). E.g.:

https://jazz.net/downloads/rational-team-concert/releases/2.0.0.1/RTC-Eclipse-Client-2.0.0.1-Win32-Local.zip

Once this was downloaded, I unzipped it and started the Installation Manager it contained. I ran through the installation steps, accepting all the defaults until it gave me the chance to either install a new Eclipse Platform (default but wrong) or on top of an existing one (non-default but right). We selected this option and added the path to the RSA eclipse.exe as requested (C:\Program Files\IBM\SDP\eclipse.exe is the default).

I then let the rest of the install proceed as normal.

Once it was completed I started up RSA and switched to the newly added “Work Items” perspective and connected to our RTC 2.0.0.1 server.

It worked!

STS and RTC – Getting them to Play Nice

We’re developing our new app using Spring 3.0 RC1 and we want the best tools available. We’ve picked the following:

  • SpringSource Tools Suite 2.2.1 (includes Maven 2.x)
  • IBM Rational Team Concert Client 2.0.0.1
  • Oracle Enterprise Pack for Eclipse 1.3.0
  • Emma Plugin 1.4.3
  • Findbugs Plugin 1.3.9
  • PMD Plugin 3.2.6
  • Checkstyle Plugin 5.0.3
  • JDepend Plugin 1.2.1

We want everything to work as seamlessly as possible. This involved getting everything to run on STS.

First we downloaded STS from SpringSource.  Once this was installed (all the defaults selected) we ran the updater to get it up to version 2.2.1 (Help > Check for Updates). We installed all the bits on offer.

Next we installed our code quality tools. In each case we added the Eclipse Update Site for the plugins in question:

Help > Install New Software > Add…

And in each case, we added the plugins (versions at the top of this post.)  I restarted after each plugin install, just to be on the safe side.

Next we added the Oracle Enterprise Pack so we’d have support for Weblogic which is our deployment platform.  Just as before we added the Eclipse Update Site:

Help > Install New Software > Add…

Now for the fiddly bit.  We needed to frig things a little to get the RTC 2.0.0.1 elements working on an Eclipse 3.5 (galileo) platform.  Please note, this is utterly and shamefully based on the fine set of info on Jazz.net:

https://jazz.net/wiki/bin/view/Main/InstallRTC20IntoEclipse35

Firstly we needed to download the RTC 2.0.0.1 Client zip (NOT the Installer) from Jazz.net:

https://jazz.net/downloads/rational-team-concert/releases/2.0.0.1/RTC-Client-2.0.0.1-Win.zip

Once this was downloaded, we unzipped it to a location of our choice. (Desktop is good.)

Next we installed the necessary pre-reqs into STS so the RTC plugins would work.  We again went to Help > Install New Software …

First we installed EMF and DTP. We selected the Galileo site in the  “work with:” drop down

  • To install EMF, we expanded the Modeling category and selected EMF - Eclipse Modeling Framework SDK and the _ XSD - XML Schema Definition SDK_ entries
  • To install DTP, we selected the Database Development category
  • We then followed the wizard through to install these features and then restart

Next up was GEF. We selected the Galileo site again:

  • This time we unchecked the “Group items by category” option at the bottom of the wizard
  • And then typed “GEF” in the filter text area.
  • Then we selected the Graphical Editing Framework GEF SDK entry
  • And finally followed the wizard through to install GEF and then restart

Now we were finally ready to install RTC.

  • Firstly we closed STS
  • Then we simply copied the folders contained in our  downloaded and unzipped jazz/client/eclipse/jazz folder (e.g. build, scm, reports, etc.) to the our eclipse/dropins folder of our STS installation
  • Then we restarted STS. The “Wotrk Items” perspective was now available, and we could connect to our Jazz Project areas.

Easy.

Saturday, March 07, 2009

Tuesday, March 03, 2009

Java Posse Roundup '09 - The Conference is Personal Again

I've just attended day 0 of the Java Posse Roundup '09. I'd been told Open Spaces conferences felt like no other, but you need to experience it to really understand why. Here's a taster:
  • We all (or at least a lot of us) met up at Camp 4 Coffee. We filled the place to overflowing. The town know's something's up with all the geeks milling around
  • We got taken through a variety of Scala by Dick (Wall), Bill (Venners), Joel (Neely) and Diane (Marsh). When you got lost you could ask (this happened quite a lot with me). Then we worked on reverse engineering LINQ with Scala. We all contributed
  • We hacked on JavaFX to build a cool lightning talk app led by Joe (Nuxoll) as the designer and Tor as the lead developer
  • We had an introduction to Fan from Fred (Simon) who is a contributor
  • We had supper round at Bruce (Eckel)'s. He's laid up with a broken leg, so we cooked for him, grilling beside a massive snow bank, and chatting about cultural differences between the US and Europe. Then I chatted to James (Ward) and we have a mutual aquaintance (Steve Webster, the architect and originator of the Cairngorm framework for FLEX)
  • We finished up with a series of summary lightning talks from all the groups on what we'd done during the day
  • We adjourned to our house, and met another attendee on the way, chatted, and listened to the Coyotes out in the woods
All in all, it just feels different. I still had the tired, brain-full feeling you get from Java ONE, but that was combined with the feeling that you're participating and building relationships which will help you get even more out of events to come (and beyond). I still haven't got involved in any projects yet, but I aim to change that today. Bill (Venners) is looking for input on the tests for ScalaTest and it looks as good a time as any to try and get to grips with that. Fred (Simon) is also making noises about a Netbeans plugin for Fan. That might be interesting too. We'll see how much I manage to pack in...

Anyway, off to Camp 4 and day 1...

Friday, February 27, 2009

Managing Parallel Development Streams With Shared Codebases in Jazz SCM


We're in the situation where we have a common codebase (i.e. a shared set of Jazz components) which is being worked on by more than one development team, each of whom have different release dates. It is possible to set up Jazz to work for this situation, but it confused me at first. Here's how we managed it.



Create a "Next Release" Stream (for Integration and Releasing)
Firstly you need to create a "Next Release" Stream. No development happens on this stream, but it does contain all the components which all the other developments will be working on. It is purely for other streams to deliver into, and acceot changes from, and where releases are made. When a release is made, a new stream is created, named after the release, and any bug fixes made in that stream are flowed back into "Next Release".

Create the "Project Xxxxx" Streams as Required
For each development team (tasked with a certain package of work - called "Change Requests" in out project) create a new Stream containing the Components from the "Next Release" Stream as required. Name them after the Project and make the flow target the "Next Release" stream. Add build engines for each new Stream, each with their own workspace. We have two - one which compiles the code and runs just the unit tests and another which also deploys and runs the integration tests. The former is automatic on each check in. The other is scheduled to run at intervals.

Usage
Set up Jazz with seperate teams for each project. These in turn should have seperate dev lines and Iterations and Iteration Plans. Developers then create workspaces as required.

Development proceeds as normal, with developers delivering changes to their project's stream no a regular basis (twice a day is good) and accepting changes which are incoming. In addition, the team which is scheduled to release first periodically deliver their changes into the "Next Release" Stream (once a week? the volatility of the codebase and amount of shared components with other projects will dictate the frequency). The other teams then flow these changes into their workspaces, merging as required. They do not yet flow their changes into the "Next Release" Stream.

When the time comes, the release is made from the "Next Release" Stream. As mentioned before, a new Stream is created and populated with the new release's Components. Bugs subsequently found in this release are fixed in this Stream and flowed back into the "Next Release" Stream also.

What if Both Projects Release Simultaneously?
If both projects deliver simultaneously, then both teams should merge into the "Next Release" Stream as the periodic merge intervals, and accept the resulting changes which come from other projects. This should be done one project at a time to ensure that there is always a working set of functionality for the Next Release.

Tuesday, December 02, 2008

Moving and Renaming in Jazz SCM

My current project has begun by us inheriting an old code base which we need to support.  We want to take this, re-structure it (literally move the contained code projects around and rename the directories which contain them), add build scripts and other meta information.  We don't want to change the inherited source or config data at all.

Ideally we want all this to be tracked, so that if, in the future, we want to know if we have changed something from what we inherited, we can do a simple "compare" between two snapshots and see what had happened in the interim.

It turns out Jazz SCM provides some really nice move and rename support to give us just what we need.  Rather than just doing deletes and adds (like Subversion) it actually knows what you've done.   It also seems to work moving things across components.

This has meant we can create a new workspace (called, for example, "inherited codebase") and within it create a component to house the codebase, and then additional ones which break down your code as desired (e.g. one per ecplise project).  We then added the code to the "inherited codebase" comopnent, checked in, snapshotted, and then started our reorganisation.

Jazz SCM - ideal for our purposes! (Thanks to Andy McGoldrick for the tip off)

Wednesday, November 26, 2008

Adding a Bespoke Work Item in Jazz Team Server

UPDATE: I've had a chat with IBM about some of the areas in this post. I've cleaned this up as a result.

I've been using IBM's Jazz Team Server 1.0.1 recently. Most of my time has been setting it up for a new project where the client wants to use the Work Item Functionality to log incidents. We're using the Scrum process configuration and the default Work Items which come with this did not meet their requirements - not that is without us ending up removing functionality from the "Task" and "Bug" Work Items which we wanted to also use internally for development.

Consequently, it was necessary to create a new Work Item: "Incident". This would allow us to specify the fields, presetation and workflow for the three sub-types of incident we needed, without altering anything else which came out of the box which we would need elsewhere.

Now, there is already some existing documentation on how to create a new Work Item,with associated presentation and workflow but after following this, I have realised some subtleties which I will highlight.

The Work Item and Enumerations
Firstly, you should create your enumerations. To aviod namespace clashes, try and use the same conventions as IBM (prefixing ID's with "com.mycompany.team.workitem." is generally how this is done, but not universally). In my case I created four new enumerations:

com.mycompany.team.workitem.enumeration.incidentPriority
com.mycompany.team.workitem.enumeration.incidentImpact
com.mycompany.team.workitem.enumeration.incidentEnvironment
com.mycompany.team.workitem.enumeration.incidentSource

Then I created the new Work Item Type Category:

com.mycompany.team.workitem.workItemType.incident

Next I added the types of incident which could occur:

ID: incident-failure-defect, Name: Failure - Defect
ID: incident-failure-bug, Name: Failure - Bug
ID: incident-service-request , Name: Service Request

Then, making sure the editor was showing my new type, I added the four enumerations as Custom Attributes.

ID: incidentPriority-n, Name: Priority-n
ID: incidentImpact-n, Name: Impact-n
ID: incidentEnvironment-n, Name: Environment-n
ID: indicentSource-n, Name: Source-n

Why the Italics? Why the Funny Names?
RTC does not allow you to remove attributes once you've created them, even if you got it wrong. This is because you might have created the custom attribute, then created work items using it, and then subsequently made a change. To preserve these old work items, you cannot create another custom attribute with the same ID. This means you need to make sure you get things right.

If you do make a mistake, just bite the bullet, all is not lost. Remove the incorrectly added custom attribute and then add it again in the right place. Make sure that you use a distinct ID (I got into the habit of appending a "-#" on the end) and do the same to it's Name. This will allow you to distinguish between the multiple choices when adding it to a presentation. Once you have added it, you will see the slightly offputting Name with "-#" appended. To remove this, go back to the custom attribute, and edit it to remove this. All will then be well.

NOTE: IBM are aware of this pecadillo and in release 2.0 they will display the Name and the ID in the drop downs. Cool.

Creating the Presentation Elements and Binding to the Work Items
Now you are ready to add the presentation. I tended to take a "Test A Lot" approach to this, just to make sure I wasn't getting myself messed up. In my case I followed the default editor very closely, with the same tabs end presentations, save for a different "Details" section in the Overview Tab.

Firstly I created the presentation:

com.mycompany.team.workitem.editor.incident
Then I created an Overview Tab:

com.mycompany.team.workitem.tab.incidentOverview
And a new Section for the Incident Details:

com.mycompany.team.workitem.section.incidentDetails

Then I added the first presentation:

com.mycompany.team.workitem.presentation.incidentType
Once this was done I swapped out to the bindings page and bound my three new work items to this new presentation, saved, and pressed CTRL-Shift-N. This allowed me to check that when I created a new Service Request, that the screen was building up as I expected. I did this after each new Presentation.

I carried on adding Presentation elements as required. I populated the rest of the editor by copying the structure of the default editor and reusing the existing elements.

Associating a Workflow
Finally I associated my new Work Item type with a Workflow. I reused the Bugzilla one which comes out of the box as it was more than sufficient for my needs. If you need to create your own, the aforementioned tutorial on the Jazz site provides an introduction on how to do this.

Tips for Setting up a New Project in IBM's Jazz Team Server

I've just set up my first few projects on IBM's Jazz platform.  It's dead simple, but there are a few things I've learned which are worth knowing.  I've listed them so others can benefit from my experiences.  

NOTE: this is all done with the Web UI.  Once you've completed these steps, its best to move to the Eclipse-based client for the rest of your configuration as the errors are less cryptic / actually exist.
  1. Think about what you need before you do anything.  You need to know what you will name your project (we named ours after the client), which process you will use (we are going for Scrum), what your development lines are (we have the default mainline and also an existing release (we have inherited a codebase) and what teams ("Team Areas") you will need (we have one for our client who will access the web UI as well as multiple for ourselves).  There are other descicions to make, but these are the ones you will need at the beginning.
  2. Create an admin user for your project area.  Give them JazzAdmin priviledges and also (temporarily) a Developer licence.
  3. Logged in as your project admin user deploy the bundled process configurations
  4. Still logged in as your project admin user, create the users you need, allocating them licences as appropriate.  As well as the "real" users, you will likely need a Build user.
  5. Before you create your Project area, deploy the bundled process configurations
  6. Create your project, making sure you select the process you want to use.  Add the users you have created as applicable.  Allocate the users to process roles (i.e. Team Member, ScrumMaster etc.)
  7. Create any additional Development Lines.  We kept the default "Main Development Line" but also added a "Support Development Line"
  8. Create team areas as required.  We had several - one for the client, one for our onsite support, another for the existing app maintenance, and a fourth for new development.  Team Members can belong to more than one team so don't worry about allocation when designing this layout.  Make sure when you create a Team Area that you select the required Development Line
  9. Allocate team members to the team areas as appropriate.  I choose to send the invite emails as this makes getting new members onboard easier
  10. Remove the default admin user (archive the account)
  11. Set up backups 
Additional Notes:
  • I've tried this on Jazz 1.0 and 1.0.1
  • It might seem as if you can't rename or archive some things after you've created them if you're using the Web UI.  Swap to the Eclipse client and you will probably be in luck.
  • I've not covered adding additional "Setup Work Items" which are automatically generated for each user upon creation.  This should be done before team members are added.  I'll cover this in a later blog post

Monday, November 17, 2008

Adding a Non-Eclipse Project to Jazz SCM

IBM's new Jazz platform works most intuitively when you're in an all-IBM world.  We're not in that world on my current project and were having to find our way a little (with excellent support from IBM).  Here's how to share a non-Eclipse project with Jazz SCM.

Pre requisites: I'm assuming you have some stuff in a filesystem you want to share.
  1. Download and unzip the RTC Client for your operating system - its any of the "Zip > Client" files under "Express-C", "Express" or "Standard".  They're all the same.
  2. Startup the RTC eclipse client - e.g ./RTC-Client-1.0.1-Win/jazz/client/eclipse/TeamConcert
  3. Switch to / open the Java Perspective (Window > Open Perspective > Other... > Java)
  4. Switch to the Package Explorer View (if you can't see it open it by navigating to Window > Show View > Other... > Package Explorer)
  5. In the Package Explorer View (it should have opened in the left hand pane.  If not, open it by going to Window > Show View > Package Explorer) ...
  6. ... and right click in it and select New > Other
  7. In the dialog which appears type "Project" and select General > Project which should be visible
  8. Click "Next"
  9. Enter a project name (the name of the folder containing the files which you want to share is good)
  10. Leave the "Use default selection" ticked.  This will mean the project is created in your RTC workspace.  If you want it to be elsewhere, untick this and Browse to where you want it to be.  NOTE: we will be copying your project into this Eclipse project so don't point straight at the project you are going to share
  11. Click "Finish"
  12. You should see your newly created project in the Package Explorer View
  13. Right click on the new project in the Project Explorer and select "Import..."
  14. Type "file" in the text box and select General > File System which should be visible
  15. Click "Next"
  16. Click on "Browse" and select the folder containing the content you wish to share
  17. In the right hand pane, tick all of the contents of the folder you with to share.  Make sure the folder itself is not ticked.  You already have a folder with the same name you are importing into
  18. Click "Finish"
  19. Once the import has finished, expand your project in the Package Explorer and check that what you have imported is there.  You may have to press "F5" with your project selected to refresh if things are not visible
  20. Now you can share your project.  Right click on the project in the Package Explorer and select "Team > Share Project ..."
  21. Select "Jazz Source Control" and click "Next"
  22. Select a component to associate this project with.  (NOTE: See the Jazz docs for more detail on what a component is.  If you need to you can create a Component at this point in the process.  We'll assume that the components available include one which you want to use.) Click "Next" when you're done
  23. Tick the "Show all resources" checkbox and check that all the files you want to share are shown.  If you want to exclude files, you can select them and click the "Ignore" button.  Alternatively you can set a new pattern.
  24. Click "Finish"
  25. Switch to the "Pending Changes" view. (If you can't see it go to "Window > Show View > Other..." and select "Jazz Source Control > Pending Changes")
  26. Expand the workspace that you shared your project into.  You should see a folder called "Outgoing"
  27. Right click on "Outgoing" and select "Deliver"
  28. Congratulations! You've shared your project.

Thursday, May 22, 2008

JavaOne 2008 - Java Recrystalised

This year after JavaOne, my wife and I took a holiday. We hired a car and drove round California and visited some of the amazing National Parks the USA has to offer. I was under orders not to speak about or mention the conference - I was supposed to be switching off and relaxing. Well, at Sequoia, we took a tour round the amazing (and badly named) Crystal Caves. While I was down there it seemed to me that the events of the hectic week just passed came together somewhat. Crystalised you might say.

It had seemed to me that on the surface, there wasn't a lot new out there. Most of the sessions I'd been had told me a lot, but its wasn't exciting and new. But then I realised that there was a more subtle trend - lots of things had instead been re-imagined: Glassfish 3 was now OSGi based and modular. Then there was a better Spring (which now claimed to be a better EJB 3.0 container) and also a new Guice (which claimed to be a better Spring). In other areas, there were calls to re centre the human and re look at our mental models behind things we take for granted - Kathy Sierra was a surprise guest at "How to Write the Next Great Java Book" and implored us to consider the audience's psychology when addressing them. In other areas Hudson was Continuous Inegration with a human face and Mylyn tried to challenge IDE information overload and allow you to code "at the speed of thought". Even the Aussies at Atlassian implored us to put the fun back into our builds.

The Re-imagining continued. Applets were back with a vengance breaking the browser / desktop boundary and gaining a spontaneous standing ovation for the team when they came on stage and new JVM languages were now accepted as first class citizens: we took the Red Pill with Groovy, heard how JRuby is being accepted in the enterprise from Ola Bini, and Scala came out of the academic shadows with a large crowd in attendance for Martin Odersky's latest update. Finally JavaFX Script continued to gain momentum, being discussed from a language design perspective by its creator, Chris Oliver.

And there it was. Just as my thoughts had crystallised, so it seems has the Java Ecosystem. Re crystallised in fact, from the same basic substrate - the JVM - but under changing conditions - dynamic languages, harder problems, new communities. It's still an interesting time to be invoved in the Java world. Just don't expect to be writing just public static void main(String[] args) for ever!

Monday, May 19, 2008

CommunityOne 2008 - Open Social For Your Website

Dave Johnson and James Wood.

History: blogs, wikis, feeds and friends. All were websites.
- Enterprise vendors and portals are adding support for this kind of web site.
- Web 1.0 was hard. FTP.
- Then came wikis and blogs. All had feeds and RESTful Apis.
- Then the web became social. Friends and shareing.
- 2002-3 friendster. Myspace. Facebook. The demographic expands.
- Facebook launch their API. Become a platfom and social graph. Plugins to my web site an beyond
- Then google "answered" with Open Social.

What is a social? Share profile and activities and control the audience for this. Find friends, get a date , share a common endeavor.

As a platform. You don't build the apps. You let others do it on you.
Then rich profile info went to work. For better personalisation , sharing and group collaboration. Big vendors build this in. The social graph will converge with ID management

What is Google's Open social? Its a Javascript API built on top of google gadgets and a REST API in top of an extended atom publishing protocol ( but JSON will be added)

Open social api: It models people but you can't write to it. They can't change your data.
It also has activities: title, date, media file. Apps can create activities.
Persistence: you can store name value pairs.

The REST API mirrors JS API above.

There is an open social namespace to get details of supported functions.

Currently .v.0.7
Grouping is not done yet
Apache Shindig is the reference implementation
Plus the open social foundation is there but that's it

But there is still the silo problem. Open Social doesn't solve it. But there are some reasons to have done silos.
Linking/federation is possible (with FOAF or XHTML friends API) but there is no privacy ( though there is work to integrate FOAF with OpenID)

Is it open? Spec now out in December. Yes it is now.

Apache shindig: Javascript
Its a Java based Google gaget server.

What's missing?: It has no implementation of a social graph. You must use your one existing. You need to provide your own UI elements to edit profiles.

How do I use It?: write a facebook app? Whitelabel? Use apache shindig?
But my site didn't have an existing social graph!

Project social site:
- Build wigets and web services.
- Web services with full rest supper
- Socialsite adds a profile widget.
- Addresses UI piece with widgets. Profile, friends, groups,...
- Addresses editing, joining, accepting and managing
- It extends open social.

Value add: it has a comprehensive social graph.
- Easy to use widgets for java and ruby apps.
- Gadget management features
- ID management features with tie in to your ID management solution.

JMaki is the widget wrapper ( Netbeans and Nclipse support)
- Drag and drop to create an application
- Extended mediawiki example
- Wrote a mediawiki extension so that as a user you add a single tag to add the widgets to my profile page.
- Also done for the roller blog server as new templates.

Links:
http://socialsite.dev.java.net
http://code.google.com/apis/opensocial