JBoss JBPM SVN: r5172 - in projects/gwt-console/trunk: server/server-core and 4 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-01 06:28:46 -0400 (Wed, 01 Jul 2009)
New Revision: 5172
Added:
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsComment.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java
Modified:
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/server/server-core/server-core.iml
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/EngineFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java
projects/gwt-console/trunk/server/server-core/src/main/webapp/index.html
projects/gwt-console/trunk/server/server-integration/server-integration.iml
Log:
Added RsDocBuilder. Create JAX-RS docs on the fly.
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -47,7 +47,7 @@
public String getProcessInstancesURL(String processId)
{
String encodedId = URL.encode(processId);
- return config.getConsoleServerUrl() + "/rs/process/definitions/" + encodedId + "/instances";
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedId + "/instances";
}
public String getUserInRoleURL(String[] possibleRoles)
@@ -71,47 +71,42 @@
public String getRemoveDefinitionURL(String processId)
{
String encodedId = URL.encode(processId);
- return config.getConsoleServerUrl() + "/rs/process/definitions/" + encodedId+ "/remove";
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedId+ "/remove";
}
public String getProcessImageURL(String processId)
{
String encodedId = URL.encode(processId);
- return config.getConsoleServerUrl() + "/rs/process/definitions/"+ encodedId+ "/image";
+ return config.getConsoleServerUrl() + "/rs/process/definition/"+ encodedId+ "/image";
}
public String getActiveNodeInfoURL(String instanceId)
{
- return config.getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/activeNodeInfo";
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/activeNodeInfo";
}
public String getStateChangeURL(String instanceId, ProcessInstanceRef.STATE state)
{
- return config.getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/state/" + state;
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/state/" + state;
}
public String getInstanceEndURL(String instanceId, ProcessInstanceRef.RESULT result)
{
- return config.getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/end/" + result;
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/end/" + result;
}
public String getInstanceDeleteURL(String instanceId)
{
- return config.getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/delete";
+ return config.getConsoleServerUrl() + "/rs/process/instance/" + instanceId + "/delete";
}
public String getStartNewInstanceURL(String processId)
{
String encodedID = URL.encode(processId);
- return config.getConsoleServerUrl() + "/rs/process/definitions/" + encodedID + "/instances/new";
+ return config.getConsoleServerUrl() + "/rs/process/definition/" + encodedID + "/new_instance";
}
- public String getUploadDefinitionURL()
- {
- return config.getConsoleServerUrl() + "/rs/process/definitions/new";
- }
-
public String getTaskListURL(String idRef)
{
return config.getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef);
@@ -158,11 +153,6 @@
return config.getConsoleServerUrl() + "/rs/identity/user/" + actorId + "/actors";
}
- public String getProcessDefinitionByNameURL(String name)
- {
- return config.getConsoleServerUrl() + "/rs/process/definitions/" + name;
- }
-
public String getDeployTestHarnessUrl()
{
return config.getConsoleServerUrl() + "/rs/test/deploy/harness";
Modified: projects/gwt-console/trunk/server/server-core/server-core.iml
===================================================================
--- projects/gwt-console/trunk/server/server-core/server-core.iml 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/server-core.iml 2009-07-01 10:28:46 UTC (rev 5172)
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
<exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../jbpm4/trunk/classes/test/server-core" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
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-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -46,7 +46,7 @@
singletons.add(new TestFacade());
singletons.add(new EngineFacade());
singletons.add(new FormProcessingFacade());
- singletons.add( new ReportFacade() );
+ singletons.add(new ReportFacade() );
}
@Override
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -31,6 +31,7 @@
import org.jboss.bpm.console.server.gson.GsonFactory;
import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
@@ -42,6 +43,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("engine")
+@RsComment(
+ title = "Process Engine",
+ description = "Process runtime state"
+)
public class EngineFacade
{
private static final Log log = LogFactory.getLog(EngineFacade.class);
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -26,6 +26,7 @@
import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
import org.jboss.resteasy.plugins.providers.multipart.InputPart;
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
@@ -48,6 +49,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("form")
+@RsComment(
+ title = "Form Processing",
+ description = "Web based form processing"
+)
public class FormProcessingFacade
{
private static final Log log = LogFactory.getLog(FormProcessingFacade.class);
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -26,13 +26,18 @@
import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.util.RsDocBuilder;
+import org.jboss.bpm.console.server.util.RsComment;
import org.jboss.bpm.console.client.model.ServerStatus;
import org.jboss.bpm.console.client.model.PluginInfo;
+import org.jboss.bpm.report.ReportFacade;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Context;
+import javax.servlet.http.HttpServletRequest;
import com.google.gson.Gson;
@@ -40,6 +45,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("server")
+@RsComment(
+ title = "Server Info",
+ description = "General REST server information"
+)
public class InfoFacade
{
@@ -54,6 +63,10 @@
@GET
@Path("status")
@Produces("application/json")
+ @RsComment(
+ title = "Plugins",
+ description = "Plugin availablity"
+ )
public Response getServerInfo()
{
ServerStatus status = getServerStatus();
@@ -76,6 +89,31 @@
return status;
}
+ @GET
+ @Path("resources")
+ @Produces("text/html")
+ public Response getPublishedUrls(
+ @Context
+ HttpServletRequest request
+ )
+ {
+ final Class[] rootResources = new Class[]
+ {
+ InfoFacade.class,
+ ProcessMgmtFacade.class,
+ TaskListFacade.class,
+ TaskMgmtFacade.class,
+ UserMgmtFacade.class,
+ EngineFacade.class,
+ FormProcessingFacade.class
+ //,ReportFacade.class
+ };
+
+ RsDocBuilder rsDocBuilder = new RsDocBuilder(request.getContextPath(),rootResources);
+ StringBuffer sb = rsDocBuilder.build();
+ return Response.ok(sb.toString()).build();
+ }
+
private Response createJsonResponse(Object wrapper)
{
Gson gson = GsonFactory.createInstance();
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -36,6 +36,7 @@
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.bpm.console.server.util.RsComment;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
@@ -52,6 +53,9 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("process")
+@RsComment(
+ title = "Process Management",
+ description = "Process related data.")
public class ProcessMgmtFacade
{
private static final Log log = LogFactory.getLog(ProcessMgmtFacade.class);
@@ -132,7 +136,7 @@
}
@POST
- @Path("definitions/{id}/remove")
+ @Path("definition/{id}/remove")
@Produces("application/json")
public Response removeDefinitionsJSON(
@PathParam("id")
@@ -145,7 +149,7 @@
}
@GET
- @Path("definitions/{id}/instances")
+ @Path("definition/{id}/instances")
@Produces("application/json")
public Response getInstancesJSON(
@PathParam("id")
@@ -158,7 +162,7 @@
}
@POST
- @Path("definitions/{id}/instances/new")
+ @Path("definition/{id}/new_instance")
@Produces("application/json")
public Response newInstance(
@PathParam("id")
@@ -178,8 +182,16 @@
}
+ @GET
+ @Path("instance/{id}/dataset")
+ @Produces("application/json")
+ public Response getInstanceData()
+ {
+ return Response.ok().build();
+ }
+
@POST
- @Path("instances/{id}/state/{next}")
+ @Path("instance/{id}/state/{next}")
@Produces("application/json")
public Response changeState(
@PathParam("id")
@@ -194,7 +206,7 @@
}
@POST
- @Path("instances/{id}/end/{result}")
+ @Path("instance/{id}/end/{result}")
@Produces("application/json")
public Response endInstance(
@PathParam("id")
@@ -209,7 +221,7 @@
}
@POST
- @Path("instances/{id}/delete")
+ @Path("instance/{id}/delete")
@Produces("application/json")
public Response deleteInstance(
@PathParam("id")
@@ -252,61 +264,8 @@
return Response.ok().type("application/json").build();
}
- @POST
- @Path("definitions/new")
- @Produces("application/json")
- @Consumes("multipart/form-data")
- public Response postNewDefinition(
- @Context
- HttpServletRequest request
- )
- {
- try
- {
- FileItemFactory factory = new DiskFileItemFactory();
- ServletFileUpload upload = new ServletFileUpload(factory);
- List items = upload.parseRequest(request);
-
- Iterator iter = items.iterator();
- while (iter.hasNext())
- {
- FileItem item = (FileItem) iter.next();
-
- if (item.isFormField())
- {
- // ignore
- System.out.println("Caught form field on file upload: " + item.getName());
- }
- else
- {
- String fieldName = item.getFieldName();
- String fileName = item.getName();
- String contentType = item.getContentType();
- boolean isInMemory = item.isInMemory();
- long sizeInBytes = item.getSize();
-
- // Process a file upload in memory
- //byte[] data = item.get();
-
- // Process stream
- InputStream uploadedStream = item.getInputStream();
- getProcessManagement().deploy(fileName, contentType, uploadedStream);
- uploadedStream.close();
-
-
- }
-
- }
- } catch (Exception e)
- {
- return Response.serverError().build();
- }
-
- return Response.ok().build();
- }
-
@GET
- @Path("definitions/{id}/image")
+ @Path("definition/{id}/image")
@Produces("image/*")
public Response getProcessImage(
@PathParam("id")
@@ -325,7 +284,7 @@
}
@GET
- @Path("instances/{id}/activeNodeInfo")
+ @Path("instance/{id}/activeNodeInfo")
@Produces("application/json")
public Response getActiveNodeInfo(
@PathParam("id")
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -32,6 +32,7 @@
import org.jboss.bpm.console.server.plugin.PluginMgr;
import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.util.RsComment;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -47,6 +48,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("tasks")
+@RsComment(
+ title = "Task Lists",
+ description = "Access task lists"
+)
public class TaskListFacade
{
private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -28,6 +28,7 @@
import org.jboss.bpm.console.server.plugin.PluginMgr;
import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.util.RsComment;
import org.jboss.resteasy.plugins.providers.multipart.InputPart;
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
@@ -52,6 +53,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("task")
+@RsComment(
+ title = "Task Management",
+ description = "Manage task instances"
+)
public class TaskMgmtFacade
{
private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/UserMgmtFacade.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -29,6 +29,7 @@
import org.jboss.bpm.console.server.gson.GsonFactory;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.UserManagement;
+import org.jboss.bpm.console.server.util.RsComment;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
@@ -42,6 +43,10 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("identity")
+@RsComment(
+ title = "User management",
+ description = "Manage user and groups"
+)
public class UserMgmtFacade
{
@@ -61,7 +66,7 @@
}
@GET
- @Path("/user/roles")
+ @Path("user/roles")
@Produces("application/json")
public Response getRolesForJAASPrincipal(
@Context
@@ -89,7 +94,7 @@
}
@GET
- @Path("/user/{actorId}/groups/")
+ @Path("user/{actorId}/groups/")
@Produces("application/json")
public Response getGroupsForActor(
@PathParam("actorId")
@@ -101,7 +106,7 @@
}
@GET
- @Path("/group/{groupName}/members")
+ @Path("group/{groupName}/members")
@Produces("application/json")
public Response getActorsForGroup(
@PathParam("groupName")
@@ -113,7 +118,7 @@
}
@GET
- @Path("/user/{actorId}/actors")
+ @Path("user/{actorId}/actors")
@Produces("application/json")
public Response getAvailableActors(
@PathParam("actorId")
Added: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsComment.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsComment.java (rev 0)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsComment.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -0,0 +1,29 @@
+/*
+ * 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.util;
+
+(a)java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
+public @interface RsComment {
+
+ java.lang.String title();
+ java.lang.String description();
+}
\ No newline at end of file
Added: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java (rev 0)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/util/RsDocBuilder.java 2009-07-01 10:28:46 UTC (rev 5172)
@@ -0,0 +1,180 @@
+/*
+ * 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.util;
+
+import org.jboss.bpm.console.server.ProcessMgmtFacade;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Date;
+
+/**
+ * Creates HTML documention for JAX-RS resource classes.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class RsDocBuilder
+{
+ private String webContext;
+ private Class[] rootResources;
+
+ public RsDocBuilder(String webContext, Class[] rootResources)
+ {
+ this.rootResources = rootResources;
+ this.webContext = webContext.startsWith("/") ? webContext : "/"+webContext;
+ }
+
+ public static void main(String[] args)
+ {
+ RsDocBuilder rsDocBuilder = new RsDocBuilder(
+ "gwt-console-server",
+ new Class[] {ProcessMgmtFacade.class}
+ );
+
+ StringBuffer sb = rsDocBuilder.build(rsDocBuilder.getRootResources()[0]);
+ System.out.println(sb.toString());
+ }
+
+
+ public String getWebContext()
+ {
+ return webContext;
+ }
+
+ public Class[] getRootResources()
+ {
+ return rootResources;
+ }
+
+ private StringBuffer build(Class root)
+ {
+ Path rootPath = (Path)root.getAnnotation(Path.class);
+ RsComment rootComment = (RsComment)root.getAnnotation(RsComment.class);
+
+ List<Representation> representations = new ArrayList<Representation>();
+
+ for(Method m : root.getDeclaredMethods())
+ {
+ Path resPath = m.getAnnotation(Path.class);
+ if(resPath!=null)
+ {
+ Representation r = new Representation();
+
+ r.path = resPath.value();
+ r.httpMethod = m.getAnnotation(GET.class)!=null ? "GET" : "POST"; // currently limited to those
+ r.consume = (m.getAnnotation(Consumes.class)!=null) ?
+ arrayToString(m.getAnnotation(Consumes.class).value()) : "*/*";
+ r.produce = (m.getAnnotation(Produces.class)!=null) ?
+ arrayToString(m.getAnnotation(Produces.class).value()) : "*/*";
+ representations.add(r);
+ }
+ }
+
+ StringBuffer sb = new StringBuffer();
+
+ if(rootComment!=null)
+ {
+ sb.append("<tr>");
+ sb.append("<td colspan=5 style='border-bottom:1px solid black;'>");
+ sb.append("<b>").append(rootComment.title()).append("</b>").append("<br>");
+ sb.append("<i>").append(rootComment.description()).append("</i>");
+ sb.append("</td>");
+ sb.append("</tr>");
+ }
+
+ for(Representation r : representations)
+ {
+ sb.append("<tr>");
+ sb.append("<td>").append(r.httpMethod.toUpperCase()).append("</td>");
+ sb.append("<td>").append(buildPath(rootPath.value(),r.path)).append("</td>");
+ sb.append("<td>").append("").append("</td>"); // description
+ sb.append("<td>").append(r.consume).append("</td>");
+ sb.append("<td>").append(r.produce).append("</td>");
+ sb.append("</tr>");
+ }
+
+ sb.append("<tr><td colspan=5> </td></tr>");
+
+ return sb;
+ }
+
+ private String arrayToString(String[] arr)
+ {
+ StringBuffer sb = new StringBuffer();
+ for(int i=0; i<arr.length; i++)
+ {
+ sb.append(arr[i]);
+ if(i<arr.length-1)
+ sb.append(",");
+ }
+ return sb.toString();
+ }
+
+ private String buildPath(String root, String resourcePath)
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(webContext);
+ sb.append("/").append(root).append("/");
+ sb.append(resourcePath);
+ return sb.toString();
+ }
+
+ public StringBuffer build()
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<html>").append("<body style='font-family: sans-serif; font-size:10pt;'>");
+ sb.append("<!--").append(" generated by RsDoc at ").append( new Date() ).append(" -->");
+ sb.append("<table style='margin-top:10px;' width='100%'>");
+
+ sb.append("<tr>");
+ sb.append("<th>").append("Method").append("</th>");
+ sb.append("<th>").append("Path").append("</th>");
+ sb.append("<th>").append("Description").append("</th>"); // description
+ sb.append("<th>").append("Consumes").append("</th>");
+ sb.append("<th>").append("Produces").append("</th>");
+ sb.append("</tr>");
+
+ for(Class c : rootResources)
+ {
+ sb.append(
+ build(c).toString()
+ );
+ }
+ sb.append("</table>");
+ sb.append("</body>").append("<html>");
+ return sb;
+
+ }
+
+ private class Representation
+ {
+ String description,title = "";
+ String consume,produce = "";
+ String path;
+ String httpMethod;
+ }
+}
Modified: projects/gwt-console/trunk/server/server-core/src/main/webapp/index.html
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/webapp/index.html 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-core/src/main/webapp/index.html 2009-07-01 10:28:46 UTC (rev 5172)
@@ -1,107 +1,20 @@
<html>
-<body>
+<body style='font-family: sans-serif; font-size:10pt;'>
<h1>GWT Console Server</h1>
-<h2>Published REST Url's </h2>
+<h2>Published URL's</h2>
+You can find a list of resources <a href="/gwt-console-server/rs/server/resources">here</a>.
-<table border=1 cellpadding=5>
-<tr>
- <th>Method</th>
- <th>Context</th>
- <th>Description</th>
- <th>Mime Types</th>
-</tr>
-
-<tr>
- <td colspan=4><h3>Process Management</h3></td>
-</tr>
-
-<tr>
- <td>GET</td>
- <td><a href="/gwt-console-server/rs/process/definitions">/rs/process/definitions</a></td>
- <td>A list of process definitions</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>POST</td>
- <td>/rs/process/definitions/{processId}/remove</td>
- <td>Removes a particular process definition</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>GET</td>
- <td><a href="/gwt-console-server/rs/process/definitions/1/instances">/rs/process/definitions/{id}/instances</a></td>
- <td>A list of process instances for a given process definition</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>POST</td>
- <td>/rs/process/instances/{id}/state/{next}</td>
- <td>Change instance state (RUNNING, SUSPENDED, ENDED)</td>
- <td>*/*</td>
-</tr>
-
-<tr>
- <td>POST</td>
- <td>/rs/process/definitions/{processId}/instances/new</td>
- <td>Create a new process instance</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td colspan=4><h3>User Management</h3></td>
-</tr>
-
-<tr>
- <td>GET</td>
- <td><a href="/gwt-console-server/rs/identity/user/roles?roleCheck=admin,user">/rs/identity/user/roles?roleCheck=a,b,c</a></td>
- <td>A list of assigned roles matching the query parameter (Comma seperated list)</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td colspan=4><h3>Task Management</h3></td>
-</tr>
-
-<tr>
- <td>GET</td>
- <td>/rs/tasks/actor/{actorId}</td>
- <td>A list of available tasks (OPEN and IN_PROGRESS) for an actor</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>GET</td>
- <td>/rs/tasks/{taskId}/assignment/{actorId}</td>
- <td>Assign a task to an actor actor. If you leave out the actorId it will release (IN_PROGRESS->OPEN) the task</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>POST</td>
- <td>/rs/tasks/{taskId}/close/transition?signal={signalName}</td>
- <td>Complete a task with signal</td>
- <td>application/json</td>
-</tr>
-
-<tr>
- <td>POST</td>
- <td>/rs/tasks/{taskId}/close/transition/default</td>
- <td>Complete a task with default transition</td>
- <td>application/json</td>
-</tr>
-
-</table>
-
<h2>Example usage</h2>
<pre>
curl -u "user:password" -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions
- curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions/1/instances
+ curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definition/1/instances
</pre>
+
+<h2>Problems?</h2>
+Please post any questions to the <a href="http://www.jboss.org/index.html?module=bb&op=viewforum&f=295">gwt-console developer forum</a>.
+
</body>
</html>
\ No newline at end of file
Modified: projects/gwt-console/trunk/server/server-integration/server-integration.iml
===================================================================
--- projects/gwt-console/trunk/server/server-integration/server-integration.iml 2009-07-01 10:19:31 UTC (rev 5171)
+++ projects/gwt-console/trunk/server/server-integration/server-integration.iml 2009-07-01 10:28:46 UTC (rev 5172)
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
<exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../jbpm4/trunk/classes/test/server-integration" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
14 years, 10 months
JBoss JBPM SVN: r5171 - jbpm4/trunk/modules/devguide/src/main/docbook/en/images.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-01 06:19:31 -0400 (Wed, 01 Jul 2009)
New Revision: 5171
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/jbpm.erd.png
Log:
added jBPM schema image to devguide docs
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/jbpm.erd.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/jbpm.erd.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 10 months
JBoss JBPM SVN: r5170 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/task/variables and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-01 06:13:04 -0400 (Wed, 01 Jul 2009)
New Revision: 5170
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/GroupRef.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/IdentityRef.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/UserRef.java
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
Log:
removed unused identity refs
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/GroupRef.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/GroupRef.java 2009-07-01 08:12:26 UTC (rev 5169)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/GroupRef.java 2009-07-01 10:13:04 UTC (rev 5170)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbpm.api.task;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class GroupRef extends IdentityRef {
-
- private static final long serialVersionUID = 1L;
-
- public GroupRef(String groupId) {
- super(groupId);
- }
-
- public String toString() {
- return "GroupRef("+id+")";
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/IdentityRef.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/IdentityRef.java 2009-07-01 08:12:26 UTC (rev 5169)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/IdentityRef.java 2009-07-01 10:13:04 UTC (rev 5170)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbpm.api.task;
-
-import java.io.Serializable;
-
-import org.jbpm.api.JbpmException;
-
-
-/**
- * references an identity. usally a user or group.
- *
- * @see org.jbpm.api.task.UserRef
- * @see org.jbpm.api.task.GroupRef
- * @see org.jbpm.api.task.Participation
- *
- * @author Tom Baeyens
- * @author Heiko Braun
- */
-public abstract class IdentityRef implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- protected String id;
-
- public IdentityRef(String id) {
- if (id==null) {
- throw new JbpmException("id is null");
- }
- this.id = id;
- }
-
- public String getId() {
- return id;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- IdentityRef other = (IdentityRef) obj;
- if (!id.equals(other.id))
- return false;
- return true;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/UserRef.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/UserRef.java 2009-07-01 08:12:26 UTC (rev 5169)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/UserRef.java 2009-07-01 10:13:04 UTC (rev 5170)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbpm.api.task;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class UserRef extends IdentityRef {
-
- private static final long serialVersionUID = 1L;
-
- public UserRef(String userId) {
- super(userId);
- }
-
- public String toString() {
- return "UserRef("+id+")";
- }
-}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-07-01 08:12:26 UTC (rev 5169)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-07-01 10:13:04 UTC (rev 5170)
@@ -29,7 +29,6 @@
import org.jbpm.api.Execution;
import org.jbpm.api.task.Task;
-import org.jbpm.api.task.UserRef;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-07-01 08:12:26 UTC (rev 5169)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-07-01 10:13:04 UTC (rev 5170)
@@ -24,7 +24,6 @@
import java.util.List;
import org.jbpm.api.task.Task;
-import org.jbpm.api.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -33,9 +32,6 @@
*/
public class TaskListTest extends JbpmTestCase {
- UserRef johndoe = new UserRef("johndoe");
- UserRef joesmoe = new UserRef("joesmoe");
-
public void testPersonalTaskList() {
Task task = taskService.newTask();
task.setName("do laundry");
14 years, 10 months
JBoss JBPM SVN: r5169 - in jbpm4/trunk/modules/integration: form-plugin/src/main/java/org/jbpm/integration/console/forms and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-01 04:12:26 -0400 (Wed, 01 Jul 2009)
New Revision: 5169
Added:
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.FormDispatcherPlugin
Removed:
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
Log:
JBPM-2233: Start a process with task form
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-01 07:17:16 UTC (rev 5168)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -65,7 +65,8 @@
for(ProcessDefinition processDefinition : activePds)
{
- results.add( ModelAdaptor.adoptDefinition(processDefinition) );
+ ProcessDefinitionRef ref = ModelAdaptor.adoptDefinition(processDefinition);
+ results.add(ref);
}
// suspended processes
@@ -75,9 +76,9 @@
for(ProcessDefinition p : suspendedPds)
{
- ProcessDefinitionRef pref = ModelAdaptor.adoptDefinition(p);
- pref.setSuspended(true);
- results.add(pref);
+ ProcessDefinitionRef ref = ModelAdaptor.adoptDefinition(p);
+ ref.setSuspended(true);
+ results.add(ref);
}
return results;
Added: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java (rev 0)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -0,0 +1,143 @@
+/*
+ * 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.jbpm.integration.console.forms;
+
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.integration.spi.mgmt.ServerConfig;
+import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
+
+import javax.naming.InitialContext;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import java.io.*;
+import java.util.Map;
+
+import freemarker.template.DefaultObjectWrapper;
+import freemarker.template.Template;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class AbstractFormDispatcher
+{
+ protected final static String WEB_CONTEXT = "/gwt-console-server/rs";
+
+ protected ProcessEngine processEngine;
+ protected ServerConfig serverConfig = null;
+ protected static final String FORM_DIRECTIVE_KEY = "form";
+ protected static final String OUTCOME_DIRECTIVE_NAME = "outcome";
+
+
+ public AbstractFormDispatcher()
+ {
+ initializeProcessEngine();
+ }
+
+ protected void initializeProcessEngine()
+ {
+ try
+ {
+ InitialContext ctx = new InitialContext();
+ this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to lookup process engine", e);
+ }
+ }
+
+ protected ServerConfig getServerConfig()
+ {
+ if(null==serverConfig)
+ {
+ serverConfig = ServerConfigFactory.getServerConfig();
+ }
+ return serverConfig;
+ }
+
+ protected StringBuilder getBaseUrl()
+ {
+ StringBuilder spec = new StringBuilder();
+ spec.append("http://");
+ spec.append(getServerConfig().getWebServiceHost());
+ spec.append(":").append(getServerConfig().getWebServicePort());
+ spec.append(WEB_CONTEXT);
+ return spec;
+ }
+
+ protected DataHandler processTemplate(
+ final String name, InputStream src,
+ Map<String, Object> renderContext
+ )
+ {
+ DataHandler merged = null;
+
+ try
+ {
+ freemarker.template.Configuration cfg = new freemarker.template.Configuration();
+ cfg.setObjectWrapper(new DefaultObjectWrapper());
+ cfg.setTemplateUpdateDelay(0);
+
+ Template temp = new Template(name, new InputStreamReader(src), cfg);
+ temp.dump(System.out);
+
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ Writer out = new OutputStreamWriter(bout);
+ temp.process(renderContext, out);
+ out.flush();
+
+ merged = new DataHandler(
+
+ new DataSource()
+ {
+
+ public InputStream getInputStream() throws IOException
+ {
+ return new ByteArrayInputStream(bout.toByteArray());
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ return bout;
+ }
+
+ public String getContentType()
+ {
+ return "application/octet-stream";
+ }
+
+ public String getName()
+ {
+ return name + "_DataSource";
+ }
+ }
+ );
+
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to process task template", e);
+ }
+
+ return merged;
+ }
+}
Added: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java (rev 0)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbpm.integration.console.forms;
+
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+
+import javax.activation.DataHandler;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class FormDispatcherComposite implements FormDispatcherPlugin
+{
+
+ private FormDispatcherPlugin taskDispatcher;
+ private FormDispatcherPlugin processDispatcher;
+
+
+ public FormDispatcherComposite()
+ {
+ this.taskDispatcher = new TaskFormDispatcher();
+ this.processDispatcher = new ProcessFormDispatcher();
+ }
+
+ public URL getDispatchUrl(FormAuthorityRef ref)
+ {
+ switch(ref.getType())
+ {
+ case TASK:
+ return taskDispatcher.getDispatchUrl(ref);
+ case PROCESS:
+ return processDispatcher.getDispatchUrl(ref);
+ default:
+ throw new IllegalArgumentException("Unknown authority type:"+ref.getType());
+ }
+ }
+
+ public DataHandler provideForm(FormAuthorityRef ref)
+ {
+ switch(ref.getType())
+ {
+ case TASK:
+ return taskDispatcher.provideForm(ref);
+ case PROCESS:
+ return processDispatcher.provideForm(ref);
+ default:
+ throw new IllegalArgumentException("Unknown authority type:"+ref.getType());
+ }
+ }
+
+ public void processCompletion(FormAuthorityRef ref, Map<String, Object> payload, String performingUser, String outcome)
+ {
+ switch(ref.getType())
+ {
+ case TASK:
+ taskDispatcher.processCompletion(ref, payload, performingUser, outcome);
+ break;
+ case PROCESS:
+ processDispatcher.processCompletion(ref, payload, performingUser, outcome);
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown authority type:"+ref.getType());
+ }
+ }
+}
Added: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java (rev 0)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -0,0 +1,180 @@
+/*
+ * 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.jbpm.integration.console.forms;
+
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentFactory;
+
+import javax.activation.DataHandler;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Processes form data to start processes.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ProcessFormDispatcher extends AbstractFormDispatcher
+ implements FormDispatcherPlugin
+{
+
+ public URL getDispatchUrl(FormAuthorityRef ref)
+ {
+ if(!processHasForm(ref.getReferenceId()))
+ return null;
+
+ StringBuilder baseUrl = getBaseUrl();
+ baseUrl.append("/form/process/");
+ baseUrl.append( ref.getReferenceId());
+ baseUrl.append("/render");
+
+ try
+ {
+ return new URL(baseUrl.toString());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException("Failed to resolve task dispatch url", e);
+ }
+ }
+
+ private boolean processHasForm(String id)
+ {
+ return getStartFormName(id)!=null;
+ }
+
+ private String getStartFormName(String id)
+ {
+ String name = null;
+
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ try
+ {
+ RepositoryService repoService = processEngine.getRepositoryService();
+ List<String> startActivityNames = repoService.getStartActivityNames(id);
+
+ if(null==startActivityNames) // who knows? I'd expect anything from jbpm
+ throw new RuntimeException("Unable to resolve start activity names for process: "+id);
+
+ String defaultActitvity = startActivityNames.get(0);
+ if(startActivityNames.size()>1)
+ {
+ System.out.println("WARN: More then 1 start activity found. Default to " + defaultActitvity + " to resolve the form name.");
+ }
+
+ name = repoService.getStartFormResourceName(id, defaultActitvity);
+ }
+ finally{
+ env.close();
+ }
+
+ return name;
+ }
+
+ public DataHandler provideForm(FormAuthorityRef ref)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ DataHandler result = null;
+
+ try
+ {
+
+ RepositoryService repoService = processEngine.getRepositoryService();
+
+ // check if a template exists
+ String startFormResourceName = getStartFormName(ref.getReferenceId());
+ if(null==startFormResourceName)
+ throw new IllegalArgumentException("Process " +ref.getReferenceId() + " doesn't provide a start form");
+
+ ProcessDefinition procDef =
+ repoService
+ .createProcessDefinitionQuery()
+ .processDefinitionId(ref.getReferenceId())
+ .uniqueResult();
+
+ InputStream template = repoService.getResourceAsStream(
+ procDef.getDeploymentId(), startFormResourceName
+ );
+
+ // merge template with process variables
+ if(template!=null)
+ {
+ // plugin context
+ StringBuilder action = getBaseUrl();
+ action.append("/form/process/");
+ action.append( ref.getReferenceId() );
+ action.append("/complete");
+
+ Map<String, Object> renderContext = new HashMap<String,Object>();
+
+ // form directive
+ FormDirective formDirective = new FormDirective();
+ formDirective.setAction( action.toString() );
+ renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
+
+ // outcome directive
+ renderContext.put(OUTCOME_DIRECTIVE_NAME, new OutcomeDirective());
+
+ result = processTemplate(startFormResourceName, template, renderContext);
+ }
+
+ return result;
+ }
+ finally{
+ env.close();
+ }
+ }
+
+ public void processCompletion(FormAuthorityRef ref, Map<String, Object> payload, String performingUser, String outcome)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ ExecutionService execService = processEngine.getExecutionService();
+ if(payload!=null)
+ {
+ execService.startProcessInstanceById(
+ ref.getReferenceId(), payload
+ );
+ }
+ else
+ {
+ execService.startProcessInstanceById(ref.getReferenceId());
+ }
+ }
+ finally
+ {
+ env.close();
+ }
+ }
+}
Deleted: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-07-01 07:17:16 UTC (rev 5168)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -1,263 +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.jbpm.integration.console.forms;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.naming.InitialContext;
-
-import org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin;
-import org.jbpm.api.ExecutionService;
-import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.ProcessDefinitionQuery;
-import org.jbpm.api.ProcessEngine;
-import org.jbpm.api.RepositoryService;
-import org.jbpm.api.TaskService;
-import org.jbpm.api.task.Task;
-import org.jbpm.integration.spi.mgmt.ServerConfig;
-import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.Transition;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-import freemarker.template.DefaultObjectWrapper;
-import freemarker.template.Template;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class TaskDispatcherPluginImpl implements TaskDispatcherPlugin
-{
- private ProcessEngine processEngine;
-
- private ServerConfig serverConfig = null;
-
- public TaskDispatcherPluginImpl()
- {
- initializeProcessEngine();
- }
-
- public URL getDispatchUrl(long taskId)
- {
- StringBuilder spec = new StringBuilder();
- spec.append("http://");
- spec.append(getServerConfig().getWebServiceHost());
- spec.append(":").append(getServerConfig().getWebServicePort());
- spec.append("/gwt-console-server/rs/task/");
- spec.append( taskId );
- spec.append("/render");
-
- try
- {
- return new URL(spec.toString());
- }
- catch (MalformedURLException e)
- {
- throw new RuntimeException("Failed to resolve task dispatch url", e);
- }
- }
-
-
- private ServerConfig getServerConfig()
- {
- if(null==serverConfig)
- {
- serverConfig = ServerConfigFactory.getServerConfig();
- }
- return serverConfig;
- }
-
- public DataHandler provideTaskUI(long taskId)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- DataHandler result = null;
-
- try
- {
- TaskService taskService = processEngine.getTaskService();
- Task task = taskService.getTask(Long.toString(taskId));
-
- // access the processdefition
- TaskImpl cast = ((TaskImpl) task);
- ExecutionImpl processInstance = cast.getProcessInstance();
- String processInstanceId = processInstance.getId();
- String processId = processInstance.getProcessDefinition().getId();
-
- RepositoryService repoService = processEngine.getRepositoryService();
- ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
- query.processDefinitionId(processId);
- ProcessDefinition procDef = query.uniqueResult();
-
- // check if a template exists
- String name = task.getName() + ".ftl";
- InputStream template = repoService.getResourceAsStream(
- procDef.getDeploymentId(), name
- );
-
- // merge template with process variables
- if(template!=null)
- {
- ExecutionService execService = processEngine.getExecutionService();
-
- Set<String> varNames = execService.getVariableNames(processInstanceId);
- if(varNames!=null)
- {
- Map<String, Object> processContext = execService.getVariables(processInstanceId, varNames);
-
- // plugin context
-
- StringBuilder action = new StringBuilder();
- action.append("http://");
- action.append(getServerConfig().getWebServiceHost());
- action.append(":").append(getServerConfig().getWebServicePort());
- action.append("/gwt-console-server/rs/task/");
- action.append( taskId );
- action.append("/process");
-
- Map<String, Object> renderContext = new HashMap<String,Object>();
-
- // formResourceName directive
- FormDirective formDirective = new FormDirective();
- formDirective.setAction( action.toString() );
- renderContext.put("formResourceName", formDirective);
-
- // outcome directive
- // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
- OutcomeDirective outcomeDirective = new OutcomeDirective();
- List<Transition> transitions =
- ((ExecutionImpl) processInstance).getActivity().getOutgoingTransitions();
- for(Transition t : transitions)
- {
- String outcomeName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
- outcomeDirective.getValues().add(outcomeName);
- }
- renderContext.put("outcome",outcomeDirective);
-
- // process variables
- renderContext.putAll(processContext);
-
-
- result = processTemplate(name, template, renderContext);
- }
- }
-
- return result;
- }
- finally{
- env.close();
- }
- }
-
- private DataHandler processTemplate(
- final String name, InputStream src,
- Map<String, Object> renderContext
- )
- {
- DataHandler merged = null;
-
- try
- {
- freemarker.template.Configuration cfg = new freemarker.template.Configuration();
- cfg.setObjectWrapper(new DefaultObjectWrapper());
- cfg.setTemplateUpdateDelay(0);
-
- Template temp = new Template(name, new InputStreamReader(src), cfg);
- temp.dump(System.out);
-
- final ByteArrayOutputStream bout = new ByteArrayOutputStream();
- Writer out = new OutputStreamWriter(bout);
- temp.process(renderContext, out);
- out.flush();
-
- merged = new DataHandler(
-
- new DataSource()
- {
-
- public InputStream getInputStream() throws IOException
- {
- return new ByteArrayInputStream(bout.toByteArray());
- }
-
- public OutputStream getOutputStream() throws IOException
- {
- return bout;
- }
-
- public String getContentType()
- {
- return "application/octet-stream";
- }
-
- public String getName()
- {
- return name + "_DataSource";
- }
- }
- );
-
- }
- catch (Exception e)
- {
- throw new RuntimeException("Failed to process task template", e);
- }
-
- return merged;
- }
-
- public void processCompletion(long taskId, String outcome, InputStream payload)
- {
-
- }
-
- protected void initializeProcessEngine()
- {
- try
- {
- InitialContext ctx = new InitialContext();
- this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
- }
- catch (Exception e)
- {
- throw new RuntimeException("Failed to lookup process engine", e);
- }
- }
-
-}
Copied: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java (from rev 5155, jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java)
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java (rev 0)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-07-01 08:12:26 UTC (rev 5169)
@@ -0,0 +1,199 @@
+/*
+ * 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.jbpm.integration.console.forms;
+
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jbpm.api.*;
+import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentFactory;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+import javax.activation.DataHandler;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Processes form data to complete tasks.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class TaskFormDispatcher extends AbstractFormDispatcher
+ implements FormDispatcherPlugin
+{
+
+ public TaskFormDispatcher()
+ {
+ super();
+ }
+
+ public URL getDispatchUrl(FormAuthorityRef ref)
+ {
+ if(!taskHasForm(ref.getReferenceId()))
+ return null;
+
+ StringBuilder baseUrl = getBaseUrl();
+ baseUrl.append("/form/task/");
+ baseUrl.append( ref.getReferenceId());
+ baseUrl.append("/render");
+
+ try
+ {
+ return new URL(baseUrl.toString());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException("Failed to resolve task dispatch url", e);
+ }
+ }
+
+ private boolean taskHasForm(String id)
+ {
+ boolean result = false;
+
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ try
+ {
+ TaskService taskService = processEngine.getTaskService();
+ Task task = taskService.getTask(id);
+ result = (task.getFormResourceName()!=null);
+ }
+ finally
+ {
+ env.close();
+ }
+
+ return result;
+ }
+
+ public DataHandler provideForm(FormAuthorityRef ref)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = processEngine.getTaskService();
+ Task task = taskService.getTask(ref.getReferenceId());
+
+ // access the processdefition
+ TaskImpl cast = ((TaskImpl) task);
+ ExecutionImpl processInstance = cast.getProcessInstance();
+ String processInstanceId = processInstance.getId();
+ String processId = processInstance.getProcessDefinition().getId();
+
+ RepositoryService repoService = processEngine.getRepositoryService();
+ ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
+ query.processDefinitionId(processId);
+ ProcessDefinition procDef = query.uniqueResult();
+
+ // check if a template exists
+ String name = task.getFormResourceName();
+ InputStream template = repoService.getResourceAsStream(
+ procDef.getDeploymentId(), name
+ );
+
+ // merge template with process variables
+ if(template==null)
+ throw new IllegalArgumentException("Task form resource '"+name+"' doesn't exist.");
+
+ Map<String, Object> processContext = new HashMap<String, Object>(); // empty default
+ ExecutionService execService = processEngine.getExecutionService();
+ Set<String> varNames = execService.getVariableNames(processInstanceId);
+
+ if(varNames!=null)
+ processContext = execService.getVariables(processInstanceId, varNames);
+
+ // plugin context
+ StringBuilder action = getBaseUrl();
+ action.append("/form/task/");
+ action.append( ref.getReferenceId() );
+ action.append("/complete");
+
+ Map<String, Object> renderContext = new HashMap<String,Object>();
+
+ // form directive
+ FormDirective formDirective = new FormDirective();
+ formDirective.setAction( action.toString() );
+ renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
+
+ // outcome directive
+ // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
+ OutcomeDirective outcomeDirective = new OutcomeDirective();
+ List<Transition> transitions =
+ ((ExecutionImpl) processInstance).getActivity().getOutgoingTransitions();
+ for(Transition t : transitions)
+ {
+ String outcomeName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
+ outcomeDirective.getValues().add(outcomeName);
+ }
+ renderContext.put(OUTCOME_DIRECTIVE_NAME, outcomeDirective);
+
+ // process variables
+ renderContext.putAll(processContext);
+
+ DataHandler result = processTemplate(name, template, renderContext);
+ return result;
+ }
+ finally
+ {
+ env.close();
+ }
+ }
+
+ public void processCompletion(
+ FormAuthorityRef ref,
+ Map<String,Object> payload,
+ String performingUser,
+ String outcome)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ String taskId = ref.getReferenceId();
+
+ try
+ {
+ TaskService taskService = processEngine.getTaskService();
+
+ if(payload!=null)
+ taskService.setVariables(taskId, payload);
+
+ if(null==outcome)
+ taskService.completeTask(taskId);
+ else
+ taskService.completeTask(taskId, outcome);
+
+ }
+ finally
+ {
+ env.close();
+ }
+ }
+
+}
Copied: jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.FormDispatcherPlugin (from rev 5146, jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin)
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.FormDispatcherPlugin (rev 0)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.FormDispatcherPlugin 2009-07-01 08:12:26 UTC (rev 5169)
@@ -0,0 +1 @@
+org.jbpm.integration.console.forms.FormDispatcherComposite
\ No newline at end of file
Deleted: jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin 2009-07-01 07:17:16 UTC (rev 5168)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin 2009-07-01 08:12:26 UTC (rev 5169)
@@ -1 +0,0 @@
-org.jbpm.integration.console.forms.TaskDispatcherPluginImpl
\ No newline at end of file
14 years, 10 months
JBoss JBPM SVN: r5168 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/process and 4 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-01 03:17:16 -0400 (Wed, 01 Jul 2009)
New Revision: 5168
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java
Log:
JBPM-2233: Start a process with task form
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -96,6 +96,7 @@
initialize();
this.currentDeployment = null;
propGrid.clear();
+ resources.clear();
}
private DeploymentRef getSelection()
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -245,6 +245,8 @@
for(ProcessDefinitionRef def : definitions)
{
+ System.out.println("->"+def.getUrl());
+
if(FILTER_NONE==currentFilter)
{
model.add(def);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -22,24 +22,27 @@
package org.jboss.bpm.console.client.process;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.Widget;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.*;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
-import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.util.WindowUtil;
+import java.util.Date;
import java.util.List;
/**
@@ -65,11 +68,14 @@
private ApplicationContext appContext;
+ private WindowPanel windowPanel = null;
+ private Frame frame = null;
+
public InstanceListView(ApplicationContext appContext)
{
super();
this.appContext = appContext;
-
+
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
setTitle("Process Instances");
setIcon(icons.instanceIcon());
@@ -105,7 +111,7 @@
listBox.setText(row, column, item.getState().toString());
break;
case 2:
- String d = item.getStartDate() != null ? dateFormat.format(item.getStartDate()) : "";
+ String d = item.getStartDate() != null ? dateFormat.format(item.getStartDate()) : "";
listBox.setText(row, column, d);
break;
default:
@@ -130,7 +136,7 @@
}
}
});
-
+
// toolbar
final LayoutPanel toolBox = new LayoutPanel();
toolBox.setPadding(0);
@@ -163,16 +169,25 @@
new MessageBox.ConfirmationCallback() {
public void onResult(boolean doIt)
{
-
if(doIt)
{
- controller.handleEvent(
- new Event(
- StartNewInstanceAction.ID,
- getCurrentDefinition()
- )
- );
+ String url = getCurrentDefinition().getUrl();
+ boolean hasForm = (url !=null && !url.equals(""));
+ if(hasForm)
+ {
+ createProcessFormWindow(getCurrentDefinition());
+ }
+ else
+ {
+ controller.handleEvent(
+ new Event(
+ StartNewInstanceAction.ID,
+ getCurrentDefinition()
+ )
+ );
+ }
}
+
}
});
@@ -276,11 +291,11 @@
layout.add(instanceList, new BorderLayoutData(BorderLayout.Region.CENTER));
// details
- InstanceDetailView detailsView = new InstanceDetailView(appContext);
+ InstanceDetailView detailsView = new InstanceDetailView(appContext);
controller.addView(InstanceDetailView.ID, detailsView);
-
+
controller.addAction(UpdateInstanceDetailAction.ID, new UpdateInstanceDetailAction());
-
+
layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH,10,200));
this.add(layout);
@@ -290,6 +305,62 @@
}
}
+ private void createProcessFormWindow(ProcessDefinitionRef process)
+ {
+ windowPanel = new WindowPanel("Process Interface");
+ windowPanel.setAnimationEnabled(true);
+ windowPanel.setSize("320px", "240px");
+
+ LayoutPanel layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setStyleName("bpm-window-layout");
+ layout.setPadding(5);
+ // info
+ Label header = new Label("Process: "+process.getId());
+ header.setStyleName("bpm-label-header");
+ layout.add(header, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // task form iframe
+
+ windowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ controller.handleEvent(
+ new Event(UpdateInstancesAction.ID, getCurrentDefinition())
+ );
+
+ windowPanel = null;
+ frame = null;
+
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
+ // iframe
+ frame = new Frame();
+ DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ // https://jira.jboss.org/jira/browse/JBPM-2244
+ frame.getElement().setId(
+ String.valueOf( new Date().getTime())
+ );
+
+ ConsoleLog.debug(frame.getElement().toString());
+ frame.setUrl(process.getUrl());
+
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ windowPanel.setWidget(layout);
+
+ WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
+
+ // display
+ windowPanel.center();
+
+ }
+
+
public ProcessInstanceRef getSelection()
{
ProcessInstanceRef selection = null;
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -59,6 +59,12 @@
ProcessDefinitionRef ref = new ProcessDefinitionRef(id, name, version);
ref.setDeploymentId(dplId);
ref.setSuspended(isSuspended);
+
+ // optional start form url
+ JSONWalk.JSONWrapper url = JSONWalk.on(root).next("url");
+ if(url!=null)
+ ref.setUrl(url.asString());
+
return ref;
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -40,6 +40,7 @@
private String deploymentId;
private boolean suspended;
+ private String url = null;
public ProcessDefinitionRef()
{
@@ -163,4 +164,14 @@
result = 31 * result + (key != null ? key.hashCode() : 0);
return result;
}
+
+ public void setUrl(String s)
+ {
+ this.url = s;
+ }
+
+ public String getUrl()
+ {
+ return url;
+ }
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/FormProcessingFacade.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -70,56 +70,102 @@
@GET
- @Path("task/{taskId}/render")
+ @Path("task/{id}/render")
@Produces("text/html")
public Response renderTaskUI(
- @PathParam("taskId")
+ @PathParam("id")
String taskId
)
{
- DataHandler dh = getFormDispatcherPlugin().provideForm(
- new FormAuthorityRef(taskId)
- );
+ return provideForm(new FormAuthorityRef(taskId));
+ }
- if(null==dh)
- {
- throw new RuntimeException("No UI associated with task ID " + taskId);
- }
-
- return Response.ok(dh.getDataSource()).type("text/html").build();
+ @GET
+ @Path("process/{id}/render")
+ @Produces("text/html")
+ public Response renderProcessUI(
+ @PathParam("id")
+ String definitionId
+ )
+ {
+ return provideForm(new FormAuthorityRef(definitionId, FormAuthorityRef.Type.PROCESS));
}
@POST
- @Path("task/{taskId}/complete")
+ @Path("task/{id}/complete")
@Produces("text/html")
@Consumes("multipart/form-data")
public Response closeTaskWithUI(
@Context
HttpServletRequest request,
- @PathParam("taskId")
+ @PathParam("id")
String taskId,
MultipartFormDataInput payload
)
{
+ Map<String,Object> processVars = createVariableMapping(payload);
+
+ // complete task
+ getFormDispatcherPlugin().processCompletion(
+ new FormAuthorityRef(taskId), processVars, request.getRemoteUser(), (String)processVars.get("outcome")
+ );
+
+ return Response.ok("Successfully processed input").build();
+ }
+
+ @POST
+ @Path("process/{id}/complete")
+ @Produces("text/html")
+ @Consumes("multipart/form-data")
+ public Response startProcessWithUI(
+ @Context
+ HttpServletRequest request,
+ @PathParam("id")
+ String definitionId,
+ MultipartFormDataInput payload
+ )
+ {
+ Map<String,Object> processVars = createVariableMapping(payload);
+
+ // complete task
+ FormAuthorityRef authref = new FormAuthorityRef(definitionId, FormAuthorityRef.Type.PROCESS);
+ getFormDispatcherPlugin().processCompletion(
+ authref, processVars, request.getRemoteUser(),
+ (String)processVars.get("outcome")
+ );
+
+ return Response.ok("Successfully processed input").build();
+ }
+
+ private Response provideForm(FormAuthorityRef authorityRef)
+ {
+ DataHandler dh = getFormDispatcherPlugin().provideForm(
+ authorityRef
+ );
+
+ if(null==dh)
+ {
+ throw new RuntimeException("No UI associated with "+authorityRef.getType()+" " + authorityRef.getReferenceId());
+ }
+
+ return Response.ok(dh.getDataSource()).type("text/html").build();
+ }
+
+ private Map<String, Object> createVariableMapping(MultipartFormDataInput payload)
+ {
Map<String,Object> processVars = new HashMap<String,Object>();
Map<String, InputPart> formData = payload.getFormData();
Iterator<String> partNames = formData.keySet().iterator();
- String outcome = null;
-
while(partNames.hasNext())
{
final String partName = partNames.next();
final InputPart part = formData.get(partName);
final MediaType mediaType = part.getMediaType();
- if(partName.equals("outcome"))
+ if(MediaType.TEXT_PLAIN_TYPE.equals(mediaType))
{
- outcome = part.getBodyAsString();
- }
- else if(MediaType.TEXT_PLAIN_TYPE.equals(mediaType))
- {
// RFC2045: Each part has an optional "Content-Type" header
// that defaults to "text/plain".
// Can go into process without conversion
@@ -158,11 +204,6 @@
}
}
- // complete task
- getFormDispatcherPlugin().processCompletion(
- new FormAuthorityRef(taskId), processVars, request.getRemoteUser(), outcome
- );
-
- return Response.ok("Successfully processed task UI").build();
+ return processVars;
}
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -28,21 +28,21 @@
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.console.client.model.ActiveNodeInfo;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRefWrapper;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.ProcessInstanceRefWrapper;
+import org.jboss.bpm.console.client.model.*;
import org.jboss.bpm.console.server.gson.GsonFactory;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
-import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import java.io.InputStream;
+import java.net.URL;
import java.util.Iterator;
import java.util.List;
@@ -59,6 +59,22 @@
private ProcessManagement processManagement;
private GraphViewerPlugin graphViewerPlugin;
+ private FormDispatcherPlugin formPlugin;
+
+ /**
+ * Lazy load the {@link org.jboss.bpm.console.server.plugin.FormDispatcherPlugin}.
+ * Can be null if the plugin is not available.
+ */
+ private FormDispatcherPlugin getFormDispatcherPlugin()
+ {
+ if(null==this.formPlugin)
+ {
+ this.formPlugin = PluginMgr.load(FormDispatcherPlugin.class);
+ }
+
+ return this.formPlugin;
+ }
+
private ProcessManagement getProcessManagement()
{
if(null==this.processManagement)
@@ -88,8 +104,30 @@
@Produces("application/json")
public Response getDefinitionsJSON()
{
+ List<ProcessDefinitionRef> processDefinitions = getProcessManagement().getProcessDefinitions();
+ return decorateProcessDefintions(processDefinitions);
+ }
+
+ private Response decorateProcessDefintions( List<ProcessDefinitionRef> processDefinitions)
+ {
+ // decorate process form URL if plugin available
+ FormDispatcherPlugin formPlugin = getFormDispatcherPlugin();
+ if(formPlugin!=null)
+ {
+ for(ProcessDefinitionRef def : processDefinitions)
+ {
+ URL processFormURL = formPlugin.getDispatchUrl(
+ new FormAuthorityRef(def.getId(), FormAuthorityRef.Type.PROCESS)
+ );
+ if(processFormURL!=null)
+ {
+ def.setUrl(processFormURL.toExternalForm());
+ }
+ }
+ }
+
ProcessDefinitionRefWrapper wrapper =
- new ProcessDefinitionRefWrapper(getProcessManagement().getProcessDefinitions());
+ new ProcessDefinitionRefWrapper(processDefinitions);
return createJsonResponse(wrapper);
}
@@ -134,7 +172,7 @@
return createJsonResponse(instance);
}
catch (Throwable t)
- {
+ {
throw new WebApplicationException(t, 500);
}
@@ -176,7 +214,7 @@
public Response deleteInstance(
@PathParam("id")
String executionId
- )
+ )
{
log.debug("Delete instance (ID "+executionId+")");
getProcessManagement().deleteInstance(executionId);
@@ -278,7 +316,7 @@
GraphViewerPlugin plugin = getProcessGraphViewPlugin();
if(plugin !=null)
{
- return Response.ok(plugin.getProcessImage(id)).type("image/png").build();
+ return Response.ok(plugin.getProcessImage(id)).type("image/png").build();
}
throw new RuntimeException(
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -73,7 +73,7 @@
* Lazy load the {@link org.jboss.bpm.console.server.plugin.FormDispatcherPlugin}.
* Can be null if the plugin is not available.
*/
- private FormDispatcherPlugin getTaskDispatcherPlugin()
+ private FormDispatcherPlugin getFormDispatcherPlugin()
{
if(null==this.formPlugin)
{
@@ -110,7 +110,7 @@
private Response processTaskListResponse(List<TaskRef> taskList)
{
// decorate task form URL if plugin available
- FormDispatcherPlugin formPlugin = getTaskDispatcherPlugin();
+ FormDispatcherPlugin formPlugin = getFormDispatcherPlugin();
if(formPlugin!=null)
{
for(TaskRef task : taskList)
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java 2009-07-01 07:13:50 UTC (rev 5167)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/FormAuthorityRef.java 2009-07-01 07:17:16 UTC (rev 5168)
@@ -41,7 +41,7 @@
this.currentType = Type.TASK;
}
- public FormAuthorityRef(Type currentType, String referenceId)
+ public FormAuthorityRef(String referenceId, Type currentType)
{
this.currentType = currentType;
this.referenceId = referenceId;
14 years, 10 months
JBoss JBPM SVN: r5167 - projects.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-01 03:13:50 -0400 (Wed, 01 Jul 2009)
New Revision: 5167
Added:
projects/jopr-integration/
Log:
14 years, 10 months