Author: heiko.braun(a)jboss.com
Date: 2010-02-05 09:31:54 -0500 (Fri, 05 Feb 2010)
New Revision: 953
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/Model.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelCommands.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelParts.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksModule.java
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
Log:
Add code split points. Use message bus for inter module dependencies
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -30,10 +30,7 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.MessageBox;
-import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
-import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
-import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.errai.bus.client.ClientMessageBus;
import org.jboss.errai.bus.client.ErraiBus;
@@ -153,10 +150,6 @@
// register global views and actions, available across editors
//controller.addView(Header.ID, header);
controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
- controller.addAction(BootstrapAction.ID, new BootstrapAction());
-
- controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction());
- controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction());
- controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction());
+ controller.addAction(BootstrapAction.ID, new BootstrapAction());
}
}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,57 @@
+/*
+ * 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.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Preferences", group = "Settings", icon =
"runtimeIcon")
+public class PreferencesModule implements WSComponent
+{
+ static PreferencesView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new PreferencesView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+ );
+
+ }
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,58 @@
+/*
+ * 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.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "System", group = "Settings",
icon="docIcon")
+public class ServerStatusModule implements WSComponent
+{
+ static ServerStatusView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new ServerStatusView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+
+ }
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/Model.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/Model.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/Model.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -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.common;
+
+
+/**
+ * @see org.jboss.bpm.console.client.common.ModelCommands
+ * @see org.jboss.bpm.console.client.common.ModelParts
+ */
+public interface Model
+{
+ public String SUBJECT = "appContext.model.listener";
+ public String DEPLOYMENT_MODEL = "deploymentModel";
+ public String PROCESS_MODEL = "processModel";
+ public String TASK_MODEL = "taskModel";
+
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelCommands.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelCommands.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelCommands.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+public enum ModelCommands
+{
+ // Somebody please update the model
+ HAS_BECOME_STALE,
+
+ // It's done, please refresh the view
+ HAS_BEEN_UPDATED
+
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelParts.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelParts.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/ModelParts.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+public enum ModelParts
+{
+ // What model are we talking about?
+ CLASS
+}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -102,6 +102,7 @@
controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction());
controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction());
controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction());
+ //controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction());
controller.addView(DeploymentListView.ID, this);
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,59 @@
+/*
+ * 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.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.bus.server.annotations.security.RequireRoles;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Deployments", group = "Runtime",
icon="deploymentIcon")
+@RequireRoles({"administrator"})
+public class DeploymentModule implements WSComponent
+{
+ static DeploymentListView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new DeploymentListView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+ }
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,59 @@
+/*
+ * 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.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.bus.server.annotations.security.RequireRoles;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Jobs", group = "Runtime",
icon="jobsIcon")
+@RequireRoles({"administrator"})
+public class JobListModule implements WSComponent
+{
+ static JobListView instance;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new JobListView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+ }
+}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -26,13 +26,12 @@
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.URLBuilder;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.common.DataDriven;
+import org.jboss.bpm.console.client.common.*;
import org.jboss.bpm.console.client.model.DTOParser;
import org.jboss.bpm.console.client.model.DeploymentRef;
-import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.MessageBuilder;
import java.util.List;
@@ -89,9 +88,13 @@
view.select(deploymentId);
// refresh process definitions
- controller.handleEvent(
- new Event(UpdateDefinitionsAction.ID, null)
- );
+ MessageBuilder.createMessage()
+ .toSubject(Model.SUBJECT)
+ .command(ModelCommands.HAS_BEEN_UPDATED)
+ .with(ModelParts.CLASS, Model.DEPLOYMENT_MODEL)
+ .noErrorHandling()
+ .sendNowWith(ErraiBus.get()
+ );
}
}
}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -27,8 +27,11 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HTML;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import com.mvc4g.client.ViewInterface;
@@ -36,11 +39,11 @@
import org.gwt.mosaic.ui.client.ToolBar;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.jboss.bpm.console.client.common.DataDriven;
-import org.jboss.bpm.console.client.common.LoadingOverlay;
-import org.jboss.bpm.console.client.common.PagingCallback;
-import org.jboss.bpm.console.client.common.PagingPanel;
+import org.jboss.bpm.console.client.common.*;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.Message;
+import org.jboss.errai.bus.client.MessageCallback;
import org.jboss.errai.common.client.framework.WSComponent;
import org.jboss.errai.common.client.framework.WidgetCallback;
import org.jboss.errai.workspaces.client.Registry;
@@ -87,6 +90,7 @@
controller.addAction(StateChangeAction.ID, new StateChangeAction());
controller.addAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction());
controller.addAction(DeleteInstanceAction.ID, new DeleteInstanceAction());
+ controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction());
initialize();
@@ -133,14 +137,7 @@
new Button("Refresh", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
- final DefaultListModel<ProcessDefinitionRef> model =
- (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
- model.clear();
-
- // force loading
- controller.handleEvent(
- new Event(UpdateDefinitionsAction.ID, null)
- );
+ reload();
}
}
)
@@ -212,10 +209,46 @@
panel.add(layout);
+ // deployments model listener
+ ErraiBus.get().subscribe(Model.SUBJECT,
+ new MessageCallback()
+ {
+ public void callback(Message message)
+ {
+ switch (ModelCommands.valueOf(message.getCommandType()))
+ {
+ case HAS_BEEN_UPDATED:
+ if(message.get(String.class,
ModelParts.CLASS).equals(Model.DEPLOYMENT_MODEL))
+ reload();
+ break;
+ }
+ }
+ });
+
isInitialized = true;
}
}
+ private void reload()
+ {
+ DeferredCommand.addCommand(
+ new Command()
+ {
+ public void execute()
+ {
+ final DefaultListModel<ProcessDefinitionRef> model =
+ (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+ model.clear();
+
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ }
+ );
+ }
+
private ListBox createListBox()
{
final ListBox<ProcessDefinitionRef> listBox =
@@ -230,7 +263,8 @@
ProcessDefinitionRef item) {
switch (column) {
case 0:
- listBox.setText(row, column, item.getName());
+ String text = item.isSuspended() ? "<div
style=\"color:#CCCCCC\">"+item.getName()+"</div>" :
item.getName();
+ listBox.setWidget(row, column, new HTML(text));
break;
case 1:
listBox.setText(row, column, String.valueOf(item.getVersion()));
@@ -255,18 +289,21 @@
{
ProcessDefinitionRef item = listBox.getItem(index);
- // update details
- controller.handleEvent(
- new Event(UpdateProcessDetailAction.ID, item)
- );
+ if(!item.isSuspended())
+ {
+ // update details
+ controller.handleEvent(
+ new Event(UpdateProcessDetailAction.ID, item)
+ );
- // load instances
- controller.handleEvent(
- new Event(
- UpdateInstancesAction.ID,
- item
- )
- );
+ // load instances
+ controller.handleEvent(
+ new Event(
+ UpdateInstancesAction.ID,
+ item
+ )
+ );
+ }
}
}
}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Process Overview", group = "Processes", icon =
"processIcon")
+public class ProcessModule implements WSComponent
+{
+ static MergedProcessView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ ProcessModule.createInstance(callback);
+ }
+
+ public static void createInstance(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new MergedProcessView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+
+ }
+}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -25,12 +25,13 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.URLBuilder;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.common.DataDriven;
+import org.jboss.bpm.console.client.common.*;
import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.MessageBuilder;
import java.util.List;
@@ -78,6 +79,15 @@
ConsoleLog.info("Loaded " + instances.size() + " process instance(s)
in "+(System.currentTimeMillis()-start)+" ms");
+ // refresh tasks
+ MessageBuilder.createMessage()
+ .toSubject(Model.SUBJECT)
+ .command(ModelCommands.HAS_BEEN_UPDATED)
+ .with(ModelParts.CLASS, Model.PROCESS_MODEL)
+ .noErrorHandling()
+ .sendNowWith(ErraiBus.get()
+ );
+
}
}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,57 @@
+/*
+ * 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.report;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Report Templates", group = "Reporting",
icon="reportIcon")
+public class ReportModule implements WSComponent
+{
+ ReportView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new ReportView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+ }
+}
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,57 @@
+/*
+ * 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 com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Personal Tasks", group = "Tasks", priority = 2,
icon = "userIcon")
+public class AssignedTasksModule implements WSComponent
+{
+ static AssignedTasksView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new AssignedTasksView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+ }
+}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -41,6 +41,9 @@
import org.jboss.bpm.console.client.task.events.DetailViewEvent;
import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.Message;
+import org.jboss.errai.bus.client.MessageCallback;
import org.jboss.errai.common.client.framework.WSComponent;
import org.jboss.errai.common.client.framework.WidgetCallback;
import org.jboss.errai.workspaces.client.Registry;
@@ -159,10 +162,8 @@
new Button("Refresh", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
- // force loading
- controller.handleEvent(
- new Event(LoadTasksAction.ID,
appContext.getAuthentication().getUsername())
- );
+ reload();
+
}
}
)
@@ -189,9 +190,7 @@
{
public void onWindowClosed()
{
- controller.handleEvent(
- new Event(LoadTasksAction.ID,
appContext.getAuthentication().getUsername())
- );
+ reload();
}
}
);
@@ -271,15 +270,29 @@
viewBtn.setEnabled(hasDispatcherPlugin);
+ // deployments model listener
+ ErraiBus.get().subscribe(Model.SUBJECT,
+ new MessageCallback()
+ {
+ public void callback(Message message)
+ {
+ switch (ModelCommands.valueOf(message.getCommandType()))
+ {
+ case HAS_BEEN_UPDATED:
+ if(message.get(String.class,
ModelParts.CLASS).equals(Model.PROCESS_MODEL))
+ reload();
+ break;
+ }
+ }
+ });
+
Timer t = new Timer()
{
@Override
public void run()
{
// force loading
- controller.handleEvent(
- new Event(LoadTasksAction.ID,
appContext.getAuthentication().getUsername())
- );
+ reload();
}
};
@@ -289,6 +302,14 @@
}
}
+ private void reload()
+ {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
+ );
+ }
+
public void reset()
{
final DefaultListModel<TaskRef> model =
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksModule.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksModule.java
(rev 0)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksModule.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -0,0 +1,57 @@
+/*
+ * 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 com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.common.client.framework.WidgetCallback;
+import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
+
+@LoadTool(name = "Group Tasks", group = "Tasks", priority = 1, icon =
"taskIcon")
+public class OpenTasksModule implements WSComponent
+{
+ static OpenTasksView instance = null;
+
+ public void getWidget(final WidgetCallback callback)
+ {
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable err)
+ {
+ ConsoleLog.error("Failed to load tool", err);
+ }
+
+ public void onSuccess()
+ {
+ if (instance == null) {
+ instance = new OpenTasksView();
+ }
+ instance.getWidget(callback);
+ }
+ }
+
+ );
+ }
+}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-02-04
16:05:51 UTC (rev 952)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-02-05
14:31:54 UTC (rev 953)
@@ -35,14 +35,14 @@
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.DataDriven;
-import org.jboss.bpm.console.client.common.LoadingOverlay;
-import org.jboss.bpm.console.client.common.PagingCallback;
-import org.jboss.bpm.console.client.common.PagingPanel;
+import org.jboss.bpm.console.client.common.*;
import org.jboss.bpm.console.client.model.TaskRef;
import org.jboss.bpm.console.client.task.events.DetailViewEvent;
import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.Message;
+import org.jboss.errai.bus.client.MessageCallback;
import org.jboss.errai.common.client.framework.WSComponent;
import org.jboss.errai.common.client.framework.WidgetCallback;
import org.jboss.errai.workspaces.client.Registry;
@@ -184,11 +184,9 @@
new Button("Refresh", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
- // force loading
- controller.handleEvent(
- new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
- );
+ reload();
+
}
}
)
@@ -249,15 +247,30 @@
controller.addView("OpenDetailView", detailsView);
detailsView.initialize();
+
+ // deployments model listener
+ ErraiBus.get().subscribe(Model.SUBJECT,
+ new MessageCallback()
+ {
+ public void callback(Message message)
+ {
+ switch (ModelCommands.valueOf(message.getCommandType()))
+ {
+ case HAS_BEEN_UPDATED:
+ if(message.get(String.class,
ModelParts.CLASS).equals(Model.PROCESS_MODEL))
+ reload();
+ break;
+ }
+ }
+ });
+
Timer t = new Timer()
{
@Override
public void run()
{
// force loading
- controller.handleEvent(
- new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
- );
+ reload();
}
};
@@ -267,7 +280,15 @@
}
}
+ private void reload()
+ {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
+ );
+ }
+
public void reset()
{
final DefaultListModel<TaskRef> model =