Sciology = Science + Technology

Religious Programming (Eclipse; AJAX; SOA; Mashups; XP + SCRUM).

Archive for the 'Uncategorized' Category


Eclipse Ganymede Release

Posted by sureshkrishna on July 13, 2008

Yesterday i have written a short blog;  Things i like in Ganymede. In my blog, Ganymede was misspelled which was purely unintentional. I would like to extend my sincere apologies to all the readers and Eclipse for the confusion.

Thanks to the readers who have timely pointed me this typo.

Posted in Uncategorized | 1 Comment »

Things i like in Ganymede

Posted by sureshkrishna on July 11, 2008

Another great release from Eclipse this year with 23 simultaneous projects. I was little bit confused as to 23 vs 24 projects; these two numbers are hovering in different sources. Never the less, i am happy to download and play with the Release. Indeed, i was really happy and delighted to see my association with Eclipse - as a user and application developer, even though i would love to be a commiter - and the way we have been improving year-by-year.

Some of the very obvious features, i have been using from the day one.

Search Feature

Improvements in the Search feature are awesome. I specially like the detailed list of occurrences. Prior to 3.4 / Ganymede, i had to move quickly to the code segments that has the search keys. But now, with the detailed list view, i know exactly where i want to go.

Bread Crumbs in Java Editor

This was only available to some of the Web 2.0 style IDEs and Web sites. I am glad that we have this features with the JDT. Even though i have not checked, if i can re-use this Bread-Crumbs widget. At the development time, i really get a good view of the hierarchy. Remember that many of the developers would be editing the source files in the Full Screen Mode (Ctrl + M), if you need to edit or jump to another file, we often minimize, navigate and then again go back to the Full screen mode.With bread crumbs, this is so easy.

“dropins” folder

This is super cool. Prior to this release, i used to either manually/automatically copy the plugins and features into the eclipse directories or provide links to the 3rd party or custom plugins. With the “dropins” folder, its as simple as just DROPPING the custom or 3rd party plugins in the “dropins” folder. How cool is that.

New Projects and Working Sets

WorkingSets are very useful when working with multiple projects. Prior to 3.4, project can be added to a workingSet only after creating it. But with Ganymede , its possible to add a project to a working set at the time of creating it.

Enhanced Java Problem and Doc Hovers

When looking at the JavaDocs by hovering on some of the used or to be used APIs, i was tired of pressing F2 for a full view. Now Ganymede supports this EASILY by just moving the mouse over the Hovers. Quick fix also gives enhanced hover. This could prove to be useful some times.

Quick Assists

I personally feel this is a cool feature, as some of the refactoring features are combined in to the Quick Assists ( Ctrl+1 ). Instead of remembering the the Short Cuts, its easy to remember Quick Assist and luckily its context sensitive.

Read-Write Occurances

This is one feature that is small yet powerful. Once the source file is large enough, its difficult to know which methods are reading and writing a particular instance variable. This features ( Alt+Shift+O ) is very useful in this respect. It shows occurrences of reads and writes in different colors.

Arrange src elements from Outline View

This has been my long time wish to have this feature. Many times while coding, i have methods so randomly written that its time consuming to arrange them in the order (like all the Public, Protected, Private, Utility Methods, Class Helper Methods, etc…). This feature works like magic, just drag-and-drop the src elements in the outline view and the src code elements are automatically arranged.

Does anyone see that the BreadCrumbs View, Package View and Outline View are showing the elements in a different sorting order.

Debug Hover

During debug, the variable values are viewed either by Ctrl + Shift + I or with the context menu. With the Ganymede enhancement, the Mouse hover would show the variable values. This is real cool.

And Finally…….

Provisioning aka p2

The greatest thing that can happen to an Eclipse Developer and Eclipse User. For Non-Eclipse and Non-IDE users, it was difficult to chose the required plugins, their dependencies, nearest download site and then download and install. With the help of p2 this is made simple. Really SIMPLE. p2 would automatically detect the dependencies and the nearest site and then download it for you. You could also set the automatic updates for a particular plugin/feature.

I have not yet digged into all the features of p2, but i am sure there are ore features than i know.

Its so easy to browse the available software and then download it without worrying about the dependencies.

Automatic updates are possible from the Preference Page.

