JBoss JBPM SVN: r2660 - in projects/gwt-console/trunk: war/src/main/java/jmaki/xhp and 8 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-29 10:40:28 -0400 (Wed, 29 Oct 2008)
New Revision: 2660
Added:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Menu.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MenuSection.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Workspace.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
Removed:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java
Modified:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReferenceWrapper.java
projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxy.java
projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
Log:
Added TaskListEditor. Login form credentials. Fine tune authentication helper
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -31,12 +31,12 @@
@XmlRootElement(name = "taskReference")
public class TaskReference
{
- private long taskId;
+ private long id;
private long tokenId;
private long processInstanceId;
- private String taskName;
- private String actorName;
+ private String name;
+ private String actor;
private boolean isBlocking;
private boolean isSignalling = true;
@@ -49,23 +49,23 @@
public TaskReference(long taskId, long tokenId, long processInstanceId, String taskName, String actorName, boolean blocking, boolean signalling)
{
- this.taskId = taskId;
+ this.id = taskId;
this.tokenId = tokenId;
this.processInstanceId = processInstanceId;
- this.taskName = taskName;
- this.actorName = actorName;
+ this.name = taskName;
+ this.actor = actorName;
isBlocking = blocking;
isSignalling = signalling;
}
- public long getTaskId()
+ public long getId()
{
- return taskId;
+ return id;
}
- public void setTaskId(long taskId)
+ public void setId(long id)
{
- this.taskId = taskId;
+ this.id = id;
}
public long getTokenId()
@@ -88,24 +88,24 @@
this.processInstanceId = processInstanceId;
}
- public String getTaskName()
+ public String getName()
{
- return taskName;
+ return name;
}
- public void setTaskName(String taskName)
+ public void setName(String name)
{
- this.taskName = taskName;
+ this.name = name;
}
- public String getActorName()
+ public String getActor()
{
- return actorName;
+ return actor;
}
- public void setActorName(String actorName)
+ public void setActor(String actor)
{
- this.actorName = actorName;
+ this.actor = actor;
}
public boolean isBlocking()
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReferenceWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReferenceWrapper.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReferenceWrapper.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -22,6 +22,7 @@
package org.jboss.bpm.console.client.model;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
import java.util.List;
import java.util.ArrayList;
@@ -33,7 +34,6 @@
{
List<TaskReference> tasks = new ArrayList<TaskReference>();
-
public TaskReferenceWrapper()
{
}
@@ -52,4 +52,10 @@
{
this.tasks = tasks;
}
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return tasks.size();
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxy.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxy.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxy.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -146,6 +146,11 @@
in = httpclient.doPost(postData, postContentType);
}
+ if(null==in)
+ {
+ throw new IOException("Failed to open input stream");
+ }
+
// read the encoding from the incoming document and default to UTF-8
// if an encoding is not provided
String ce = httpclient.getContentEncoding();
Modified: projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/jmaki/xhp/XmlHttpProxyServlet.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -38,7 +38,8 @@
private String resourcesDir = "/resources/";
private String classpathResourcesDir = "/META-INF/resources/";
private String headerToken = "jmaki-";
-
+ private String testToken = "xtest-";
+
public XmlHttpProxyServlet() {
if (rDebug) {
logger = getLogger();
@@ -215,9 +216,13 @@
// Forward all request headers starting with the header token jmaki-
// and chop off the jmaki-
Enumeration hnum = req.getHeaderNames();
+
+ // test hack
+
while (hnum.hasMoreElements()) {
String name = (String)hnum.nextElement();
- if (name.startsWith(headerToken)) {
+ if (name.startsWith(headerToken))
+ {
if (headers == null) headers = new HashMap();
String value = "";
@@ -230,6 +235,12 @@
String sname = name.substring(headerToken.length(), name.length());
headers.put(sname,value);
}
+ else if(name.startsWith(testToken))
+ {
+ // hack test capabilities for authentication
+ if("xtest-user".equals(name)) userName = req.getHeader("xtest-user");
+ if("xtest-pass".equals(name)) password = req.getHeader("xtest-pass");
+ }
}
try
{
@@ -243,8 +254,10 @@
if (service.has("passthrough")) passthrough =
Boolean.valueOf(service.getString("passthrough"));
+
if (service.has("username")) userName = service.getString("username");
if (service.has("password")) password = service.getString("password");
+
String apikey = "";
if (service.has("apikey")) apikey = service.getString("apikey");
if (service.has("xslStyleSheet")) xslURLString = service.getString("xslStyleSheet");
@@ -357,13 +370,13 @@
iox.printStackTrace();
getLogger().severe("XmlHttpProxyServlet: caught " + iox);
res.setStatus(500);
- try {
+ /*try {
writer = res.getWriter();
writer.write("XmlHttpProxyServlet error loading service for " + serviceKey + " . Please notify the administrator.");
writer.flush();
} catch (java.io.IOException ix) {
ix.printStackTrace();
- }
+ }*/
return;
}
finally
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -7,17 +7,17 @@
*/
public class Application implements EntryPoint
{
- private MainCompositeView mainView;
+ private MainView mainView;
/**
* This is the entry point method.
*/
public void onModuleLoad()
{
- mainView = new MainCompositeView();
+ mainView = new MainView();
}
- public MainCompositeView getConsoleView()
+ public MainView getConsoleView()
{
return mainView;
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -22,13 +22,15 @@
package org.jboss.bpm.console.client;
import com.google.gwt.http.client.*;
+import com.google.gwt.core.client.GWT;
import org.jboss.bpm.console.client.model.DTOParser;
import java.util.List;
import java.util.ArrayList;
/**
- * Authentication helper
+ * Does HTTP Basic Auth and keeps assigned roles
+ * (piggy backed on response) and the username that was used.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -37,8 +39,8 @@
private String loginUrl;
private AuthCallback callback;
private List<String> rolesAssigned = new ArrayList<String>();
+ private String username;
-
public Authentication(String loginUrl)
{
this.loginUrl = loginUrl;
@@ -68,6 +70,8 @@
{
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, loginUrl);
+ this.username = user;
+ // discard password
System.out.println("Authentication against: " + rb.getUrl());
@@ -75,6 +79,12 @@
{
rb.setUser(user);
rb.setPassword(pass);
+
+ if(!GWT.isScript()) // hosted mode only
+ {
+ rb.setHeader("xtest-user", user);
+ rb.setHeader("xtest-pass", pass); // NOTE: This is plaintext, use for testing only
+ }
}
try
@@ -85,23 +95,32 @@
public void onResponseReceived(Request request, Response response)
{
// parse roles
- rolesAssigned = DTOParser.parseRolesAssigned(response.getText());
- if(callback!=null) callback.onLoginSuccess(request, response);
+ if(200==response.getStatusCode())
+ {
+ rolesAssigned = DTOParser.parseRolesAssigned(response.getText());
+ if(callback!=null) callback.onLoginSuccess(request, response);
+ }
+ else
+ {
+ onError(request, new Exception(response.getText()));
+ }
}
public void onError(Request request, Throwable t)
{
// auth failed
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
if(callback!=null)
callback.onLoginFailed(request, t);
else
- throw new RuntimeException("Login failed", t);
+ throw new RuntimeException("Unknown exception upon login attempt", t);
}
});
}
catch (RequestException e1)
{
+ // Couldn't connect to server
throw new RuntimeException("Unknown error upon login attempt", e1);
}
}
@@ -123,4 +142,9 @@
{
return rolesAssigned;
}
+
+ public String getUsername()
+ {
+ return username;
+ }
}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java (from rev 2652, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -0,0 +1,43 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Panel;
+
+/**
+ * An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class Editor extends Panel
+{
+
+ protected Editor()
+ {
+ super();
+
+ }
+
+ public abstract String getEditorId();
+ public abstract String getTitle();
+ public abstract String getIconCSS();
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.TabPanel;
-import org.jboss.bpm.console.client.EditorView;
-
-/**
- * Maintains {@link org.jboss.bpm.console.client.EditorPanel}'s
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class EditorPanel extends TabPanel
-{
- protected MainCompositeView view;
-
- public EditorPanel()
- {
- super();
-
- this.setResizeTabs(true);
- this.setMinTabWidth(115);
- this.setTabWidth(135);
- this.setEnableTabScroll(true);
- this.setAutoScroll(true);
- this.setActiveTab(0);
- }
-
- private Panel addTab(EditorView editorView, boolean closeable) {
- Panel tab = new WrapperPanel(editorView.getId()+".tab");
- tab.setAutoScroll(true);
- tab.setTitle(editorView.getTitle());
- tab.setClosable(closeable);
- tab.setBorder(false);
- tab.setFrame(false);
- tab.setHideBorders(true);
- tab.setIconCls(editorView.getIconCSS());
- this.add(tab);
- return tab;
- }
-
- public void addEditor(EditorView editorView, boolean closeable)
- {
- Panel tab = addTab(editorView, closeable);
- tab.add(editorView);
- this.setActiveTab(tab.getId());
- }
-
- public boolean hasEditor(String id)
- {
- boolean b = false;
- final String tabId = id +".tab";
-
- Component[] tabs = this.getItems();
- for(int i=0; i<tabs.length; i++)
- {
- Component tab = tabs[i];
- if(tab.getId().equals(tabId))
- {
- b=true;
- break;
- }
- }
-
- return b;
- }
-
- public void showTab(String id)
- {
- final String tabId = id+".tab";
- this.setActiveTab(tabId);
- }
-
- class WrapperPanel extends Panel
- {
-
- public WrapperPanel(String id)
- {
- super();
- setId(id);
- }
- }
-}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.gwtext.client.widgets.Panel;
-
-/**
- * An editor can be plugged into a {@link org.jboss.bpm.console.client.EditorPanel}
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public abstract class EditorView extends Panel
-{
-
- protected EditorView()
- {
- super();
- }
-
- public abstract String getEditorId();
- public abstract String getTitle();
- public abstract String getIconCSS();
-}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -23,17 +23,20 @@
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.layout.*;
+import com.google.gwt.user.client.ui.HTML;
+import java.util.List;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class Header extends Panel
{
- private MainCompositeView view;
+ private MainView view;
public final static String ID = "org.jboss.bpm.headerPanel";
- public Header(MainCompositeView view)
+ public Header(MainView view)
{
super();
this.view = view;
@@ -45,49 +48,20 @@
this.setHeight(50);
this.setBaseCls("bpm-header");
+ }
- // --
-
- /* FormPanel formPanel = new FormPanel();
- formPanel.setUrl("");
- formPanel.setLabelAlign(Position.TOP);
- formPanel.setWidth(100);
+ public void setUserInfo(String username, List<String> roles)
+ {
+ Panel userInfo = new Panel();
+ userInfo.setBorder(false);
+ userInfo.setHeader(false);
+ userInfo.setFrame(false);
- // ---
-
- Panel topPanel = new Panel();
- topPanel.setLayout(new ColumnLayout());
-
- Panel columnOnePanel = new Panel();
- columnOnePanel.setLayout(new FormLayout());
-
- TextField name = new TextField("Username", "username", 230);
- name.setAllowBlank(false);
-
- columnOnePanel.add(name, new AnchorLayoutData("95%"));
-
- // ---
-
- Panel columnTwoPanel = new Panel();
- columnTwoPanel.setLayout(new FormLayout());
-
- TextField pass = new TextField("Password", "password", 230);
- pass.setAllowBlank(false);
- pass.setPassword(true);
-
- columnTwoPanel.add(pass, new AnchorLayoutData("95%"));
-
- // ---
-
- topPanel.add(name, new ColumnLayoutData(.5));
- topPanel.add(pass, new ColumnLayoutData(.5));
-
- formPanel.add(topPanel);
-
- // ---
+ userInfo.add( new HTML("<h3>User: "+view.getUsername()+"</h3>"));
- final Image image = new Image("images/Jbpm_logo_small.png");
- this.add(formPanel); */
+ this.clear();
+ this.add(userInfo);
+ this.doLayout();
}
}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HTML;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.core.Margins;
-import com.gwtext.client.core.RegionPosition;
-import com.gwtext.client.widgets.*;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.layout.BorderLayout;
-import com.gwtext.client.widgets.layout.BorderLayoutData;
-import com.gwtext.client.widgets.layout.FitLayout;
-import com.gwtext.client.widgets.layout.VerticalLayout;
-import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
-import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
-
-/**
- * The main composite that assembles the gwt console application.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MainCompositeView extends Composite
-{
- private HTML status = new HTML();
- private Header header;
- private MainMenu mainMenu;
- private EditorPanel editorPanel;
- private URLBuilder urlBuilder;
-
- private String[] rolesAssigned = new String[] {};
- public final static String[] KNOWN_ROLES = {"admin", "user"};
-
- private Viewport viewport;
-
- public MainCompositeView()
- {
- if(!GWT.isScript()) // hosted mode used proxy by default
- urlBuilder = new URLBuilder(GWT.getModuleBaseURL(), "xhp");
- else
- urlBuilder = new URLBuilder( "http://localhost:8080", "gwt-console-server"); // TODO: make configureable
-
- Panel mainPanel = createMainPanel();
- assembleMainApplication(mainPanel);
- forceLogin(mainPanel);
- viewport = new Viewport(mainPanel);
- }
-
- private Panel createMainPanel()
- {
- Panel mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setPaddings(5); // outer most padding
- mainPanel.setLayout(new FitLayout());
- mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
- mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
- mainPanel.hide();
-
- initWidget( mainPanel );
- return mainPanel;
- }
-
- private void assembleMainApplication(Panel mainPanel)
- {
- Panel borderPanel = new Panel();
- borderPanel.setLayout(new BorderLayout());
-
- // ------------------------------------------
-
- header = new Header(this);
- borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
-
- // ------------------------------------------
-
- mainMenu = new MainMenu(this);
- BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
- menuData.setSplit(false);
- menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
- menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
- menuData.setMargins(new Margins(0, 5, 0, 0));
- borderPanel.add(mainMenu, menuData);
-
- // ------------------------------------------
-
- editorPanel = new EditorPanel();
- borderPanel.add(editorPanel, new BorderLayoutData(RegionPosition.CENTER));
-
- // ------------------------------------------
-
- editorPanel.addEditor( new ProcessDefinitionListEditor(this), false );
- editorPanel.addEditor( new MetricOverviewEditor(this), false);
-
- // ------------------------------------------
-
- mainPanel.add(borderPanel);
- }
-
- private void forceLogin(final Panel mainPanel)
- {
- Panel panel = new Panel();
- panel.setPaddings(20);
- panel.setStyleName("login-panel-content");
- panel.setLayout(new VerticalLayout(10));
- panel.add( new HTML("Welcome, please login.") );
-
- final Window window = new Window();
- window.setTitle("GWT-Console");
- window.setClosable(false);
- window.setResizable(false);
- window.setWidth(300);
- window.setHeight(180);
- window.setLayout(new BorderLayout());
- window.setCloseAction(Window.CLOSE);
-
- final Button submitBtn = new Button("Login",
- new ButtonListenerAdapter()
- {
- public void onClick(Button button, EventObject e)
- {
- String url = getUrlBuilder().getUserInRoleURL(KNOWN_ROLES);
- final Authentication authentication = new Authentication(url);
- authentication.setCallback(
- new Authentication.AuthCallback()
- {
-
- public void onLoginSuccess(Request request, Response response)
- {
- // parse roles
- rolesAssigned = authentication.getRolesAssigned().toArray(new String[] {});
-
- // display main console
- window.close();
- mainPanel.show();
- mainPanel.doLayout();
- }
-
- public void onLoginFailed(Request request, Throwable t)
- {
- // auth failed
- setError("Authentication failed.");
- t.printStackTrace(System.out);
- }
- }
- );
-
- authentication.doLogin();
-
- }
- });
-
- panel.add(submitBtn);
-
- BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
- centerData.setMargins(3, 0, 3, 3);
-
- window.add(panel, centerData);
- // ------------------------------------------
-
- window.show();
- }
-
-
- public void addEditorView(EditorView editorView)
- {
- editorPanel.addEditor(editorView, true);
- }
-
- public boolean hasEditorView(String id)
- {
- return editorPanel.hasEditor(id);
- }
-
- public URLBuilder getUrlBuilder()
- {
- return this.urlBuilder;
- }
-
- public void showEditor(String id)
- {
- editorPanel.showTab(id);
- }
-
- public void setError(final String error)
- {
- displayMessage(error, true);
- }
-
- public void displayMessage(final String message, final boolean isError)
- {
- status.setText(message);
-
- MessageBox.show(new MessageBoxConfig() {
- {
- String title = isError ? "Unknown error" : "System Message";
- setTitle(title);
- setMsg(message);
- setButtons(MessageBox.OK);
- setCallback(new MessageBox.PromptCallback()
- {
- public void execute(String btnID, String text)
- {
- }
- });
- }
- });
- }
-
- public String[] getRolesAssigned()
- {
- return rolesAssigned;
- }
-
-}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -1,188 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.data.Node;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.AccordionLayout;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.TreePanel;
-import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
-import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
-import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
-import org.jboss.bpm.console.client.MainMenuSection;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * The main menu on the left hand.
- * Keeps a list of {@link org.jboss.bpm.console.client.MainMenuSection}.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MainMenu extends Panel
-{
- private final MainCompositeView view;
- private List<Panel> sections = new ArrayList<Panel>();
-
- public MainMenu(final MainCompositeView view)
- {
- super();
- this.view = view;
-
- final AccordionLayout accordion = new AccordionLayout(true);
-
- this.setTitle("");
- this.setCollapsible(true);
- this.setWidth(200);
- this.setLayout(accordion);
-
- MainMenuSection navPanel = new MainMenuSection("Process Management", "bpm-process-icon", new ProcessTree());
- MainMenuSection taskPanel = new MainMenuSection("Task Management", "bpm-task-icon", null);
- MainMenuSection metricPanel = new MainMenuSection("Metrics and Stats", "bpm-metric-icon", new MetricTree());
- MainMenuSection settingsPanel = new MainMenuSection("Settings", "bpm-settings-icon", new SettingsTree());
-
- this.addSection(navPanel);
- this.addSection(taskPanel);
- this.addSection(metricPanel);
- this.addSection(settingsPanel);
- }
-
- public void addSection(MainMenuSection menuSection)
- {
- this.sections.add(menuSection);
- this.add(menuSection);
- }
-
- class ProcessTree extends TreePanel
- {
-
- public ProcessTree() {
-
- TreeNode root = new TreeNode("Process Definitions");
-
- TreeNode definitions = new TreeNode("View definitions");
- definitions.setExpanded(true);
- definitions.addListener(
- new TreeNodeListenerAdapter()
- {
- public void onClick(Node node, EventObject eventObject)
- {
- if(view.hasEditorView(ProcessDefinitionListEditor.ID))
- {
- view.showEditor(ProcessDefinitionListEditor.ID);
- }
- else
- {
- view.addEditorView( new ProcessDefinitionListEditor(view) );
- }
-
- }
- }
- );
- TreeNode upload = new TreeNode("Upload new definitions");
- upload.setExpanded(true);
-
- root.appendChild(definitions);
- root.appendChild(upload);
-
- setRootVisible(true);
- setRootNode(root);
- root.setExpanded(true);
- }
- }
-
- class MetricTree extends TreePanel
- {
-
- public MetricTree() {
-
- TreeNode root = new TreeNode("Process Metrics");
-
- TreeNode overview = new TreeNode("Process workload");
- overview.setExpanded(true);
- overview.addListener(
- new TreeNodeListenerAdapter()
- {
- public void onClick(Node node, EventObject eventObject)
- {
- if(view.hasEditorView(MetricOverviewEditor.ID))
- {
- view.showEditor(MetricOverviewEditor.ID);
- }
- else
- {
- view.addEditorView( new MetricOverviewEditor(view) );
- }
-
- }
- }
- );
-
- TreeNode export = new TreeNode("Export stats");
- export.setExpanded(true);
-
- root.appendChild(overview);
- root.appendChild(export);
-
- setRootVisible(true);
- setRootNode(root);
- root.setExpanded(true);
- }
- }
-
- class SettingsTree extends TreePanel
- {
-
- public SettingsTree()
- {
- TreeNode root = new TreeNode("Debug");
-
- TreeNode overview = new TreeNode("Assigned roles");
- overview.setExpanded(true);
- overview.addListener(
- new TreeNodeListenerAdapter()
- {
- public void onClick(Node node, EventObject eventObject)
- {
- StringBuffer sb = new StringBuffer();
- for(String roleName : view.getRolesAssigned())
- {
- sb.append("<br> - ").append(roleName);
- }
-
- view.displayMessage("Assigned roles: " + sb.toString(), false);
- }
- }
- );
-
- root.appendChild(overview);
-
- setRootVisible(true);
- setRootNode(root);
- root.setExpanded(true);
-
- }
- }
-}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Component;
-
-/**
- * One section in the lefthand main menu.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MainMenuSection extends Panel
-{
-
- public MainMenuSection(String title, String iconClass, Component tree)
- {
- super();
-
- setTitle(title);
- setBorder(false);
- setHideBorders(true);
- setIconCls(iconClass);
-
- if(tree!=null)
- add(tree);
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java (from rev 2652, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -0,0 +1,261 @@
+/*
+ * 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;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HTML;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Margins;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.widgets.*;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.layout.BorderLayout;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.layout.VerticalLayout;
+import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
+import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
+import org.jboss.bpm.console.client.task.TaskListEditor;
+
+import java.util.List;
+
+/**
+ * The main composite that assembles the gwt console application.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MainView extends Composite
+{
+ private HTML status = new HTML();
+ private Header header;
+ private Menu menu;
+ private Workspace workspace;
+ private URLBuilder urlBuilder;
+
+ public final static String[] KNOWN_ROLES = {"admin", "manager", "user"};
+
+ private Viewport viewport;
+
+ private Authentication auth;
+
+ public MainView()
+ {
+ if(!GWT.isScript()) // hosted mode used proxy by default
+ urlBuilder = new URLBuilder(GWT.getModuleBaseURL(), "xhp");
+ else
+ urlBuilder = new URLBuilder( "http://localhost:8080", "gwt-console-server"); // TODO: make configureable
+
+ Panel mainPanel = createMainPanel();
+ assembleMainApplication(mainPanel);
+ forceLogin(mainPanel);
+ viewport = new Viewport(mainPanel);
+ }
+
+ private Panel createMainPanel()
+ {
+ Panel mainPanel = new Panel();
+ mainPanel.setBorder(false);
+ mainPanel.setPaddings(5); // outer most padding
+ mainPanel.setLayout(new FitLayout());
+ mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
+ mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
+ mainPanel.hide();
+
+ initWidget( mainPanel );
+ return mainPanel;
+ }
+
+ private void assembleMainApplication(Panel mainPanel)
+ {
+ Panel borderPanel = new Panel();
+ borderPanel.setLayout(new BorderLayout());
+
+ // ------------------------------------------
+
+ header = new Header(this);
+ borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
+
+ // ------------------------------------------
+
+ menu = new Menu(this);
+ BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
+ menuData.setSplit(false);
+ menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
+ menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
+ menuData.setMargins(new Margins(0, 5, 0, 0));
+ borderPanel.add(menu, menuData);
+
+ // ------------------------------------------
+
+ workspace = new Workspace();
+ borderPanel.add(workspace, new BorderLayoutData(RegionPosition.CENTER));
+
+ // ------------------------------------------
+
+ workspace.addEditor( new ProcessDefinitionListEditor(this), false );
+ workspace.addEditor( new TaskListEditor(this), false );
+ workspace.addEditor( new MetricOverviewEditor(this), false);
+
+ // ------------------------------------------
+
+ mainPanel.add(borderPanel);
+ }
+
+ private void forceLogin(final Panel mainPanel)
+ {
+ Panel panel = new Panel();
+ panel.setPaddings(20);
+ panel.setStyleName("login-panel-content");
+ panel.setLayout(new VerticalLayout(10));
+ panel.add( new HTML("Welcome, please login.") );
+
+ final Window window = new Window();
+ window.setTitle("GWT-Console");
+ window.setClosable(false);
+ window.setResizable(false);
+ window.setWidth(300);
+ window.setHeight(180);
+ window.setLayout(new BorderLayout());
+ window.setCloseAction(Window.CLOSE);
+
+ final FormPanel loginForm = new FormPanel();
+ loginForm.setBorder(false);
+ loginForm.add(new TextField("Username", "user"));
+ TextField passwordField = new TextField("Password", "pass");
+ passwordField.setPassword(true);
+ loginForm.add(passwordField);
+
+ final Button submitBtn = new Button("Login",
+ new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+ String user = loginForm.getForm().findField("user").getValueAsString();
+ String pass = loginForm.getForm().findField("pass").getValueAsString();
+
+ String url = getUrlBuilder().getUserInRoleURL(KNOWN_ROLES);
+ auth = new Authentication(url);
+ auth.setCallback(
+ new Authentication.AuthCallback()
+ {
+
+ public void onLoginSuccess(Request request, Response response)
+ {
+ // clear the form
+ loginForm.getForm().reset();
+
+ // display main console
+ window.close();
+ mainPanel.show();
+ mainPanel.doLayout();
+
+ // update header
+ header.setUserInfo(auth.getUsername(), auth.getRolesAssigned());
+ }
+
+ public void onLoginFailed(Request request, Throwable t)
+ {
+ // auth failed
+ setError("Authentication failed." +t.getMessage());
+ t.printStackTrace(System.out);
+ }
+ }
+ );
+
+ auth.doLogin(user,pass);
+
+ }
+ });
+
+ loginForm.addButton(submitBtn);
+ panel.add(loginForm);
+
+ BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
+ centerData.setMargins(3, 0, 3, 3);
+
+ window.add(panel, centerData);
+ // ------------------------------------------
+
+ window.show();
+ }
+
+
+ public void addEditor(Editor editor)
+ {
+ workspace.addEditor(editor, true);
+ }
+
+ public boolean hasEditor(String id)
+ {
+ return workspace.hasEditor(id);
+ }
+
+ public void showEditor(String id)
+ {
+ workspace.showTab(id);
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return this.urlBuilder;
+ }
+
+ public void setError(final String error)
+ {
+ displayMessage(error, true);
+ }
+
+ public void displayMessage(final String message, final boolean isError)
+ {
+ status.setText(message);
+
+ MessageBox.show(new MessageBoxConfig() {
+ {
+ String title = isError ? "Unknown error" : "System Message";
+ setTitle(title);
+ setMsg(message);
+ setButtons(MessageBox.OK);
+ setCallback(new MessageBox.PromptCallback()
+ {
+ public void execute(String btnID, String text)
+ {
+ }
+ });
+ }
+ });
+ }
+
+ public List<String> getRolesAssigned()
+ {
+ return auth.getRolesAssigned();
+ }
+
+ public String getUsername()
+ {
+ return auth.getUsername();
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Menu.java (from rev 2652, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Menu.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Menu.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -0,0 +1,187 @@
+/*
+ * 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;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.data.Node;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.AccordionLayout;
+import com.gwtext.client.widgets.tree.TreeNode;
+import com.gwtext.client.widgets.tree.TreePanel;
+import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
+import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
+import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The main menu on the left hand.
+ * Keeps a list of {@link org.jboss.bpm.console.client.MenuSection}.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Menu extends Panel
+{
+ private final MainView view;
+ private List<Panel> sections = new ArrayList<Panel>();
+
+ public Menu(final MainView view)
+ {
+ super();
+ this.view = view;
+
+ final AccordionLayout accordion = new AccordionLayout(true);
+
+ this.setTitle("");
+ this.setCollapsible(true);
+ this.setWidth(200);
+ this.setLayout(accordion);
+
+ MenuSection navPanel = new MenuSection("Process Management", "bpm-process-icon", new ProcessTree());
+ MenuSection taskPanel = new MenuSection("Task Management", "bpm-task-icon", null);
+ MenuSection metricPanel = new MenuSection("Metrics and Stats", "bpm-metric-icon", new MetricTree());
+ MenuSection settingsPanel = new MenuSection("Settings", "bpm-settings-icon", new SettingsTree());
+
+ this.addSection(navPanel);
+ this.addSection(taskPanel);
+ this.addSection(metricPanel);
+ this.addSection(settingsPanel);
+ }
+
+ public void addSection(MenuSection menuSection)
+ {
+ this.sections.add(menuSection);
+ this.add(menuSection);
+ }
+
+ class ProcessTree extends TreePanel
+ {
+
+ public ProcessTree() {
+
+ TreeNode root = new TreeNode("Process Definitions");
+
+ TreeNode definitions = new TreeNode("View definitions");
+ definitions.setExpanded(true);
+ definitions.addListener(
+ new TreeNodeListenerAdapter()
+ {
+ public void onClick(Node node, EventObject eventObject)
+ {
+ if(view.hasEditor(ProcessDefinitionListEditor.ID))
+ {
+ view.showEditor(ProcessDefinitionListEditor.ID);
+ }
+ else
+ {
+ view.addEditor( new ProcessDefinitionListEditor(view) );
+ }
+
+ }
+ }
+ );
+ TreeNode upload = new TreeNode("Upload new definitions");
+ upload.setExpanded(true);
+
+ root.appendChild(definitions);
+ root.appendChild(upload);
+
+ setRootVisible(true);
+ setRootNode(root);
+ root.setExpanded(true);
+ }
+ }
+
+ class MetricTree extends TreePanel
+ {
+
+ public MetricTree() {
+
+ TreeNode root = new TreeNode("Process Metrics");
+
+ TreeNode overview = new TreeNode("Process workload");
+ overview.setExpanded(true);
+ overview.addListener(
+ new TreeNodeListenerAdapter()
+ {
+ public void onClick(Node node, EventObject eventObject)
+ {
+ if(view.hasEditor(MetricOverviewEditor.ID))
+ {
+ view.showEditor(MetricOverviewEditor.ID);
+ }
+ else
+ {
+ view.addEditor( new MetricOverviewEditor(view) );
+ }
+
+ }
+ }
+ );
+
+ TreeNode export = new TreeNode("Export stats");
+ export.setExpanded(true);
+
+ root.appendChild(overview);
+ root.appendChild(export);
+
+ setRootVisible(true);
+ setRootNode(root);
+ root.setExpanded(true);
+ }
+ }
+
+ class SettingsTree extends TreePanel
+ {
+
+ public SettingsTree()
+ {
+ TreeNode root = new TreeNode("Debug");
+
+ TreeNode overview = new TreeNode("Assigned roles");
+ overview.setExpanded(true);
+ overview.addListener(
+ new TreeNodeListenerAdapter()
+ {
+ public void onClick(Node node, EventObject eventObject)
+ {
+ StringBuffer sb = new StringBuffer();
+ for(String roleName : view.getRolesAssigned())
+ {
+ sb.append("<br> - ").append(roleName);
+ }
+
+ view.displayMessage("Assigned roles: " + sb.toString(), false);
+ }
+ }
+ );
+
+ root.appendChild(overview);
+
+ setRootVisible(true);
+ setRootNode(root);
+ root.setExpanded(true);
+
+ }
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Menu.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MenuSection.java (from rev 2652, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MenuSection.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Component;
+
+/**
+ * One section in the lefthand main menu.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MenuSection extends Panel
+{
+
+ public MenuSection(String title, String iconClass, Component tree)
+ {
+ super();
+
+ setTitle(title);
+ setBorder(false);
+ setHideBorders(true);
+ setIconCls(iconClass);
+
+ if(tree!=null)
+ add(tree);
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MenuSection.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -23,6 +23,8 @@
import org.jboss.bpm.console.client.model.ProcessInstance;
+import java.util.List;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -109,4 +111,18 @@
{
return getBaseUrl() + "/rs/jbpm3/definitions/new";
}
+
+ public String getTaskListByActorURL(List<String> actors)
+ {
+ StringBuffer sb = new StringBuffer();
+ int i = 0;
+ for(String s : actors)
+ {
+ sb.append(s);
+ if(i<actors.size()-1)
+ sb.append(",");
+ i++;
+ }
+ return getBaseUrl() + "/rs/tasks/actor?actors="+sb.toString();
+ }
}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Workspace.java (from rev 2652, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Workspace.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Workspace.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -0,0 +1,104 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
+import org.jboss.bpm.console.client.Editor;
+
+/**
+ * Maintains {@link org.jboss.bpm.console.client.Workspace}'s
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Workspace extends TabPanel
+{
+ protected MainView view;
+
+ public Workspace()
+ {
+ super();
+
+ this.setResizeTabs(true);
+ this.setMinTabWidth(115);
+ this.setTabWidth(135);
+ this.setEnableTabScroll(true);
+ this.setAutoScroll(true);
+ this.setActiveTab(0);
+ }
+
+ private Panel addTab(Editor editor, boolean closeable) {
+ Panel tab = new WrapperPanel(editor.getId()+".tab");
+ tab.setAutoScroll(true);
+ tab.setTitle(editor.getTitle());
+ tab.setClosable(closeable);
+ tab.setBorder(false);
+ tab.setFrame(false);
+ tab.setHideBorders(true);
+ tab.setIconCls(editor.getIconCSS());
+ this.add(tab);
+ return tab;
+ }
+
+ public void addEditor(Editor editor, boolean closeable)
+ {
+ Panel tab = addTab(editor, closeable);
+ tab.add(editor);
+ this.setActiveTab(tab.getId());
+ }
+
+ public boolean hasEditor(String id)
+ {
+ boolean b = false;
+ final String tabId = id +".tab";
+
+ Component[] tabs = this.getItems();
+ for(int i=0; i<tabs.length; i++)
+ {
+ Component tab = tabs[i];
+ if(tab.getId().equals(tabId))
+ {
+ b=true;
+ break;
+ }
+ }
+
+ return b;
+ }
+
+ public void showTab(String id)
+ {
+ final String tabId = id+".tab";
+ this.setActiveTab(tabId);
+ }
+
+ class WrapperPanel extends Panel
+ {
+
+ public WrapperPanel(String id)
+ {
+ super();
+ setId(id);
+ }
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Workspace.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -21,12 +21,12 @@
*/
package org.jboss.bpm.console.client.metric;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.model.ProcessDefinition;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.process.ProcessInstanceEditor;
import org.jboss.bpm.console.client.process.ProcessInstanceListEditor;
import com.gwtext.client.widgets.layout.ColumnLayout;
@@ -41,14 +41,14 @@
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class DefinitionMetricEditor extends EditorView
+public class DefinitionMetricEditor extends Editor
{
private ProcessDefinition parent;
- private MainCompositeView view;
+ private MainView view;
private Panel teaserPanel;
- public DefinitionMetricEditor(final MainCompositeView view, final ProcessDefinition proc)
+ public DefinitionMetricEditor(final MainView view, final ProcessDefinition proc)
{
super();
this.view = view;
@@ -80,10 +80,10 @@
{
String editorId = ProcessInstanceEditor.ID+"."+proc.getName();
- if(view.hasEditorView(editorId))
+ if(view.hasEditor(editorId))
view.showEditor(editorId);
else
- view.addEditorView( new ProcessInstanceListEditor(proc, view) );
+ view.addEditor( new ProcessInstanceListEditor(proc, view) );
}
})
);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -26,7 +26,7 @@
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.core.Position;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
@@ -43,9 +43,9 @@
{
private ProcessDefinition parent;
- private MainCompositeView view;
+ private MainView view;
- public DefinitionMetricView(MainCompositeView view, ProcessDefinition parent)
+ public DefinitionMetricView(MainView view, ProcessDefinition parent)
{
super();
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -32,7 +32,7 @@
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
@@ -51,10 +51,10 @@
{
private Map row2ProcessMap = new HashMap();
- private final MainCompositeView view;
+ private final MainView view;
private int currentSelection=-1;
- public MetricOverview(final MainCompositeView view)
+ public MetricOverview(final MainView view)
{
super();
this.setHeader(false);
@@ -141,13 +141,13 @@
ProcessDefinition def = (ProcessDefinition)row2ProcessMap.get(new Integer(currentSelection));
String editorId = MetricOverviewEditor.ID+"."+def.getName();
- if(view.hasEditorView(editorId))
+ if(view.hasEditor(editorId))
{
view.showEditor(editorId);
}
else
{
- view.addEditorView(new DefinitionMetricEditor(view, def));
+ view.addEditor(new DefinitionMetricEditor(view, def));
}
}
else
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.console.client.metric;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.HelpDAO;
import com.gwtext.client.widgets.layout.ColumnLayout;
@@ -35,15 +35,15 @@
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class MetricOverviewEditor extends EditorView
+public class MetricOverviewEditor extends Editor
{
- private MainCompositeView view;
+ private MainView view;
private Panel teaserPanel;
public final static String ID = "org.jboss.bpm.metric.ProcessMetric";
- public MetricOverviewEditor(MainCompositeView view)
+ public MetricOverviewEditor(MainView view)
{
super();
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -46,7 +46,6 @@
for (int i = 0; i < array.size(); ++i)
{
JSONObject item = array.get(i).isObject();
- System.out.println("!!!! "+ item);
boolean assigned = JSONWalk.on(item).next("isAssigned").asBool();
String roleName = JSONWalk.on(item).next("role").asString();
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.widgets.RemoteListView;
@@ -40,12 +40,12 @@
{
private Map<Integer, ProcessDefinition> row2ProcessMap = new HashMap<Integer,ProcessDefinition>();
- public ProcessDefinitionList(String titleName, final MainCompositeView view)
+ public ProcessDefinitionList(String titleName, final MainView view)
{
super(titleName, view, getResourceUrl(view), false);
}
- private static String getResourceUrl(MainCompositeView view)
+ private static String getResourceUrl(MainView view)
{
return view.getUrlBuilder().getProcessDefinitionURL();
}
@@ -85,10 +85,10 @@
ProcessDefinition proc = row2ProcessMap.get(row);
String editorId = ProcessInstanceEditor.createWidgetID(proc);
- if(view.hasEditorView(editorId))
+ if(view.hasEditor(editorId))
view.showEditor(editorId);
else
- view.addEditorView( new ProcessInstanceListEditor(proc, view) );
+ view.addEditor( new ProcessInstanceListEditor(proc, view) );
}
protected void onDelete(final int row)
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -33,8 +33,8 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;
-import org.jboss.bpm.console.client.MainCompositeView;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
import org.jboss.bpm.console.client.model.DAOFactory;
@@ -47,17 +47,17 @@
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class ProcessDefinitionListEditor extends EditorView
+public class ProcessDefinitionListEditor extends Editor
{
public final static String ID = "org.jboss.bpm.process.ProcessList";
private ProcessDefinitionList processDefinitionList;
- private MainCompositeView view;
+ private MainView view;
private Panel teaserPanel;
- public ProcessDefinitionListEditor(final MainCompositeView view)
+ public ProcessDefinitionListEditor(final MainView view)
{
super();
this.setId(ID);
@@ -176,13 +176,13 @@
new ToolbarButton("More metrics", new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e)
{
- if(view.hasEditorView(MetricOverviewEditor.ID))
+ if(view.hasEditor(MetricOverviewEditor.ID))
{
view.showEditor(MetricOverviewEditor.ID);
}
else
{
- view.addEditorView( new MetricOverviewEditor(view) );
+ view.addEditor( new MetricOverviewEditor(view) );
}
}
})
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.model.ProcessInstance;
import org.jboss.bpm.console.client.model.jbpm3.ActiveNodeInfo;
import org.jboss.bpm.console.client.model.jbpm3.DiagramNodeInfo;
@@ -49,10 +49,10 @@
public class ProcessImageView extends Panel
{
private ProcessInstance instance;
- private MainCompositeView view;
+ private MainView view;
private ActiveNodeInfo activeNodeInfo = null;
- public ProcessImageView(final ProcessInstance instance, final MainCompositeView view)
+ public ProcessImageView(final ProcessInstance instance, final MainView view)
{
super();
this.instance = instance;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -26,8 +26,8 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.core.EventObject;
-import org.jboss.bpm.console.client.MainCompositeView;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
@@ -39,7 +39,7 @@
*
* @see ProcessInstanceList#onExamine(int)
*/
-public class ProcessInstanceEditor extends EditorView
+public class ProcessInstanceEditor extends Editor
{
public final static String ID = "org.jboss.bpm.process.ProcessInstance";
@@ -47,11 +47,11 @@
private ProcessInstance processInstance;
- private MainCompositeView view;
+ private MainView view;
private Panel teaserPanel;
- public ProcessInstanceEditor(final ProcessDefinition proc, final ProcessInstance instance, final MainCompositeView view)
+ public ProcessInstanceEditor(final ProcessDefinition proc, final ProcessInstance instance, final MainView view)
{
super();
this.setId(ProcessInstanceEditor.ID+"."+instance.getInstanceId());
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.util.DateRenderer;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
@@ -46,7 +46,7 @@
private ProcessDefinition parent;
private static final String DATE_FORMAT = "y-m-j H:i:s"; //08-10-02 13:51:27
- public ProcessInstanceList(ProcessDefinition procDef, String titleName, MainCompositeView view)
+ public ProcessInstanceList(ProcessDefinition procDef, String titleName, MainView view)
{
super(titleName, view, getResourceUrl(view, procDef.getProcessId()), true);
this.parent = procDef;
@@ -61,10 +61,10 @@
{
ProcessInstance instance = row2InstanceMap.get(row);
String id = ProcessInstanceEditor.ID+"."+instance.getInstanceId();
- if(view.hasEditorView(id))
+ if(view.hasEditor(id))
view.showEditor(id);
else
- view.addEditorView( new ProcessInstanceEditor(parent, instance, view) );
+ view.addEditor( new ProcessInstanceEditor(parent, instance, view) );
}
protected void onDelete(final int row)
@@ -224,7 +224,7 @@
return reader;
}
- private static String getResourceUrl(MainCompositeView view, long parentId)
+ private static String getResourceUrl(MainView view, long parentId)
{
return view.getUrlBuilder().getProcessInstanceURL(parentId);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -38,8 +38,8 @@
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
-import org.jboss.bpm.console.client.MainCompositeView;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
@@ -51,15 +51,15 @@
*
* @see org.jboss.bpm.console.client.process.ProcessDefinitionList#onExamine(int)
*/
-public class ProcessInstanceListEditor extends EditorView
+public class ProcessInstanceListEditor extends Editor
{
private ProcessDefinition parent;
private ProcessInstance selectedInstance;
- private MainCompositeView view;
+ private MainView view;
private ProcessInstanceList instanceList;
- public ProcessInstanceListEditor(ProcessDefinition proc, MainCompositeView view)
+ public ProcessInstanceListEditor(ProcessDefinition proc, MainView view)
{
super();
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -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.client.task;
+
+import org.jboss.bpm.console.client.widgets.RemoteListView;
+import org.jboss.bpm.console.client.MainView;
+import com.gwtext.client.data.*;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class TaskList extends RemoteListView
+{
+ public TaskList(String titleName, final MainView view)
+ {
+ super(titleName, view,
+ view.getUrlBuilder().getTaskListByActorURL(view.getRolesAssigned()),
+ false
+ );
+ }
+
+ protected void onAdd()
+ {
+ throw new RuntimeException("Tasks cannot be added manually!");
+ }
+
+ protected void onDelete(final int row)
+ {
+ throw new RuntimeException("Tasks cannot be deleted manually!");
+ }
+
+ protected void onExamine(final int row)
+ {
+
+ }
+
+ protected void onRecordsLoaded(Record[] records)
+ {
+
+ }
+
+ protected ColumnModel createColumnModel()
+ {
+ final ColumnModel columnModel = new ColumnModel(
+ new ColumnConfig[]
+ {
+ new ColumnConfig("ID", "id", 75, true),
+ new ColumnConfig("Task Name", "name", 300, true, null, "expand"),
+ new ColumnConfig("Assigned to", "actor", 75, true)
+ }
+ );
+ return columnModel;
+ }
+
+ protected JsonReader createReader()
+ {
+ final RecordDef recordDef = new RecordDef(
+ new FieldDef[]{
+ new IntegerFieldDef("id"),
+ new StringFieldDef("name"),
+ new StringFieldDef("actor")
+ }
+ );
+
+ final JsonReader reader = new JsonReader(recordDef);
+ reader.setRoot("tasks");
+ reader.setTotalProperty("totalCount");
+ reader.setId("id");
+ return reader;
+ }
+}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -21,26 +21,97 @@
*/
package org.jboss.bpm.console.client.task;
-import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.UIConstants;
+import org.jboss.bpm.console.client.widgets.TeaserPanel;
+import com.gwtext.client.widgets.layout.ColumnLayout;
+import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class TaskListEditor extends EditorView
+public class TaskListEditor extends Editor
{
+ public final static String ID = "org.jboss.bpm.task.TaskList";
+ private MainView mainView;
+ private TaskList taskList;
+ private Panel teaserPanel;
+ private boolean initialized;
+
+ public TaskListEditor(MainView mainView )
+ {
+ super();
+ this.setId(ID);
+ this.mainView = mainView;
+
+ this.setLayout( new ColumnLayout() );
+ this.setWidth(UIConstants.EDITOR_WIDTH);
+
+ this.addListener(
+ new PanelListenerAdapter()
+ {
+
+ public boolean doBeforeRender(Component component)
+ {
+ return beforeRenderCallback();
+ }
+ }
+ );
+
+ }
+
public String getEditorId()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return ID;
}
public String getTitle()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return "Tasks";
}
public String getIconCSS()
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return "bpm-task-icon";
}
+
+ /**
+ * TaskList editor requires an authenticated user,
+ * hence the initialization through callback
+ */
+ public boolean beforeRenderCallback()
+ {
+ if(!initialized)
+ {
+ final Panel leftHand = new Panel();
+ leftHand.setFrame(false);
+ leftHand.setHeader(false);
+ leftHand.setBorder(false);
+
+ // ----------------------------------
+
+ taskList = new TaskList("Your tasks", mainView);
+ leftHand.add(taskList);
+
+ // ----------------------------------
+
+ teaserPanel = new TeaserPanel();
+
+ // ----------------------------------
+
+ this.add(leftHand, new ColumnLayoutData(0.7) );
+ this.add(teaserPanel , new ColumnLayoutData(0.3) );
+
+ doLayout();
+
+ initialized = true;
+ }
+
+ return true;
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -30,7 +30,7 @@
import com.gwtext.client.widgets.grid.ColumnModel;
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.grid.event.GridCellListener;
-import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
/**
@@ -46,7 +46,7 @@
public abstract class RemoteListView extends Panel
{
protected int selectedRowIndex = -1;
- protected MainCompositeView view;
+ protected MainView view;
protected static final int PAGE_SIZE = 25;
private GridPanel grid;
protected String title;
@@ -57,7 +57,7 @@
private boolean storeInit = false;
private boolean hasAddButton;
- public RemoteListView(String titleName, MainCompositeView view, String resourceUrl, boolean hasAddButton)
+ public RemoteListView(String titleName, MainView view, String resourceUrl, boolean hasAddButton)
{
super();
Modified: projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json 2008-10-29 14:40:28 UTC (rev 2660)
@@ -4,8 +4,8 @@
{"id": "default",
"url":"http://localhost:8080/gwt-console-server",
"passthrough":true,
- "username":"admin",
- "password":"admin"
+ "username":"manager",
+ "password":"manager"
},
{"id": "jboss",
"url":"http://localhost:8080/gwt-console-server",
Modified: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-10-29 14:37:50 UTC (rev 2659)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-10-29 14:40:28 UTC (rev 2660)
@@ -56,7 +56,7 @@
public void testAuthentication()
{
- final MainCompositeView view = application.getConsoleView();
+ final MainView view = application.getConsoleView();
assertNotNull("View not initialized", view);
Timer timer = new Timer()
@@ -64,7 +64,7 @@
public void run()
{
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainCompositeView.KNOWN_ROLES);
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
final Authentication auth = new Authentication(inRoleURL);
auth.setCallback(
new Authentication.AuthCallback() {
@@ -92,7 +92,7 @@
public void testProcessDefList()
{
- final MainCompositeView view = application.getConsoleView();
+ final MainView view = application.getConsoleView();
assertNotNull("View not initialized", view);
@@ -134,7 +134,7 @@
public void run()
{
System.out.println("Do authentication");
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainCompositeView.KNOWN_ROLES);
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainView.KNOWN_ROLES);
final Authentication auth = new Authentication(inRoleURL);
auth.doLogin();
15 years, 6 months
JBoss JBPM SVN: r2659 - in projects/spec/trunk: modules/api/src/main/java/org/jbpm/api/config/internal and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 10:37:50 -0400 (Wed, 29 Oct 2008)
New Revision: 2659
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestSetup.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestProcessCatalog.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
projects/spec/trunk/modules/samples/airticket/client/pom.xml
projects/spec/trunk/pom.xml
Log:
Airticket GWT sample ok
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -29,7 +29,6 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
import org.jboss.kernel.plugins.util.KernelLocator;
-import org.jbpm.api.test.CTSTestSetup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,7 +41,7 @@
public class EmbeddedBeansDeployer extends BasicBootstrap
{
// Provide logging
- final Logger log = LoggerFactory.getLogger(CTSTestSetup.class);
+ final Logger log = LoggerFactory.getLogger(EmbeddedBeansDeployer.class);
private Kernel kernel;
private BasicXMLDeployer deployer;
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestSetup.java (from rev 2649, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestSetup.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestSetup.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -0,0 +1,60 @@
+/*
+ * 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.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestSuite;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An API test setup
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class APITestSetup extends TestSetup
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(APITestSetup.class);
+
+ public APITestSetup(Class<?> testCase)
+ {
+ super(new TestSuite(testCase));
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.debug("### START SETUP " + getTest());
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ log.debug("### END SETUP " + getTest());
+ }
+
+}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestProcessCatalog.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestProcessCatalog.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestProcessCatalog.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -1,108 +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.test;
-
-// $Id$
-
-import junit.framework.TestCase;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Task;
-import org.jbpm.api.model.Assignment.AssignTime;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.service.ProcessBuilderService;
-
-/**
- * A catalog of CTS test processes
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public abstract class CTSTestProcessCatalog
-{
- public static ProcessDefinition getDefaultProcess(ProcessEngine engine)
- {
- ProcessBuilder builder = engine.getService(ProcessBuilderService.class).getProcessBuilder();
- builder.addProcess("Proc");
- builder.addProcessProperty("proP1", "valP1").addProcessProperty("proP2", "valP2");
- builder.addProcessMessage("procMsg").addProperty("msgPropName", "msgPropVal");
- builder.addProcessAssignment(AssignTime.Start, Expression.ExpressionLanguage.MVEL, "foo==true", "fooTrue");
- builder.addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addNodeProperty("proT1", "valT1").addNodeProperty("proT2", "valT2");
- builder.addSequenceFlow("End").addEndEvent("End");
- return builder.getProcessDefinition();
- }
-
- public static void validateDefaultProcess(ProcessDefinition procDef)
- {
- TestCase.assertNotNull("Process not null", procDef);
- TestCase.assertEquals("Proc", procDef.getName());
-
- TestCase.assertEquals("Two proc props", 2, procDef.getPropertyNames().size());
- TestCase.assertEquals("valP1", procDef.getProperty("proP1").getValue());
- TestCase.assertEquals("valP2", procDef.getProperty("proP2").getValue());
-
- Message procMsg = procDef.getMessage("procMsg");
- TestCase.assertEquals("One proc message", 1, procDef.getMessages().size());
- TestCase.assertEquals("msgPropVal", procMsg.getProperty("msgPropName").getValue());
-
- TestCase.assertEquals("One proc assignment", 1, procDef.getAssignments().size());
- Assignment procAssign = procDef.getAssignments().get(0);
- TestCase.assertEquals(AssignTime.Start, procAssign.getAssignTime());
- TestCase.assertEquals("foo==true", procAssign.getFrom().getExpressionBody());
- TestCase.assertEquals("fooTrue", procAssign.getTo().getName());
-
- StartEvent start = (StartEvent)procDef.getNode("Start");
- Task task = (Task)procDef.getNode("Task");
- EndEvent end = (EndEvent)procDef.getNode("End");
-
- TestCase.assertNotNull("Start not null", start);
- TestCase.assertNotNull("Task not null", task);
- TestCase.assertNotNull("End not null", end);
-
- TestCase.assertEquals("No start props", 0, start.getPropertyNames().size());
- TestCase.assertEquals("Two task props", 2, task.getPropertyNames().size());
- TestCase.assertEquals("No end props", 0, end.getPropertyNames().size());
-
- TestCase.assertEquals("valT1", task.getProperty("proT1").getValue());
- TestCase.assertEquals("valT2", task.getProperty("proT2").getValue());
-
- SequenceFlow startFlow = start.getOutFlow();
- TestCase.assertNotNull("Start flow not null", startFlow);
- TestCase.assertEquals("Task", startFlow.getTargetName());
- TestCase.assertSame(start, startFlow.getSourceRef());
- TestCase.assertSame(task, startFlow.getTargetRef());
-
- SequenceFlow taskFlow = task.getOutFlow();
- TestCase.assertNotNull("Task flow not null", taskFlow);
- TestCase.assertEquals("End", taskFlow.getTargetName());
- TestCase.assertSame(task, taskFlow.getSourceRef());
- TestCase.assertSame(end, taskFlow.getTargetRef());
- }
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -1,60 +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.test;
-
-import junit.extensions.TestSetup;
-import junit.framework.TestSuite;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A CTS test setup
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class CTSTestSetup extends TestSetup
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(CTSTestSetup.class);
-
- public CTSTestSetup(Class<?> testCase)
- {
- super(new TestSuite(testCase));
- }
-
- @Override
- protected void setUp() throws Exception
- {
- log.debug("### START SETUP " + getTest());
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- log.debug("### END SETUP " + getTest());
- }
-
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -35,7 +35,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class ConfigurationTestSetup extends CTSTestSetup
+public class ConfigurationTestSetup extends APITestSetup
{
public static final String CTS_TEST_ENGINE = "CTSTestEngine";
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -37,7 +37,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 14-Oct-2004
*/
-public class IntegrationTestSetup extends CTSTestSetup
+public class IntegrationTestSetup extends APITestSetup
{
private IntegrationTestHelper delegate = new IntegrationTestHelper();
private String[] archives = new String[0];
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java (from rev 2649, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestProcessCatalog.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -0,0 +1,108 @@
+/*
+ * 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.test;
+
+// $Id$
+
+import junit.framework.TestCase;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Assignment;
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.model.Assignment.AssignTime;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
+
+/**
+ * A catalog of CTS test processes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Sep-2008
+ */
+public abstract class ProcessCatalog
+{
+ public static ProcessDefinition getDefaultProcess(ProcessEngine engine)
+ {
+ ProcessBuilder builder = engine.getService(ProcessBuilderService.class).getProcessBuilder();
+ builder.addProcess("Proc");
+ builder.addProcessProperty("proP1", "valP1").addProcessProperty("proP2", "valP2");
+ builder.addProcessMessage("procMsg").addProperty("msgPropName", "msgPropVal");
+ builder.addProcessAssignment(AssignTime.Start, Expression.ExpressionLanguage.MVEL, "foo==true", "fooTrue");
+ builder.addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addNodeProperty("proT1", "valT1").addNodeProperty("proT2", "valT2");
+ builder.addSequenceFlow("End").addEndEvent("End");
+ return builder.getProcessDefinition();
+ }
+
+ public static void validateDefaultProcess(ProcessDefinition procDef)
+ {
+ TestCase.assertNotNull("Process not null", procDef);
+ TestCase.assertEquals("Proc", procDef.getName());
+
+ TestCase.assertEquals("Two proc props", 2, procDef.getPropertyNames().size());
+ TestCase.assertEquals("valP1", procDef.getProperty("proP1").getValue());
+ TestCase.assertEquals("valP2", procDef.getProperty("proP2").getValue());
+
+ Message procMsg = procDef.getMessage("procMsg");
+ TestCase.assertEquals("One proc message", 1, procDef.getMessages().size());
+ TestCase.assertEquals("msgPropVal", procMsg.getProperty("msgPropName").getValue());
+
+ TestCase.assertEquals("One proc assignment", 1, procDef.getAssignments().size());
+ Assignment procAssign = procDef.getAssignments().get(0);
+ TestCase.assertEquals(AssignTime.Start, procAssign.getAssignTime());
+ TestCase.assertEquals("foo==true", procAssign.getFrom().getExpressionBody());
+ TestCase.assertEquals("fooTrue", procAssign.getTo().getName());
+
+ StartEvent start = (StartEvent)procDef.getNode("Start");
+ Task task = (Task)procDef.getNode("Task");
+ EndEvent end = (EndEvent)procDef.getNode("End");
+
+ TestCase.assertNotNull("Start not null", start);
+ TestCase.assertNotNull("Task not null", task);
+ TestCase.assertNotNull("End not null", end);
+
+ TestCase.assertEquals("No start props", 0, start.getPropertyNames().size());
+ TestCase.assertEquals("Two task props", 2, task.getPropertyNames().size());
+ TestCase.assertEquals("No end props", 0, end.getPropertyNames().size());
+
+ TestCase.assertEquals("valT1", task.getProperty("proT1").getValue());
+ TestCase.assertEquals("valT2", task.getProperty("proT2").getValue());
+
+ SequenceFlow startFlow = start.getOutFlow();
+ TestCase.assertNotNull("Start flow not null", startFlow);
+ TestCase.assertEquals("Task", startFlow.getTargetName());
+ TestCase.assertSame(start, startFlow.getSourceRef());
+ TestCase.assertSame(task, startFlow.getTargetRef());
+
+ SequenceFlow taskFlow = task.getOutFlow();
+ TestCase.assertNotNull("Task flow not null", taskFlow);
+ TestCase.assertEquals("End", taskFlow.getTargetName());
+ TestCase.assertSame(task, taskFlow.getSourceRef());
+ TestCase.assertSame(end, taskFlow.getTargetRef());
+ }
+}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -28,7 +28,7 @@
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.api.test.CTSTestProcessCatalog;
+import org.jbpm.api.test.ProcessCatalog;
/**
* Test the ProcessBuilder
@@ -40,8 +40,8 @@
{
public void testBasicProcess() throws Exception
{
- ProcessDefinition procDef = CTSTestProcessCatalog.getDefaultProcess(getProcessEngine());
- CTSTestProcessCatalog.validateDefaultProcess(procDef);
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess(getProcessEngine());
+ ProcessCatalog.validateDefaultProcess(procDef);
}
public void testNoProcessName() throws Exception
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -33,7 +33,7 @@
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.api.test.CTSTestProcessCatalog;
+import org.jbpm.api.test.ProcessCatalog;
/**
* Test the ProcessDefinition
@@ -45,8 +45,8 @@
{
public void testBasicProcess() throws Exception
{
- ProcessDefinition procDef = CTSTestProcessCatalog.getDefaultProcess(getProcessEngine());
- CTSTestProcessCatalog.validateDefaultProcess(procDef);
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess(getProcessEngine());
+ ProcessCatalog.validateDefaultProcess(procDef);
ProcessEngine engine = procDef.getProcessEngine();
assertNotNull("ProcessEngine not null", engine);
@@ -60,7 +60,7 @@
public void testNewInstance() throws Exception
{
- ProcessDefinition procDef = CTSTestProcessCatalog.getDefaultProcess(getProcessEngine());
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess(getProcessEngine());
ProcessEngine engine = procDef.getProcessEngine();
ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
@@ -74,7 +74,7 @@
public void testRegister() throws Exception
{
- ProcessDefinition procDef = CTSTestProcessCatalog.getDefaultProcess(getProcessEngine());
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess(getProcessEngine());
ProcessEngine engine = procDef.getProcessEngine();
ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -33,7 +33,7 @@
import org.jbpm.api.model.Task;
import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.api.test.CTSTestProcessCatalog;
+import org.jbpm.api.test.ProcessCatalog;
/**
* Test the PersistenceService
@@ -52,13 +52,13 @@
PersistenceService service = engine.getService(PersistenceService.class);
// Save the ProcessDefinition
- ProcessDefinition procDef = CTSTestProcessCatalog.getDefaultProcess(engine);
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess(engine);
service.saveProcessDefinition(procDef);
// Load the ProcessDefinition
ObjectName procDefID = procDef.getKey();
ProcessDefinition loadDef = service.loadProcessDefinition(procDefID);
- CTSTestProcessCatalog.validateDefaultProcess(loadDef);
+ ProcessCatalog.validateDefaultProcess(loadDef);
StartEvent start = loadDef.getNode(StartEvent.class, "Start");
Task task = loadDef.getNode(Task.class, "Task");
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-10-29 14:37:50 UTC (rev 2659)
@@ -35,7 +35,7 @@
import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.api.test.CTSTestProcessCatalog;
+import org.jbpm.api.test.ProcessCatalog;
/**
* Test the PersistenceService
@@ -55,7 +55,7 @@
PersistenceService service = engine.getService(PersistenceService.class);
// Register (save) the process definition, which is not done implicitly
- ProcessDefinition procDef = unregisterOnTearDown(CTSTestProcessCatalog.getDefaultProcess(engine));
+ ProcessDefinition procDef = unregisterOnTearDown(ProcessCatalog.getDefaultProcess(engine));
procDefService.registerProcessDefinition(procDef);
// Create and save the Process
@@ -65,7 +65,7 @@
// Load the process
ObjectName procID = proc.getKey();
Process loadProc = service.loadProcess(procID);
- CTSTestProcessCatalog.validateDefaultProcess(loadProc.getProcessDefinition());
+ ProcessCatalog.validateDefaultProcess(loadProc.getProcessDefinition());
StartEvent start = loadProc.getNode(StartEvent.class, "Start");
Task task = loadProc.getNode(Task.class, "Task");
Modified: projects/spec/trunk/modules/samples/airticket/client/pom.xml
===================================================================
--- projects/spec/trunk/modules/samples/airticket/client/pom.xml 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/modules/samples/airticket/client/pom.xml 2008-10-29 14:37:50 UTC (rev 2659)
@@ -33,6 +33,18 @@
<artifactId>jbpm-spec-sample-airticket-server</artifactId>
<version>${version}</version>
</dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ </dependency>
</dependencies>
<!-- Profiles -->
Modified: projects/spec/trunk/pom.xml
===================================================================
--- projects/spec/trunk/pom.xml 2008-10-29 14:14:52 UTC (rev 2658)
+++ projects/spec/trunk/pom.xml 2008-10-29 14:37:50 UTC (rev 2659)
@@ -210,7 +210,6 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
- <scope>test</scope>
</dependency>
</dependencies>
</profile>
15 years, 6 months
JBoss JBPM SVN: r2658 - in projects/spec/trunk: modules/ri/src/main/java/org/jbpm/ri/model and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 10:14:52 -0400 (Wed, 29 Oct 2008)
New Revision: 2658
Modified:
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
projects/spec/trunk/pom.xml
Log:
Airticket sample test ok
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-29 14:12:23 UTC (rev 2657)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-29 14:14:52 UTC (rev 2658)
@@ -106,7 +106,7 @@
if (receivedMessages.size() > 0)
{
// Copy the expected properties from the received message
- Message msg = receivedMessages.get(0);
+ Message msg = receivedMessages.remove(0);
ExecutionContext exContext = token.getExecutionContext();
for (String key : messageRef.getPropertyNames())
{
Modified: projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml 2008-10-29 14:12:23 UTC (rev 2657)
+++ projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml 2008-10-29 14:14:52 UTC (rev 2658)
@@ -61,7 +61,7 @@
<bean name="jBPMProcessService" class="org.jbpm.ri.service.ProcessServiceImpl" >
<property name="interceptors">
<list elementClass="java.lang.String">
- <value>org.jbpm.ri.runtime.TransactionInterceptor</value>
+ <!-- value>org.jbpm.ri.runtime.TransactionInterceptor</value -->
<value>org.jbpm.ri.runtime.SignalHandlerInterceptor</value>
<value>org.jbpm.ri.runtime.FlowHandlerInterceptor</value>
<value>org.jbpm.ri.runtime.AssignmentInterceptor</value>
Modified: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-10-29 14:12:23 UTC (rev 2657)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-10-29 14:14:52 UTC (rev 2658)
@@ -52,11 +52,12 @@
private MessageService messageManager = MessageService.locateMessageService();
private AirticketMessageListener msgListener;
+ private Process proc;
public void testValidData() throws Exception
{
- ProcessDefinition procDef = getProcessDefinition();
- Process proc = procDef.newInstance();
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ proc = procDef.newInstance();
proc.startProcess();
messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getValidRequestMessage());
@@ -70,8 +71,8 @@
public void testInvalidData() throws Exception
{
- ProcessDefinition procDef = getProcessDefinition();
- Process proc = procDef.newInstance();
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ proc = procDef.newInstance();
proc.startProcess();
messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getInvalidRequestMessage());
@@ -159,7 +160,7 @@
@Override
public ObjectName getKey()
{
- return ObjectNameFactory.create("org.jbpm.listener:sample=AirticketService");
+ return listenerID;
}
public Message getConfirmMessage()
@@ -170,7 +171,7 @@
public void catchMessage(Message msg)
{
log.debug("catchMessage: " + msg);
- ObjectName procID = msg.getFromRef().getName();
+ ObjectName procID = proc.getKey();
MessageService mm = MessageService.locateMessageService();
if (msg.getName().equals(AirticketProcessBuilder.MESSAGE_INVALID_DATA))
mm.sendMessage(procID, AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getValidRequestMessage());
@@ -179,10 +180,5 @@
else if (msg.getName().equals(AirticketProcessBuilder.MESSAGE_CONFIRM))
confirmMessage = msg;
}
-
- public ObjectName getID()
- {
- return listenerID;
- }
}
}
\ No newline at end of file
Modified: projects/spec/trunk/pom.xml
===================================================================
--- projects/spec/trunk/pom.xml 2008-10-29 14:12:23 UTC (rev 2657)
+++ projects/spec/trunk/pom.xml 2008-10-29 14:14:52 UTC (rev 2658)
@@ -36,8 +36,8 @@
<module>modules/api</module>
<module>modules/dialects</module>
<module>modules/ri</module>
+ <module>modules/samples/airticket</module>
<module>modules/cts</module>
- <module>modules/samples/airticket</module>
</modules>
<!-- Properties -->
15 years, 6 months
JBoss JBPM SVN: r2657 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-29 10:12:23 -0400 (Wed, 29 Oct 2008)
New Revision: 2657
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutor.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutorThread.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/seam/
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
Log:
[JBPM-1166] fix SEAM timer tx integration problem
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2008-10-29 13:01:28 UTC (rev 2656)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2008-10-29 14:12:23 UTC (rev 2657)
@@ -20,24 +20,24 @@
private static final long serialVersionUID = 1L;
- JbpmConfiguration jbpmConfiguration;
- String name;
- int nbrOfThreads;
- int idleInterval;
- int maxIdleInterval;
- int historyMaxSize;
+ protected JbpmConfiguration jbpmConfiguration;
+ protected String name;
+ protected int nbrOfThreads;
+ protected int idleInterval;
+ protected int maxIdleInterval;
+ protected int historyMaxSize;
- int maxLockTime;
- int lockMonitorInterval;
- int lockBufferTime;
+ protected int maxLockTime;
+ protected int lockMonitorInterval;
+ protected int lockBufferTime;
- Map threads = new HashMap();
- LockMonitorThread lockMonitorThread;
- Map monitoredJobIds = Collections.synchronizedMap(new HashMap());
+ protected Map threads = new HashMap();
+ protected LockMonitorThread lockMonitorThread;
+ protected Map monitoredJobIds = Collections.synchronizedMap(new HashMap());
- boolean isStarted = false;
+ protected boolean isStarted = false;
- private static String hostName;
+ protected static String hostName;
public synchronized void start() {
if (! isStarted) {
@@ -86,12 +86,16 @@
protected synchronized void startThread() {
String threadName = getNextThreadName();
- Thread thread = new JobExecutorThread(threadName, this, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, historyMaxSize);
+ Thread thread = createThread(threadName);
threads.put(threadName, thread);
log.debug("starting new job executor thread '"+threadName+"'");
thread.start();
}
+ protected Thread createThread(String threadName) {
+ return new JobExecutorThread(threadName, this, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, historyMaxSize);
+ }
+
protected String getNextThreadName() {
return getThreadName(threads.size()+1);
}
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/AsyncAction.java 2008-10-29 14:12:23 UTC (rev 2657)
@@ -0,0 +1,31 @@
+/*
+ * 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.seam;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+public class AsyncAction implements ActionHandler {
+ public void execute(ExecutionContext executionContext) throws Exception {
+ JobExecutorCustomizationTest.jobEvents.add("execute action");
+ }
+}
\ No newline at end of file
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutor.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutor.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutor.java 2008-10-29 14:12:23 UTC (rev 2657)
@@ -0,0 +1,11 @@
+package org.jbpm.seam;
+
+import org.jbpm.job.executor.JobExecutor;
+
+public class CustomJobExecutor extends JobExecutor {
+ private static final long serialVersionUID = 1L;
+
+ protected Thread createThread(String threadName) {
+ return new CustomJobExecutorThread(threadName, this, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, historyMaxSize);
+ }
+}
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutorThread.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutorThread.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/CustomJobExecutorThread.java 2008-10-29 14:12:23 UTC (rev 2657)
@@ -0,0 +1,24 @@
+package org.jbpm.seam;
+
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.job.Job;
+import org.jbpm.job.executor.JobExecutor;
+import org.jbpm.job.executor.JobExecutorThread;
+
+public class CustomJobExecutorThread extends JobExecutorThread {
+
+ public CustomJobExecutorThread(String name, JobExecutor jobExecutor, JbpmConfiguration jbpmConfiguration, int idleInterval, int maxIdleInterval, long maxLockTime, int maxHistory) {
+ super(name, jobExecutor, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, maxHistory);
+ }
+
+ protected void executeJob(Job job) {
+ // intercept before
+ JobExecutorCustomizationTest.jobEvents.add("before");
+ try {
+ super.executeJob(job);
+ } finally {
+ // intercept after
+ JobExecutorCustomizationTest.jobEvents.add("after");
+ }
+ }
+}
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/JobExecutorCustomizationTest.java 2008-10-29 14:12:23 UTC (rev 2657)
@@ -0,0 +1,63 @@
+package org.jbpm.seam;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.job.executor.JobExecutor;
+
+
+public class JobExecutorCustomizationTest extends AbstractDbTestCase {
+
+ public static List jobEvents = new ArrayList();
+
+ protected String getJbpmTestConfig() {
+ return "org/jbpm/seam/custom.job.executor.jbpm.cfg.xml";
+ }
+
+ public void testCustomJobExecutor() {
+ JobExecutor jobExecutor = getJbpmConfiguration().getJobExecutor();
+ assertEquals(CustomJobExecutor.class, jobExecutor.getClass());
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition name='customjobexecution' initial='start'>" +
+ " <node name='start'>" +
+ " <transition to='end'>" +
+ " <action async='true' class='"+AsyncAction.class.getName()+"' />" +
+ " </transition>" +
+ " </node>" +
+ " <state name='end' />" +
+ "</process-definition>"
+ );
+ jbpmContext.deployProcessDefinition(processDefinition);
+ long processDefinitionId = processDefinition.getId();
+ try {
+
+ newTransaction();
+
+ jbpmContext.newProcessInstanceForUpdate("customjobexecution");
+
+ newTransaction();
+
+ jobExecutor.start();
+ try {
+ waitForJobs(8000, 0);
+ } finally {
+ jobExecutor.stop();
+ }
+
+ } finally {
+ newTransaction();
+
+ graphSession.deleteProcessDefinition(processDefinitionId);
+ }
+
+ List expectedJobEvents = new ArrayList();
+ expectedJobEvents.add("before");
+ expectedJobEvents.add("execute action");
+ expectedJobEvents.add("after");
+
+ assertEquals(expectedJobEvents, jobEvents);
+ }
+}
Added: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml (rev 0)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/seam/custom.job.executor.jbpm.cfg.xml 2008-10-29 14:12:23 UTC (rev 2657)
@@ -0,0 +1,13 @@
+<jbpm-configuration>
+ <bean name="jbpm.job.executor" class="org.jbpm.seam.CustomJobExecutor">
+ <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
+ <field name="name"><string value="JbpmJobExecutor" /></field>
+ <field name="nbrOfThreads"><int value="1" /></field>
+ <field name="idleInterval"><int value="5000" /></field>
+ <field name="maxIdleInterval"><int value="3600000" /></field> <!-- 1 hour -->
+ <field name="historyMaxSize"><int value="20" /></field>
+ <field name="maxLockTime"><int value="600000" /></field> <!-- 10 minutes -->
+ <field name="lockMonitorInterval"><int value="60000" /></field> <!-- 1 minute -->
+ <field name="lockBufferTime"><int value="5000" /></field> <!-- 5 seconds -->
+ </bean>
+</jbpm-configuration>
\ No newline at end of file
15 years, 6 months
JBoss JBPM SVN: r2656 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/model/builder and 15 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 09:01:28 -0400 (Wed, 29 Oct 2008)
New Revision: 2656
Removed:
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketAPIDescriptorTest.java
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketMarshallerTest.java
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketSTPDescriptorTest.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/dialects/api10/.classpath
projects/spec/trunk/modules/dialects/jpdl32/.classpath
projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java
projects/spec/trunk/modules/dialects/stp/.classpath
projects/spec/trunk/modules/dialects/xpdl21/.classpath
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleInFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleOutFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleInFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleOutFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/samples/airticket/client/.classpath
projects/spec/trunk/modules/samples/airticket/client/pom.xml
projects/spec/trunk/modules/samples/airticket/server/.classpath
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
Log:
Fix compile issues
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -24,6 +24,7 @@
//$Id$
import org.jbpm.api.model.Signal;
+import org.jbpm.api.service.SignalService;
/**
* A signal listener that can be registered with the {@link SignalService}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -21,6 +21,7 @@
*/
package org.jbpm.api.model.builder;
+import org.jbpm.api.model.Gate;
import org.jbpm.api.model.Expression.ExpressionLanguage;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -27,11 +27,12 @@
import java.io.Writer;
import java.net.URI;
import java.net.URL;
+
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
/**
- * The DialectHandler converts a supported dialect to the Process model.
+ * The DialectHandler converts a supported dialect to the ProcessDefinition model.
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
@@ -46,14 +47,12 @@
URI getNamespaceURI();
/**
- * Create a {@link Process} from a descriptor.
- * @param isInclude TODO
+ * Create a ProcessDefinition from a descriptor.
*/
ProcessDefinition createProcessDefinition(String pXML);
/**
- * Create a {@link Process} from a descriptor URL.
- * @param isInclude TODO
+ * Create a ProcessDefinition from a descriptor URL.
*/
ProcessDefinition createProcessDefinition(URL pURL) throws IOException;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -52,7 +52,7 @@
public class CTSTestCase extends APITestCase
{
// Provide logging
- final Logger log = LoggerFactory.getLogger(CTSTestCase.class);
+ private static final Logger log = LoggerFactory.getLogger(CTSTestCase.class);
// The embedded SignalListener
private SignalListener signalListener;
Modified: projects/spec/trunk/modules/dialects/api10/.classpath
===================================================================
--- projects/spec/trunk/modules/dialects/api10/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/dialects/api10/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/dialects/jpdl32/.classpath
===================================================================
--- projects/spec/trunk/modules/dialects/jpdl32/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/dialects/jpdl32/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java
===================================================================
--- projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -34,8 +34,8 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process;
import org.jbpm.api.service.DialectHandler;
import org.jbpm.dialect.jpdl32.model.JPDL32ProcessDefinition;
Modified: projects/spec/trunk/modules/dialects/stp/.classpath
===================================================================
--- projects/spec/trunk/modules/dialects/stp/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/dialects/stp/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/dialects/xpdl21/.classpath
===================================================================
--- projects/spec/trunk/modules/dialects/xpdl21/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/dialects/xpdl21/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleInFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleInFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -25,6 +25,7 @@
import java.util.List;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleOutFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MultipleOutFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -25,6 +25,7 @@
import java.util.List;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleInFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleInFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -23,6 +23,7 @@
//$Id$
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleOutFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SingleOutFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -23,6 +23,7 @@
//$Id$
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -25,6 +25,7 @@
import java.util.List;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.ri.model.SequenceFlowImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -25,6 +25,7 @@
import java.util.List;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.ri.model.SequenceFlowImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -23,6 +23,7 @@
//$Id$
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.ri.model.SequenceFlowImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -23,6 +23,7 @@
//$Id$
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.ri.model.SequenceFlowImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -31,7 +31,7 @@
import org.jbpm.api.runtime.Token;
/**
- * A {@link Token} that includes properties from the current {@link Activity}
+ * A {@link Token} that includes properties from the current {@link Node}
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
@@ -44,7 +44,7 @@
public DelegatingToken(MutableToken token)
{
this.delegateToken = token;
-
+
Node targetRef = token.getFlow().getTargetRef();
ExecutionContext exContext = token.getExecutionContext();
this.delegateContext = new DelegatingExecutionContext(targetRef, exContext);
@@ -109,7 +109,7 @@
{
delegateToken.setOutputSet(outputSet);
}
-
+
public String toString()
{
Node node = getFlow().getTargetRef();
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -41,7 +41,7 @@
import org.slf4j.LoggerFactory;
/**
- * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link ConnectingObject} objects together with their
+ * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link SequenceFlow} objects together with their
* associated {@link Token}.
*
* @author thomas.diesler(a)jboss.com
@@ -122,7 +122,7 @@
if (token.getTokenStatus() != TokenStatus.Started)
throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
-
+
MutableToken mutableToken = (MutableToken)token;
mutableToken.setFlow(flow);
}
@@ -156,14 +156,14 @@
RunnableToken rtToken = runnableTokens.get(token.getTokenID());
if (rtToken == null)
throw new IllegalStateException("Not a runnable token: " + token);
-
+
log.debug("Suspend Token: " + token);
MutableToken mutableToken = (MutableToken)token;
mutableToken.setTokenStatus(TokenStatus.Suspended);
-
+
// Release the thread for a suspended token
rtToken.releaseThread();
-
+
return token.getTokenID();
}
}
@@ -187,7 +187,7 @@
rtToken = new RunnableToken(this, rtProc, mutableToken);
runnableTokens.put(token.getTokenID(), rtToken);
executor.submit(rtToken);
-
+
return token;
}
}
Modified: projects/spec/trunk/modules/samples/airticket/client/.classpath
===================================================================
--- projects/spec/trunk/modules/samples/airticket/client/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/client/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/samples/airticket/client/pom.xml
===================================================================
--- projects/spec/trunk/modules/samples/airticket/client/pom.xml 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/client/pom.xml 2008-10-29 13:01:28 UTC (rev 2656)
@@ -38,8 +38,8 @@
<!-- Profiles -->
<profiles>
<!--
- Name: skiptests
- Desc: Skips the tests
+ Name: gwt
+ Desc: Build and run the GWT client
-->
<profile>
<id>gwt</id>
Modified: projects/spec/trunk/modules/samples/airticket/server/.classpath
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/.classpath 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/.classpath 2008-10-29 13:01:28 UTC (rev 2656)
@@ -4,7 +4,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -25,16 +25,16 @@
import javax.management.ObjectName;
-import org.jboss.bpm.model.Expression;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.GatewayBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Task;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.model.Assignment.AssignTime;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
/**
* Test the Airticket sample application
@@ -92,11 +92,10 @@
this.msgListenerID = msgListenerID;
}
- public Process buildProcess()
+ public ProcessDefinition buildProcessDefinition()
{
// Create a Process through the ProcessBuilder
- ProcessBuilderFactory procFactory = ProcessBuilderFactory.newInstance();
- ProcessBuilder procBuilder = procFactory.newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess(PROCESS_NAME);
// Add Start Event
@@ -104,8 +103,8 @@
// Build the ReceiveReqTask
TaskBuilder taskBuilder = procBuilder.addTask(TASK_RECEIVE_REQUEST, Task.TaskType.Receive);
- taskBuilder.addMessageRef(MESSAGE_REQ_DATA).
- addAssignment(AssignTime.End, ExpressionLanguage.MVEL, getValidationExpression(), PROPERTY_IS_VALID_REQUEST).
+ taskBuilder.addInMessageRef(MESSAGE_REQ_DATA).
+ addNodeAssignment(AssignTime.End, ExpressionLanguage.MVEL, getValidationExpression(), PROPERTY_IS_VALID_REQUEST).
addSequenceFlow(GATEWAY_IS_VALID);
// Build the ValidateGateway
@@ -115,13 +114,13 @@
// Build the CheckAvailabilityTask
taskBuilder = procBuilder.addTask(TASK_CHECK_AVAILABLE);
- taskBuilder.addAssignment(AssignTime.End, ExpressionLanguage.MVEL, PROPERTY_SEATS + " < 10", PROPERTY_IS_AVAILABLE).
- addAssignment(AssignTime.End, ExpressionLanguage.MVEL, PROPERTY_SEATS + " * 111", PROPERTY_PRICE).
+ taskBuilder.addNodeAssignment(AssignTime.End, ExpressionLanguage.MVEL, PROPERTY_SEATS + " < 10", PROPERTY_IS_AVAILABLE).
+ addNodeAssignment(AssignTime.End, ExpressionLanguage.MVEL, PROPERTY_SEATS + " * 111", PROPERTY_PRICE).
addSequenceFlow(GATEWAY_IS_AVAILABLE);
// Build the SendInvalidTask
taskBuilder = procBuilder.addTask(TASK_SEND_INVALID, Task.TaskType.Send);
- taskBuilder.addMessageRef(MESSAGE_INVALID_DATA).
+ taskBuilder.addOutMessageRef(MESSAGE_INVALID_DATA).
addSequenceFlow(TASK_RECEIVE_REQUEST);
// Build the AvailabilityGateway
@@ -131,17 +130,17 @@
// Build the SendOfferTask
taskBuilder = procBuilder.addTask(TASK_SEND_OFFER, Task.TaskType.Send);
- taskBuilder.addMessageRef(MESSAGE_OFFER).
+ taskBuilder.addOutMessageRef(MESSAGE_OFFER).
addSequenceFlow(TASK_RECEIVE_ORDER);
// Build the SendNotAvailableTask
taskBuilder = procBuilder.addTask(TASK_SEND_NOT_AVAILABLE, Task.TaskType.Send);
- taskBuilder.addMessageRef(MESSAGE_NOT_AVAILABLE).
+ taskBuilder.addOutMessageRef(MESSAGE_NOT_AVAILABLE).
addSequenceFlow(TASK_RECEIVE_REQUEST);
// Build the ReceiveReqTask
taskBuilder = procBuilder.addTask(TASK_RECEIVE_ORDER, Task.TaskType.Receive);
- taskBuilder.addMessageRef(MESSAGE_ACCEPT_OFFER).
+ taskBuilder.addInMessageRef(MESSAGE_ACCEPT_OFFER).
addSequenceFlow(GATEWAY_IS_ACCEPTED);
// Build the AcceptOfferGateway
@@ -178,14 +177,14 @@
// Build the SendConfirmTask
taskBuilder = procBuilder.addTask(TASK_SEND_CONFIRM, Task.TaskType.Send);
- taskBuilder.addMessageRef(MESSAGE_CONFIRM).
+ taskBuilder.addOutMessageRef(MESSAGE_CONFIRM).
addSequenceFlow(EVENT_END);
// Add the EndEvent
procBuilder.addEndEvent(EVENT_END);
// Add ReqDataMsg
- procBuilder.addMessage(MESSAGE_REQ_DATA).
+ procBuilder.addProcessMessage(MESSAGE_REQ_DATA).
addProperty(PROPERTY_NAME, null, true).
addProperty(PROPERTY_FROM, null, true).
addProperty(PROPERTY_TO, null, true).
@@ -193,7 +192,7 @@
addProperty(PROPERTY_SEATS, null, true);
// Add InvalidDataMsg
- procBuilder.addMessage(MESSAGE_INVALID_DATA).
+ procBuilder.addProcessMessage(MESSAGE_INVALID_DATA).
addToRef(msgListenerID).
addProperty(PROPERTY_NAME, null, true).
addProperty(PROPERTY_FROM, null, true).
@@ -202,7 +201,7 @@
addProperty(PROPERTY_SEATS, null, true);
// Add NotAvailableMsg
- procBuilder.addMessage(MESSAGE_NOT_AVAILABLE).
+ procBuilder.addProcessMessage(MESSAGE_NOT_AVAILABLE).
addToRef(msgListenerID).
addProperty(PROPERTY_NAME, null, true).
addProperty(PROPERTY_FROM, null, true).
@@ -211,7 +210,7 @@
addProperty(PROPERTY_SEATS, null, true);
// Add OfferMsg
- procBuilder.addMessage(MESSAGE_OFFER).
+ procBuilder.addProcessMessage(MESSAGE_OFFER).
addToRef(msgListenerID).
addProperty(PROPERTY_NAME, null, true).
addProperty(PROPERTY_FROM, null, true).
@@ -221,13 +220,13 @@
addProperty(PROPERTY_PRICE, null, true);
// Add AcceptOfferMsg
- procBuilder.addMessage(MESSAGE_ACCEPT_OFFER).
+ procBuilder.addProcessMessage(MESSAGE_ACCEPT_OFFER).
addProperty(TASK_CREDIT_CARD, null, true).
addProperty(PROPERTY_EXPIRE, null, true).
addProperty(PROPERTY_IS_OFFER_ACCEPTED, null, true);
// Add ConfirmMsg
- procBuilder.addMessage(MESSAGE_CONFIRM).
+ procBuilder.addProcessMessage(MESSAGE_CONFIRM).
addToRef(msgListenerID).
addProperty(PROPERTY_NAME, null, true).
addProperty(PROPERTY_FROM, null, true).
@@ -237,7 +236,7 @@
addProperty(PROPERTY_PRICE, null, true);
// Get the process
- Process proc = procBuilder.getProcess();
+ ProcessDefinition proc = procBuilder.getProcessDefinition();
return proc;
}
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -6,17 +6,6 @@
import javax.management.ObjectName;
import javax.servlet.http.HttpSession;
-import org.jboss.bpm.client.MessageListener;
-import org.jboss.bpm.client.MessageManager;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.MessageBuilderFactory;
-import org.jboss.bpm.model.ObjectNameFactory;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Signal;
import org.jboss.bpm.samples.airticket.AirticketProcessBuilder;
import org.jboss.bpm.samples.airticket.client.AirticketService;
import org.jboss.bpm.samples.airticket.client.ConfirmMessage;
@@ -26,19 +15,31 @@
import org.jboss.bpm.samples.airticket.client.OfferMessage;
import org.jboss.bpm.samples.airticket.client.OrderMessage;
import org.jboss.bpm.samples.airticket.client.RequestMessage;
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.SignalService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@SuppressWarnings("serial")
public class AirticketServiceImpl extends RemoteServiceServlet implements AirticketService
{
- private ObjectName sampleID = ObjectNameFactory.create("org.jboss.bpm:sample=AirticketService");
+ private ObjectName sampleID = ObjectNameFactory.create("org.jbpm:sample=AirticketService");
public void sendMessage(GwtMessage gwtMsg)
{
- ProcessManager pm = ProcessManager.locateProcessManager();
- MessageManager mm = MessageManager.locateMessageManager();
- SignalManager sm = SignalManager.locateSignalManager();
+ ProcessService procService = ProcessService.locateProcessService();
+ MessageService mm = MessageService.locateMessageService();
+ SignalService sm = SignalService.locateSignalService();
System.out.println(gwtMsg);
@@ -59,11 +60,13 @@
// Create/Start a new process
ObjectName procID = (ObjectName)httpSession.getAttribute("procID");
- if (procID == null || pm.getProcessByID(procID) == null)
+ if (procID == null || procService.getProcess(procID) == null)
{
System.out.println("Create new Process");
AirticketProcessBuilder procBuilder = new AirticketProcessBuilder(sampleID);
- Process proc = procBuilder.buildProcess();
+ ProcessDefinition procDef = procBuilder.buildProcessDefinition();
+ Process proc = procDef.newInstance();
+ procService.registerProcess(proc);
procID = proc.startProcess();
httpSession.setAttribute("procID", procID);
}
@@ -98,43 +101,43 @@
if (msgName.equals(AirticketProcessBuilder.MESSAGE_OFFER))
{
OfferMessage gwtMsg = new OfferMessage();
- gwtMsg.name = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_NAME);
- gwtMsg.from = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_FROM);
- gwtMsg.to = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_TO);
- gwtMsg.date = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_DATE);
- gwtMsg.seats = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_SEATS);
- gwtMsg.price = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_PRICE);
+ gwtMsg.name = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_NAME).getValue();
+ gwtMsg.from = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_FROM).getValue();
+ gwtMsg.to = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_TO).getValue();
+ gwtMsg.date = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_DATE).getValue();
+ gwtMsg.seats = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_SEATS).getValue());
+ gwtMsg.price = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_PRICE).getValue());
returnMsg = gwtMsg;
}
else if (msgName.equals(AirticketProcessBuilder.MESSAGE_INVALID_DATA))
{
InvalidDataMessage gwtMsg = new InvalidDataMessage();
- gwtMsg.name = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_NAME);
- gwtMsg.from = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_FROM);
- gwtMsg.to = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_TO);
- gwtMsg.date = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_DATE);
- gwtMsg.seats = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_SEATS);
+ gwtMsg.name = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_NAME).getValue();
+ gwtMsg.from = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_FROM).getValue();
+ gwtMsg.to = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_TO).getValue();
+ gwtMsg.date = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_DATE).getValue();
+ gwtMsg.seats = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_SEATS).getValue());
returnMsg = gwtMsg;
}
else if (msgName.equals(AirticketProcessBuilder.MESSAGE_NOT_AVAILABLE))
{
NotAvailableMessage gwtMsg = new NotAvailableMessage();
- gwtMsg.name = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_NAME);
- gwtMsg.from = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_FROM);
- gwtMsg.to = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_TO);
- gwtMsg.date = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_DATE);
- gwtMsg.seats = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_SEATS);
+ gwtMsg.name = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_NAME).getValue();
+ gwtMsg.from = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_FROM).getValue();
+ gwtMsg.to = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_TO).getValue();
+ gwtMsg.date = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_DATE).getValue();
+ gwtMsg.seats = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_SEATS).getValue());
returnMsg = gwtMsg;
}
else if (msgName.equals(AirticketProcessBuilder.MESSAGE_CONFIRM))
{
ConfirmMessage gwtMsg = new ConfirmMessage();
- gwtMsg.name = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_NAME);
- gwtMsg.from = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_FROM);
- gwtMsg.to = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_TO);
- gwtMsg.date = bpmMsg.getPropertyValue(String.class, AirticketProcessBuilder.PROPERTY_DATE);
- gwtMsg.seats = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_SEATS);
- gwtMsg.price = bpmMsg.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_PRICE);
+ gwtMsg.name = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_NAME).getValue();
+ gwtMsg.from = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_FROM).getValue();
+ gwtMsg.to = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_TO).getValue();
+ gwtMsg.date = bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_DATE).getValue();
+ gwtMsg.seats = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_SEATS).getValue());
+ gwtMsg.price = new Integer(bpmMsg.getProperty(AirticketProcessBuilder.PROPERTY_PRICE).getValue());
returnMsg = gwtMsg;
}
else
@@ -147,8 +150,7 @@
private Message getRequestMessage(RequestMessage gwtMsg)
{
- MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
- MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = msgBuilder.newMessage(AirticketProcessBuilder.MESSAGE_REQ_DATA).
addProperty(AirticketProcessBuilder.PROPERTY_NAME, gwtMsg.name).
addProperty(AirticketProcessBuilder.PROPERTY_FROM, gwtMsg.from).
@@ -161,8 +163,7 @@
private Message getOrderMessage(OrderMessage gwtMsg)
{
- MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
- MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = msgBuilder.newMessage(AirticketProcessBuilder.MESSAGE_ACCEPT_OFFER).
addProperty(AirticketProcessBuilder.PROPERTY_CREDIT_CARD, gwtMsg.creditCard).
addProperty(AirticketProcessBuilder.PROPERTY_EXPIRE, gwtMsg.expire).
@@ -180,6 +181,13 @@
this.messageQueue = messageQueue;
}
+ @Override
+ public ObjectName getKey()
+ {
+ return sampleID;
+ }
+
+ @Override
public void catchMessage(Message message)
{
messageQueue.add(message);
@@ -194,11 +202,13 @@
class AirticketSignalListener implements SignalListener
{
+ @Override
public boolean acceptSignal(Signal signal)
{
return true;
}
+ @Override
public void catchSignal(Signal signal)
{
System.out.println(signal);
Deleted: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketAPIDescriptorTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketAPIDescriptorTest.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketAPIDescriptorTest.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -1,47 +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.jboss.bpm.samples.airticket;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test the Airticket sample application
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class AirticketAPIDescriptorTest extends AirticketTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL expURL = getResourceURL("samples/airticket/airticket-api10.xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- return pm.createProcess(expURL);
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketMarshallerTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketMarshallerTest.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketMarshallerTest.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -1,50 +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.jboss.bpm.samples.airticket;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test the Airticket process marshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class AirticketMarshallerTest extends AirticketTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketSTPDescriptorTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketSTPDescriptorTest.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketSTPDescriptorTest.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -1,47 +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.jboss.bpm.samples.airticket;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test the Airticket sample application
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class AirticketSTPDescriptorTest extends AirticketTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL expURL = getResourceURL("samples/airticket/airticket-stp-api10.xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- return pm.createProcess(expURL);
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-10-29 11:42:20 UTC (rev 2655)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-10-29 13:01:28 UTC (rev 2656)
@@ -27,14 +27,17 @@
import javax.management.ObjectName;
-import org.jboss.bpm.client.MessageListener;
-import org.jboss.bpm.client.MessageManager;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.MessageBuilderFactory;
-import org.jboss.bpm.model.ObjectNameFactory;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+import org.jbpm.api.test.CTSTestCase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Test the Airticket sample application
@@ -42,37 +45,42 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class AirticketTest extends DefaultEngineTestCase
+public class AirticketTest extends CTSTestCase
{
- private MessageManager messageManager = MessageManager.locateMessageManager();
+ // Provide logging
+ private static final Logger log = LoggerFactory.getLogger(AirticketTest.class);
+
+ private MessageService messageManager = MessageService.locateMessageService();
private AirticketMessageListener msgListener;
public void testValidData() throws Exception
{
- Process proc = getProcess();
+ ProcessDefinition procDef = getProcessDefinition();
+ Process proc = procDef.newInstance();
proc.startProcess();
- messageManager.sendMessage(proc.getID(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getValidRequestMessage());
+ messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getValidRequestMessage());
proc.waitForEnd();
Message confirmMessage = msgListener.getConfirmMessage();
assertNotNull("Expected confirm message", confirmMessage);
- Integer price = confirmMessage.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_PRICE);
- assertEquals(new Integer(222), price);
+ String price = confirmMessage.getProperty(AirticketProcessBuilder.PROPERTY_PRICE).getValue();
+ assertEquals(new Integer(222), new Integer(price));
}
public void testInvalidData() throws Exception
{
- Process proc = getProcess();
+ ProcessDefinition procDef = getProcessDefinition();
+ Process proc = procDef.newInstance();
proc.startProcess();
- messageManager.sendMessage(proc.getID(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getInvalidRequestMessage());
+ messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getInvalidRequestMessage());
proc.waitForEnd();
Message confirmMessage = msgListener.getConfirmMessage();
assertNotNull("Expected confirm message", confirmMessage);
- Integer price = confirmMessage.getPropertyValue(Integer.class, AirticketProcessBuilder.PROPERTY_PRICE);
- assertEquals(new Integer(222), price);
+ String price = confirmMessage.getProperty(AirticketProcessBuilder.PROPERTY_PRICE).getValue();
+ assertEquals(new Integer(222), new Integer(price));
}
@Override
@@ -97,8 +105,7 @@
private Message getValidRequestMessage()
{
- MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
- MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = msgBuilder.newMessage(AirticketProcessBuilder.MESSAGE_REQ_DATA).
addProperty(AirticketProcessBuilder.PROPERTY_NAME, "Kermit").
addProperty(AirticketProcessBuilder.PROPERTY_FROM, "MUC").
@@ -110,8 +117,7 @@
private Message getInvalidRequestMessage()
{
- MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
- MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = msgBuilder.newMessage(AirticketProcessBuilder.MESSAGE_REQ_DATA).
addProperty(AirticketProcessBuilder.PROPERTY_NAME, "Kermit").
addProperty(AirticketProcessBuilder.PROPERTY_FROM, "MUC").
@@ -124,8 +130,7 @@
private Message getAcceptOfferMessage()
{
- MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
- MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = msgBuilder.newMessage(AirticketProcessBuilder.MESSAGE_ACCEPT_OFFER).
addProperty(AirticketProcessBuilder.PROPERTY_CREDIT_CARD, "1234-1234-1234-1234").
addProperty(AirticketProcessBuilder.PROPERTY_EXPIRE, "25-Jul-2012").
@@ -135,10 +140,10 @@
}
- protected Process getProcess() throws IOException
+ protected ProcessDefinition getProcessDefinition() throws IOException
{
AirticketProcessBuilder builder = new AirticketProcessBuilder(getTestID());
- return builder.buildProcess();
+ return builder.buildProcessDefinition();
}
class AirticketMessageListener implements MessageListener
@@ -151,6 +156,12 @@
this.listenerID = listenerID;
}
+ @Override
+ public ObjectName getKey()
+ {
+ return ObjectNameFactory.create("org.jbpm.listener:sample=AirticketService");
+ }
+
public Message getConfirmMessage()
{
return confirmMessage;
@@ -159,8 +170,8 @@
public void catchMessage(Message msg)
{
log.debug("catchMessage: " + msg);
- ObjectName procID = msg.getFromRef().getEntityRef().getName();
- MessageManager mm = MessageManager.locateMessageManager();
+ ObjectName procID = msg.getFromRef().getName();
+ MessageService mm = MessageService.locateMessageService();
if (msg.getName().equals(AirticketProcessBuilder.MESSAGE_INVALID_DATA))
mm.sendMessage(procID, AirticketProcessBuilder.TASK_RECEIVE_REQUEST, getValidRequestMessage());
else if (msg.getName().equals(AirticketProcessBuilder.MESSAGE_OFFER))
15 years, 6 months
JBoss JBPM SVN: r2655 - in projects/spec/trunk: modules and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 07:42:20 -0400 (Wed, 29 Oct 2008)
New Revision: 2655
Added:
projects/spec/trunk/modules/samples/
Modified:
projects/spec/trunk/modules/samples/airticket/client/pom.xml
projects/spec/trunk/modules/samples/airticket/pom.xml
projects/spec/trunk/modules/samples/airticket/server/pom.xml
projects/spec/trunk/pom.xml
Log:
Resurect airticket sample
Copied: projects/spec/trunk/modules/samples (from rev 2651, projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/samples)
Modified: projects/spec/trunk/modules/samples/airticket/client/pom.xml
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/samples/airticket/client/pom.xml 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/samples/airticket/client/pom.xml 2008-10-29 11:42:20 UTC (rev 2655)
@@ -15,21 +15,21 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>jBPM Spec - Samples Airticket (Client)</name>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket-client</artifactId>
<packaging>war</packaging>
<!-- Parent -->
<parent>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket</artifactId>
- <version>1.0.0-Alpha1</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket-server</artifactId>
<version>${version}</version>
</dependency>
Modified: projects/spec/trunk/modules/samples/airticket/pom.xml
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/samples/airticket/pom.xml 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/samples/airticket/pom.xml 2008-10-29 11:42:20 UTC (rev 2655)
@@ -2,15 +2,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>jBPM Spec - Samples Airticket</name>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket</artifactId>
<packaging>pom</packaging>
<!-- Parent -->
<parent>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec</artifactId>
- <version>1.0.0-Alpha1</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
@@ -20,15 +20,44 @@
<module>client</module>
</modules>
+ <!-- Properties -->
+ <properties>
+ <google.gwt.version>1.4.61</google.gwt.version>
+ <javax.servlet.version>2.5</javax.servlet.version>
+ </properties>
+
+ <!-- DependencyManagement -->
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${google.gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${google.gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${javax.servlet.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-api</artifactId>
+ <version>${version}</version>
</dependency>
<dependency>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-ri</artifactId>
+ <version>${version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
Modified: projects/spec/trunk/modules/samples/airticket/server/pom.xml
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/samples/airticket/server/pom.xml 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/samples/airticket/server/pom.xml 2008-10-29 11:42:20 UTC (rev 2655)
@@ -15,26 +15,29 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>jBPM Spec - Samples Airticket (Server)</name>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket-server</artifactId>
<!-- Parent -->
<parent>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-sample-airticket</artifactId>
- <version>1.0.0-Alpha1</version>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
-
+
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-dialect-api10</artifactId>
+ <version>${version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.jbpm.spec</groupId>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spec-dialect-stp</artifactId>
+ <version>${version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
Modified: projects/spec/trunk/pom.xml
===================================================================
--- projects/spec/trunk/pom.xml 2008-10-29 11:23:10 UTC (rev 2654)
+++ projects/spec/trunk/pom.xml 2008-10-29 11:42:20 UTC (rev 2655)
@@ -37,6 +37,7 @@
<module>modules/dialects</module>
<module>modules/ri</module>
<module>modules/cts</module>
+ <module>modules/samples/airticket</module>
</modules>
<!-- Properties -->
15 years, 6 months
JBoss JBPM SVN: r2654 - in projects/spec/trunk/modules/ri/src/test: java/org/jbpm/test/ri/dialect/stp and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 07:23:10 -0400 (Wed, 29 Oct 2008)
New Revision: 2654
Added:
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/
projects/spec/trunk/modules/ri/src/test/resources/dialect/
projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/
projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/sequence/
Removed:
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/AbstractSTPDialectTest.java
Modified:
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java
projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/sequence/basic-sequence.bpmn
Log:
Resurect STP SequenceTest
Copied: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect (from rev 2651, projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect)
Deleted: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/AbstractSTPDialectTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/AbstractSTPDialectTest.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/AbstractSTPDialectTest.java 2008-10-29 11:23:10 UTC (rev 2654)
@@ -1,50 +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.jboss.bpm.dialect.stp;
-
-//$Id$
-
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public abstract class AbstractSTPDialectTest extends DefaultEngineTestCase
-{
- private String dialect;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- dialect = System.getProperty("jbpm.dialect", "api10");
- System.setProperty("jbpm.dialect", "stp");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- System.setProperty("jbpm.dialect", dialect);
- super.tearDown();
- }
-}
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/sequence/SequenceTest.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java 2008-10-29 11:23:10 UTC (rev 2654)
@@ -19,15 +19,15 @@
* 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.dialect.stp.sequence;
+package org.jbpm.test.ri.dialect.stp.sequence;
// $Id$
import java.net.URL;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.test.APITestCase;
/**
* Test the basic execution sequence
@@ -35,18 +35,18 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class SequenceTest extends DefaultEngineTestCase
+public class SequenceTest extends APITestCase
{
/**
* Test a basic sequence
*/
public void testBasicSequence() throws Exception
{
- URL procURL = getResourceURL("sequence/basic-sequence.bpmn");
+ URL procURL = getResourceURL("dialect/stp/sequence/basic-sequence.bpmn");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
+ ProcessDefinitionService pdService = ProcessDefinitionService.locateProcessDefinitionService();
+ ProcessDefinition procDef = pdService.createProcessDefinition(procURL);
- assertNotNull(proc);
+ assertNotNull(procDef);
}
}
Copied: projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/sequence (from rev 2651, projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/dialects/stp/src/test/resources/sequence)
Modified: projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/sequence/basic-sequence.bpmn
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/dialects/stp/src/test/resources/sequence/basic-sequence.bpmn 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/spec/trunk/modules/ri/src/test/resources/dialect/stp/sequence/basic-sequence.bpmn 2008-10-29 11:23:10 UTC (rev 2654)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmi:id="_UstEIE3nEd2LNJlZf0NQOw" iD="_UspZwE3nEd2LNJlZf0NQOw">
<pools xmi:type="bpmn:Pool" xmi:id="_Ut2ToE3nEd2LNJlZf0NQOw" iD="_Ut1skE3nEd2LNJlZf0NQOw" name="Pool">
+ <vertices xmi:type="bpmn:Activity" xmi:id="_aeNvwE3nEd2LNJlZf0NQOw" iD="_aeNIsE3nEd2LNJlZf0NQOw" outgoingEdges="_bWie4E3nEd2LNJlZf0NQOw" activityType="EventStartEmpty"/>
<vertices xmi:type="bpmn:Activity" xmi:id="_UuUNsU3nEd2LNJlZf0NQOw" iD="_UuUNsE3nEd2LNJlZf0NQOw" outgoingEdges="_c8S7wU3nEd2LNJlZf0NQOw" incomingEdges="_bWie4E3nEd2LNJlZf0NQOw" name="StateA" activityType="Task"/>
- <vertices xmi:type="bpmn:Activity" xmi:id="_aeNvwE3nEd2LNJlZf0NQOw" iD="_aeNIsE3nEd2LNJlZf0NQOw" outgoingEdges="_bWie4E3nEd2LNJlZf0NQOw" activityType="EventStartEmpty"/>
<vertices xmi:type="bpmn:Activity" xmi:id="_cUlbgU3nEd2LNJlZf0NQOw" iD="_cUlbgE3nEd2LNJlZf0NQOw" incomingEdges="_c8S7wU3nEd2LNJlZf0NQOw" activityType="EventEndEmpty"/>
<sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_bWie4E3nEd2LNJlZf0NQOw" iD="_bWh30E3nEd2LNJlZf0NQOw" source="_aeNvwE3nEd2LNJlZf0NQOw" target="_UuUNsU3nEd2LNJlZf0NQOw"/>
<sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_c8S7wU3nEd2LNJlZf0NQOw" iD="_c8S7wE3nEd2LNJlZf0NQOw" source="_UuUNsU3nEd2LNJlZf0NQOw" target="_cUlbgU3nEd2LNJlZf0NQOw"/>
15 years, 6 months
JBoss JBPM SVN: r2653 - in projects/spec/trunk: modules/api/src/main/java/org/jbpm/api/service and 8 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-29 07:00:07 -0400 (Wed, 29 Oct 2008)
New Revision: 2653
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestHelper.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/DialectHandlerServiceImpl.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestHelper.java
projects/spec/trunk/modules/dialects/api10/src/test/
projects/spec/trunk/modules/dialects/stp/src/test/
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/dialects/stp/.classpath
projects/spec/trunk/modules/ri/pom.xml
projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml
projects/spec/trunk/pom.xml
Log:
Add support for DialectService
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -33,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jul-2008
*/
-public abstract class DialectHandlerService
+public abstract class DialectHandlerService extends AbstractService
{
// Maps namespaceURI to a DialectHandler
protected Map<URI, DialectHandler> dialectHandlers;
@@ -49,5 +49,4 @@
return dialectHandler;
}
-
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -23,18 +23,27 @@
//$Id$
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.management.ObjectName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
import org.jbpm.api.client.Deployment;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.ProcessDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
@@ -65,6 +74,36 @@
}
/**
+ * Create a ProcessDefinition from a XML string in one of the supported formats
+ */
+ public final ProcessDefinition createProcessDefinition(String pXML)
+ {
+ URI nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
+ DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ ProcessDefinition procDef = dialectHandler.createProcessDefinition(pXML);
+ return procDef;
+ }
+
+ /**
+ * Create a ProcessDefinition from an URL to a XML descritor in one of the supported formats
+ */
+ public final ProcessDefinition createProcessDefinition(URL pURL) throws IOException
+ {
+ URI nsURI = getNamespaceURI(pURL.openStream());
+ DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ ProcessDefinition procDef = dialectHandler.createProcessDefinition(pURL);
+ return procDef;
+ }
+
+ /**
* Deploy a new ProcessDefinition to the ProcessDefinition service.
*/
public ObjectName deploy(Deployment dep)
@@ -140,4 +179,27 @@
{
return Collections.unmodifiableSet(procDefs.keySet());
}
+
+ private URI getNamespaceURI(InputStream procXML)
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(procXML);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -0,0 +1,93 @@
+/*
+ * 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.test;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.management.ObjectName;
+
+import junit.framework.TestCase;
+
+import org.jbpm.api.Constants;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An API test case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class APITestCase extends TestCase
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(APITestCase.class);
+
+ private APITestHelper delegate = new APITestHelper();
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.debug("### START " + getLongName());
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ log.debug("### END " + getLongName());
+ }
+
+ protected URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return delegate.getResourceURL(resource);
+ }
+
+ protected File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ protected String getShortName()
+ {
+ String shortName = getClass().getName();
+ shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
+ return shortName;
+ }
+
+ protected String getLongName()
+ {
+ return getClass().getName() + "." + getName();
+ }
+
+ public ObjectName getTestID()
+ {
+ String shortName = getShortName();
+ shortName = shortName.replace("DescriptorTest", "Test");
+ shortName = shortName.replace("MarshallerTest", "Test");
+ return ObjectNameFactory.create(Constants.ID_DOMAIN, "test", shortName);
+ }
+}
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestHelper.java (from rev 2649, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestHelper.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestHelper.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestHelper.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -0,0 +1,67 @@
+/*
+ * 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.test;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * An CTS test helper
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class APITestHelper
+{
+ private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+
+ private static String testResourcesDir;
+
+ /** Try to discover the URL for the test resource */
+ public URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return getResourceFile(resource).toURI().toURL();
+ }
+
+ /** Try to discover the File for the test resource */
+ public File getResourceFile(String resource)
+ {
+ File file = new File(resource);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestResourcesDir() + "/" + resource);
+ if (file.exists())
+ return file;
+
+ throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
+ }
+
+ public String getTestResourcesDir()
+ {
+ if (testResourcesDir == null)
+ testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
+
+ return testResourcesDir;
+ }
+}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -21,9 +21,6 @@
*/
package org.jbpm.api.test;
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -31,9 +28,6 @@
import javax.management.ObjectName;
-import junit.framework.TestCase;
-
-import org.jbpm.api.Constants;
import org.jbpm.api.client.MessageListener;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.SignalListener;
@@ -41,7 +35,6 @@
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.ObjectNameFactory;
import org.jbpm.api.model.builder.SignalBuilder;
import org.jbpm.api.service.MessageService;
import org.jbpm.api.service.ProcessDefinitionService;
@@ -56,12 +49,11 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class CTSTestCase extends TestCase
+public class CTSTestCase extends APITestCase
{
// Provide logging
final Logger log = LoggerFactory.getLogger(CTSTestCase.class);
- private CTSTestHelper delegate = new CTSTestHelper();
// The embedded SignalListener
private SignalListener signalListener;
// The signals caught by this test case
@@ -87,7 +79,6 @@
@Override
protected void setUp() throws Exception
{
- log.debug("### START " + getLongName());
super.setUp();
ProcessEngine engine = getProcessEngine();
@@ -156,39 +147,8 @@
}
super.tearDown();
- log.debug("### END " + getLongName());
}
- protected URL getResourceURL(String resource) throws MalformedURLException
- {
- return delegate.getResourceURL(resource);
- }
-
- protected File getResourceFile(String resource)
- {
- return delegate.getResourceFile(resource);
- }
-
- protected String getShortName()
- {
- String shortName = getClass().getName();
- shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
- return shortName;
- }
-
- protected String getLongName()
- {
- return getClass().getName() + "." + getName();
- }
-
- public ObjectName getTestID()
- {
- String shortName = getShortName();
- shortName = shortName.replace("DescriptorTest", "Test");
- shortName = shortName.replace("MarshallerTest", "Test");
- return ObjectNameFactory.create(Constants.ID_DOMAIN, "test", shortName);
- }
-
public List<Signal> getSignals()
{
synchronized (signals)
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestHelper.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestHelper.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestHelper.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -1,67 +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.test;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * An CTS test helper
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class CTSTestHelper
-{
- private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
-
- private static String testResourcesDir;
-
- /** Try to discover the URL for the test resource */
- public URL getResourceURL(String resource) throws MalformedURLException
- {
- return getResourceFile(resource).toURI().toURL();
- }
-
- /** Try to discover the File for the test resource */
- public File getResourceFile(String resource)
- {
- File file = new File(resource);
- if (file.exists())
- return file;
-
- file = new File(getTestResourcesDir() + "/" + resource);
- if (file.exists())
- return file;
-
- throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
- }
-
- public String getTestResourcesDir()
- {
- if (testResourcesDir == null)
- testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
-
- return testResourcesDir;
- }
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -42,7 +42,7 @@
// Provide logging
final Logger log = LoggerFactory.getLogger(ConfigurationTestSetup.class);
- private CTSTestHelper helper = new CTSTestHelper();
+ private APITestHelper helper = new APITestHelper();
private String beansConfig;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -39,7 +39,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 14-Oct-2004
*/
-public class IntegrationTestHelper extends CTSTestHelper
+public class IntegrationTestHelper extends APITestHelper
{
private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-10-29 11:00:07 UTC (rev 2653)
@@ -37,23 +37,6 @@
<artifactId>jbpm-spec-api</artifactId>
<version>${version}</version>
</dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<!-- Plugins -->
Modified: projects/spec/trunk/modules/dialects/stp/.classpath
===================================================================
--- projects/spec/trunk/modules/dialects/stp/.classpath 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/dialects/stp/.classpath 2008-10-29 11:00:07 UTC (rev 2653)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: projects/spec/trunk/modules/ri/pom.xml
===================================================================
--- projects/spec/trunk/modules/ri/pom.xml 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/ri/pom.xml 2008-10-29 11:00:07 UTC (rev 2653)
@@ -70,6 +70,27 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-api10</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-jpdl32</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-stp</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-xpdl21</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
@@ -85,23 +106,6 @@
<groupId>org.mvel</groupId>
<artifactId>mvel</artifactId>
</dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<!-- Plugins -->
Added: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/DialectHandlerServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/DialectHandlerServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/DialectHandlerServiceImpl.java 2008-10-29 11:00:07 UTC (rev 2653)
@@ -0,0 +1,51 @@
+/*
+ * 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.ri.service;
+
+// $Id$
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.DialectHandler;
+import org.jbpm.api.service.DialectHandlerService;
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class DialectHandlerServiceImpl extends DialectHandlerService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setDialectHandlers(Map<URI, DialectHandler> dialectHandlers)
+ {
+ this.dialectHandlers = dialectHandlers;
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/DialectHandlerServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/modules/ri/src/main/resources/jbpm-cfg-beans.xml 2008-10-29 11:00:07 UTC (rev 2653)
@@ -8,6 +8,7 @@
<bean name="jBPMProcessEngine" class="org.jbpm.ri.client.ProcessEngineImpl">
<property name="services">
<set elementClass="org.jbpm.api.service.Service">
+ <inject bean="jBPMDialectHandlerService" />
<inject bean="jBPMExecutionService" />
<inject bean="jBPMMessageService" />
<inject bean="jBPMMessageBuilderService" />
@@ -69,6 +70,22 @@
</property>
</bean>
+ <!-- The DialectHandlerService -->
+ <bean name="jBPMDialectHandlerService" class="org.jbpm.ri.service.DialectHandlerServiceImpl" >
+ <property name="dialectHandlers">
+ <map keyClass="java.net.URI" valueClass="org.jbpm.api.service.DialectHandler">
+ <entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="jBPMDialectHandlerAPI10"/></value></entry>
+ <entry><key>urn:jbpm.org:jpdl-3.2</key><value><inject bean="jBPMDialectHandlerJPDL32"/></value></entry>
+ <entry><key>http://stp.eclipse.org/bpmn</key><value><inject bean="jBPMDialectHandlerSTP"/></value></entry>
+ <entry><key>http://www.wfmc.org/2008/XPDL2.1</key><value><inject bean="jBPMDialectHandlerXPDL21"/></value></entry>
+ </map>
+ </property>
+ </bean>
+ <bean name="jBPMDialectHandlerAPI10" class="org.jbpm.dialect.api10.DialectHandlerImpl"/>
+ <bean name="jBPMDialectHandlerJPDL32" class="org.jbpm.dialect.jpdl32.DialectHandlerImpl"/>
+ <bean name="jBPMDialectHandlerSTP" class="org.jbpm.dialect.stp.DialectHandlerImpl"/>
+ <bean name="jBPMDialectHandlerXPDL21" class="org.jbpm.dialect.xpdl21.DialectHandlerImpl"/>
+
<!-- Other Services -->
<bean name="jBPMExecutionService" class="org.jbpm.ri.service.ExecutionServiceImpl" />
<bean name="jBPMMessageService" class="org.jbpm.ri.service.MessageServiceImpl" />
Modified: projects/spec/trunk/pom.xml
===================================================================
--- projects/spec/trunk/pom.xml 2008-10-29 10:27:43 UTC (rev 2652)
+++ projects/spec/trunk/pom.xml 2008-10-29 11:00:07 UTC (rev 2653)
@@ -91,6 +91,26 @@
</dependencies>
</dependencyManagement>
+ <!-- Dependencies -->
+ <dependencies>
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/jbpm/jbpm4</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/jbpm/jbpm4</developerConnection>
15 years, 6 months
JBoss JBPM SVN: r2652 - in projects/gwt-console/trunk/war/src: main/java/org/jboss/bpm/console/client/metric and 4 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-29 06:27:43 -0400 (Wed, 29 Oct 2008)
New Revision: 2652
Added:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/UIConstants.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
Removed:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/HeaderPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/MainMenuPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
Modified:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
Log:
Cleanup package structure, classnames and javadoc
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -7,18 +7,18 @@
*/
public class Application implements EntryPoint
{
- private ConsoleView consoleView;
+ private MainCompositeView mainView;
/**
* This is the entry point method.
*/
public void onModuleLoad()
{
- consoleView = new ConsoleView();
+ mainView = new MainCompositeView();
}
- public ConsoleView getConsoleView()
+ public MainCompositeView getConsoleView()
{
- return consoleView;
+ return mainView;
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -28,6 +28,8 @@
import java.util.ArrayList;
/**
+ * Authentication helper
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class Authentication
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -1,241 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HTML;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.core.Margins;
-import com.gwtext.client.core.RegionPosition;
-import com.gwtext.client.widgets.*;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.layout.BorderLayout;
-import com.gwtext.client.widgets.layout.BorderLayoutData;
-import com.gwtext.client.widgets.layout.FitLayout;
-import com.gwtext.client.widgets.layout.VerticalLayout;
-import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
-import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
-import org.jboss.bpm.console.client.widgets.EditorView;
-import org.jboss.bpm.console.client.widgets.UIConstants;
-
-/**
- * The main composite that assembles the gwt console application.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class ConsoleView extends Composite
-{
- private HTML status = new HTML();
- private HeaderPanel header;
- private MainMenu mainMenu;
- private EditorPanel editorPanel;
- private URLBuilder urlBuilder;
-
- private String[] rolesAssigned = new String[] {};
- public final static String[] KNOWN_ROLES = {"admin", "user"};
-
- private static final int WIDTH = 1024;
- private static final int HEIGHT = 768;
-
- private Viewport viewport;
-
- public ConsoleView()
- {
- if(!GWT.isScript()) // hosted mode used proxy by default
- urlBuilder = new URLBuilder(GWT.getModuleBaseURL(), "xhp");
- else
- urlBuilder = new URLBuilder( "http://localhost:8080", "gwt-console-server"); // TODO: make configureable
-
- Panel mainPanel = createMainPanel();
- assembleMainApplication(mainPanel);
- forceLogin(mainPanel);
- viewport = new Viewport(mainPanel);
- }
-
- private Panel createMainPanel()
- {
- Panel mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setPaddings(5); // outer most padding
- mainPanel.setLayout(new FitLayout());
- mainPanel.setWidth(WIDTH);
- mainPanel.setHeight(HEIGHT);
- mainPanel.hide();
-
- initWidget( mainPanel );
- return mainPanel;
- }
-
- private void assembleMainApplication(Panel mainPanel)
- {
- Panel borderPanel = new Panel();
- borderPanel.setLayout(new BorderLayout());
-
- // ------------------------------------------
-
- header = new HeaderPanel(this);
- borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
-
- // ------------------------------------------
-
- mainMenu = new MainMenu(this);
- BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
- menuData.setSplit(false);
- menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
- menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
- menuData.setMargins(new Margins(0, 5, 0, 0));
- borderPanel.add(mainMenu, menuData);
-
- // ------------------------------------------
-
- editorPanel = new EditorPanel();
- borderPanel.add(editorPanel, new BorderLayoutData(RegionPosition.CENTER));
-
- // ------------------------------------------
-
- editorPanel.addEditor( new ProcessDefinitionListEditor(this), false );
- editorPanel.addEditor( new MetricOverviewEditor(this), false);
-
- // ------------------------------------------
-
- mainPanel.add(borderPanel);
- }
-
- private void forceLogin(final Panel mainPanel)
- {
- Panel panel = new Panel();
- panel.setPaddings(20);
- panel.setStyleName("login-panel-content");
- panel.setLayout(new VerticalLayout(10));
- panel.add( new HTML("Welcome, please login.") );
-
- final Window window = new Window();
- window.setTitle("GWT-Console");
- window.setClosable(false);
- window.setResizable(false);
- window.setWidth(300);
- window.setHeight(180);
- window.setLayout(new BorderLayout());
- window.setCloseAction(Window.CLOSE);
-
- final Button submitBtn = new Button("Login",
- new ButtonListenerAdapter()
- {
- public void onClick(Button button, EventObject e)
- {
- String url = getUrlBuilder().getUserInRoleURL(KNOWN_ROLES);
- final Authentication authentication = new Authentication(url);
- authentication.setCallback(
- new Authentication.AuthCallback()
- {
-
- public void onLoginSuccess(Request request, Response response)
- {
- // parse roles
- rolesAssigned = authentication.getRolesAssigned().toArray(new String[] {});
-
- // display main console
- window.close();
- mainPanel.show();
- mainPanel.doLayout();
- }
-
- public void onLoginFailed(Request request, Throwable t)
- {
- // auth failed
- setError("Authentication failed.");
- t.printStackTrace(System.out);
- }
- }
- );
-
- authentication.doLogin();
-
- }
- });
-
- panel.add(submitBtn);
-
- BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
- centerData.setMargins(3, 0, 3, 3);
-
- window.add(panel, centerData);
- // ------------------------------------------
-
- window.show();
- }
-
-
- public void addEditorView(EditorView editorView)
- {
- editorPanel.addEditor(editorView, true);
- }
-
- public boolean hasEditorView(String id)
- {
- return editorPanel.hasEditor(id);
- }
-
- public URLBuilder getUrlBuilder()
- {
- return this.urlBuilder;
- }
-
- public void showEditor(String id)
- {
- editorPanel.showTab(id);
- }
-
- public void setError(final String error)
- {
- displayMessage(error, true);
- }
-
- public void displayMessage(final String message, final boolean isError)
- {
- status.setText(message);
-
- MessageBox.show(new MessageBoxConfig() {
- {
- String title = isError ? "Unknown error" : "System Message";
- setTitle(title);
- setMsg(message);
- setButtons(MessageBox.OK);
- setCallback(new MessageBox.PromptCallback()
- {
- public void execute(String btnID, String text)
- {
- }
- });
- }
- });
- }
-
- public String[] getRolesAssigned()
- {
- return rolesAssigned;
- }
-
-}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorPanel.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -24,15 +24,16 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.layout.FitLayout;
-import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.EditorView;
/**
+ * Maintains {@link org.jboss.bpm.console.client.EditorPanel}'s
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class EditorPanel extends TabPanel
{
- protected ConsoleView view;
+ protected MainCompositeView view;
public EditorPanel()
{
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java (from rev 2649, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,42 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Panel;
+
+/**
+ * An editor can be plugged into a {@link org.jboss.bpm.console.client.EditorPanel}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public abstract class EditorView extends Panel
+{
+
+ protected EditorView()
+ {
+ super();
+ }
+
+ public abstract String getEditorId();
+ public abstract String getTitle();
+ public abstract String getIconCSS();
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/EditorView.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java (from rev 2649, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/HeaderPanel.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,93 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.*;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Header extends Panel
+{
+ private MainCompositeView view;
+
+ public final static String ID = "org.jboss.bpm.headerPanel";
+
+ public Header(MainCompositeView view)
+ {
+ super();
+ this.view = view;
+
+ this.setId(ID);
+
+ HorizontalLayout layout = new HorizontalLayout(20);
+ this.setLayout(layout);
+
+ this.setHeight(50);
+ this.setBaseCls("bpm-header");
+
+ // --
+
+ /* FormPanel formPanel = new FormPanel();
+ formPanel.setUrl("");
+ formPanel.setLabelAlign(Position.TOP);
+ formPanel.setWidth(100);
+
+ // ---
+
+ Panel topPanel = new Panel();
+ topPanel.setLayout(new ColumnLayout());
+
+ Panel columnOnePanel = new Panel();
+ columnOnePanel.setLayout(new FormLayout());
+
+ TextField name = new TextField("Username", "username", 230);
+ name.setAllowBlank(false);
+
+ columnOnePanel.add(name, new AnchorLayoutData("95%"));
+
+ // ---
+
+ Panel columnTwoPanel = new Panel();
+ columnTwoPanel.setLayout(new FormLayout());
+
+ TextField pass = new TextField("Password", "password", 230);
+ pass.setAllowBlank(false);
+ pass.setPassword(true);
+
+ columnTwoPanel.add(pass, new AnchorLayoutData("95%"));
+
+ // ---
+
+ topPanel.add(name, new ColumnLayoutData(.5));
+ topPanel.add(pass, new ColumnLayoutData(.5));
+
+ formPanel.add(topPanel);
+
+ // ---
+
+ final Image image = new Image("images/Jbpm_logo_small.png");
+ this.add(formPanel); */
+
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/HeaderPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/HeaderPanel.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/HeaderPanel.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.user.client.ui.Image;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.*;
-import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.core.Position;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class HeaderPanel extends Panel
-{
- private ConsoleView view;
-
- public final static String ID = "org.jboss.bpm.headerPanel";
-
- public HeaderPanel(ConsoleView view)
- {
- super();
- this.view = view;
-
- this.setId(ID);
-
- HorizontalLayout layout = new HorizontalLayout(20);
- this.setLayout(layout);
-
- this.setHeight(50);
- this.setBaseCls("bpm-header");
-
- // --
-
- /* FormPanel formPanel = new FormPanel();
- formPanel.setUrl("");
- formPanel.setLabelAlign(Position.TOP);
- formPanel.setWidth(100);
-
- // ---
-
- Panel topPanel = new Panel();
- topPanel.setLayout(new ColumnLayout());
-
- Panel columnOnePanel = new Panel();
- columnOnePanel.setLayout(new FormLayout());
-
- TextField name = new TextField("Username", "username", 230);
- name.setAllowBlank(false);
-
- columnOnePanel.add(name, new AnchorLayoutData("95%"));
-
- // ---
-
- Panel columnTwoPanel = new Panel();
- columnTwoPanel.setLayout(new FormLayout());
-
- TextField pass = new TextField("Password", "password", 230);
- pass.setAllowBlank(false);
- pass.setPassword(true);
-
- columnTwoPanel.add(pass, new AnchorLayoutData("95%"));
-
- // ---
-
- topPanel.add(name, new ColumnLayoutData(.5));
- topPanel.add(pass, new ColumnLayoutData(.5));
-
- formPanel.add(topPanel);
-
- // ---
-
- final Image image = new Image("images/Jbpm_logo_small.png");
- this.add(formPanel); */
-
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java (from rev 2649, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,236 @@
+/*
+ * 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;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HTML;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Margins;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.widgets.*;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.layout.BorderLayout;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.layout.VerticalLayout;
+import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
+import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
+
+/**
+ * The main composite that assembles the gwt console application.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MainCompositeView extends Composite
+{
+ private HTML status = new HTML();
+ private Header header;
+ private MainMenu mainMenu;
+ private EditorPanel editorPanel;
+ private URLBuilder urlBuilder;
+
+ private String[] rolesAssigned = new String[] {};
+ public final static String[] KNOWN_ROLES = {"admin", "user"};
+
+ private Viewport viewport;
+
+ public MainCompositeView()
+ {
+ if(!GWT.isScript()) // hosted mode used proxy by default
+ urlBuilder = new URLBuilder(GWT.getModuleBaseURL(), "xhp");
+ else
+ urlBuilder = new URLBuilder( "http://localhost:8080", "gwt-console-server"); // TODO: make configureable
+
+ Panel mainPanel = createMainPanel();
+ assembleMainApplication(mainPanel);
+ forceLogin(mainPanel);
+ viewport = new Viewport(mainPanel);
+ }
+
+ private Panel createMainPanel()
+ {
+ Panel mainPanel = new Panel();
+ mainPanel.setBorder(false);
+ mainPanel.setPaddings(5); // outer most padding
+ mainPanel.setLayout(new FitLayout());
+ mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
+ mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
+ mainPanel.hide();
+
+ initWidget( mainPanel );
+ return mainPanel;
+ }
+
+ private void assembleMainApplication(Panel mainPanel)
+ {
+ Panel borderPanel = new Panel();
+ borderPanel.setLayout(new BorderLayout());
+
+ // ------------------------------------------
+
+ header = new Header(this);
+ borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
+
+ // ------------------------------------------
+
+ mainMenu = new MainMenu(this);
+ BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
+ menuData.setSplit(false);
+ menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
+ menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
+ menuData.setMargins(new Margins(0, 5, 0, 0));
+ borderPanel.add(mainMenu, menuData);
+
+ // ------------------------------------------
+
+ editorPanel = new EditorPanel();
+ borderPanel.add(editorPanel, new BorderLayoutData(RegionPosition.CENTER));
+
+ // ------------------------------------------
+
+ editorPanel.addEditor( new ProcessDefinitionListEditor(this), false );
+ editorPanel.addEditor( new MetricOverviewEditor(this), false);
+
+ // ------------------------------------------
+
+ mainPanel.add(borderPanel);
+ }
+
+ private void forceLogin(final Panel mainPanel)
+ {
+ Panel panel = new Panel();
+ panel.setPaddings(20);
+ panel.setStyleName("login-panel-content");
+ panel.setLayout(new VerticalLayout(10));
+ panel.add( new HTML("Welcome, please login.") );
+
+ final Window window = new Window();
+ window.setTitle("GWT-Console");
+ window.setClosable(false);
+ window.setResizable(false);
+ window.setWidth(300);
+ window.setHeight(180);
+ window.setLayout(new BorderLayout());
+ window.setCloseAction(Window.CLOSE);
+
+ final Button submitBtn = new Button("Login",
+ new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+ String url = getUrlBuilder().getUserInRoleURL(KNOWN_ROLES);
+ final Authentication authentication = new Authentication(url);
+ authentication.setCallback(
+ new Authentication.AuthCallback()
+ {
+
+ public void onLoginSuccess(Request request, Response response)
+ {
+ // parse roles
+ rolesAssigned = authentication.getRolesAssigned().toArray(new String[] {});
+
+ // display main console
+ window.close();
+ mainPanel.show();
+ mainPanel.doLayout();
+ }
+
+ public void onLoginFailed(Request request, Throwable t)
+ {
+ // auth failed
+ setError("Authentication failed.");
+ t.printStackTrace(System.out);
+ }
+ }
+ );
+
+ authentication.doLogin();
+
+ }
+ });
+
+ panel.add(submitBtn);
+
+ BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
+ centerData.setMargins(3, 0, 3, 3);
+
+ window.add(panel, centerData);
+ // ------------------------------------------
+
+ window.show();
+ }
+
+
+ public void addEditorView(EditorView editorView)
+ {
+ editorPanel.addEditor(editorView, true);
+ }
+
+ public boolean hasEditorView(String id)
+ {
+ return editorPanel.hasEditor(id);
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return this.urlBuilder;
+ }
+
+ public void showEditor(String id)
+ {
+ editorPanel.showTab(id);
+ }
+
+ public void setError(final String error)
+ {
+ displayMessage(error, true);
+ }
+
+ public void displayMessage(final String message, final boolean isError)
+ {
+ status.setText(message);
+
+ MessageBox.show(new MessageBoxConfig() {
+ {
+ String title = isError ? "Unknown error" : "System Message";
+ setTitle(title);
+ setMsg(message);
+ setButtons(MessageBox.OK);
+ setCallback(new MessageBox.PromptCallback()
+ {
+ public void execute(String btnID, String text)
+ {
+ }
+ });
+ }
+ });
+ }
+
+ public String[] getRolesAssigned()
+ {
+ return rolesAssigned;
+ }
+
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainCompositeView.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -30,16 +30,23 @@
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
-import org.jboss.bpm.console.client.widgets.MainMenuPanel;
+import org.jboss.bpm.console.client.MainMenuSection;
+import java.util.List;
+import java.util.ArrayList;
+
/**
+ * The main menu on the left hand.
+ * Keeps a list of {@link org.jboss.bpm.console.client.MainMenuSection}.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class MainMenu extends Panel
{
- private final ConsoleView view;
+ private final MainCompositeView view;
+ private List<Panel> sections = new ArrayList<Panel>();
- public MainMenu(final ConsoleView view)
+ public MainMenu(final MainCompositeView view)
{
super();
this.view = view;
@@ -51,17 +58,23 @@
this.setWidth(200);
this.setLayout(accordion);
- Panel navPanel = new MainMenuPanel("Process Management", "bpm-process-icon", new ProcessTree());
- Panel taskPanel = new MainMenuPanel("Task Management", "bpm-task-icon", null);
- Panel metricPanel = new MainMenuPanel("Metrics and Stats", "bpm-metric-icon", new MetricTree());
- Panel settingsPanel = new MainMenuPanel("Settings", "bpm-settings-icon", new SettingsTree());
+ MainMenuSection navPanel = new MainMenuSection("Process Management", "bpm-process-icon", new ProcessTree());
+ MainMenuSection taskPanel = new MainMenuSection("Task Management", "bpm-task-icon", null);
+ MainMenuSection metricPanel = new MainMenuSection("Metrics and Stats", "bpm-metric-icon", new MetricTree());
+ MainMenuSection settingsPanel = new MainMenuSection("Settings", "bpm-settings-icon", new SettingsTree());
- this.add(navPanel);
- this.add(taskPanel);
- this.add(metricPanel);
- this.add(settingsPanel);
+ this.addSection(navPanel);
+ this.addSection(taskPanel);
+ this.addSection(metricPanel);
+ this.addSection(settingsPanel);
}
+ public void addSection(MainMenuSection menuSection)
+ {
+ this.sections.add(menuSection);
+ this.add(menuSection);
+ }
+
class ProcessTree extends TreePanel
{
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java (from rev 2649, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/MainMenuPanel.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Component;
+
+/**
+ * One section in the lefthand main menu.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MainMenuSection extends Panel
+{
+
+ public MainMenuSection(String title, String iconClass, Component tree)
+ {
+ super();
+
+ setTitle(title);
+ setBorder(false);
+ setHideBorders(true);
+ setIconCls(iconClass);
+
+ if(tree!=null)
+ add(tree);
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainMenuSection.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/UIConstants.java (from rev 2649, projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/UIConstants.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/UIConstants.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class UIConstants
+{
+ public static final int OVERALL_WIDTH = 1024;
+ public static final int OVERALL_HEIGHT = 768;
+ public static final int MAIN_MENU_MIN = 175;
+ public static final int MAIN_MENU_MAX = 400;
+ public static final int EDITOR_WIDTH = 680;
+ public static final int TEASER_PANEL_WIDTH = 200;
+ public static final int EDITOR_PANEL_WIDTH = 450;
+}
Property changes on: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/UIConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -21,12 +21,12 @@
*/
package org.jboss.bpm.console.client.metric;
-import org.jboss.bpm.console.client.widgets.EditorView;
-import org.jboss.bpm.console.client.widgets.UIConstants;
+import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.model.ProcessDefinition;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
import org.jboss.bpm.console.client.process.ProcessInstanceEditor;
import org.jboss.bpm.console.client.process.ProcessInstanceListEditor;
import com.gwtext.client.widgets.layout.ColumnLayout;
@@ -45,10 +45,10 @@
{
private ProcessDefinition parent;
- private ConsoleView view;
+ private MainCompositeView view;
private Panel teaserPanel;
- public DefinitionMetricEditor(final ConsoleView view, final ProcessDefinition proc)
+ public DefinitionMetricEditor(final MainCompositeView view, final ProcessDefinition proc)
{
super();
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -26,12 +26,12 @@
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.core.Position;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstancePerformance;
import org.jboss.bpm.console.client.widgets.LineChart;
-import org.jboss.bpm.console.client.widgets.UIConstants;
import java.util.Iterator;
import java.util.Map;
@@ -43,9 +43,9 @@
{
private ProcessDefinition parent;
- private ConsoleView view;
+ private MainCompositeView view;
- public DefinitionMetricView(ConsoleView view, ProcessDefinition parent)
+ public DefinitionMetricView(MainCompositeView view, ProcessDefinition parent)
{
super();
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -32,12 +32,12 @@
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
import org.jboss.bpm.console.client.widgets.BarChart;
-import org.jboss.bpm.console.client.widgets.UIConstants;
import java.util.HashMap;
import java.util.Iterator;
@@ -51,10 +51,10 @@
{
private Map row2ProcessMap = new HashMap();
- private final ConsoleView view;
+ private final MainCompositeView view;
private int currentSelection=-1;
- public MetricOverview(final ConsoleView view)
+ public MetricOverview(final MainCompositeView view)
{
super();
this.setHeader(false);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.console.client.metric;
-import org.jboss.bpm.console.client.widgets.EditorView;
-import org.jboss.bpm.console.client.widgets.UIConstants;
+import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.HelpDAO;
import com.gwtext.client.widgets.layout.ColumnLayout;
@@ -38,12 +38,12 @@
public class MetricOverviewEditor extends EditorView
{
- private ConsoleView view;
+ private MainCompositeView view;
private Panel teaserPanel;
public final static String ID = "org.jboss.bpm.metric.ProcessMetric";
- public MetricOverviewEditor(ConsoleView view)
+ public MetricOverviewEditor(MainCompositeView view)
{
super();
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.widgets.RemoteListView;
@@ -40,12 +40,12 @@
{
private Map<Integer, ProcessDefinition> row2ProcessMap = new HashMap<Integer,ProcessDefinition>();
- public ProcessDefinitionList(String titleName, final ConsoleView view)
+ public ProcessDefinitionList(String titleName, final MainCompositeView view)
{
super(titleName, view, getResourceUrl(view), false);
}
- private static String getResourceUrl(ConsoleView view)
+ private static String getResourceUrl(MainCompositeView view)
{
return view.getUrlBuilder().getProcessDefinitionURL();
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -33,7 +33,9 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.HelpDAO;
@@ -51,11 +53,11 @@
private ProcessDefinitionList processDefinitionList;
- private ConsoleView view;
+ private MainCompositeView view;
private Panel teaserPanel;
- public ProcessDefinitionListEditor(final ConsoleView view)
+ public ProcessDefinitionListEditor(final MainCompositeView view)
{
super();
this.setId(ID);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
import org.jboss.bpm.console.client.model.ProcessInstance;
import org.jboss.bpm.console.client.model.jbpm3.ActiveNodeInfo;
import org.jboss.bpm.console.client.model.jbpm3.DiagramNodeInfo;
@@ -49,10 +49,10 @@
public class ProcessImageView extends Panel
{
private ProcessInstance instance;
- private ConsoleView view;
+ private MainCompositeView view;
private ActiveNodeInfo activeNodeInfo = null;
- public ProcessImageView(final ProcessInstance instance, final ConsoleView view)
+ public ProcessImageView(final ProcessInstance instance, final MainCompositeView view)
{
super();
this.instance = instance;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -26,13 +26,13 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.core.EventObject;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
-import org.jboss.bpm.console.client.widgets.EditorView;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
import org.jboss.bpm.console.client.widgets.HelpPanel;
-import org.jboss.bpm.console.client.widgets.UIConstants;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -47,11 +47,11 @@
private ProcessInstance processInstance;
- private ConsoleView view;
+ private MainCompositeView view;
private Panel teaserPanel;
- public ProcessInstanceEditor(final ProcessDefinition proc, final ProcessInstance instance, final ConsoleView view)
+ public ProcessInstanceEditor(final ProcessDefinition proc, final ProcessInstance instance, final MainCompositeView view)
{
super();
this.setId(ProcessInstanceEditor.ID+"."+instance.getInstanceId());
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -27,7 +27,7 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
import org.jboss.bpm.console.client.util.DateRenderer;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
@@ -46,7 +46,7 @@
private ProcessDefinition parent;
private static final String DATE_FORMAT = "y-m-j H:i:s"; //08-10-02 13:51:27
- public ProcessInstanceList(ProcessDefinition procDef, String titleName, ConsoleView view)
+ public ProcessInstanceList(ProcessDefinition procDef, String titleName, MainCompositeView view)
{
super(titleName, view, getResourceUrl(view, procDef.getProcessId()), true);
this.parent = procDef;
@@ -224,7 +224,7 @@
return reader;
}
- private static String getResourceUrl(ConsoleView view, long parentId)
+ private static String getResourceUrl(MainCompositeView view, long parentId)
{
return view.getUrlBuilder().getProcessInstanceURL(parentId);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -38,11 +38,11 @@
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.EditorView;
+import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
-import org.jboss.bpm.console.client.widgets.EditorView;
-import org.jboss.bpm.console.client.widgets.UIConstants;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
import org.jboss.bpm.console.client.widgets.HelpPanel;
@@ -56,10 +56,10 @@
private ProcessDefinition parent;
private ProcessInstance selectedInstance;
- private ConsoleView view;
+ private MainCompositeView view;
private ProcessInstanceList instanceList;
- public ProcessInstanceListEditor(ProcessDefinition proc, ConsoleView view)
+ public ProcessInstanceListEditor(ProcessDefinition proc, MainCompositeView view)
{
super();
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -0,0 +1,46 @@
+/*
+ * 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.task;
+
+import org.jboss.bpm.console.client.EditorView;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class TaskListEditor extends EditorView
+{
+
+ public String getEditorId()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getTitle()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getIconCSS()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/EditorView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.widgets;
-
-import com.gwtext.client.widgets.Panel;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public abstract class EditorView extends Panel
-{
-
- protected EditorView()
- {
- super();
- }
-
- public abstract String getEditorId();
- public abstract String getTitle();
- public abstract String getIconCSS();
-}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/MainMenuPanel.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/MainMenuPanel.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/MainMenuPanel.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.widgets;
-
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Component;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MainMenuPanel extends Panel
-{
-
- public MainMenuPanel(String title, String iconClass, Component tree)
- {
- super();
-
- setTitle(title);
- setBorder(false);
- setHideBorders(true);
- setIconCls(iconClass);
-
- if(tree!=null)
- add(tree);
- }
-}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -30,7 +30,8 @@
import com.gwtext.client.widgets.grid.ColumnModel;
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.grid.event.GridCellListener;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.MainCompositeView;
+import org.jboss.bpm.console.client.UIConstants;
/**
* A {@link com.gwtext.client.widgets.grid.GridPanel} view that will pull data
@@ -45,7 +46,7 @@
public abstract class RemoteListView extends Panel
{
protected int selectedRowIndex = -1;
- protected ConsoleView view;
+ protected MainCompositeView view;
protected static final int PAGE_SIZE = 25;
private GridPanel grid;
protected String title;
@@ -56,7 +57,7 @@
private boolean storeInit = false;
private boolean hasAddButton;
- public RemoteListView(String titleName, ConsoleView view, String resourceUrl, boolean hasAddButton)
+ public RemoteListView(String titleName, MainCompositeView view, String resourceUrl, boolean hasAddButton)
{
super();
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.widgets;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class UIConstants
-{
- public static final int MAIN_MENU_MIN = 175;
- public static final int MAIN_MENU_MAX = 400;
- public static final int EDITOR_WIDTH = 680;
- public static final int TEASER_PANEL_WIDTH = 200;
- public static final int EDITOR_PANEL_WIDTH = 450;
-}
Modified: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-10-29 09:30:14 UTC (rev 2651)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-10-29 10:27:43 UTC (rev 2652)
@@ -56,7 +56,7 @@
public void testAuthentication()
{
- final ConsoleView view = application.getConsoleView();
+ final MainCompositeView view = application.getConsoleView();
assertNotNull("View not initialized", view);
Timer timer = new Timer()
@@ -64,7 +64,7 @@
public void run()
{
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(ConsoleView.KNOWN_ROLES);
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainCompositeView.KNOWN_ROLES);
final Authentication auth = new Authentication(inRoleURL);
auth.setCallback(
new Authentication.AuthCallback() {
@@ -92,7 +92,7 @@
public void testProcessDefList()
{
- final ConsoleView view = application.getConsoleView();
+ final MainCompositeView view = application.getConsoleView();
assertNotNull("View not initialized", view);
@@ -134,7 +134,7 @@
public void run()
{
System.out.println("Do authentication");
- String inRoleURL = view.getUrlBuilder().getUserInRoleURL(ConsoleView.KNOWN_ROLES);
+ String inRoleURL = view.getUrlBuilder().getUserInRoleURL(MainCompositeView.KNOWN_ROLES);
final Authentication auth = new Authentication(inRoleURL);
auth.doLogin();
15 years, 6 months
JBoss JBPM SVN: r2651 - in projects/gwt-console/trunk: server/src/main/java/org/jboss/bpm/console/server/dao/internal and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-29 05:30:14 -0400 (Wed, 29 Oct 2008)
New Revision: 2651
Added:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
Log:
For some reason TaskReference was missing from previous commit
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskReference.java 2008-10-29 09:30:14 UTC (rev 2651)
@@ -0,0 +1,135 @@
+/*
+ * 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(a)jboss.com>
+ */
+@XmlRootElement(name = "taskReference")
+public class TaskReference
+{
+ private long taskId;
+ private long tokenId;
+ private long processInstanceId;
+
+ private String taskName;
+ private String actorName;
+
+ private boolean isBlocking;
+ private boolean isSignalling = true;
+
+ private List<String> transitionNames = new ArrayList<String>();
+
+ public TaskReference()
+ {
+ }
+
+ public TaskReference(long taskId, long tokenId, long processInstanceId, String taskName, String actorName, boolean blocking, boolean signalling)
+ {
+ this.taskId = taskId;
+ this.tokenId = tokenId;
+ this.processInstanceId = processInstanceId;
+ this.taskName = taskName;
+ this.actorName = actorName;
+ isBlocking = blocking;
+ isSignalling = signalling;
+ }
+
+ public long getTaskId()
+ {
+ return taskId;
+ }
+
+ public void setTaskId(long taskId)
+ {
+ this.taskId = taskId;
+ }
+
+ public long getTokenId()
+ {
+ return tokenId;
+ }
+
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
+
+ public long getProcessInstanceId()
+ {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(long processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
+
+ public String getTaskName()
+ {
+ return taskName;
+ }
+
+ public void setTaskName(String taskName)
+ {
+ this.taskName = taskName;
+ }
+
+ public String getActorName()
+ {
+ return actorName;
+ }
+
+ public void setActorName(String actorName)
+ {
+ this.actorName = actorName;
+ }
+
+ public boolean isBlocking()
+ {
+ return isBlocking;
+ }
+
+ public void setBlocking(boolean blocking)
+ {
+ isBlocking = blocking;
+ }
+
+ public boolean isSignalling()
+ {
+ return isSignalling;
+ }
+
+ public void setSignalling(boolean signalling)
+ {
+ isSignalling = signalling;
+ }
+
+ public List<String> getTransitionNames()
+ {
+ return transitionNames;
+ }
+}
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java 2008-10-29 09:22:50 UTC (rev 2650)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java 2008-10-29 09:30:14 UTC (rev 2651)
@@ -73,14 +73,11 @@
public static TaskReference taskInstance(org.jbpm.taskmgmt.exe.TaskInstance t0)
{
TaskReference taskRef = new TaskReference(
- t0.getId(),
- t0.getName(),
- t0.getDescription(),
- t0.isSignalling(),
- t0.isBlocking(),
+ t0.getId(),
t0.getToken().getId(),
t0.getProcessInstance().getId(),
- t0.getActorId()
+ t0.getName(), t0.getActorId(),
+ t0.isBlocking(), t0.isSignalling()
);
List<Transition> transitionList = (List<Transition>)
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-29 09:22:50 UTC (rev 2650)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-29 09:30:14 UTC (rev 2651)
@@ -82,10 +82,9 @@
boolean isSignalling = JSONWalk.on(item).next("isSignalling").asBool();
TaskReference ref = new TaskReference(
- id, name, "", // TODO: description, deal with optional values in JSONWalk
- isSignalling, isBlocking,
- tokenId, instanceId,
- actor
+ id, tokenId, instanceId,
+ name, actor,
+ isSignalling, isBlocking
);
if(isSignalling)
15 years, 6 months