You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/08/27 07:46:57 UTC

svn commit: r1377572 [1/4] - in /incubator/oozie/trunk: ./ workflowgenerator/ workflowgenerator/src/ workflowgenerator/src/main/ workflowgenerator/src/main/assemblies/ workflowgenerator/src/main/java/ workflowgenerator/src/main/java/org/ workflowgenera...

Author: virag
Date: Mon Aug 27 05:46:54 2012
New Revision: 1377572

URL: http://svn.apache.org/viewvc?rev=1377572&view=rev
Log:
OOZIE-944 Implement Workflow Generator UI Tool (egashira via virag)

Added:
    incubator/oozie/trunk/workflowgenerator/
    incubator/oozie/trunk/workflowgenerator/README.txt
    incubator/oozie/trunk/workflowgenerator/pom.xml
    incubator/oozie/trunk/workflowgenerator/src/
    incubator/oozie/trunk/workflowgenerator/src/main/
    incubator/oozie/trunk/workflowgenerator/src/main/assemblies/
    incubator/oozie/trunk/workflowgenerator/src/main/assemblies/workflowgenerator.xml
    incubator/oozie/trunk/workflowgenerator/src/main/java/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieDiagramController.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieWorkflowGenerator.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/Property.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/PropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/PropertyTableFactory.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/EmailPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/FSPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/JavaPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/MapReducePropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/PigPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/PipesPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/SSHPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/ShellPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/StreamingPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/action/SubWFPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/DecisionPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/EndPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/ForkPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/JoinPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/KillPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/StartPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/control/WrkflowPropertyTable.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/NodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/EmailActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/FSActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/JavaActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/MapReduceActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/PigActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/PipesActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/SSHActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/ShellActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/StreamingActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/action/SubWFActionWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/DecisionNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/EndNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/ForkNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/JoinNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/KillNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/widget/control/StartNodeWidget.java
    incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/workflowgenerator.gwt.xml
    incubator/oozie/trunk/workflowgenerator/src/main/resources/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/add-btn.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/decision.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/del-btn.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/distcp-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/email-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/end.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/fork-shape.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/fork.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/fs-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/hive-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/java-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/join-shape.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/join.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/kill.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/mr-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/pig-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/pipes-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/shell-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/ssh-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/start-shape.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/start.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/streaming-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/img/subwf-action.png   (with props)
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/apache/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/apache/oozie/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/apache/oozie/tools/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/apache/oozie/tools/workflowgenerator/
    incubator/oozie/trunk/workflowgenerator/src/main/resources/org/apache/oozie/tools/workflowgenerator/workflowgenerator.gwt.xml
    incubator/oozie/trunk/workflowgenerator/src/main/webapp/
    incubator/oozie/trunk/workflowgenerator/src/main/webapp/WEB-INF/
    incubator/oozie/trunk/workflowgenerator/src/main/webapp/WEB-INF/web.xml
    incubator/oozie/trunk/workflowgenerator/src/main/webapp/workflowgenerator.css
    incubator/oozie/trunk/workflowgenerator/src/main/webapp/workflowgenerator.html
    incubator/oozie/trunk/workflowgenerator/workflowgeneratorTest-dev.launch
    incubator/oozie/trunk/workflowgenerator/workflowgeneratorTest-prod.launch
Modified:
    incubator/oozie/trunk/release-log.txt

Modified: incubator/oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1377572&r1=1377571&r2=1377572&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Mon Aug 27 05:46:54 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.3.0 release (trunk - unreleased)
 
+OOZIE-944 Implement Workflow Generator UI Tool (egashira via virag)
 OOZIE-961 Load Hbase credentials in Oozie (virag)
 OOZIE-963 Add new EL function to replace all instances of a sub-string with another one (kamrul via virag)
 OOZIE-969 Unit tests in TestStatusTransitService failing due to change in CoordKillX (mona via virag)

Added: incubator/oozie/trunk/workflowgenerator/README.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/README.txt?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/README.txt (added)
+++ incubator/oozie/trunk/workflowgenerator/README.txt Mon Aug 27 05:46:54 2012
@@ -0,0 +1,126 @@
+
+Workflow Generator Tool
+=========================
+
+What is Workflow Generator Tool
+----------------------
+Workflow generator tool is a web application where a user can construct Oozie workflow through GUI.
+Since it is based on html and javascript, a user needs only browser to access the tool. (major browsers such as Chrome, Firefox, IE supported)
+It is developed using Google Web Toolkit ( https://developers.google.com/web-toolkit/ ), which provides functionality to compile java code into javascript.
+Therefore, although final product is in javascript, development process is performed in java.
+
+
+How to build and launch Workflow Generator Tool
+----------------------
+
+There are three possible options
+Option-A) launch app using bundled tomcat
+Option-B) launch app using web server that you are already running (without using bundled tomcat)
+Option-C) launch app in dev mode using bundled internal web server provided by GWT.
+
+Option-A would be good for easy start since you don't have to install and run tomcat server by yourself.
+Option-B would be suitable when you want to host this application on the existing tomcat instance. You need to copy war file into webapp directory of existing tomcat.
+Option-C would be suitable for development of the tool since you can see error messages for debugging, and don't need to create and copy war file every time
+
+Option-C internally using java class (servlet), not javascript.
+On browser UI, therefore, DOM operation (e.g., creating/deleting nodewidget) might be slower than using pure javascript (Option-A and B)
+
+============================
+<Option-A>
+
+1. build project
+---------------------
+mvn clean package -Dmaven.test.skip=true
+---------------------
+[NOTE]
+test case not implemented yet, so please skip test, otherwise may fail
+during the build process, tomcat package is automatically downloaded from apache site. war file is also generated and copied into webapps directory of tomcat.
+
+2. start web server
+---------------------
+target/workflowgenerator-1.0-SNAPSHOT-tomcat/bin/startup.sh
+---------------------
+
+3. check through browser
+---------------------
+http://localhost:8080/workflowgenerator-1.0-SNAPSHOT/
+---------------------
+[NOTE]
+using default port number, which is 8080. tomcat server may fail to start if other application already using the same port. please make sure the port is not used. If you want to change the port number, please edit target/workflowgenerator-1.0-SNAPSHOT-tomcat/conf/server.xml
+
+4. stop web server
+---------------------
+target/workflowgenerator-1.0-SNAPSHOT-tomcat/bin/shutdown.sh
+---------------------
+
+
+============================
+<Option-B>
+
+1. build project and create war file
+---------------------
+mvn clean package -Dmaven.test.skip=true
+---------------------
+[NOTE]
+test case not implemented yet, so please skip test, otherwise may fail
+
+2. copy war file to webapps directory of web server
+---------------------
+cp target/workflowgenerator-1.0-SNAPSHOT.war <webserver-installed-directory>/webapps/
+---------------------
+
+3. start web server
+---------------------
+<webserver-installed-directory>/bin/startup.sh
+---------------------
+[NOTE]
+name of start script might be different in your web-server, please change accordingly
+
+4. check through browser
+---------------------
+http://localhost:8080/workflowgenerator-1.0-SNAPSHOT/
+---------------------
+[NOTE]
+port number might not be 8080 in your web-server setting, please change accordingly
+
+5. stop web server
+---------------------
+<webserver-installed-directory>/bin/shutdown.sh
+---------------------
+[NOTE] name of shutdown script might be different in your web-server, please change accordingly
+
+
+============================
+<Option-C>
+
+1. compile and start GWT launcher
+---------------------
+mvn clean gwt:run
+---------------------
+you will see GWT launcher program automatically starts
+
+2. launch app on browser from GWT launcher
+---------------------
+press button either "Launch Default Browser" or "Copy to Clipboard"
+
+"Launcher Default Browser"
+  --> automatically open application on default browser
+  --> First time, you will be asked to install plug-in on browser, (also take few mins to launch app, pls be patient)
+
+"Copy to Clipboard"
+  --> you can copy this link to browser that you like and open it
+  --> First time, you will be asked to install plug-in on browser (also take few mins to launch app, pls be patient)
+---------------------
+
+if you want to kill process, Ctrl-C in console
+
+
+=====================================================================
+
+If you have any questions/issues, please send an email to:
+
+oozie-users@incubator.apache.org
+
+Subscribe using the link:
+
+http://incubator.apache.org/oozie/MailingLists.html