All in all, i am enjoying my time with Ganymede. I am sure that the ECF is one more exciting project that got released. But i have not got the time to play with it yet. I have seen one video that Ian shared. Its awesome.

Thanks to all those developers and the organizations behind them. Long live Eclipse.

Posted in Uncategorized | Tagged: , , , | 6 Comments »

Java XML Libraries - Quick Reference

Posted by sureshkrishna on June 13, 2008

Reader Level : Basic

Recently i have been involved in a project that uses heavy XML which game me opportunity to look into many Java and XML related technologies/libraries/parsers. I tried to share some of interesting libraries that i dealt with. Interestingly, i have seen very few developers knew what each term (like “Reader”, “Parser”, “Builder” and “Factories”) means in the XML world. The idea of this article is to introduce basic terms and some resources to start in depth dissection.

XML Parser Technology / Types :

Many refer to “XML parsers” as “XML APIs”. Whatever you call it, in the end every one wants to read, process and build xml in some way or the other. Though its quite possible to consider XML file as sequence of characters and write custom parsers, thats not the recommended way if one need to do their job in a “easy” manner. In the XML world we often fined two widely used parsers; SAX (Simple API for XML) and DOM (Document Object Model). I am limiting the discussion only to the SAX and DOM.

SAX : sax is a event-based parsing mechanism. As the “SAX Parser” parses the XML input streams, events like startDocument, endDocument, startElement, endElement, ect… are encountered and the client program gets the call backs. As this parser type does not load the xml document in to the memory, its relatively low on resources. Sax is a READ-ONLY api (i.e. One can not change any content of the XML File). Client is able to traverse the document in a sequential manner. The new SAX2 specification incorporates name spaces, filter chains, and querying. Some time they are also refered to as push-parsers, as parser pushes recognized tokens to the client.

DOM : DOM is a comprehensive API for XML documents. It lets clients to navigate, retrieve, add, modify or delete the contents from the source XML. As opposed to SAX, DOM stores the entire content of XML file in the memory. As one can imagine that storing the XML document would require some sort of object representation for Nodes, Elements, Attributes, ProcessignInstructions, Comments and Text types, its relatively heavy on the memory. The memory consumption size is normally viewed as 5x the XML size. DOM enables clients to access data randomly from the in-memory document. Before we go any further, its important to understand that the current discussion is limited to Java technology. So, lets see a little about the most-frequently-used package from the SDK.

JAXP :

The Java API for XML Processing (JAXP) enables applications to parse, transform, validate and query XML documents using an API that is independent of a particular XML processor implementation. JAXP provides a pluggability layer to enable vendors to provide their own implementations without introducing dependencies in application code. Using this software, application and tool developers can build fully-functional XML-enabled Java applications for e-commerce, application integration, and web publishing.

JAXP is a standard component in the Java platform. An implementation of the JAXP 1.3 is included in J2SE 5.0 and an implementation of JAXP 1.4 is in Java SE 6.0. JAXP 1.4 is a maintenance release of JAXP 1.3 with support for the Streaming API for XML (StAX). JAXP 1.3 contained five JAR files which were jaxp-api.jar, sax.jar, dom,jar, xercesImpl.jar, and xalan.jar. The packaging reflected the technologies covered, as well as sources used in JAXP 1.3. In JAXP 1.4, these technologies and the newly added StAX package have been tightly integrated into the JAXP RI

Parser Implementations :

Xerces-J : The Xerces Java Parser 1.4.4 supports the XML 1.0 recommendation and contains advanced parser functionality, such as support for the W3C’s XML Schema recommendation version 1.0, DOM Level 2 version 1.0, and SAX Version 2, in addition to supporting the industry-standard DOM Level 1 and SAX version 1 APIs. This release includes full support for the W3C XML Schema Recommendation, except for limitations as described on their website.

In order to take advantage of the fact that this parser is very often used in conjunction with other XML technologies, such as XSLT processors, which also rely on standard API’s like DOM and SAX, xerces.jar was split into two jarfiles:

  • xml-apis.jar contains the DOM level 3, SAX 2.0.2 and the JAXP 1.3 APIs;
  • xercesImpl.jar contains the implementation of these API’s as well as the XNI API.

XPath Implementations :

