Monday, April 23, 2007

Extending Domino with Java - Part 2 - Simple Java

Now that we've downloaded eclipse, lets install the IDE and take a look. The eclipse install is easy - just unzip the folder to a directory of choice, it doesn't update the registry - simple and easy. I usually navigate to eclipse.exe and add a short cut to the desktop.

When I startup eclipse and I get the following error which means that I forgot to install the JSDK.

After I installed the JSDK eclipse starts up and stops to prompt you for the location of the workspace. I've chosen c:\workspaces\workspace so that I can keep them in one easy to backup location.



Next, close the Welcome screen and you then be in the Java perspective. Perspectives are the way that eclipse organises the files for different users and tasks. The default for the WTP is the Java perspective.

From the File > New > Other select the Java Project and enter an appropriate name and leave the default JRE selected.

The next Step is to get the HTTPClient code that we want to reuse. Using open source code can be hit and miss on the documentation front. Newer versions of projects do not have a great deal of documentation. However, the established project usually have more than enough examples, documentation and tutorials to get you started.

We'll download the HTTPClient 3.1 rc 1 version from the HTTPClient Project. We'll also need the other prerequsite projects, although we can skip the Junit project. Each zip file contains documentation and the *.jar files. These are the libraries that we want to reuse. I usually collect them into one single directory of jars that I want to reuse, in this example c:\lib.

Select the new project and in the properties > java build path select to add external jars. Navigate to the single directory and add each one.


So lets finish with a simple test - to confirm that we've got all the files that we need. There is a complete example in the HttpClient website. Select File > New > Class and enter the name of the class as HttpClientTutorial. The copy and paste the tutorial code. If everything is ok there should be no errors or warnings in the problems tab.


So lets execute the program. Select the java class file in the package explorer and then select run > run as > java application. This runs the class and starts with the main method. In the console tab you should see the html code for the apache.org website.


That's it a simple java program that gets the xhtml from a website using a http client. However, in this format is not easy for domino to consume. We will need to be able to pass parameters and decide how to handle errors, essentially hiding some of the complexity.

In the next post we'll build a facade to the HttpClient for use in Domino and add in authentication - ready for integration into a domino java agent.

Sunday, April 22, 2007

Extending Domino with Java - Part 1 IDE

When I answered the post on codestore I was sure that somewhere I had a working sample of domino and the HTTP client code that I did on a very short project. I searched on every dvd archive, thumbdrive and folders on my workstations to no avail.

So what next ?

Well, it didn't take long to write the code in the first place. The projects was only two days worth of consulting (over a year ago), so over the next week (or maybe two) in my spare time in the evenings we'll build it from scratch. To answer Rafaels question - yes I did get the authentication working with the proxy server. However, I don't have access to one for this exercise, so you might have to do some trial and error. I can point you in the right direction though.

It's not a bad idea to revisit the sample and using all of the latest code versions and libraries.

So where should I start ? I don't want to go over stuff that you may already know and I don't want to leave out important steps for the newbies to java and domino. For the experienced you can skip to the bits that interest you.

I think that maybe the first thing to do is start with the a decent Java IDE as Java in the Notes Designer leave a lot to be desired.

For this exercise I'll use Eclipse as its free and is the foundation for Rational Application Developer (RAD) so its familar when you are switching between them. Of course deciding on Eclipse is not that simple as there a few choices for eclipse.

First there is the standard IDE - around 90Mb - great for pure java programming but not many wizards or tools for anything else.

Next there is the Eclipse Web Tools Project (Eclipse WTP) - around 200 Mb - which provides tools for web and j2ee development.

Then there is the Eclipse Callisto Distribution from IBM - around 300 Mb - which bundles Web Tools Platform (WTP), Graphical Modeling Framework (GMF) and
Test and Performance Tools Platform (TPTP).


It's also worth mentioning MyEclipse they have an annual subscription service for a standard version for $30 USD or $50 USD for the professional version. For that you get all the updates plus support.

And the most feature rich of all the eclipse IDE variants is IBM's Rational Application Developer . It also has a price to match - 5,452.99 AUD.

There are other Java IDE's that are out there but I use the eclipse variants because sometime I have to use RAD as that's what the client uses and sometimes they don't have RAD and so the free versions are easier to install for some simple Java development. The bundles are good as they take some of the hard work out of ensuring that all the prerequisite components are installed too.