Added: incubator/oozie/trunk/workflowgenerator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/pom.xml?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/pom.xml (added)
+++ incubator/oozie/trunk/workflowgenerator/pom.xml Mon Aug 27 05:46:54 2012
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <!-- POM file generated with GWT webAppCreator -->
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.oozie</groupId>
+  <artifactId>workflowgenerator</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>GWT Maven Archetype</name>
+
+  <properties>
+    <!-- Convenience property to set the GWT version -->
+    <gwtVersion>2.5.0-rc1</gwtVersion>
+    <!-- GWT needs at least java 1.5 -->
+    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.google.gwt</groupId>
+      <artifactId>gwt-servlet</artifactId>
+      <version>${gwtVersion}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.gwt</groupId>
+      <artifactId>gwt-user</artifactId>
+      <version>${gwtVersion}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.10</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <version>1.0.0.GA</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <version>1.0.0.GA</version>
+      <classifier>sources</classifier>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.allen-sauer.gwt.dnd</groupId>
+      <artifactId>gwt-dnd</artifactId>
+      <version>3.1.2</version>
+   </dependency>
+   <dependency>
+      <groupId>com.orange.links</groupId>
+      <artifactId>gwt-links</artifactId>
+      <version>1.3-SNAPSHOT</version>
+    </dependency>
+
+   <dependency>
+       <groupId>com.google.gwt</groupId>
+       <artifactId>gwt-incubator</artifactId>
+       <version>2.0.1</version>
+    </dependency>
+   </dependencies>
+   <build>
+    <!-- Generate compiled stuff in the folder used for developing mode -->
+    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
+
+    <plugins>
+
+      <!-- GWT Maven Plugin -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>gwt-maven-plugin</artifactId>
+        <version>2.5.0-rc1</version>
+        <executions>
+          <execution>
+             <configuration>
+                <module>org.apache.oozie.tools.workflowgenerator.workflowgenerator</module>
+             </configuration>
+           <goals>
+              <goal>compile</goal>
+              <goal>test</goal>
+            </goals>
+          </execution>
+        </executions>
+        <!-- Plugin configuration. There are many available options, see
+        gwt-maven-plugin documentation at codehaus.org -->
+        <configuration>
+          <runTarget>workflowgenerator.html</runTarget>
+          <hostedWebapp>${webappDirectory}</hostedWebapp>
+        </configuration>
+      </plugin>
+
+      <!-- Copy static web files before executing gwt:run -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.1.1</version>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <goal>exploded</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <webappDirectory>${webappDirectory}</webappDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>2.8.1</version>
+        <configuration>
+             <linksource>true</linksource>
+             <quiet>true</quiet>
+             <verbose>false</verbose>
+             <source>${maven.compile.source}</source>
+             <charset>${maven.compile.encoding}</charset>
+         </configuration>
+         <executions>
+             <execution>
+                 <goals>
+                     <goal>javadoc</goal>
+                 </goals>
+                 <phase>package</phase>
+             </execution>
+         </executions>
+      </plugin>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.6</version>
+            <executions>
+                <execution>
+                    <configuration>
+                        <target>
+                            <mkdir dir="downloads"/>
+                            <get src="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz"
+                                 dest="downloads/tomcat.tar.gz" verbose="true" skipexisting="true"/>
+                            <delete dir="target/tomcat-pkg"/>
+                            <mkdir dir="target/tomcat-pkg"/>
+                            <delete dir="target/${project.artifactId}-${project.version}-tomcat"/>
+                            <mkdir dir="target/${project.artifactId}-${project.version}-tomcat"/>
+                            <gunzip src="downloads/tomcat.tar.gz" dest="target/tomcat-pkg/tomcat.tar"/>
+                            <untar src="target/tomcat-pkg/tomcat.tar" dest="target/tomcat-pkg"/>
+                            <move file="target/tomcat-pkg/apache-tomcat-6.0.32" tofile="target/${project.artifactId}-${project.version}-tomcat"/>
+                            <delete dir="target/tomcat-pkg"/>
+                            <delete dir="target/${project.artifactId}-${project.version}-tomcat/webapps"/>
+                            <mkdir dir="target/${project.artifactId}-${project.version}-tomcat/webapps"/>
+                            <copy file="target/${project.artifactId}-${project.version}.war" toDir="target/${project.artifactId}-${project.version}-tomcat/webapps"/>
+                            <chmod dir="target/${project.artifactId}-${project.version}-tomcat/bin" perm="ugo+rx" includes="**/*.sh"/>
+                        </target>
+                    </configuration>
+                    <goals>
+                        <goal>run</goal>
+                    </goals>
+                    <phase>package</phase>
+                </execution>
+            </executions>
+        </plugin>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+                <execution>
+                    <goals>
+                        <goal>assembly</goal>
+                    </goals>
+                    <phase>package</phase>
+                </execution>
+            </executions>
+            <configuration>
+                <descriptors>
+                    <descriptor>src/main/assemblies/workflowgenerator.xml</descriptor>
+                </descriptors>
+            </configuration>
+        </plugin>
+    </plugins>
+    <resources>
+        <resource>
+              <directory>src/main/resources/img</directory>
+              <targetPath>../../img</targetPath>
+        </resource>
+    </resources>
+  </build>
+  <repositories>
+    <repository>
+     <id>gwt-links</id>
+     <url>http://gwt-links.googlecode.com/svn/repository</url>
+    </repository>
+  </repositories>
+</project>