Jaxen : Jaxen is an open source XPath library written in Java. It is adaptable to many different object models, including DOM, XOM, dom4j, and JDOM. Is it also possible to write adapters that treat non-XML trees such as compiled Java byte code or Java beans as XML, thus enabling you to query these trees with XPath too.

Saxon : Saxon is a full featured library for the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations. Saxon comes in two packages: Saxon-B implements the “basic” conformance level for XSLT 2.0 and XQuery, while Saxon-SA is a schema-aware XSLT and XQuery processor. Both packages are available on both platforms (Java and .NET). Saxon-B is an open source product available from this site; Saxon-SA is a commercial product available from Saxonica Limited. A free 30-day evaluation license is available.

Xalan : Xalan-Java fully implements XSL Transformations (XSLT) Version 1.0 and the XML Path Language (XPath) Version 1.0. XSLT is the first part of the XSL stylesheet language for XML. It includes the XSL Transformation vocabulary and XPath, a language for addressing parts of XML documents. Implements Java API for XML Processing (JAXP) 1.3, and builds on SAX 2 and DOM level 3.Implements the XPath API in JAXP 1.3.May be configured to work with any XML parser, such as Xerces-Java, that implements JAXP 1.3.

Java XML Document Builders :

Do NOT confuse Builders with parsers. Builders basically uses the default/underlaying parsers, gets the org.w3c.Document and converts them to specific Document type (e.g. org.dom4j.Document or org.jdom.Document). DOM4J seems to be quite advanced in terms of the functionality for a Java developer. The JDOM API seems to be quite simple for the implementation.

JDOM : JDOM is, quite simply, a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing. It has a straightforward API, is a lightweight and fast, and is optimized for the Java programmer. It’s an alternative to DOM and SAX, although it integrates well with both DOM and SAX. Most importantly it uses Java Collection API. I hope its easy for a java programmer :) .
As i understand JDOM relies on the Jaxen as the default XPath library. But we can also use any xpath lilbrary of our choice like xalan.

DOM4J : dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAXP.

References:

  • Xerces
    • http://xerces.apache.org/xerces2-j
    • http://xerces.apache.org/xerces2-j/faqs.html
  • JAXP
    • https://jaxp.dev.java.net
    • https://jaxp.dev.java.net/files/documents/913/16751/BoF-9209-Java-API-for-XML-Processing.pdf
  • JDOM
    • http://www.jdom.org
    • http://www.jdom.org/docs/faq.html
  • DOM4J
    • http://www.dom4j.org/cookbook.html
    • http://www.dom4j.org/compare.html
    • http://dom4j.org/benchmarks/xpath/index.html
  • Jaxen
    • http://jaxen.codehaus.org
    • http://jaxen.codehaus.org/faq.html
    • http://cafeconleche.org/books/xmljava/chapters/ch16s07.html
  • Saxon
    • http://www.saxonica.com
    • http://saxon.sourceforge.net
  • Xalan
    • http://xml.apache.org/xalan-j/overview.html
    • http://xml.apache.org/xalan-j/getstarted.html
  • A look at features and performance of XML document models in Java
    • http://www.ibm.com/developerworks/xml/library/x-injava/index.html
  • http://www.ibm.com/developerworks/edu/x-dw-xml-i.html

Posted in Uncategorized | Tagged: , , , , , , , , , | 7 Comments »

JDOM Quick Reference

Posted by sureshkrishna on June 9, 2008

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 Uncategorized | No Comments »

MoinMoin setup in easy steps

Posted by sureshkrishna on April 25, 2008

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 Uncategorized | Tagged: , , , , , | No Comments »

Why should you Jazz ?

Posted by sureshkrishna on April 4, 2008

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 Uncategorized | Tagged: , , , | 1 Comment »

EclipseCon 2008 - I loved it.

Posted by sureshkrishna on March 21, 2008

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 Uncategorized | Tagged: , , , | 1 Comment »

JFace Dialogs : which one is right for you ?

Posted by sureshkrishna on March 15, 2008

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 343278, Eclipse, Plugin, RCP, Uncategorized | Tagged: , , , | 2 Comments »

Videos as Next generation documentation

Posted by sureshkrishna on March 6, 2008

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 Uncategorized | Tagged: , , | 6 Comments »

Wikis for your Organization

Posted by sureshkrishna on March 4, 2008

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 Uncategorized | Tagged: , , | 1 Comment »