Lets use Eclipse WTP 1.5.3 and download the 'all-in-one' file from the download area. You'll also need to download a java sdk I would suggest picking one that matches the JVM version supplied with the version of Domino that you are using - that way the IDE will highlight any problems that you would otherwise encounter when you come to include the java code in Domino. So for Domino 6 - that's JSDK 1.3 and for Domino 7.0.2 that is JSDK 1.4.2. We'll use 1.4.2_13 from the Sun archive area.

Anyway that's enough for one night - next session we'll install Eclipse and the Java SDK, download the HTTP client jars and build the first test.


Wednesday, February 07, 2007

Blog-reading

I was one of the unlucky ones that didn't make it to LotusSphere 2007, so I have been spending my few free night reading and catching up with the news and opinions rather than posting.

I'm gradually working through the presentations that interest me. I liked Nathans & Chris' interface presentation. I think that stuff like this should be mandatory training for Notes & Domino Developers. Some of the techniques apply just as well to web apps too so it's worth a read.

I learnt early on in my developer career that some nice graphics and icons can make a world of difference to the perception of an application. The investment in learning photoshop has been well worth it.

Anyway back to the reading....

Friday, January 12, 2007

Another J2ee Framework and Another AJAX Toolkit

I came across yet another J2EE framework this week. Open SubSystems and another AJAX toolkit. ThinWire they cleverly also put a page about the differences between Thin Wire and the Google Widget Toolkit. The interesting thing is that with ThinWire you have access to the Full Java API not just the ones available through the Google Widget Toolkit.

The only problem with all of these frameworks and toolkits is which one to choose.

Thursday, January 11, 2007

Locked out of your WAS ?

Somehow I managed to lock myself out of my WAS server during configuration of Domino LDAP - doh! I'd turned on Global Security with the wrong credentials for the LDAP server. After much Googling I finally found the nugget of information to allow me to disable Global Security without the server running.

Want to know what it is ?

WAS_ROOT\bin\wsadmin -conntype NONE

wsadmin>securityoff

and then wsadmin>quit

It was in a document called "Common Mistakes for Enabling Security" hidden away in the IBM website.

Sunday, January 07, 2007

I've been tagged...

By Carl. So here are five things that you don't know about me.


  1. My first computer was a Sinclair ZX80. I spent a lot of time typing in programs from magazines that never actually worked.
  2. My first car was a Mini Metro Van, which cost me the princely sum of 325 English pounds. I repaired the rust and eventually upgraded the engine from a standard 998cc to a 'tuned' 1398cc with a really LOUD exhaust. It served me well all through University. I had to get a sensible car when I started work, so it got dismantled and the engine is still in the back of my folks garage!
  3. My nickname in University was Sheepy as I was from Wales - great imagination from one of my classmates! If you didn't know the Welsh are rumoured to like sheep - alot!
  4. I once went to a fancy dress party dressed as one fifth of the Village People, my three other house mates and a good friend were the other four. I was the biker guy. We even went to the local pub dressed in full regalia.
  5. I once tried out for a part time job as a barman, but my mental arithmetic was so bad that I only lasted one night.

I suppose I should nominate 5 people. Gareth Cook, Micheal Rice, Simon Hampel and Cali Clarke, if they've not been tagged already.

Monday, December 18, 2006

Jave EE 5 SDK includes beta JSR168 container

Java EE 5 SDK Update is out. The thing that interested me was the inclusion of a beta version of the JSR168 portlet container. Interestingly, IBM WebSphere Application Server 6.1 also includes a JSR168 portlet container.

So what does a Portal give me and what does a Portlet container ?

A portlet container runs portlets and provides them with a runtime environment. The runtime environment manages the portlets lifecycle and persistent data for the portlets preferences. JSR168 is the portlet specification, if you write portlets to this specification you can use them on any portal server that supports the JSR168 specification.

A portal is a web application and provides a presentation layer, security, personalisation and aggregation from different sources. The way in which this functionality is implemented varies from vendor to vendor.

Monday, December 11, 2006

Book:Agile Java Development

I've just finished reading the book Agile Java Development with Spring, Hibernate and Eclipse. I wasn't looking, but there it was in the book shop. I keep hearing good things about spring and hibernate. That together with Agile and Eclipse and it just about hits all of the areas that I'm curious about, so I bought the book.

The books takes you through a small project to create a timesheet application from requirements to finished product using the Agile methods. The author also described other necessary parts of the development process not just Agile, Spring and Hibernate. He covered UML, and setting up ANT and JUNIT. He also includes his personal opinions on things like "Why Agile Modelling and Extreme Programming?". I was very please to see that he thought setting up code directory structure, ant and junit upfront was vital to a projects success. All of which resonates with my own personal opinion that this builds the foundations for a smoother project.

