[jbpm-commits] JBoss JBPM SVN: r5071 - in projects/gwt-console/trunk: server/server-core/src/main/java/org/jboss/bpm/console/server and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jun 22 07:14:05 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-06-22 07:14:05 -0400 (Mon, 22 Jun 2009)
New Revision: 5071

Added:
   projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
   projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java
   projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
   projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java
Modified:
   projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
   projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
Log:
Start work on deployment editor

Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java	                        (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -0,0 +1,72 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentRef
+{
+  private String id;
+
+  private boolean suspended;
+
+  private List<ProcessDefinitionRef> definitions = new ArrayList<ProcessDefinitionRef>();
+
+  public DeploymentRef()
+  {
+  }
+
+  public DeploymentRef(String id, boolean suspended)
+  {
+    this.id = id;
+    this.suspended = suspended;
+  }
+
+  public String getId()
+  {
+    return id;
+  }
+
+  public void setId(String id)
+  {
+    this.id = id;
+  }
+
+  public boolean isSuspended()
+  {
+    return suspended;
+  }
+
+  public void setSuspended(boolean suspended)
+  {
+    this.suspended = suspended;
+  }
+
+  public List<ProcessDefinitionRef> getDefinitions()
+  {
+    return definitions;
+  }
+}

Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java	                        (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRefWrapper.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -0,0 +1,60 @@
+/*
+ * 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.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class DeploymentRefWrapper
+{
+  List<DeploymentRef> deployments = new ArrayList<DeploymentRef>();
+
+
+  public DeploymentRefWrapper()
+  {
+  }
+
+  public DeploymentRefWrapper(List<DeploymentRef> deployments)
+  {
+    this.deployments = deployments;
+  }
+
+  public List<DeploymentRef> getDeployments()
+  {
+    return deployments;
+  }
+
+  public void setDeployments(List<DeploymentRef> deployments)
+  {
+    this.deployments = deployments;
+  }
+
+  public int getTotalCount()
+  {
+    return deployments.size();
+  }
+}

Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java	2009-06-22 10:35:34 UTC (rev 5070)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -44,6 +44,7 @@
     singletons.add(new TaskMgmtFacade());
     singletons.add(new UserMgmtFacade());
     singletons.add(new TestFacade());
+    singletons.add(new DeploymentFacade());
 
     singletons.add( new ReportFacade() );
   }

Added: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java	                        (rev 0)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -0,0 +1,92 @@
+/*
+ * 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.server;
+
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.plugin.DeploymentPlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.integration.ManagementFactory;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import com.google.gson.Gson;
+
+import java.util.List;
+
+/**
+ * Manage process deployments
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("repository")
+public class DeploymentFacade
+{
+  private static final Log log = LogFactory.getLog(DeploymentFacade.class);
+
+  private DeploymentPlugin deploymentPlugin;
+
+  private DeploymentPlugin getDeploymentPlugin()
+  {
+    if(null==this.deploymentPlugin)
+    {
+      this.deploymentPlugin = PluginMgr.load(DeploymentPlugin.class);      
+    }
+
+    return this.deploymentPlugin;
+  }
+
+  @GET
+  @Path("deployments")
+  @Produces("application/json")
+  public Response getDeployments()
+  {
+
+    DeploymentPlugin dplPlugin = getDeploymentPlugin();
+    if(deploymentPlugin!=null)
+    {
+      List<DeploymentRef> dpls = dplPlugin.getDeployments();
+      return createJsonResponse(
+          new DeploymentRefWrapper(dpls)
+      );
+    }
+    else
+    {
+      log.error("DeploymentPlugin not available");
+      return Response.serverError().build();
+    }
+
+  }
+
+  private Response createJsonResponse(Object wrapper)
+  {
+    Gson gson = GsonFactory.createInstance();
+    String json = gson.toJson(wrapper);
+    return Response.ok(json).type("application/json").build();
+  }
+}

Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java	2009-06-22 10:35:34 UTC (rev 5070)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -49,4 +49,5 @@
   public abstract TaskManagement createTaskManagement();
 
   public abstract UserManagement createUserManagement();
+  
 }

Added: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java	                        (rev 0)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java	2009-06-22 11:14:05 UTC (rev 5071)
@@ -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.server.plugin;
+
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface DeploymentPlugin
+{
+  List<DeploymentRef> getDeployments();
+
+  void deleteDeployment(String id);
+  
+  void setSuspended(String id, boolean isSuspended);
+}




More information about the jbpm-commits mailing list