JDOM Quick Reference

JDOM: [www.jdom.org]

JDOM is a full featured Java API for the SAX and DOM accessing. Collections are used heavily for the results and queries to make Java programmer life easier. The SAX and DOM parsers would be the underlaying default parsers. i.e. JAXP is checked if it exists then the Apache parser then finally the hard coded internal parser. It also provides adapters to many other parsers like Oracle Parser, IBM Parser and Apache Xerces DOM.

Main Classes [JDOM Java Docs] :

SAXBuilder : Builds a JDOM document from files, streams, readers, URLs, or a SAX InputSource instance using a SAX parser. The builder uses a third-party SAX parser (chosen by JAXP by default, or you can choose manually) to handle the parsing duties and simply listens to the SAX events to construct a document.
SAXHandler : This will create a new SAXHandler that listens to SAX events and creates a JDOM Document. The objects will be constructed using the default factory.
SAXOutputter : Outputs a JDOM document as a stream of SAX2 events.

DOMBuilder : Builds a JDOM org.jdom.Document from a pre-existing DOM org.w3c.dom.Document. Also handy for testing builds from files to sanity check SAXBuilder.
DOMOutputter : Outputs a JDOM org.jdom.Document as a DOM org.w3c.dom.Document.

XSLTransformer : A convenience class to handle simple transformations. The JAXP TrAX classes have more bells and whistles and can be used with JDOMSource and JDOMResult for advanced uses. This class handles the common case and presents a simple interface. XSLTransformer is thread safe and may be used from multiple threads.

XSLTransformer transformer = new XSLTransformer(“file.xsl”);

Document x2 = transformer.transform(x); // x is a Document
Document y2 = transformer.transform(y); // y is a Document

JDOM relies on TrAX to perform the transformation. The “javax.xml.transform.TransformerFactory” Java system property determines which XSLT engine TrAX uses. Its value should be the fully qualified name of the implementation of the abstract javax.xml.transform.TransformerFactory class. Values of this property for popular XSLT processors include:

* Saxon 6.x: com.icl.saxon.TransformerFactoryImpl
* Saxon 7.x: net.sf.saxon.TransformerFactoryImpl
* Xalan: org.apache.xalan.processor.TransformerFactoryImpl

JDOMSource : A holder for an XML Transformation source: a Document, Element, or list of nodes.
public static List transform(Document doc, String stylesheet) throws JDOMException {
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(stylesheet));
JDOMSource in = new JDOMSource(doc);
JDOMResult out = new JDOMResult();
transformer.transform(in, out);
return out.getResult();
}
catch (TransformerException e) {
throw new JDOMException(“XSLT Transformation failed”, e);
}
}

JDOMResult : A holder for an XSL Transformation result, generally a list of nodes although it can be a JDOM Document also. As stated by the XSLT 1.0 specification, the result tree generated by an XSL transformation is not required to be a well-formed XML document. The result tree may have “any sequence of nodes as children that would be possible for an element node”.

Sample programs :

All the examples uses the sample file “plugin.xml” in “c:\” directory.

#1 Create a document and output it via the XMLOutputter class.

package com.suresh.xml.jdom;

import java.io.File;
import java.io.IOException;

import org.jdom.Document;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;

public class TestJDOMOutputter {