The reasons for my interest in Spring and Hibernate, stems from my Domino and Notes roots. One of the important areas that keeps Notes and Domino in demand is that it has an easy to use database implementation and easy to program environment. Historically, in J2EE projects storing of data somewhere has been the area that required lots of effort. As a result there has been a proliferation of persistence frameworks, such as Hibernate, Ibatis, JDO and Toplink that have been designed and written to simply J2EE persistence. The other area is the general MVC framework for web application development. Spring is one of the leading (or most talked about) modular frameworks for web application development, which includes a flexible MVC web application framework, AOP, JDBC abstraction layer and integration with Hibernate, Ibatis, JDO and Toplink.

I've used Struts and Ibatis in other projects and they are not exactly easy to use and so I was keen to read about spring and hibernate. It seems that everyday J2EE is becoming easier and quicker. The net impact is these frameworks, which speed up development, have the potential to make J2EE applications another option for projects where Domino has been traditionally chosen.

Sunday, December 10, 2006

WebSphere Sales Professional 2006

I had a spare few moments in the office and thought I would have a go at the test. First attempt - failed, Second attempt 100%. So now I know the difference in how to pitch the benefits of Websphere MQ versus Websphere ESB.

I'm not entirely convinced of the value of the test. All it really proves is that you can memorise a few key messages from a 40+ page presentation. The Lotus test was a little harder IMHO as there were more material to remember. However, as with most things the devil is in the detail.

Thursday, December 07, 2006

Lotus Solution Sales Professional 2006

I always wondered when keeping up with IBM/Lotus software strategies would be useful. Today I found out. I had to sit the Lotus Solutions Sales Professional Test. I passed - 76%. Even when I was in the depths of the J2EE world I always kept up with the latest release and acquisitions by visiting developerworks, Ed Brill and all the other notable bloggers. Mostly this was to understand what technical skills I should think about developing.

Now my boss wants me to sit the Websphere Solution Sales test...

Monday, December 04, 2006

Virtual ANT and a new Portal 6.0 Redpiece

Via theserverside.com. A new tool for visually creating and maintaining ANT scripts.

Virtual ANT

There is also a new redpiece available Best Practices for Migrating to IBM WebSphere Portal 6


Friday, November 24, 2006

Interface Matters

There has been some criticism of web interfaces produced by domino developers. There is a perception that the majority of domino web interfaces (and Notes) have fallen out of the ugly tree and hit every branch. From time to time I come across some very poor examples of (shock horror) other environments that have less than beautiful interfaces. I came across one today. Its a paid-for-out-of-the-box web application, in a trial phase, so the web app must be relatively new.

It's not a reason give up and produce poor interfaces, its just that Domino web apps and Notes apps do not have a monopoly on bad user interfaces.

Wednesday, November 15, 2006

Introduction

I was so energized by the Ed Brill presentation, that I decided that it was time for me to get involved in the Lotus community and start a professional blog, rather than the one I've been using to keep family and friends up-to-date.

I couldn't decide what should be the first post. I thought that perhaps an introduction would be good. I'm really not that interesting, so here is a little about me in bullet points.

  • Left University with Degree in Computer Science.
  • Started working for Lotus UK on the Help Desk, supporting Notes v2.1, cc:Mail and Organiser.
  • Left Lotus and started working at a UK start up for a large US Lotus Business Partner.
  • Left the Business Partner to start contracting.
  • Started contracting for Lotus Consulting UK.
  • Decided to have a quick look at what Sydney, Australia had to offer.
  • Started on Contract with Lotus Consulting in Australia, which then became/merged with IBM Software Group Services.
  • Got married.
  • Left IBM to working in a finance organisation.
  • Had two children and became an Aussie.
  • Left the finance organisation and started working for a large Australian IBM business partner.

So far during my career, I've built solutions for clients using Lotus Notes/Domino and related products (Quickplace, Domino.doc, Workflow..even ViP for those that remember). In the last couple of years I've been more involved with the Java/J2EE world which I find interesting. So far I've been using IBM products such as WAS, Portal and Rational Application Developer - but have been keeping my eye on the open source products.

I've also become interested in the Project Management discipline and recently been deemed competent to be certified as a Registered Project Manager (RPM) with the Australian Institute of Project Management.

However, I'm still a techie at heart....

...and if you are wondering, the quick look at Australia became a little more permanent.