Sciology = Science + Technology

Commonsense in Technology

Archive for the ‘Uncategorized’ Category

RCP, RAP and eRCP : Single Code Base and Three Runtimes

Posted by sureshkrishna on September 17, 2008

Running an Eclipse application on Desktop, Web and mobile platform seems to be an exciting and challenging task for many. With a clear and crisp APIs, Eclipse made this task practical and easier. Chris Aniszczyk has already posted an example of Tic-Tac-Toe on his blog.

Recently me and Trebor (another eclipse enthusiast) have done an exercise to get a sample application on top of these three (rcp, rap and ercp) run-times with the Ganymede release. In this three part tutorial we built a simple Personal Organizer application and ran it on RCP, RAP and eRCP.

First Part goes through the necessary steps to create the application and run it as the Rich Client Platform (RCP) application.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt1.html

Second Part talks about the Rich Ajax Platform and how the existing code base of the sample RCP application can be adapted to run it on the RAP target.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt2.html

Third Part talks about the Embedded RCP and how to adapt the existing RCP code base to be able to run it on the eRCP.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt3.html

Hope these tutorials and insights will help a lot of developers to understand these platforms and know the possibilities. I will be happy to hear your experiences in making the single code base run on these three different platforms.

Till then Happy Eclipse-ing.

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

Attn : Eclipse Enthusiasts in Bay Area

Posted by sureshkrishna on September 9, 2008

After the Eclipse Day @ Googleplex, i was wondering if a similar thing can be organized in Bay Area. I understand that Googleplex event is a special one, however if anyone is interested, we can probably start a Regional Community in BayArea.

Please raise a hand if you are interested in sharing your thoughts, experiences and discussing the happenings in the Eclipse community. This is also an opportunity to meet Eclipse enthusiasts in Bay Area.

Send me a mail (suresh DOT madhuvarsu AT gmail DOT com) expressing your interest and I am glad to coordinate for future “Bay Area Eclipse Users Group”. If it’s too much of a work for me, perhaps i can get some help from Ian Skerrett 😉

Posted in Uncategorized | Tagged: , , | Leave a Comment »

Beware of writing regex and string functions

Posted by sureshkrishna on August 6, 2008

Recently i was involved in an issue took a week to come to know the root cause. In the end its an eye opener to many who does not give importance to string functions and regex. “Regular expressions and String functions are quite powerful in any language; however utmost importance should be given to such code.”

The issue is very simple. Set of Java Files need to processed to get some annotations and other proprietary stuff and also separate the main class names and inner class names. The customer created Business Entities which may contain inner classes and are passed through a pre-processor. Problem occurs in a particular case when the File name is “BlaSomeClassName_Bla.java” and it contains a inner class “SomeClass”.

–>Inner class name is SIMILAR to main class name.

Lets look at the following code and especially the line 6. This line tries to match the class names given by qdox (java source parser) with the java source file that is currently being processed.

1     if (classes.length == 1) {
2         _javaClass = classes[0];
3     } else {
4         for (int i = 0; i < classes.length; i++) {
5             JavaClass aClass = classes[i];
6             if (aSourceFile.getName().matches(".*" + aClass.getName() + ".*")) {
7                 _javaClass = classes[i];
8                 break;
9             }
10        }
11    }

This is the regular expression that took up my days and nights which rarely has any sort of consistency in execution. In the above example the source that is being processed is the “BlaSomeClassName_Bla.java” and the class names that you get from qdox will be “BlaSomeClassName_Bla” and “SomeClass”. And now probably you would have guessed. In the array “classes”, if the “SomeClass” comes as the first element you are screwed. The regular expression matches the “BlaSomeClassName_Bla” and the processing class is taken as “SomeClass”. Where as the right processing class is “BlaSomeClassName_Bla”.

This issue took quite a few days to really understand and get to the bottom of the code. Many many thanks to eclipse which enables a cool debugging. Conditional debugging is very useful in such scenarios where you would not want to wait for a long time to see the special case. Instead, introduce the right condition and rest is taken care by eclipse. This is what makes the eclipse my favorite IDE.

Do you have any such experiences with strings and regex ?

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

Organizational Growth and Freeway Traffic

Posted by sureshkrishna on July 30, 2008

Did you every wonder any kind of correlation between the Organizational Growth and Freeway traffic ? As i travel a lot on the freeway over the weekends (to Southern California especially on the Route 1), i found an interesting correlation among these two.

Everyone of us would want to do great jobs and grow in an organization; Be it a small or big organization. Every once aspires and dreams to take some dream jobs and work towards it. Your success at work is mainly a function of yourself, organization, boss and job. How many times did you ever wonder that if i had a better boss, if i were in a  better project, if i was in “ABC” organization, etc… I see some of these scenarios and could not resist to compare it with the why we drive on the freeway.

Your Growth and Boss : For many of us Boss is the “Company” to you. As he is the person, everyone looks at a company. If he gives us a good feeling, you feel happy about the company and if he is bad, you are screwed. Boss is the one who recognizes the stuff in you, promotes you at the right time. Your growth pace is directly proportional to your Boss and his work. If Boss is sluggish and slow, so is your growth rate and opportunities. Many a times his speed is your speed (I often hear that many people leave the company because of the Boss and NOT because of the Organization).

Now compare this on a single line freeway with no turnarounds and no way to pull out of the road. Your Boss is the Vehicle in front of you. You are following the vehicle and your speed is DIRECTLY proportional it. If the vehicle in front of you is going fast you are going fast; if its slow you are slow. There is no way to bypass or move into another lane. You need to wait till he takes an EXIT and you are driving on your own. Does it ring the bell.

Corporates and Freeway : Many people that i know work in corporates so that they have the flexibility to move around the globe (with the companies multinational presence) and take on different areas of work (which could translate to different departments, business verticals and corporate divisions). When you typically work in such environments, if you do not like your boss or you want to move on…. you always have the OPPORTUNITY. Move to a new Division or Department or new Geo Area…. you are most probably set. You do not worry about being stuck to your SAME Boss for a long time.

Now look at the Freeway with multiple lines. You are driving in one lane and your vehicle in front of you gets clogged, move on to the other lane and drive ahead. You have many possibilities in terms of how you want to go and at what phase you want to go.

Of course it is the ultimate BAD LUCK, if ALL the lanes are busy and there is no way to escape :). The only thing you can do in this scenario is either to complete the travel or take an EXIT and move on to another freeway.

Oversight : We all want to do the dream job and in any organization there is a job that is most sought after. We all are in that QUEUE to get that job and achieve our goals. But we seldom see a job that is less sought after, BUT takes you to your destination much faster. We are so obsessed in doing our RIGHT job, we often forget that there is a less trodden path which would also take you to the destination.

Its easy on Freeway. We all want to go FAST, so we take the “LEFT” most lane. There are so many people who wants to drive faster, you see that the LEFT lane is full of vehicles and the other “SLOWER” lanes are almost empty. Even when we can move to the other lanes to avoid this big QUEUE, we don’t. It takes a little bit of insight and smartness to move from the LEFT lane to the other SLOWER lanes and reach the destination FASTER than the LEFT lane.

Dont you thing this happens with many us ? I will be glad to hear your experiences and such analogies.

Posted in Uncategorized | Tagged: , , , , | Leave a Comment »

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: , , , | 7 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:

Posted in Uncategorized | Tagged: , , , , , , , , , | 11 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 | Tagged: , , , , | 3 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

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:

Posted in Uncategorized | Tagged: , , , , , | 19 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 »