[jbpm-commits] JBoss JBPM SVN: r4594 - in projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client: common and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Apr 21 10:41:11 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-04-21 10:41:11 -0400 (Tue, 21 Apr 2009)
New Revision: 4594

Added:
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractContextAwareAction.java
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractDataRequestAction.java
Removed:
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractContextAwareAction.java
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractDataRequestAction.java
Modified:
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
   projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
Log:
Create common package

Copied: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractContextAwareAction.java (from rev 4587, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractContextAwareAction.java)
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractContextAwareAction.java	                        (rev 0)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractContextAwareAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.mvc4g.client.ActionInterface;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractContextAwareAction implements ActionInterface
+{
+  protected ApplicationContext appContext;
+
+  public AbstractContextAwareAction(ApplicationContext appContext)
+  {
+    this.appContext = appContext;
+  }
+}

Copied: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractDataRequestAction.java (from rev 4592, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractDataRequestAction.java)
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractDataRequestAction.java	                        (rev 0)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractDataRequestAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.user.client.Timer;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LoadingStatusAction;
+
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractDataRequestAction implements ActionInterface
+{
+  protected ApplicationContext appContext;
+
+  protected AbstractDataRequestAction(ApplicationContext appContetext)
+  {
+    this.appContext = appContetext;
+  }
+
+  abstract String getId();
+  abstract String getUrl(Object event);
+  abstract RequestBuilder.Method getRequestMethod();
+  abstract void handleSuccessfulResponse(final Controller controller, final Object event, Response response);
+
+  public void execute(final Controller controller, final Object object)
+  {    
+    final String url = getUrl(object);
+    RequestBuilder builder = new RequestBuilder(getRequestMethod(), URL.encode(url));
+
+    try
+    {
+      controller.handleEvent( LoadingStatusAction.ON );
+
+      final Request request = builder.sendRequest(null,
+          new RequestCallback()
+          {
+            public void onError(Request request, Throwable exception) {
+              // Couldn't connect to server (could be timeout, SOP violation, etc.)
+              handleError(url, exception);
+              controller.handleEvent( LoadingStatusAction.OFF );
+            }
+
+            public void onResponseReceived(Request request, Response response) {
+              try
+              {
+                if (200 == response.getStatusCode())
+                {
+                  handleSuccessfulResponse(controller, object, response);
+                }
+                else
+                {
+                  final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
+                  handleError(
+                      url,
+                      new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
+                  );
+                }
+              }
+              finally
+              {
+                controller.handleEvent( LoadingStatusAction.OFF );
+              }
+            }
+          }
+      );
+
+      // Timer to handle pending request
+      Timer t = new Timer() {
+
+        public void run()
+        {
+          if(request.isPending())
+          {
+            request.cancel();
+            handleError(
+                url,
+                new IOException("Request timeout")
+            );
+          }
+
+        }
+      };
+      t.schedule(5000);
+      
+    }
+    catch (RequestException e)
+    {
+      // Couldn't connect to server
+      handleError(url, e);
+      controller.handleEvent( LoadingStatusAction.OFF );
+    }
+  }
+
+  protected void handleError(String url, Throwable t)
+  {   
+    final String out =
+        "<ul>"+
+          "<li>URL: '" + url + "'\n"+
+          "<li>Action: '" + getId() + "'\n" +
+          "<li>Exception: '" + t.getClass() +
+        "</ul>'\n\n"+
+        t.getMessage();
+    
+    appContext.displayMessage(out, true);
+
+  }
+}

Deleted: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractContextAwareAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractContextAwareAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractContextAwareAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.mvc4g.client.ActionInterface;
-import org.jboss.bpm.console.client.ApplicationContext;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-abstract class AbstractContextAwareAction implements ActionInterface
-{
-  ApplicationContext appContext;
-
-  public AbstractContextAwareAction(ApplicationContext appContext)
-  {
-    this.appContext = appContext;
-  }
-}