    public static void main(String[] args) {
        try {
            // This SAXBuilder looks for the default SAXParsers, parses and builds the XML.
            // The default behavior is to (1) use the saxDriverClass, if it has been
            // set, (2) try to obtain a parser from JAXP, if it is available, and
            // (3) if all else fails, use a hard-coded default parser (currently
            // the Xerces parser).
            // SaxBuilder -> JAXPParserFactory -> SAXParserFactory ->
            // com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl or
            // org.apache.xerces.jaxp.SAXParserFactoryImpl

            SAXBuilder builder = new SAXBuilder();
            Document document = builder.build(new File("c:\\plugin.xml"));
            XMLOutputter outputter = new XMLOutputter();
            outputter.output(document, System.out);
        } catch (JDOMException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

#2 Traverse the entire tree and print the node statistics

package com.suresh.xml.jdom;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import org.jdom.Comment;
import org.jdom.DocType;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.ProcessingInstruction;
import org.jdom.Text;
import org.jdom.input.SAXBuilder;

public class TestJDOMTraverseTree {

    public static void main(String[] args) {
        SAXBuilder builder = new SAXBuilder();
        try {
            Document doc = builder.build(new File("c:\\plugin.xml"));
            traverseXMLTree(doc.getContent());

            Element rootElement = doc.getRootElement();
            String baseURI = doc.getBaseURI();
            DocType docType = doc.getDocType();
            // this gives the file path "file:/c:/plugin.xml"
            System.out.println("base URI : " + baseURI);
            // this is "plugin" element
            System.out.println("RootElement : " + rootElement.getName());
            // if it has a doctype then get the info
            if (docType != null) {
                System.out.println("DocType : " + docType.getElementName() + " : " + docType.getPublicID() +
                        " : " + docType.getSystemID() + " : " + docType.getValue());
            }
        } catch (JDOMException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void traverseXMLTree(List<Object> contentList) {
        Iterator<Object> contentIter = contentList.iterator();
        while (contentIter.hasNext()) {
            Object obj = contentIter.next();
            if (obj instanceof Element) {
                Element element = (Element) obj;
                System.out.println("Element Name[" + element.getContentSize() + "] : " + element.getName());
                traverseXMLTree(element.getContent());
            } else if (obj instanceof ProcessingInstruction) {
                ProcessingInstruction pi = (ProcessingInstruction) obj;
                System.out.println("PI as seen in Doc : <?" +  pi.getTarget() + " " + pi.getData() + "?>");
            } else if (obj instanceof Text) {
                Text text = (Text) obj;
                if (text != null && text.getText() != null && text.getTextTrim().length() > 0) {
                    System.out.println("Text : " + text.getTextTrim());
                }
            } else if (obj instanceof Comment) {
                Comment comment = (Comment) obj;
                System.out.println("Comment : " + comment.getValue());
            }
        }
    }

}

Example plugin.xml file used in the above examples :

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
   id="com.example.eclipseTools"
   name="Tools Plug-in"
   version="1.0.0"
   provider-name="Example"
   class="com.example.eclipse.EclipseToolsPlugin">
   <runtime>
      <library name="tools/tools-2.2.0-SNAPSHOT.jar">
         <export name="*"/>
      </library>
      <library name="tools/lib/velocity-1.4.jar">
         <export name="*"/>
      </library>
      <library name="shared/shared-2.2.0-SNAPSHOT.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/c3p0-0.9.0.4.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/cglib-2.1.3.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/commons-beanutils-1.6.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/commons-collections-2.1.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/commons-logging-1.0.4.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/dom4j-1.6.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/ehcache-1.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/hibernate-3.1.3.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/junit-3.8.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/log4j-1.2.11.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/xstream-1.2.1.jar">
         <export name="*"/>
      </library>
      <library name="jta.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/asm-1.5.3.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/asm-attrs-1.5.3.jar">
         <export name="*"/>
      </library>
      <library name="eclipseTools.jar">
         <export name="*"/>
      </library>
      <library name="tools/lib/qdox-1.6.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/antlr-2.7.6.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/commons-lang-2.2.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/jaxen-1.1.1.jar">
         <export name="*"/>
      </library>
      <library name="shared/lib/ojdbc14-10.2.0.3.jar">
         <export name="*"/>
      </library>
   </runtime>
   <requires>
      <import plugin="org.eclipse.ui"/>
      <import plugin="org.eclipse.core.resources"/>
      <import plugin="org.eclipse.core.runtime"/>
      <import plugin="org.eclipse.jdt.ui"/>
      <import plugin="org.eclipse.jdt.core"/>
   </requires>
   <extension
         point="org.eclipse.ui.preferencePages">
      <page
            class="com.example.eclipse.preferences.SPLPreferencePage"
            name="Example Preferences"
            id="com.example"/>
      <page
            category="com.example"
            class="com.example.eclipse.database.preferences.PreferencePage"
            id="com.example.eclipseTools.database.preferences.PreferencePage"
            name="Database Connection Preferences"/>
   </extension>
   <extension
         point="org.eclipse.ui.propertyPages">
      <page
            class="com.example.eclipse.properties.ProjectPropertyPage"
            id="com.example.eclipse.properties.ProjectPropertyPage"
            name="Example Database Properties"
            objectClass="org.eclipse.jdt.core.IJavaProject"/>
   </extension>
   <!-- This is a Comment -->
   </plugin>
Posted in java, software | Tagged , , , , | 2 Comments

Save time with Pulse 2.1

Pulse has been of a great help for me personally to manage versions, plugins and to share profiles. It is a great sign of relief to many developers and also corporates as it eased the plugin configuration. I quickly checked with the new pulse release and its very interesting and matured a lot. Following are some interesting features that i noticed with Pulse 2.1

  • Seamless support (Select -> Add -> Done) for building a customized eclipse config
  • Features selection automatically prompts for the related software. This is especially useful when we want to customize the features getting added to the Eclipse Configuration.
  • Improved set of plugins support (Add-On Software -> Browse Categories)
  • Improved UI interactions and Response Time
  • And finally Pulse Freelance seems to be a nice value added feature for corporates. According to the features description, i understand that the organizations would be able to add their custom / specific plugins to the catalog, share the configuration with development groups or individuals and have a private update site.

Addition Plugin Categories

Related Plugins

Posted in eclipse, plugins, software | Tagged , | 1 Comment

MoinMoin setup in easy steps

Wikis are a nice way to collaborate in an organizational environment. There are several wikis available in the market and thanks to the wikimatrix, which makes it easy to decide. Recently i did an exercise to install and upgrade the MoinMoin wiki. Listed are ALL the important steps that one can use to SUCCESSFULLY install and upgrade a wiki.

The infrastructure is a pretty simple. Windows XP, Apache Server, Intranet Environment, Latest Python and MoinMoin. I hope the following steps are very simple and enables everyone installing on Win XP and Apache to have a smooth setup process.

Note : This is not meant to have comprehensive setup instructions. For full help and installation instructions please look into the http://www.moinmo.in

Pre-Requisites

  • Download latest MoinMoin [http://www.moinmo.in/MoinMoinDownload]
  • Download latest UnZip/Zip SW [http://www.rarlab.com/download.htm]
  • Download latest Python [http://www.python.org]
  • Download latest EditPlus [http://www.editplus.com]
  • Download latest Apache Server [http://httpd.apache.org/download.cgi]

Example Paths

  • Python Installation : C:\WikiSetup\Python252
  • MoinMoin Installation : C:\WikiSetup\moin-1.6.3
  • Utilities Instance : C:\WikiSetup\MyCompanyMoinMoin
  • MyWiki : C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki

Install Python

  • Install Python
  • Set the system path to Python.exe. This is not necessary, but helps you to execute python from everywhere.
  • Goto the cmd and type python. Python starts and shown the version.
    • python -V
    • Exit this by Ctrl+Z and then Enter key.

Install Apache Server

  • Make sure after the installation the server is started. This can be tested by launching the IE/FF/SF/.. and goto URL http://localhost. The browser should say “It Works!”.
  • If needed the server port can be changed to something that you like and safe. e.g. 1111, 2222 or 9999

Install MoinMoin

  • cd C:\WikiSetup\moin-1.6.3
  • python setup.py –quiet install –prefix=”C:\WikiSetup\MyCompanyMoinMoin” –record=install.log
  • Look for any errors in <C:\WikiSetup\moin-1.6.3\install.log>. If this has errors, go for a coffee and try again.
  • Wether the installation is successful or not can be checked as follows. On the command prompt type “python” and then “import MoinMoin”.
  • This should not produce any messages and it just comes out.
    • C:\WikiSetup\moin-1.6.3>python
    • Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
    • Type “help”, “copyright”, “credits” or “license” for more information.
    • >>> import MoinMoin
    • >>>
  • Note : It is not necessary to change ANY of the configuration or files from the original MoinMoin installation <C:\WikiSetup\moin-1.6.3>.
  • Change the file <C:\WikiSetup\MyCompanyMoinMoin\share\moin\server\moin.cgi> to insert the MoinMoin library path.
    • #!C:\WikiSetup\Python252\python.exe
  • Path of the directory where wikiconfig.py is located.
    • # YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
    • # sys.path.insert(0, ‘/path/to/wikiconfig’)
    • sys.path.insert(0, r’C:/WikiSetup/MyCompanyMoinMoin/share/moin/config’);
    • # Path to MoinMoin package, needed if you installed with –prefix=PREFIX
    • # or if you did not use setup.py.
    • ## sys.path.insert(0, ‘PREFIX/lib/python2.3/site-packages’)
    • sys.path.insert(0, r’C:/WikiSetup/MyCompanyMoinMoin/Lib/site-packages’)

Create the myCompanyWiki Instance

  • Create the directory “myCompanyWiki” under C:\WikiSetup\MyCompanyMoinMoin
    • cd C:\WikiSetup\MyCompanyMoinMoin\share\moin
    • xcopy data C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki\data /E
    • xcopy underlay C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki\underlay /E
    • copy config\*.* C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki\*.*
    • copy server\*.* C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki\*.*
  • Configuring wikiconfig.py
    • sitename = u’My Company Wiki’
    • logo_string = u'<img src=”/wiki/common/mycompany.png” alt=”My Company Logo”>’
    • page_front_page = u”FrontPage”
    • data_dir = ‘C:/WikiSetup/MyCompanyMoinMoin/myCompanyWiki/data’
    • data_underlay_dir = ‘C:/WikiSetup/MyCompanyMoinMoin/myCompanyWiki/underlay’
    • url_prefix_static = ‘/wiki’
    • allowed_actions = [‘DeletePage’, ‘AttachFile’, ‘RenamePage’, ]
    • # If you will not be running a Wiki farm (if you’re not sure what this means, then you probably won’t be), make sure to delete the farmconfig.py file from the C:\Moin\mywiki directory, or else moin.cgi will most likely give off various errors (including one about not being able to find a configuration file) and will ultimately fail to start up properly
  • Configuring moin.cgi. Change the moin.cgi to contain the following lines of script.
    • #!C:\WikiSetup\Python252\python.exe
    • sys.path.insert(0, r’C:/WikiSetup/MyCompanyMoinMoin/myCompanyWiki’);
    • sys.path.insert(0, r’C:/WikiSetup/MyCompanyMoinMoin/Lib/site-packages’)
  • Configuring Apache httpd.conf. Add exactly as shown below. Nothing more nothing less.
    • Its common to have the 80 port already ruinning. Or in some of the corporates this is taken by the Anti-Virus programs. So i would suggest to have your own port for Wiki.
    • Listen xxx.xxx.xxx.xxx:1234
    • The Alias is used to point all the static content like, images, css etc…
    • Alias /wiki/ “C:/WikiSetup/MyCompanyMoinMoin/share/moin/htdocs/”
    • Script Alias points to the newly created Wiki Instance. This kicks up the entire Wiki as i understand.
    • ScriptAlias /myCompanyWiki “C:/WikiSetup/MyCompanyMoinMoin/myCompanyWiki/moin.cgi”
    • Following directories need to accessible by the server
    • <Directory “C:/WikiSetup/MyCompanyMoinMoin/share/moin/htdocs/”>
      • AllowOverride None
      • Options None
      • Order allow,deny
      • Allow from all
    • </Directory>
    • <Directory “C:/WikiSetup/MyCompanyMoinMoin/myCompanyWiki/”>
      • AllowOverride None
      • Options None
      • Order allow,deny
      • Allow from all
    • </Directory>
  • Add following css content in C:\WikiSetup\MyCompanyMoinMoin\share\moin\htdocs\modern\css. This might help you to have some kind of good looking headers. Of course you can change this style if you dont like.
    • h1, h2, h3, h4, h5, h6 {
      • background-color:#E7E7E7;
      • border-style:none;
      • border-width:thin;
      • font-family:sans-serif;
      • margin-bottom:8pt;
      • margin-top:2pt;
      • font-size:150%;
      • padding-left:0.4%;
      • width:99.6%;
    • }

Check Wiki Instance

  • start/restart the apache server with the desired port
  • enter the url http://xxx.xxx.xxx.xxx:1234/myCompanyWiki This should show the startpage of the Wiki

Data Migraiton :

Data migration might be necessary, if you have existing wiki and you would want to enhance the wiki engine and data. Sometimes this could be the most painful process in the entire wiki setup (at least for me).

  • # Before doing the migration, please check if the MoinMoin module is available to command prompt.
  • # Copy the data directory from the existing wiki installation.
  • ‘your\old\MoinMoin\Wiki\data’ to C:\WikiSetup\MyCompanyMoinMoin\Lib\site-packages\MoinMoin\script\old\migration
  • # And start running all the scripts. All means ALL. If you encounter any errors make sure that you correct all of them.
  • # Migrate Post 5.3 Data :
  • C:\WikiSetup\MyCompanyMoinMoin\Lib\site-packages\MoinMoin\script\moin.py –config-dir=C:\WikiSetup\MyCompanyMoinMoin\myCompanyWiki –wiki-url=http://xxx.xxx.xxx.xxx:1234/myCompanyWiki/ migration data

HTML Dump

Many a times we want to export some of the pages or all of the wiki pages as documentation to the developers, sales or to the customers. This HTML Dump works handy in these cases. This feature is a fresh breath in life (i was using MoinMoin 1.2.1 before i migrated).

  • C:\WikiSetup\MyCompanyMoinMoin\Lib\site-packages\MoinMoin\script\moin.py –config-dir=C:\tmp\MOINWIKI\share\moin\matrix –wiki-url=http://xxx.xxx.xxx.xxx:1234/myCompanyWiki/ export dump –target-dir=C:\tmp\myWikiDataDump
  • Once the Dump is done. Copy the *.* from “C:/WikiSetup/MyCompanyMoinMoin/share/moin/htdocs” to “C:\tmp\myWikiDataDump“. This would apply all the “css” to the htmls.

User Access Control

The Wiki i setup, works in an intranet. I would like to have all the users to have the read, write, revert and delete access. Only the SuperUser has the admin capability. So my configuration is as follows.

  • superuser = [u”sureshkrishna”, ]
  • acl_rights_before = u”sureshkrishna:read,write,delete,revert,admin”
  • acl_rights_default = u”All:read,write,delete,revert”

References:

  • Wiki For you : http://sureshkrishna.wordpress.com/2008/03/04/wikis-for-your-organization
  • MoinMoin Download : http://www.moinmo.in/MoinMoinDownload
  • MoinMoin Installation : http://www.moinmo.in/HelpOnInstalling
  • MoinMoin Configuration : http://www.moinmo.in/HelpOnConfiguration
  • MoinMoin Administration : http://www.moinmo.in/HelpOnAdministration
Posted in software | Tagged , , , , , | 1 Comment

Why should you Jazz ?

Jazz is a technology platform from IBM. Its based on the client-server technology and manages the source management, build tools and promotes the team collaboration. Once of the great aspect of this platform is that its built with Team Collaboration in mind. Well… this makes a lot of difference in the corporate and product development environment.

Not to get confused, IBM Rational Team Concert is the first product based on the Jazz Platform. Team Concert is based on Eclipse and related technologies. By basing the Team Concert on Eclipse proves “Eclipse as a Platform“. Team Concert is available for free to download and play with. Not sure if Rational would want to make money in future and also how the licensing mechanism works for the Jazz and Team Concert for the enterprises.

I am truly impressed with the workshop that me and Peter Kirschner (a colleagues of mine from Robert Bosch, Germany) attended at EclipseCon2008. Starting with the presentation of Erich Gamma, Jean-Michel, Kai-Uwe Maetzel and John Wiegand gave a very good overview of the Platform and ideas behind it. Soon after EclipseCon, i downloaded and started playing with it. My colleagues at Bosch says he gets response in matter of minutes. But i have a different opinion. Perhaps i am JUST a developer.

All the corporates that i worked for have similar problems. Especially i worked for the tool development departments and you can see the same patterns every where. We have Process, Methods and Tools departments and they always were three DIFFERENT departments. Developers always wanted to have Simple Processes, Unified Methods and Integrated Tools. But this never happens. It is good to have different people to concentrate on different problems, but at the same time they need to collaborate to solve these problems. I am sure, for many of the readers the bell rings… 🙂

Software development needs different facets to fit in a co-ordinated way. Requirements Management, Design, Project Management, Source Management, Issue Management, Process Management, Build Tools and Collaboration are some of the aspects of the software development. The biggest challenge for any corporate is to have an integrated platform where all the processes and tools come together.

Process Integration

From the organization point of view, its necessary to integrate the Process, Methods and Tools. However till now it was not possible to have several methods and tools integrated into a single environment. Its not because of technology, but because we need a framework/platform that supports this kind of integration.

After attending the Jazz workshop and once i played with Jazz a little bit, this platform seems to be a PLAUSIBLE solution for some of the unsolved problems in software development. It has an easy to setup a Team Repository, can assign users to this repository with the security permissions, etc… For me it looks like they picked up best of the breed features into the Jazz’s Source Control system. Some of the similar concepts like changelists from Perforce, powerful branching, merging and multi-site functionality from Clearcase and what i love is the concept of branching, merging are all transparent to the developer. You need to concentrate on the REAL work. Like development, release trains, fixing bugs, etc… and not how to branch for a new release version and how to merge into the main branch ….. all these tasks are managed (apparently) by Jazz platform.

Team collaboration is amazing. I really liked the example conversation to setup a project, that Erich presented at the EclipseCon2008.  The problem is universal… find the projects you want to checkout, find the repository path, see if you have permission to the repository, find if you can get specified projects, how to build the projects, which are the dependent modules, which jars should i build before i do anything……..the list is endless. How cool would it be if all the above tasks are taken by your development environment. Of course, we have been doing software development and system development all the while by spending time, communication effort and finally frustration when nothing works.

As a project manager, its is very logical that i might not use heavy development tools. So you have the web interface to get a complete overview and detailed artifacts about the project. The web interface is sophisticated with the AJAX functionality and as i have seen, its quite responsive. Different charts, reports on the individual team level and project level can be obtained.

The entire work flow at the development time can be controlled with the help of the process templates. We want to eliminate all possible errors in the initial stages so that verification and review process can be reduced. A developer might not keep a comment before he commits a piece of code, code can not be checked in unless it is reviewed by senior developer, etc… In my previous experiences, we managed all these rules with the help of perl / shell scripts at the source control side. This is a nice capability of the Jazz to be able to integrate the Process Management in to the environment.

Jazz ??

The above picture probably is what i believe that Jazz could do. I really see this as a potential enterprise infrastructure for software development. I am hoping that this project would bring out a lot of happy smiles though i am little skeptical about the licensing mechanism.

Many of you would have had similar problems i mentioned and i hope you might find Jazz to be a potential solution. I would love to hear interesting points from you. By now, i hope you know “Why you should Jazz ?”.

Posted in eclipse, java, software, technology | Tagged , , , | Leave a comment

My JDeveloper Training

I have been undergoing the Oracle ADF and JDeveloper training for a future project. It was pretty hard for me to accept that i am undergoing this training considering my strong belief in eclipse-as-a-platform. I started the training by asking, if all/many of the JDeveloper features are available in Eclipse and soon realized that JDeveloper does have a strong set of database feature set.

There are some discrete set of database features that are available for Eclipse. These 2 projects do provide good plugins to improve the productivity of the database developer on Eclipse.

OK, but dont feel happy about it. For the set of features that JDeveloper has, its difficult to compare the feature set with Eclipse. In my view we should not even compare. At the end of the training, i am sort of started believing that its apt to call JDeveloper as Integrated Services Environment (ISE). Its has many things inside. For me it looked like the concepts of Application, Project, Module, Entity Object and View Objects are tightly integrated with JDeveloper. I cant imagine to build a complex application “-which is tightly integrated with DataBase and ADF-” without JDeveloper.

Of-course i “think” its possible to develop some decent ADF applciations without JDeveloper. We can still develop the UI with the help of the ADF Faces and JSF in Eclipse, but there is no support (as i know) of ADF BusinessComponents in Eclipse till date (03/27/2008). I guess people can still develop some good Oracle ADF applications with the help of EJB3 and JPA stuff.

In the end JDeveloper does many things with Database/Class Diagrams, ADF Components, Business Rules, EJB, Toplink, WebServices, Database Connection, SOA Stuff (not sure what exactly it does with SOA), JSP, JSF, Struts and much more. Some of the features can be pulled into the eclipse and one can use pulse to do this.

As an Eclipse lover, i am just waiting for a good ADF plugin into the Eclipse world. ahem….

Posted in eclipse, java | Tagged , , | Leave a comment

EclipseCon 2008 – I loved it.

EclipseCon needs no introduction. Its been happening from past 4 years and each year it has a lot of interesting news and updates. I was very excited to meet my ex-colleagues from Germany. Its been refreshing for me to talk to these guys [Peter Kirschner (Robert Bosch, Germany), Stephan Eberle (Geensys, France), Frank Gerhardt (Gerhardt Informatics, Germany)] after a long time. I got to meet Jens Eckles from Pulse, looks like they released a new version, i need to check it out. Its one of good products i like for eclipse users. After a long time i got to meet Ralph Mueller from Eclipse foundation and also Ed Merks from EMF project.

This time there are very good sessions about the OSGi, Equinox, RAP, Mylyn, EclipseLink and Jazz. I am personally very impressed with Jazz. I attended the Jazz workshop and looked like a perfect fit for many of the sw engineering problems. I immediately registered and would want to try this out in the next few months. When i was working with Robert Bosch, we were trying to solve similar problems Jazz is trying to solve.

(I heard that GM and Ford are doing some nice and cool things with Eclipse. Hummmm…. i think i am missing this action.)

I had great time presenting my sessions and the audience response was great.

I had lot of fun all these 4 days. From tomorrow the reality comes,  need to go to Office 🙂

Anyway, i had lot of great things to take back from EclipseCon 2008. Hoping to see all of you in the next year with some more great stuff.

Posted in eclipse, java, software | Tagged , , , | Leave a comment

JFace Dialogs : which one is right for you ?

JFace framework of Eclipse provides many standard and useful dialogs and a framework to build custom dialogs and wizards. When the standard dialogs seems to be too simple for your plugin or RCP developement, one can extend the standard dialogs to suite their own needs. The aim of this article is to provide example oriented approach to dialogs and see in depth of all frequently used dialogs. I am hoping to have this article as the point of reference for many developers to get Dialogs overview.

Dialogs are modal UI components which would do some user interaction tasks. Traditionally Dialogs are used to enter a simple input, to select a choice from a list, to select multiple nodes from a tree, to inform about a success/failure from an operation, to input confirmations from the user, etc…

Eclipse provides standard dialogs from two different frameworks, SWT provides very basic dialogs like FontDialog, ColorDialog, DirectoryDialog, FileDialog and FontDialog. These SWT dialogs are coming out of the SWT as they are very basic and has close connection to the OS. All these Dialogs are available from org.eclipse.swt.widgets package from the org.eclipse.swt.<platform>.jar.

JFace provides a variety of Dialogs for the implementers to extend or to use them directly. Its interesting to look into variety of dialogs provided by JFace and i would leave the usage to your imagination and context. Rest of this article is mostly code, screen shots and less of textual description. I tried to keep the short, sweet and simple.

FileDialog: This is a SWT Dialog but worth mentioning under the general concept of the Dialogs.

“Instances of this class allow the user to navigate the file system and select or enter a file name. Note: Only one of the styles SAVE and OPEN may be specified.

IMPORTANT: This class is intended to be subclassed <em>only</em> within the SWT implementation.”

File Dialog

Information Dialogs: These dialogs are used to inform user about some event and take some necessary action. There are different Dialogs under this category.

ErrorDialog : A dialog to display one or more errors to the user, as contained in an IStatus object. If an error contains additional detailed information then a Details button is automatically supplied, which shows or hides an error details viewer when pressed by the user.

Error Dialog

MessageDialog : “A dialog for showing messages to the user. This concrete dialog class can be instantiated as is, or further subclassed as required.

Information Dialog
Question Dialog

InputDialog: This Dialog is used for a very general paradigm to process some input from the user. Generally its not recommended to use this for input of complex data and for large number of input fields.

InputDialog

PrinterDialog: “Instances of this class allow the user to select a printer and various print-related parameters prior to starting a print job. IMPORTANT: This class is intended to be subclassed only within the SWT implementation.

Print Dialog

ProgressMonitorDialog: This is a very important Dialog component most of the applications would use. This Dialog is used to represent any time consuming task or to provide a long running workspace task to the user. Proper care must be taken to show accurate information of progress information to the user.

Progress Dialog

TitleAreaDialog: “A dialog that has a title area for displaying a title and an image as well as a common area for displaying a description, a message, or an error message. This dialog class may be subclassed.

This is the class that i often use for “About MyCompany” kind of dialogs.

TitleArea Dialog

ElementListSelectionDialog:A class to select elements out of a list of elements.

ElementListSelectionDialog

ListDialog:A dialog that prompts for one element out of a list of elements. Uses IStructuredContentProvider to provide the elements and ILabelProvider to provide their labels.

ListDialog

TwoPaneElementSelector:A list selection dialog with two panes. Duplicated entries will be folded together and are displayed in the lower pane (qualifier).”

TwoPaneElementDialog

List SelectionDialog:A standard dialog which solicits a list of selections from the user. This class is configured with an arbitrary data model represented by content and label provider objects. The getResult method returns the selected elements.

ListSelectionDialog

ElementTreeSelectionDialog:A dialog class to select elements out of a tree structure.

ElementTreeSelectionDialog

CheckedTreeSelectionDialog: “A dialog class to select elements out of a tree structure”

CheckedTreeSelectionDialog

Some Notes :

  • YesNoCancelListSelectionDialog has been Deprecated in 3.3 of Eclipse.
  • RCP Product extensions and custmizations can be done via AboutDialogs.
    • AboutDialog
    • AboutFeaturesDialog
    • AboutPluginsDialog
    • AboutSystemDialog

    Note : Above Dialogs are internal dialogs and not APIs. They are mentioned only as a reference.

  • PrintDialog is intended to be sub-classes by the clients and use it for identifying the printers and other parameters for print job.
  • SaveAsDialog is not available in Eclipse 3.3

Conclusion: Dialogs are a great way to present simple data and receive user input. Its very important to understand several Dialogs provided by JFace and use them appropriately.

References:

Posted in eclipse, java, plugins, software | Tagged , , , | 4 Comments

Videos as Next generation documentation

Have you ever spent hours and hours, reading a document and to get some help to accomplish a simple task. I am sure many of us did this. Many of the product and training material that we have are predominantly in the following category.

  • Word Documents
  • PDF Documents
  • Post Script
  • CHM File
  • HTML Files
  • and others (which i have not used)

We normally take a printout of the document to know the system, functionality, how-to, etc… At the end of the 2-3 hour read, we are still not sure how to accomplish a task and what are the new features in the product. With one of my previous client that i worked with, we did a lot of videos, which seemed to be a very effective way and customers love them. Taking videos of some speaker/presentation and some special demos have been in the industry for a long time. Making a video can be particularly suitable for the following scenarios.

  • Task focused training material for a larger audience
  • Showcase the preview of your product
  • Complex installation instructions
  • Knowledge transfer to colleagues (in a geographically-distributed environment)

Following are some of the practical benefits for the company and the end-user.

Product Company :

  • Its easy. Instead of spending the $s on the huge documentation, its easy to do a professional quality screen casts.
  • Many corporate users are task focused. Its easy to make small screen casts, focused on a single task.
  • With the Audio and Video built in, its a value addition in the “Documentation” process.
  • Its a pain to make the “screen shots” of the software and then describe each and every step that you would want to do. Screen casts makes it easy as its simple to perceive and understand.
  • Installation of a product could be tedious and error prone, if not done carefully. When there is a screen cast describing the installation steps, its not easy to go wrong.

Customer / End user :

  • Reading material to find out a specific information is time taking. Task focused screen casts can reduce this time.
  • No one would like to repeat installations. Its no fun. Screen casts can avoid this.
  • Its easy to grasp certain steps to complete a task by LOOKING at a screen cast rather than reading documents.

Its very important to differentiate the Podcasts, Webinars and Documentation Videos (Podcasts and Webinars are NOT documentation videos). This might not be suitable for the source code and API documentation.

Following are some of the companies that have a very good documentation via videos.

I am sure some of the above mentioned points are applicable for your organization too. I would be glad to see your comments and experiences on “Videos as Next generation documentation”.

Posted in reviews, software, technology | Tagged , , | Leave a comment

Wikis for your Organization

I have been trying to select a Wiki for our business group and i came across this cool site. I worked with MoinMoin and MediaWiki and this site can compare any/all of available wiki systems.

http://www.wikimatrix.org/compare/MediaWiki+MoinMoin

http://www.wikimatrix.org/compare/JSPWiki+MoinMoin+PhpWiki

If you want to find wikis that best suits, you can start a…

http://www.wikimatrix.org/wizard.php

Hope this site would be helpful for everyone searching for Wikis.

Posted in software, technology | Tagged , , | Leave a comment

Eclipse Help vs Cheat Sheets ?

Did you ever got into such an argument from your boss or colleague ? During the documentation time, many categorize the tasks/topics into either of Eclipse Help Content or Cheat Sheets. Depending on the task, domain and business at hand, its very tricky to decide if a topic falls into the category of Cheat Sheet or Help. Oops… i am not sure, if cheat sheets are used by many organizations, but i did use them in couple of projects and customers loved them. Its been quite easy to decide what goes into Cheat Sheets, if we follow a task based approach.

Following are few hints and tips, that i use to decide when to use Help and when to use Cheat Sheets.

Cheat Sheets :

  • Let the user accomplish a TASK using a cheat sheet.
  • Cheat sheet assists the user in a step-by-step manner.
  • When there is some Dynamic Data to be filled-in, use cheat sheet.
  • Cheat sheet is more appropriate to accomplishing a task might take…
    • Invoking a Wizard
    • Filling the Data in Multiple Wizard Pages
    • Use a search criteria to get data from DataBase, do data/wizard validations
    • Invoking a View, etc…

Help Content :

  • Explain the system/modules with the help of Help
  • Describe the specific Views, Perspectives, etc… with in Help
  • Describe the content, allowed values of a Wizard or Action with the help of Help
  • DO NOT describe steps to accomplish a complex task in Help (there are high chances that users might ignore it). Instead, do it in Cheat Sheet.

When we follow the above hints, i guess there is no argument on what to use when. I hope many of you would have used help and cheat sheets in combination and i would love to hear your experiences.

Posted in eclipse, plugins | Tagged , , | Leave a comment