Added: incubator/oozie/trunk/workflowgenerator/src/main/assemblies/workflowgenerator.xml
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/src/main/assemblies/workflowgenerator.xml?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/src/main/assemblies/workflowgenerator.xml (added)
+++ incubator/oozie/trunk/workflowgenerator/src/main/assemblies/workflowgenerator.xml Mon Aug 27 05:46:54 2012
@@ -0,0 +1,30 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<assembly>
+    <id>tomcat</id>
+    <formats>
+        <format>tar.gz</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>${basedir}/target/${project.artifactId}-${project.version}-tomcat</directory>
+            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

Added: incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieDiagramController.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieDiagramController.java?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieDiagramController.java (added)
+++ incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieDiagramController.java Mon Aug 27 05:46:54 2012
@@ -0,0 +1,434 @@
+package org.apache.oozie.tools.workflowgenerator.client;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.oozie.tools.workflowgenerator.client.property.control.WrkflowPropertyTable;
+import org.apache.oozie.tools.workflowgenerator.client.widget.NodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.KillNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.StartNodeWidget;
+
+import com.google.gwt.dom.client.Style.Cursor;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.MenuItem;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.TextArea;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.xml.client.Document;
+import com.google.gwt.xml.client.Element;
+import com.google.gwt.xml.client.Node;
+import com.google.gwt.xml.client.XMLParser;
+import com.orange.links.client.DiagramController;
+import com.orange.links.client.connection.Connection;
+import com.orange.links.client.event.TieLinkEvent;
+import com.orange.links.client.menu.ContextMenu;
+import com.orange.links.client.shapes.FunctionShape;
+
+/**
+ * Class to provide a panel where users create node widget or draw a line to
+ * construct a workflow
+ */
+public class OozieDiagramController extends DiagramController {
+
+    private Panel xmlpanel;
+    private WrkflowPropertyTable wrkflowtable;
+
+    /**
+     * Constructor which records canvas size
+     *
+     * @param canvasWidth width of canvas
+     * @param canvasHeight height of canvas
+     */
+    public OozieDiagramController(int canvasWidth, int canvasHeight) {
+        super(canvasWidth, canvasHeight);
+    }
+
+    /**
+     * Constructor which records canvas size and frame size
+     *
+     * @param canvasWidth width of canvas
+     * @param canvasHeight height of canvas
+     * @param frameWidth width of frame
+     * @param frameHeight height of frame
+     */
+    public OozieDiagramController(int canvasWidth, int canvasHeight, int frameWidth, int frameHeight) {
+        super(canvasWidth, canvasHeight, frameWidth, frameHeight);
+    }
+
+    /**
+     * Initialize right-click context menu
+     */
+    public void initMenu() {
+        canvasMenu = new ContextMenu();
+        canvasMenu.addItem(new MenuItem("Generate XML", new Command() {
+            @Override
+            public void execute() {
+                generateXml();
+            }
+        }));
+
+    }
+
+    /**
+     * Return a list of neighboring node widgets which the specified node widget
+     * has connection to
+     *
+     * @param w node widget
+     * @return
+     */
+    public List<NodeWidget> getCurrentNeighbor(NodeWidget w) {
+        List<NodeWidget> current = new ArrayList<NodeWidget>();
+        FunctionShape s = widgetShapeMap.get(w);
+        Map<Widget, Connection> connectMap = functionsMap.get(w);
+        if (connectMap == null) {
+            return null;
+        }
+        for (Iterator<Map.Entry<Widget, Connection>> it = connectMap.entrySet().iterator(); it.hasNext();) {
+            Map.Entry<Widget, Connection> entry = it.next();
+            Connection c = entry.getValue();
+            if (c.getStartShape() == s) {
+                FunctionShape e = (FunctionShape) c.getEndShape();
+                current.add((NodeWidget) e.asWidget());
+            }
+        }
+
+        return current;
+    }
+
+    /**
+     * Return a list of connections that the specified node widget has
+     *
+     * @param w node widget
+     * @return
+     */
+    public List<Connection> getConnection(NodeWidget w) {
+        List<Connection> li = new ArrayList<Connection>();
+        FunctionShape shape = widgetShapeMap.get(w);
+        for (Connection c : shape.getConnections()) {
+            li.add(c);
+        }
+        return li;
+    }
+
+    /**
+     * Add a new connection from one node widget to the other, while deleting
+     * existing connection that the start node widget has if any
+     *
+     * @param start start node widget
+     * @param end end node widget
+     */
+    public void addConnection(NodeWidget start, NodeWidget end) {
+        boolean exists = false;
+        FunctionShape s1 = widgetShapeMap.get(start);
+        FunctionShape s2 = widgetShapeMap.get(end);
+        Connection current = null;
+        for (Connection c : s1.getConnections()) {
+            if (c.getStartShape() == s1) {
+                current = c;
+            }
+            if (c.getEndShape() == s2) {
+                exists = true;
+                break;
+            }
+        }
+        if (!exists) {
+            if (current != null) {
+                this.deleteConnection(current);
+                s1.removeConnection(current);
+                s2.removeConnection(current);
+            }
+            Connection c = drawStraightArrowConnection(start, end);
+            fireEvent(new TieLinkEvent(start, end, c));
+        }
+    }
+
+    /**
+     * Add a new connection from one node widget to the other without deleting
+     * existing connection that the starting node widget has
+     *
+     * @param start start node widget
+     * @param end end node widget
+     * @return
+     */
+    public Connection addMultiConnection(NodeWidget start, NodeWidget end) {
+        boolean exists = false;
+        FunctionShape s1 = widgetShapeMap.get(start);
+        FunctionShape s2 = widgetShapeMap.get(end);
+        Connection conn = null;
+
+        for (Connection c : s1.getConnections()) {
+            if (c.getEndShape() == s2) {
+                exists = true;
+                break;
+            }
+        }
+        if (!exists) {
+            conn = drawStraightArrowConnection(start, end);
+            fireEvent(new TieLinkEvent(start, end, conn));
+        }
+
+        return conn;
+    }
+
+    /**
+     * Return a connection between node widgets
+     *
+     * @param start start node widget
+     * @param end end node widget
+     * @return
+     */
+    public Connection getConnection(NodeWidget start, NodeWidget end) {
+
+        Connection conn = null;
+        Map<Widget, Connection> m = (Map<Widget, Connection>) functionsMap.get(start);
+        if (m != null) {
+            conn = (Connection) m.get(end);
+        }
+        return conn;
+    }
+
+    /**
+     * Return if there is a connection between node widgets
+     *
+     * @param start start node widget
+     * @param end end node widget
+     * @return
+     */
+    public boolean isConnected(NodeWidget start, NodeWidget end) {
+        return functionsMap.get(start).containsKey(end);
+    }
+
+    /**
+     * Remove a connection between node widgets
+     *
+     * @param start start node widget
+     * @param end end node widget
+     */
+    public void removeConnection(NodeWidget start, NodeWidget end) {
+
+        FunctionShape s1 = widgetShapeMap.get(start);
+        FunctionShape s2 = widgetShapeMap.get(end);
+
+        if (functionsMap.get(start).containsKey(end)) {
+            Connection c = functionsMap.get(start).get(end);
+            this.deleteConnection(c);
+            s1.removeConnection(c);
+            s2.removeConnection(c);
+            functionsMap.get(start).remove(end);
+        }
+    }
+
+    /**
+     * Set a panel to display generated xml
+     *
+     * @param w
+     */
+    public void setXmlPanel(Panel w) {
+        this.xmlpanel = w;
+    }
+
+    /**
+     * Generate a xml document of the current workflow
+     */
+    public void generateXml() {
+
+        Document xmldoc = null;
+        xmldoc = (Document) XMLParser.createDocument();
+
+        // initialize visit-flag of all widgets
+        for (Widget w : widgetShapeMap.keySet()) {
+            ((NodeWidget) w).unvisit();
+        }
+
+        NodeWidget current = null;
+        NodeWidget next = null;
+        LinkedList<NodeWidget> queue = new LinkedList<NodeWidget>();
+
+        String appname = "visualizationApp";
+        if (wrkflowtable != null) {
+            appname = wrkflowtable.getName();
+        }
+        Element root = xmldoc.createElement("workflow-app");
+        root.setAttribute("xmlns", wrkflowtable.getNameSpace());
+        root.setAttribute("name", appname);
+        xmldoc.appendChild(root);
+
+        wrkflowtable.generateXML(xmldoc, root, null);
+
+        for (Connection c : this.connections) {
+            FunctionShape startShape = (FunctionShape) c.getStartShape();
+            NodeWidget w = (NodeWidget) startShape.asWidget();
+            if (w instanceof StartNodeWidget) {
+                queue.add(w);
+                break;
+            }
+        }
+
+        while ((current = queue.poll()) != null) {
+
+            if (current.isVisited()) {
+                continue;
+            }
+            Map<Widget, Connection> nextMap = this.functionsMap.get(current);
+            if (nextMap == null) {
+                next = null;
+            }
+            else {
+                for (Iterator itr = nextMap.keySet().iterator(); itr.hasNext();) {
+                    next = (NodeWidget) itr.next();
+                    queue.add(next);
+                }
+            }
+            current.generateXML(xmldoc, root, next);
+            current.visit();
+        }
+
+        // Adding Kill Node
+        for (Widget w : this.widgetShapeMap.keySet()) {
+            if (w instanceof KillNodeWidget) {
+                ((KillNodeWidget) w).generateXML(xmldoc, root, null);
+            }
+        }
+
+        xmlpanel.clear();
+        TextArea xml = new TextArea();
+        xml.getElement().setScrollTop(xml.getElement().getScrollHeight());
+        xml.setCharacterWidth(80);
+        xml.setVisibleLines(30);
+        xml.setText(formatXML(root, "  "));
+        xmlpanel.add(xml);
+
+    }
+
+    /**
+     * Format generated xml doc by indentation
+     *
+     * @param node
+     * @param indent
+     * @return
+     */
+    protected String formatXML(Node node, String indent) {
+        StringBuilder formatted = new StringBuilder();
+
+        if (node.getNodeType() == Node.ELEMENT_NODE) {
+            StringBuilder attributes = new StringBuilder();
+            for (int k = 0; k < node.getAttributes().getLength(); k++) {
+                attributes.append(" ");
+                attributes.append(node.getAttributes().item(k).getNodeName());
+                attributes.append("=\"");
+                attributes.append(node.getAttributes().item(k).getNodeValue());
+                attributes.append("\"");
+            }
+
+            formatted.append(indent);
+            formatted.append("<");
+            formatted.append(node.getNodeName());
+            formatted.append(attributes.toString());
+            if (!node.hasChildNodes() || (node.hasChildNodes() && node.getFirstChild().getNodeType() == Node.TEXT_NODE)) {
+                formatted.append(">");
+            }
+            else {
+                formatted.append(">\n");
+            }
+
+            for (int i = 0; i < node.getChildNodes().getLength(); i++) {
+                formatted.append(formatXML(node.getChildNodes().item(i), indent + "   "));
+            }
+
+            if (node.hasChildNodes() && node.getFirstChild().getNodeType() != Node.TEXT_NODE) {
+                formatted.append(indent);
+            }
+            formatted.append("</");
+            formatted.append(node.getNodeName());
+            formatted.append(">\n");
+        }
+        else {
+            if (node.toString().trim().length() > 0) {
+                formatted.append(node.toString());
+            }
+        }
+
+        return formatted.toString();
+    }
+
+    /**
+     * Update a diagram controller
+     */
+    @Override
+    public void update() {
+        redrawConnections();
+
+        // If the user is dragging widgets, do nothing
+        if (inDragWidget) {
+            return;
+        }
+        topCanvas.clear();
+
+        // Search for selectable area
+        if (!inDragBuildArrow) {
+            for (FunctionShape s : shapes) {
+                if (s.isMouseNearSelectableArea(mousePoint)) {
+                    s.highlightSelectableArea(mousePoint);
+                    inEditionSelectableShapeToDrawConnection = true;
+                    startFunctionWidget = s.asWidget();
+                    RootPanel.getBodyElement().getStyle().setCursor(Cursor.POINTER);
+                    return;
+                }
+                inEditionSelectableShapeToDrawConnection = false;
+            }
+        }
+        else {
+            // Don't go deeper if in edition mode
+            // If mouse over a widget, highlight it
+            FunctionShape s = getShapeUnderMouse();
+            if (s != null) {
+                s.drawHighlight();
+                highlightFunctionShape = s;
+            }
+            else if (highlightFunctionShape != null) {
+                highlightFunctionShape.draw();
+                highlightFunctionShape = null;
+            }
+            clearAnimationsOnCanvas();
+        }
+
+        // Test if in Drag Movable Point
+        if (!inDragMovablePoint && !inDragBuildArrow) {
+            for (Connection c : connections) {
+                if (c.isMouseNearConnection(mousePoint)) {
+                    highlightPoint = c.highlightMovablePoint(mousePoint);
+                    highlightConnection = getConnectionNearMouse();
+                    inEditionDragMovablePoint = true;
+                    RootPanel.getBodyElement().getStyle().setCursor(Cursor.POINTER);
+                    return;
+                }
+                inEditionDragMovablePoint = false;
+            }
+        }
+
+        clearAnimationsOnCanvas();
+    }
+
+    /**
+     * Return a workflow property table
+     *
+     * @return
+     */
+    public WrkflowPropertyTable getWrkflowPropertyTable() {
+        return wrkflowtable;
+    }
+
+    /**
+     * Set a workflow property table
+     *
+     * @param t Workflow property table
+     */
+    public void setWrkflowPropertyTable(WrkflowPropertyTable t) {
+        this.wrkflowtable = t;
+    }
+
+}

