[jbpm-commits] JBoss JBPM SVN: r5112 - in projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client: deployment and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jun 25 04:51:30 EDT 2009
Author: heiko.braun at jboss.com
Date: 2009-06-25 04:51:30 -0400 (Thu, 25 Jun 2009)
New Revision: 5112
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
Log:
Refresh process definitions when deployments are changed
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -37,7 +37,8 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.util.WindowUtil;
import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
-import org.jboss.bpm.console.client.deployment.UpdateDeploymentListAction;
+import org.jboss.bpm.console.client.deployment.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
/**
* The main composite that assembles the gwt console application.
@@ -118,14 +119,8 @@
// workspace
workspace = createWorkspace();
layoutPanel.add(workspace, new BorderLayoutData(Region.CENTER, false));
+ registerGlobalViewsAndActions();
-
- // register global views and actions, available across editors
- controller.addView(Header.ID, header);
- controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
- controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction(this));
- controller.addAction(UpdateDeploymentListAction.ID, new UpdateDeploymentListAction(this));
-
// message Panel
final CaptionLayoutPanel messagePanel = createMessagePanel(layoutPanel);
messagePanel.add(Log.getDivLogger().getWidget());
@@ -143,6 +138,19 @@
}
+ /**
+ * Views and actions accessible from any component
+ */
+ private void registerGlobalViewsAndActions()
+ {
+ // register global views and actions, available across editors
+ controller.addView(Header.ID, header);
+ controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
+ controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction(this));
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(this));
+ controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(this));
+ }
+
private CaptionLayoutPanel createMessagePanel(final LayoutPanel layoutPanel)
{
final CaptionLayoutPanel messagePanel = new CaptionLayoutPanel("Messages", true);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -61,7 +61,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -95,7 +95,7 @@
registerView(DeploymentListView.ID, new DeploymentListView());
// create and register actions
- controller.addAction(UpdateDeploymentListAction.ID, new UpdateDeploymentListAction(appContext));
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(appContext));
controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction(appContext));
controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction(appContext));
@@ -106,7 +106,7 @@
// force loading
super.controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
isInitialized = true;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -36,8 +36,10 @@
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
import java.util.List;
+import java.util.Date;
/**
* List of deployments
@@ -57,6 +59,8 @@
private DeploymentRef selection = null;
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
public DeploymentListView()
{
super();
@@ -72,7 +76,7 @@
final ListBox<DeploymentRef> listBox =
new ListBox<DeploymentRef>(
new String[] {
- "ID", "Name", "Suspended"}
+ "ID", "Name", "Timestamp", "Suspended"}
);
@@ -87,6 +91,9 @@
listBox.setText(row, column, item.getName());
break;
case 2:
+ listBox.setText(row, column, dateFormat.format(new Date(item.getTimestamp())));
+ break;
+ case 3:
listBox.setText(row, column, String.valueOf(item.isSuspended()));
break;
default:
@@ -145,7 +152,7 @@
public void onClick(Widget sender) {
// force loading
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -60,7 +60,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -60,7 +60,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -1,89 +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.deployment;
-
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.DeploymentRef;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONValue;
-import com.google.gwt.json.client.JSONParser;
-import com.mvc4g.client.Controller;
-
-import java.util.List;
-
-/**
- * Updates a list of deployment and can optionally select a particular one.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class UpdateDeploymentListAction extends AbstractRESTAction
-{
-
- public final static String ID = UpdateDeploymentListAction.class.getName();
-
-
- public UpdateDeploymentListAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- return appContext.getUrlBuilder().getDeploymentsUrl();
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.GET;
- }
-
- public void handleSuccessfulResponse(
- final Controller controller, final Object event, Response response)
- {
- JSONValue json = JSONParser.parse(response.getText());
- List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
-
- DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
- if(null==view)
- throw new RuntimeException("View not initialzed: " + DeploymentListView.ID);
-
- view.update(deployments);
-
- // optional
- String deploymentId = (String)event;
- if(deploymentId!=null)
- {
- System.out.println("activate " + deploymentId);
- view.select(deploymentId);
- }
-
- }
-}
Copied: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java (from rev 5097, projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java)
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -0,0 +1,94 @@
+/*
+ * 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.deployment;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.json.client.JSONParser;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Updates a list of deployment and can optionally select a particular one.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDeploymentsAction extends AbstractRESTAction
+{
+
+ public final static String ID = UpdateDeploymentsAction.class.getName();
+
+
+ public UpdateDeploymentsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getDeploymentsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
+
+ DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
+ if(null==view)
+ throw new RuntimeException("View not initialzed: " + DeploymentListView.ID);
+
+ view.update(deployments);
+
+ // optional
+ String deploymentId = (String)event;
+ if(deploymentId!=null)
+ {
+ System.out.println("activate " + deploymentId);
+ view.select(deploymentId);
+ }
+
+ // refresh process definitions
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -56,7 +56,7 @@
}
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, dplId)
+ new Event(UpdateDeploymentsAction.ID, dplId)
);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -32,7 +32,6 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
-import org.jboss.bpm.console.client.deployment.UpdateDeploymentListAction;
import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -99,7 +99,7 @@
registerView(InstanceListView.ID, new InstanceListView(appContext));
// create and register actions
- registerAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(appContext));
+
registerAction(UpdateInstancesAction.ID, new UpdateInstancesAction(appContext));
registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction(appContext));
registerAction(StateChangeAction.ID, new StateChangeAction(appContext));
More information about the jbpm-commits
mailing list