Deleted: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractDataRequestAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractDataRequestAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/AbstractDataRequestAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.http.client.*;
-import com.google.gwt.user.client.Timer;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.LoadingStatusAction;
-
-import java.io.IOException;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-abstract class AbstractDataRequestAction implements ActionInterface
-{
-  protected ApplicationContext appContext;
-
-  protected AbstractDataRequestAction(ApplicationContext appContetext)
-  {
-    this.appContext = appContetext;
-  }
-
-  abstract String getId();
-  abstract String getUrl(Object event);
-  abstract RequestBuilder.Method getRequestMethod();
-  abstract void handleSuccessfulResponse(final Controller controller, final Object event, Response response);
-
-  public void execute(final Controller controller, final Object object)
-  {    
-    final String url = getUrl(object);
-    RequestBuilder builder = new RequestBuilder(getRequestMethod(), URL.encode(url));
-
-    try
-    {
-      controller.handleEvent( LoadingStatusAction.ON );
-
-      final Request request = builder.sendRequest(null,
-          new RequestCallback()
-          {
-            public void onError(Request request, Throwable exception) {
-              // Couldn't connect to server (could be timeout, SOP violation, etc.)
-              handleError(url, exception);
-              controller.handleEvent( LoadingStatusAction.OFF );
-            }
-
-            public void onResponseReceived(Request request, Response response) {
-              try
-              {
-                if (200 == response.getStatusCode())
-                {
-                  handleSuccessfulResponse(controller, object, response);
-                }
-                else
-                {
-                  final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
-                  handleError(
-                      url,
-                      new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
-                  );
-                }
-              }
-              finally
-              {
-                controller.handleEvent( LoadingStatusAction.OFF );
-              }
-            }
-          }
-      );
-
-      // Timer to handle pending request
-      Timer t = new Timer() {
-
-        public void run()
-        {
-          if(request.isPending())
-          {
-            request.cancel();
-            handleError(
-                url,
-                new IOException("Request timeout")
-            );
-          }
-
-        }
-      };
-      t.schedule(5000);
-      
-    }
-    catch (RequestException e)
-    {
-      // Couldn't connect to server
-      handleError(url, e);
-      controller.handleEvent( LoadingStatusAction.OFF );
-    }
-  }
-
-  protected void handleError(String url, Throwable t)
-  {   
-    final String out =
-        "<ul>"+
-          "<li>URL: '" + url + "'\n"+
-          "<li>Action: '" + getId() + "'\n" +
-          "<li>Exception: '" + t.getClass() +
-        "</ul>'\n\n"+
-        t.getMessage();
-    
-    appContext.displayMessage(out, true);
-
-  }
-}

Modified: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -27,6 +27,7 @@
 import com.google.gwt.json.client.JSONValue;
 import com.mvc4g.client.Controller;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractDataRequestAction;
 import org.jboss.bpm.console.client.model.DTOParser;
 import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
 

Modified: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -27,6 +27,7 @@
 import com.google.gwt.json.client.JSONValue;
 import com.mvc4g.client.Controller;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractDataRequestAction;
 import org.jboss.bpm.console.client.model.DTOParser;
 import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
 import org.jboss.bpm.console.client.model.ProcessInstanceRef;

Modified: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -26,6 +26,7 @@
 import com.google.gwt.http.client.*;
 import org.jboss.bpm.console.client.ApplicationContext;
 import org.jboss.bpm.console.client.LoadingStatusAction;
+import org.jboss.bpm.console.client.common.AbstractContextAwareAction;
 import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
 
 /**

Modified: projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java	2009-04-21 14:26:36 UTC (rev 4593)
+++ projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java	2009-04-21 14:41:11 UTC (rev 4594)
@@ -22,6 +22,7 @@
 package org.jboss.bpm.console.client.process;
 
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractContextAwareAction;
 import org.jboss.bpm.console.client.model.ProcessInstanceRef;
 import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
 import com.mvc4g.client.Controller;




More information about the jbpm-commits mailing list