Added: incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieWorkflowGenerator.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieWorkflowGenerator.java?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieWorkflowGenerator.java (added)
+++ incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/OozieWorkflowGenerator.java Mon Aug 27 05:46:54 2012
@@ -0,0 +1,696 @@
+package org.apache.oozie.tools.workflowgenerator.client;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+
+import org.apache.oozie.tools.workflowgenerator.client.OozieDiagramController;
+import org.apache.oozie.tools.workflowgenerator.client.property.PropertyTable;
+import org.apache.oozie.tools.workflowgenerator.client.property.control.WrkflowPropertyTable;
+import org.apache.oozie.tools.workflowgenerator.client.widget.NodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.EmailActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.FSActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.JavaActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.MapReduceActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.PigActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.PipesActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.SSHActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.ShellActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.StreamingActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.action.SubWFActionWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.DecisionNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.EndNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.ForkNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.JoinNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.KillNodeWidget;
+import org.apache.oozie.tools.workflowgenerator.client.widget.control.StartNodeWidget;
+
+import com.allen_sauer.gwt.dnd.client.PickupDragController;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.logical.shared.SelectionEvent;
+import com.google.gwt.event.logical.shared.SelectionHandler;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Random;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.*;
+
+/**
+ * Main class of application
+ * <p>
+ * implements EntryPoint class which defines <code>onModuleLoad()</code>.
+ */
+public class OozieWorkflowGenerator implements EntryPoint {
+
+    private PickupDragController dragController;
+    private OozieDiagramController controller;
+    private Panel propPanel;
+    private List<NodeWidget> widgets;
+    private StartNodeWidget start;
+    private EndNodeWidget end;
+    private KillNodeWidget kill;
+    private WrkflowPropertyTable wrkflowtable;
+    private NodeWidget node;
+    private EnumMap<NodeType, Integer> nodeCount;
+
+    enum NodeType {
+        START, END, KILL, FORK, JOIN, DECISION, MAPREDUCE, PIG, FS, JAVA, PIPES, STREAMING, SHELL, SSH, EMAIL, SUBWF
+    };
+
+    /**
+     * Return a set of created node widgets in a workflow design panel
+     *
+     * @return
+     */
+    public List<NodeWidget> getWidgets() {
+        return this.widgets;
+    }
+
+    /**
+     * Set and display the property table of a selected node widget
+     *
+     * @param table
+     */
+    public void setPropertyTable(PropertyTable table) {
+        propPanel.clear();
+        propPanel.add(table);
+    }
+
+    /**
+     * Return an instance of current diagram controller
+     *
+     * @return
+     */
+    public OozieDiagramController getDiagramController() {
+        return this.controller;
+    }
+
+    /**
+     * Return the currently selected node widget
+     *
+     * @return
+     */
+    public NodeWidget getNodeWidget() {
+        return this.node;
+    }
+
+    /**
+     * Set the current node widget
+     *
+     * @param n node widget
+     */
+    protected void setNodeWidget(NodeWidget n) {
+        this.node = n;
+    }
+
+    /**
+     * onModuleLoad is the entry point method.
+     */
+    @SuppressWarnings("deprecation")
+    public void onModuleLoad() {
+
+        widgets = new ArrayList<NodeWidget>();
+        nodeCount = new EnumMap<OozieWorkflowGenerator.NodeType, Integer>(NodeType.class);
+
+        // start DiagramController (gwt-links library)
+        controller = new OozieDiagramController(1200, 600);
+        controller.showGrid(true); // Display a background grid
+
+        // start PickUpDragContoller (gwt-Drag-and-Drop library)
+        dragController = new PickupDragController(controller.getView(), true);
+
+        // register the dragController in GWT-Links
+        controller.registerDragController(dragController);
+
+        // panel for Property Table
+        propPanel = new AbsolutePanel();
+
+        // stack Layout for left-side tree-view
+        StackLayoutPanel stack = new StackLayoutPanel(Unit.EM);
+
+        // create left tree-view panel
+        stack.add(initNodeTree(), new HTML("Nodes"), 2);
+        stack.add(initWrkflowTree(), new HTML("Workflow"), 2);
+
+        initWidget();
+
+        // Create a three-pane layout with splitters.
+        SplitLayoutPanel p = new SplitLayoutPanel();
+
+        Panel east = new AbsolutePanel();
+
+        // Create a top panel under menu to hold button (e.g, generate xml)
+        AbsolutePanel btnpanl = new AbsolutePanel();
+        Button btn = createXMLButton();
+        btnpanl.add(btn);
+
+        p.addNorth(initMenu(), 30);
+        p.addEast(east, 250);
+        p.addSouth(propPanel, 300);
+        p.addWest(stack, 150);
+        p.addNorth(btnpanl, 30);
+        ((OozieDiagramController) controller).setXmlPanel(east);
+        p.add(controller.getView());
+
+        // Attach the LayoutPanel to the RootLayoutPanel.
+        RootLayoutPanel rp = RootLayoutPanel.get();
+        rp.add(p);
+
+    }
+
+    /**
+     * Create a "Generate XML" button
+     *
+     * @return
+     */
+    public Button createXMLButton() {
+        Button btn = new Button("Generate XML");
+        btn.addClickHandler(new ClickHandler() {
+
+            @Override
+            public void onClick(ClickEvent event) {
+                ((OozieDiagramController) controller).generateXml();
+            }
+        });
+        return btn;
+    }
+
+    /**
+     * Initialize a default set of node widgets shown in a workflow design
+     * panel, such as start, end, kill nodes
+     */
+    public void initWidget() {
+
+        if (wrkflowtable == null) {
+            wrkflowtable = new WrkflowPropertyTable(null);
+            ((OozieDiagramController) controller).setWrkflowPropertyTable(wrkflowtable);
+        }
+
+        // display Start/End/Kill Nodes as default
+        if (start == null) {
+            start = new StartNodeWidget(this);
+            controller.addWidget(start, 30, 100);
+            dragController.makeDraggable(start);
+            widgets.add(start);
+        }
+
+        if (end == null) {
+            end = new EndNodeWidget(this);
+            end.setName("End");
+            controller.addWidget(end, 600, 100);
+            dragController.makeDraggable(end);
+            widgets.add(end);
+        }
+
+        if (kill == null) {
+            kill = new KillNodeWidget(this);
+            kill.setName("Kill");
+            controller.addWidget(kill, 700, 100);
+            dragController.makeDraggable(kill);
+            widgets.add(kill);
+        }
+    }
+
+    /**
+     * Initialize workflow tree-view menu on left side
+     *
+     * @return
+     */
+    public Tree initWrkflowTree() {
+        Tree t = new Tree();
+        TreeItem actionTree = new TreeItem("Property");
+        t.addItem(actionTree);
+        t.addSelectionHandler(new SelectionHandler<TreeItem>() {
+
+            @Override
+            public void onSelection(SelectionEvent<TreeItem> event) {
+                TreeItem item = event.getSelectedItem();
+                String name = item.getText();
+                if (name.equals("Property") && wrkflowtable != null) {
+                    setPropertyTable(wrkflowtable);
+                }
+            }
+        });
+
+        return t;
+    }
+
+    /**
+     * Initialize node tree-view menu on left side
+     *
+     * @return
+     */
+    public Tree initNodeTree() {
+
+        Tree t = new Tree();
+
+        // Action Node Tree
+        TreeItem actionTree = new TreeItem("Action Node");
+        TreeItem mrTree = new TreeItem("MapReduce");
+        mrTree.addItem("Streaming");
+        mrTree.addItem("Pipes");
+        actionTree.addItem(mrTree);
+        actionTree.addItem("Pig");
+        actionTree.addItem("Java");
+        actionTree.addItem("FS");
+        actionTree.addItem("Subworkflow");
+        actionTree.addItem("SSH");
+        actionTree.addItem("Shell");
+        actionTree.addItem("Email");
+
+        // Control Node Tree
+        TreeItem controlTree = new TreeItem("Control Node");
+        controlTree.addItem("Start");
+        controlTree.addItem("End");
+        controlTree.addItem("Kill");
+        controlTree.addItem("Fork/Join");
+        controlTree.addItem("Decision");
+
+        t.addItem(actionTree);
+        t.addItem(controlTree);
+
+        // Event Handler
+        t.addSelectionHandler(new SelectionHandler<TreeItem>() {
+
+            @Override
+            public void onSelection(SelectionEvent<TreeItem> event) {
+                TreeItem item = event.getSelectedItem();
+                String name = item.getText();
+                if (name.equals("MapReduce")) {
+                    MapReduceActionWidget w = new MapReduceActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("MR_".concat(nodeCount.get(NodeType.MAPREDUCE) != null ? nodeCount
+                            .get(NodeType.MAPREDUCE).toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("Streaming")) {
+                    StreamingActionWidget w = new StreamingActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Streaming_".concat(nodeCount.get(NodeType.STREAMING) != null ? nodeCount.get(
+                            NodeType.STREAMING).toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("Pipes")) {
+                    PipesActionWidget w = new PipesActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Pipes_".concat(nodeCount.get(NodeType.PIPES) != null ? nodeCount.get(NodeType.PIPES)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("Pig")) {
+                    PigActionWidget w = new PigActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Pig_".concat(nodeCount.get(NodeType.PIG) != null ? nodeCount.get(NodeType.PIG)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("Java")) {
+                    JavaActionWidget w = new JavaActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Java_".concat(nodeCount.get(NodeType.JAVA) != null ? nodeCount.get(NodeType.JAVA)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("FS")) {
+                    FSActionWidget w = new FSActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("FS_".concat(nodeCount.get(NodeType.FS) != null ? nodeCount.get(NodeType.FS).toString()
+                            : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+                else if (name.equals("SSH")) {
+                    SSHActionWidget w = new SSHActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("SSH_".concat(nodeCount.get(NodeType.SSH) != null ? nodeCount.get(NodeType.SSH)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                }
+                else if (name.equals("Email")) {
+                    EmailActionWidget w = new EmailActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Email_".concat(nodeCount.get(NodeType.EMAIL) != null ? nodeCount.get(NodeType.EMAIL)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                }
+                else if (name.equals("Shell")) {
+                    ShellActionWidget w = new ShellActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("Shell_".concat(nodeCount.get(NodeType.SHELL) != null ? nodeCount.get(NodeType.SHELL)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                }
+                else if (name.equals("Subworkflow")) {
+                    SubWFActionWidget w = new SubWFActionWidget(OozieWorkflowGenerator.this);
+                    w.setName("SubWF_".concat(nodeCount.get(NodeType.SUBWF) != null ? nodeCount.get(NodeType.SUBWF)
+                            .toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                }
+                else if (name.equals("Start")) {
+                    if (start == null) {
+                        StartNodeWidget w = new StartNodeWidget(OozieWorkflowGenerator.this);
+                        start = w;
+                        addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                    }
+                }
+                else if (name.equals("End")) {
+                    if (end == null) {
+                        EndNodeWidget w = new EndNodeWidget(OozieWorkflowGenerator.this);
+                        w.setName("End");
+                        end = w;
+                        addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                    }
+                }
+                else if (name.equals("Kill")) {
+                    if (kill == null) {
+                        KillNodeWidget w = new KillNodeWidget(OozieWorkflowGenerator.this);
+                        w.setName("Kill");
+                        kill = w;
+                        addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                    }
+                }
+                else if (name.equals("Fork/Join")) {
+                    ForkNodeWidget fork = new ForkNodeWidget(OozieWorkflowGenerator.this);
+                    fork.setName("Fork_".concat(nodeCount.get(NodeType.FORK) != null ? nodeCount.get(NodeType.FORK)
+                            .toString() : "0"));
+                    addWidget(fork, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                    JoinNodeWidget join = new JoinNodeWidget(OozieWorkflowGenerator.this);
+                    join.setName("Join_".concat(nodeCount.get(NodeType.JOIN) != null ? nodeCount.get(NodeType.JOIN)
+                            .toString() : "0"));
+                    addWidget(join, 90 + Random.nextInt(30), 30 + Random.nextInt(30));
+
+                }
+                else if (name.equals("Decision")) {
+                    DecisionNodeWidget w = new DecisionNodeWidget(OozieWorkflowGenerator.this);
+                    w.setName("Decision_".concat(nodeCount.get(NodeType.DECISION) != null ? nodeCount.get(
+                            NodeType.DECISION).toString() : "0"));
+                    addWidget(w, 30 + Random.nextInt(30), 30 + Random.nextInt(30));
+                }
+            }
+        });
+
+        return t;
+    }
+
+    /**
+     * Initialize menu panel on top
+     *
+     * @return
+     */
+    public MenuBar initMenu() {
+
+        // Menu bar
+        Command cmd = new Command() {
+            public void execute() {
+                Window.alert("To be implemented soon");
+            }
+        };
+
+        Command mr_cmd = new Command() {
+            public void execute() {
+                initWidget();
+                MapReduceActionWidget mr = new MapReduceActionWidget(OozieWorkflowGenerator.this);
+                mr.setName("MR_0");
+                addWidget(mr, 300, 100);
+                ((OozieDiagramController) controller).addConnection(start, mr);
+                ((OozieDiagramController) controller).addConnection(mr, end);
+                mr.updateOnSelection();
+            }
+        };
+
+        Command pig_cmd = new Command() {
+
+            public void execute() {
+                clear();
+                initWidget();
+                PigActionWidget pig = new PigActionWidget(OozieWorkflowGenerator.this);
+                pig.setName("Pig_0");
+                addWidget(pig, 300, 100);
+                ((OozieDiagramController) controller).addConnection(start, pig);
+                ((OozieDiagramController) controller).addConnection(pig, end);
+                pig.updateOnSelection();
+            }
+        };
+
+        Command java_cmd = new Command() {
+
+            public void execute() {
+                clear();
+                initWidget();
+                JavaActionWidget java = new JavaActionWidget(OozieWorkflowGenerator.this);
+                java.setName("Java_0");
+                addWidget(java, 300, 100);
+                ((OozieDiagramController) controller).addConnection(start, java);
+                ((OozieDiagramController) controller).addConnection(java, end);
+                java.updateOnSelection();
+            }
+        };
+
+        Command forkjoin_cmd = new Command() {
+
+            public void execute() {
+                clear();
+                initWidget();
+                ForkNodeWidget fork = new ForkNodeWidget(OozieWorkflowGenerator.this);
+                fork.setName("Fork_0");
+                addWidget(fork, 150, 100);
+                ((OozieDiagramController) controller).addConnection(start, fork);
+
+                MapReduceActionWidget mr = new MapReduceActionWidget(OozieWorkflowGenerator.this);
+                mr.setName("MR_0");
+                addWidget(mr, 300, 30);
+                ((OozieDiagramController) controller).addMultiConnection(fork, mr);
+
+                PigActionWidget pig = new PigActionWidget(OozieWorkflowGenerator.this);
+                pig.setName("Pig_0");
+                addWidget(pig, 300, 200);
+                ((OozieDiagramController) controller).addMultiConnection(fork, pig);
+
+                JoinNodeWidget join = new JoinNodeWidget(OozieWorkflowGenerator.this);
+                join.setName("Join_0");
+                addWidget(join, 450, 100);
+                ((OozieDiagramController) controller).addConnection(mr, join);
+                ((OozieDiagramController) controller).addConnection(pig, join);
+                ((OozieDiagramController) controller).addConnection(join, end);
+
+                fork.updateOnSelection();
+                join.updateOnSelection();
+                mr.updateOnSelection();
+                pig.updateOnSelection();
+            }
+        };
+
+        Command clear_cmd = new Command() {
+
+            public void execute() {
+                clear();
+            }
+
+        };
+
+        MenuBar fileMenu = new MenuBar(true);
+        fileMenu.setAutoOpen(true);
+        fileMenu.setAnimationEnabled(true);
+        fileMenu.addItem("New", cmd);
+        fileMenu.addItem("Open", cmd);
+        fileMenu.addItem("Load XML", cmd);
+        fileMenu.addItem("Save", cmd);
+        fileMenu.addItem("Save As..", cmd);
+        fileMenu.addItem("Generate XML", cmd);
+        fileMenu.addItem("Print", cmd);
+        fileMenu.addItem("Quit", cmd);
+
+        MenuBar editMenu = new MenuBar(true);
+        editMenu.setAutoOpen(true);
+        editMenu.setAnimationEnabled(true);
+        editMenu.addItem("Undo", cmd);
+        editMenu.addItem("Redo", cmd);
+        editMenu.addItem("Copy", cmd);
+        editMenu.addItem("Cut", cmd);
+        editMenu.addItem("Paste", cmd);
+        editMenu.addItem("Duplicate", cmd);
+        editMenu.addItem("Delete", cmd);
+        editMenu.addItem("Clear Diagram", clear_cmd);
+
+        MenuBar examples = new MenuBar(true);
+        examples.setAutoOpen(true);
+        examples.setAnimationEnabled(true);
+        examples.addItem("wrkflow with MR action", mr_cmd);
+        examples.addItem("wrkflow with Pig action", pig_cmd);
+        examples.addItem("wrkflow with Java action", java_cmd);
+        examples.addItem("wrkflow with Fork/Join ", forkjoin_cmd);
+
+        MenuBar helpMenu = new MenuBar(true);
+        helpMenu.setAutoOpen(true);
+        helpMenu.setAnimationEnabled(true);
+        helpMenu.addItem("Documentation", cmd);
+        helpMenu.addItem("Online Help", cmd);
+        helpMenu.addItem("About", cmd);
+
+        MenuBar menu = new MenuBar();
+        menu.addItem("File", fileMenu);
+        menu.addItem("Edit", editMenu);
+        menu.addItem("Example", examples);
+        menu.addItem("Help", helpMenu);
+
+        return menu;
+    }
+
+    /**
+     * Add a new node widget
+     *
+     * @param w node widget
+     * @param x x-coordinate
+     * @param y y-coordinate
+     */
+    public void addWidget(NodeWidget w, int x, int y) {
+        controller.addWidget(w, x, y);
+        changeNodeCount(w, true);
+        dragController.makeDraggable(w);
+        widgets.add(w);
+    }
+
+    /**
+     * Remove a node widget
+     *
+     * @param w node widget
+     */
+    public void removeWidget(NodeWidget w) {
+        controller.deleteWidget(w);
+        widgets.remove(w);
+        if (w instanceof StartNodeWidget) {
+            start = null;
+        }
+        else if (w instanceof EndNodeWidget) {
+            end = null;
+        }
+        else if (w instanceof KillNodeWidget) {
+            kill = null;
+        }
+        changeNodeCount(w, false);
+    }
+
+    /**
+     * Increment/Decrement count of node widget type
+     *
+     * @param w nodeWidget
+     * @param increment true: increment, false: decrement
+     */
+    protected void changeNodeCount(NodeWidget w, boolean increment) {
+        int i = 0;
+        if (w instanceof MapReduceActionWidget) {
+            if (nodeCount.containsKey(NodeType.MAPREDUCE)) {
+                i = nodeCount.get(NodeType.MAPREDUCE);
+            }
+            updateNodeCountMap(NodeType.MAPREDUCE, increment, i);
+        }
+        else if (w instanceof PigActionWidget) {
+            if (nodeCount.containsKey(NodeType.PIG)) {
+                i = nodeCount.get(NodeType.PIG);
+            }
+            updateNodeCountMap(NodeType.PIG, increment, i);
+        }
+        else if (w instanceof JavaActionWidget) {
+            if (nodeCount.containsKey(NodeType.JAVA)) {
+                i = nodeCount.get(NodeType.JAVA);
+            }
+            updateNodeCountMap(NodeType.JAVA, increment, i);
+        }
+        else if (w instanceof FSActionWidget) {
+            if (nodeCount.containsKey(NodeType.FS)) {
+                i = nodeCount.get(NodeType.FS);
+            }
+            updateNodeCountMap(NodeType.FS, increment, i);
+        }
+        else if (w instanceof PipesActionWidget) {
+            if (nodeCount.containsKey(NodeType.PIPES)) {
+                i = nodeCount.get(NodeType.PIPES);
+            }
+            updateNodeCountMap(NodeType.PIPES, increment, i);
+        }
+        else if (w instanceof StreamingActionWidget) {
+            if (nodeCount.containsKey(NodeType.STREAMING)) {
+                i = nodeCount.get(NodeType.STREAMING);
+            }
+            updateNodeCountMap(NodeType.STREAMING, increment, i);
+        }
+        else if (w instanceof ShellActionWidget) {
+            if (nodeCount.containsKey(NodeType.SHELL)) {
+                i = nodeCount.get(NodeType.SHELL);
+            }
+            updateNodeCountMap(NodeType.SHELL, increment, i);
+        }
+        else if (w instanceof SSHActionWidget) {
+            if (nodeCount.containsKey(NodeType.SSH)) {
+                i = nodeCount.get(NodeType.SSH);
+            }
+            updateNodeCountMap(NodeType.SSH, increment, i);
+        }
+        else if (w instanceof EmailActionWidget) {
+            if (nodeCount.containsKey(NodeType.EMAIL)) {
+                i = nodeCount.get(NodeType.EMAIL);
+            }
+            updateNodeCountMap(NodeType.EMAIL, increment, i);
+        }
+        else if (w instanceof SubWFActionWidget) {
+            if (nodeCount.containsKey(NodeType.SUBWF)) {
+                i = nodeCount.get(NodeType.SUBWF);
+            }
+            updateNodeCountMap(NodeType.SUBWF, increment, i);
+        }
+        else if (w instanceof StartNodeWidget) {
+            if (nodeCount.containsKey(NodeType.START)) {
+                i = nodeCount.get(NodeType.START);
+            }
+            updateNodeCountMap(NodeType.START, increment, i);
+        }
+        else if (w instanceof EndNodeWidget) {
+            if (nodeCount.containsKey(NodeType.END)) {
+                i = nodeCount.get(NodeType.END);
+            }
+            updateNodeCountMap(NodeType.END, increment, i);
+        }
+        else if (w instanceof KillNodeWidget) {
+            if (nodeCount.containsKey(NodeType.KILL)) {
+                i = nodeCount.get(NodeType.KILL);
+            }
+            updateNodeCountMap(NodeType.KILL, increment, i);
+        }
+        else if (w instanceof ForkNodeWidget) {
+            if (nodeCount.containsKey(NodeType.FORK)) {
+                i = nodeCount.get(NodeType.FORK);
+            }
+            updateNodeCountMap(NodeType.FORK, increment, i);
+        }
+        else if (w instanceof JoinNodeWidget) {
+            if (nodeCount.containsKey(NodeType.JOIN)) {
+                i = nodeCount.get(NodeType.JOIN);
+            }
+            updateNodeCountMap(NodeType.JOIN, increment, i);
+        }
+        else if (w instanceof DecisionNodeWidget) {
+            if (nodeCount.containsKey(NodeType.DECISION)) {
+                i = nodeCount.get(NodeType.DECISION);
+            }
+            updateNodeCountMap(NodeType.DECISION, increment, i);
+        }
+    }
+
+    private void updateNodeCountMap(NodeType type, boolean increment, int i) {
+        if (increment) {
+            nodeCount.put(type, i + 1);
+        }
+        else {
+            nodeCount.put(type, i - 1);
+        }
+    }
+
+    /**
+     * Remove all node widgets in a workflow design panel
+     */
+    public void clear() {
+        controller.clearDiagram();
+        widgets.clear();
+        nodeCount.clear();
+        start = null;
+        end = null;
+        kill = null;
+    }
+}

Added: incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/Property.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/Property.java?rev=1377572&view=auto
==============================================================================
--- incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/Property.java (added)
+++ incubator/oozie/trunk/workflowgenerator/src/main/java/org/apache/oozie/tools/workflowgenerator/client/property/Property.java Mon Aug 27 05:46:54 2012
@@ -0,0 +1,57 @@
+package org.apache.oozie.tools.workflowgenerator.client.property;
+
+/**
+ * class to provide key-value pair for property, mostly used in property table
+ */
+public class Property {
+
+    private String name;
+    private String value;
+
+    /**
+     * Constructor which records name and value
+     *
+     * @param name name
+     * @param value value
+     */
+    public Property(String name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    /**
+     * Return a name of property
+     *
+     * @return
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Set a name of property
+     *
+     * @param name
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Return a value of property
+     *
+     * @return
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Set a value of property
+     *
+     * @param value
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+}
\ No newline at end of file