[jbpm-commits] JBoss JBPM SVN: r5134 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client and 10 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jun 26 10:12:31 EDT 2009
Author: heiko.braun at jboss.com
Date: 2009-06-26 10:12:30 -0400 (Fri, 26 Jun 2009)
New Revision: 5134
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
Modified:
projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
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/common/AbstractView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.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/resources/org/jboss/bpm/console/workspace-default.cfg
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
Log:
Beginn work on job lists
Modified: projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-26 14:12:30 UTC (rev 5134)
@@ -2,4 +2,4 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
org.jboss.bpm.console.client.report.ReportEditor
-org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
+org.jboss.bpm.console.client.engine.EngineEditor
\ No newline at end of file
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-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -36,8 +36,8 @@
import org.gwt.mosaic.ui.client.util.ButtonHelper;
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.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
+import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
/**
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -35,6 +35,8 @@
{
private AbstractImagePrototype icon;
+ protected boolean initialized;
+
protected AbstractView()
{
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,67 @@
+/*
+ * 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 org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeleteDeploymentAction extends AbstractRESTAction
+{
+
+ public final static String ID = DeleteDeploymentAction.class.getName();
+
+ public DeleteDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getDeleteDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,199 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * Detail panel associated with a selected deployment.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentDetailView extends CaptionLayoutPanel implements ViewInterface
+{
+ public final static String ID = DeploymentDetailView.class.getName();
+
+ private Controller controller;
+
+ private PropertyGrid grid;
+
+ private DeploymentRef currentDeployment;
+
+ private ResourcePanel resourcePanel;
+
+ ToolButton suspendBtn;
+ ToolButton resumeBtn;
+
+ public DeploymentDetailView()
+ {
+ super("Deployment details");
+ super.setStyleName("bpm-detail-panel");
+
+ grid = new PropertyGrid(new String[] {"ID:", "Name:", "Processes:"});
+ LayoutPanel propLayout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ propLayout.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+
+ suspendBtn = new ToolButton("Suspend", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Suspend deployment",
+ "Do you want to suspend this deployment? Any associated process will suspended aswell.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ SuspendDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+ resumeBtn = new ToolButton("Resume", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Resume deployment",
+ "Do you want to resume this deployment?",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ ResumeDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+
+ propLayout.add(suspendBtn);
+ propLayout.add(resumeBtn);
+
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(propLayout);
+
+ // resource info
+ ScrollLayoutPanel scrollPanel = new ScrollLayoutPanel();
+ resourcePanel = new ResourcePanel();
+ scrollPanel.add(resourcePanel);
+ deck.add(scrollPanel);
+
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("Properties");
+ dropBox.addItem("Resources");
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
+
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ deck.showWidget(dropBox.getSelectedIndex());
+
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return currentDeployment;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ resourcePanel.setController(controller);
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ this.currentDeployment= deployment;
+
+ String[] values = new String[] {
+ deployment.getId(),
+ deployment.getName(),
+ deployment.getDefinitions().toString()
+ };
+
+ resumeBtn.setEnabled(deployment.isSuspended());
+ suspendBtn.setEnabled(!resumeBtn.isEnabled());
+
+ grid.update(values);
+ resourcePanel.update(deployment);
+ }
+
+ public void clearView()
+ {
+ this.currentDeployment = null;
+ grid.clear();
+ resourcePanel.clearView();
+
+ suspendBtn.setEnabled(false);
+ resumeBtn.setEnabled(false);
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,324 @@
+/*
+ * 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.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+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
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class DeploymentListView extends AbstractView
+{
+ public final static String ID = DeploymentListView.class.getName();
+
+ private Controller controller;
+
+ private boolean initialized;
+
+ private LayoutPanel deploymentList = null;
+
+ private ListBox<DeploymentRef> listBox;
+
+ private DeploymentRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<DeploymentRef> deployments = null;
+
+ public DeploymentListView()
+ {
+ super();
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Deployments");
+ setIcon(icons.deploymentIcon());
+
+ listBox = createListBox();
+
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<DeploymentRef> listBox =
+ new ListBox<DeploymentRef>(
+ new String[] {
+ "ID", "Name", "Timestamp", "Suspended"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<DeploymentRef>() {
+ public void renderCell(ListBox<DeploymentRef> listBox, int row, int column,
+ DeploymentRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ 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:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ DeploymentRef item = listBox.getItem(index);
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, item)
+ );
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ deploymentList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ deploymentList.setPadding(0);
+ deploymentList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Delete", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Delete deployment",
+ "Do you want to delete this deployment? Any related data will be removed.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ DeleteDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.deploymentList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.deploymentList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(deploymentList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ /*ProcessDetailView detailsView = new ProcessDetailView();
+ controller.addView(ProcessDetailView.ID, detailsView);
+ controller.addAction(UpdateProcessDetailAction.ID, new UpdateProcessDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+ */
+
+ this.add(layout);
+
+ initialized = true;
+ }
+ }
+
+ public DeploymentRef getSelection()
+ {
+ DeploymentRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public void update(List<DeploymentRef> deployments)
+ {
+ this.deployments = deployments;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.deployments!=null)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ model.clear();
+
+ for(DeploymentRef dpl : deployments)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(dpl);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(dpl.isSuspended()==showSuspended)
+ model.add(dpl);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, null)
+ );
+ }
+ }
+
+ public void select(String deploymentId)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ for(int i=0; i<model.size(); i++)
+ {
+ DeploymentRef ref = model.get(i);
+ if(ref.getId().equals(deploymentId))
+ {
+ listBox.setSelectedIndex(i);
+ break;
+ }
+ }
+
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,162 @@
+/*
+ * 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.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Manage runtime aspects of a process engine
+ * (currently jbpm only).
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class EngineEditor extends Editor
+{
+ public final static String ID = EngineEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ private DeploymentDetailView detailView;
+
+ private Map<String,Integer> view2index = new HashMap<String,Integer>();
+
+ public EngineEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // detail panel
+ detailView = new DeploymentDetailView();
+ controller.addView(DeploymentDetailView.ID, detailView);
+ this.add(detailView, new BorderLayoutData(BorderLayout.Region.SOUTH,10,200));
+
+ // create and register views
+ registerView(DeploymentListView.ID, new DeploymentListView());
+ registerView(JobListView.ID, new JobListView(appContext));
+
+ // create and register actions
+ 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));
+ controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ view2index.put(id, tabPanel.getWidgetCount());
+
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Runtime";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Runtime",
+ icons.runtimeIcon(),
+ new EngineEditorNavigation(appContext)
+ );
+ }
+
+ public void showView(String viewId)
+ {
+ if(!view2index.containsKey(viewId))
+ throw new IllegalArgumentException("Unknown view: "+viewId);
+
+ tabPanel.selectTab( view2index.get(viewId) );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,68 @@
+/*
+ * 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.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class EngineEditorNavigation extends Tree
+{
+
+ public EngineEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Deployments");
+
+ TreeItem root = addItem("Process Engine");
+ TreeItem jbpmDeployments = root.addItem("Deployments");
+ TreeItem jobs = root.addItem("Jobs");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ Workspace workspace = appContext.getWorkpace();
+
+ if("Deployments".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, DeploymentListView.ID);
+ }
+ else if("Jobs".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, JobListView.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,274 @@
+/*
+ * 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.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Display a list of jobs waiting for execution.<br/>
+ * I.e. pending Timers and Messages.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class JobListView extends AbstractView
+{
+ public final static String ID = JobListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel jobList = null;
+
+ private ListBox<JobRef> listBox;
+
+ private JobRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_TIMER = 20;
+ private int FILTER_MESSAGE = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<JobRef> jobs = null;
+
+ private ApplicationContext appContext;
+
+ public JobListView(ApplicationContext appContext)
+ {
+ setTitle("Jobs");
+ this.appContext = appContext;
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setIcon(icons.jobsIcon());
+
+ this.listBox = createListBox();
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<JobRef> listBox =
+ new ListBox<JobRef>(
+ new String[] {
+ "ID", "Due Date", "Type"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<JobRef>() {
+ public void renderCell(ListBox<JobRef> listBox, int row, int column,
+ JobRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ long ts = item.getTimestamp();
+ String ds = ts > 0 ? dateFormat.format(new Date(ts)) : "";
+ listBox.setText(row, column, ds);
+ break;
+ case 2:
+ listBox.setText(row, column, item.getType());
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ JobRef item = listBox.getItem(index);
+
+ /*controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, item)
+ );*/
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ jobList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ jobList.setPadding(0);
+ jobList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ // toolbar
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Timers");
+ dropBox.addItem("Messages");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_TIMER;
+ break;
+ case 2:
+ currentFilter = FILTER_MESSAGE;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.jobList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.jobList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(jobList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ /*JobDetailView detailsView = new JobDetailView();
+ controller.addView(JobDetailView.ID, detailsView);
+ controller.addAction(UpdateJobDetailAction.ID, new UpdateJobDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+ */
+
+ controller.addAction(UpdateJobsAction.ID, new UpdateJobsAction(appContext));
+
+ this.add(layout);
+
+ this.initialized = true;
+ }
+ }
+
+ public void update(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.jobs!=null)
+ {
+ final DefaultListModel<JobRef> model =
+ (DefaultListModel<JobRef>) listBox.getModel();
+
+ model.clear();
+
+ for(JobRef def : jobs)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(def);
+ }
+ else
+ {
+ if(FILTER_TIMER==currentFilter
+ && def.getType().equals("timer"))
+ {
+ model.add(def);
+ }
+ else if(FILTER_MESSAGE==currentFilter
+ && def.getType().equals("message"))
+ {
+ model.add(def);
+ }
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ /* controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, null)
+ ); */
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,105 @@
+/*
+ * 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.mvc4g.client.Controller;
+import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+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.model.DeploymentRef;
+
+/**
+ * List resources associated with a process deployment.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ResourcePanel extends LayoutPanel
+{
+
+ private Controller controller;
+
+ private PropertyGrid propGrid;
+
+ private DeploymentRef currentDeployment = null;
+
+ private boolean initialized;
+
+ private LayoutPanel resources = new LayoutPanel();
+
+ public ResourcePanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ }
+
+ private void initialize()
+ {
+ if(!initialized)
+ {
+ this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
+
+ this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+ this.add(resources, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.initialized = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ initialize();
+ this.currentDeployment = deployment;
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("<ul>");
+ for(String res : deployment.getResourceNames())
+ {
+ sb.append("<li>").append(res);
+ }
+ sb.append("</ul>");
+
+ HTML html = new HTML(sb.toString());
+ resources.clear();
+ resources.add(html);
+
+ propGrid.update(new String[]{deployment.getId()});
+ }
+
+ public void clearView()
+ {
+ initialize();
+ this.currentDeployment = null;
+ propGrid.clear();
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return this.currentDeployment;
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,66 @@
+/*
+ * 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 org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ResumeDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = ResumeDeploymentAction.class.getName();
+
+ public ResumeDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getResumeDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,66 @@
+/*
+ * 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 org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class SuspendDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = SuspendDeploymentAction.class.getName();
+
+ public SuspendDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getSuspendDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,51 @@
+/*
+ * 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.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateDeploymentDetailAction implements ActionInterface
+{
+ public final static String ID = UpdateDeploymentDetailAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ DeploymentRef ref = object!=null ? (DeploymentRef)object : null;
+ DeploymentDetailView view = (DeploymentDetailView)controller.getView(DeploymentDetailView.ID);
+
+ if(null==ref)
+ {
+ // clear view
+ view.clearView();
+ }
+ else
+ {
+ // update view
+ view.update(ref);
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,99 @@
+/*
+ * 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 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)
+ {
+ DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
+
+ // deployment could be disabled
+ if(view!=null)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
+
+ if(null==view)
+ throw new RuntimeException("View not initialized: " + 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)
+ );
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.JobRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class UpdateJobsAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateJobsAction.class.getName();
+
+ public UpdateJobsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getJobsUrl();
+ }
+
+ 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<JobRef> jobs = DTOParser.parseJobRefList(json);
+ JobListView view = (JobListView)controller.getView(JobListView.ID);
+ view.update(jobs);
+
+ }
+}
+
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,64 @@
+/*
+ * 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.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * Cross editor view toggle.
+ * Event requires to be a deployment ID.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ViewDeploymentAction implements ActionInterface
+{
+ public final static String ID = ViewDeploymentAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public ViewDeploymentAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(Controller controller, Object object)
+ {
+ String dplId = (String)object;
+ System.out.println("view deployment " + dplId);
+
+ Workspace workspace = appContext.getWorkpace();
+ if(workspace.hasEditor(EngineEditor.ID))
+ {
+ workspace.showEditor(EngineEditor.ID);
+ }
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, dplId)
+ );
+
+
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -115,7 +115,17 @@
AbstractImagePrototype reportIcon();
/**
+ * @gwt.resource runtime.png
+ */
+ AbstractImagePrototype runtimeIcon();
+
+ /**
* @gwt.resource deployment.png
*/
AbstractImagePrototype deploymentIcon();
+
+ /**
+ * @gwt.resource jobs.png
+ */
+ AbstractImagePrototype jobsIcon();
}
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-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -32,7 +32,7 @@
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.ViewDeploymentAction;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
/**
@@ -61,14 +61,6 @@
{
this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
- ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
-
- Image image = icons.deploymentIcon().createImage();
- LayoutPanel imgPanel = new LayoutPanel();
- imgPanel.setStyleName("bpm-property-image");
- imgPanel.add(image);
-
- this.add(imgPanel);
this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
final Button button = new Button("View Deployment", new ClickListener(){
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-26 14:12:30 UTC (rev 5134)
@@ -2,4 +2,4 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
org.jboss.bpm.console.client.report.ReportEditor
-#org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
+#org.jboss.bpm.console.client.engine.EngineEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -73,6 +73,15 @@
return this.isInitialized;
}
+ /**
+ * should be overwritten if needed
+ * @param viewId
+ */
+ public void showView(String viewId)
+ {
+ throw new IllegalArgumentException("Illegal call. This method should be overridden.");
+ }
+
public abstract void initialize();
public abstract String getEditorId();
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -194,24 +194,29 @@
public String getDeploymentsUrl()
{
- return config.getConsoleServerUrl() + "/rs/repository/deployments";
+ return config.getConsoleServerUrl() + "/rs/engine/deployments";
}
public String getSuspendDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/suspend";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/suspend";
}
public String getResumeDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/resume";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/resume";
}
public String getDeleteDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/delete";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/delete";
}
+
+ public String getJobsUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/engine/jobs";
+ }
}
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -65,19 +65,25 @@
return findEditor(id)!=null;
}
- public void showEditor(final String id)
+ public void showEditor(final String editorId)
{
- EditorDeck deck = findEditor(id);
+ showEditor(editorId, null);
+ }
+
+ public void showEditor(final String editorId, final String viewId)
+ {
+ EditorDeck deck = findEditor(editorId);
if(null==deck)
- throw new IllegalArgumentException("No such editor: " +id);
+ throw new IllegalArgumentException("No such editor: " +editorId);
// display editor
this.showWidget(deck.index);
deck.editor.initialize();
+ if(viewId!=null) deck.editor.showView(viewId);
DeferredCommand.addCommand(new Command() {
public void execute() {
- menu.toggle(id);
+ menu.toggle(editorId);
}
});
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -328,6 +328,8 @@
public static List<DeploymentRef> parseDeploymentRefList(JSONValue json)
{
+ ConsoleLog.debug("parse " + json);
+
List<DeploymentRef> result = new ArrayList<DeploymentRef>();
JSONArray jsonArray = JSONWalk.on(json).next("deployments").asArray();
@@ -365,4 +367,35 @@
return result;
}
+
+ public static List<JobRef> parseJobRefList(JSONValue json)
+ {
+ ConsoleLog.debug("parse " + json);
+
+ List<JobRef> result = new ArrayList<JobRef>();
+
+ JSONArray jsonArray = JSONWalk.on(json).next("jobs").asArray();
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue item = jsonArray.get(i);
+ String id = JSONWalk.on(item).next("id").asString();
+ String type = JSONWalk.on(item).next("type").asString();
+
+ JobRef ref = new JobRef();
+ ref.setId(id);
+ ref.setType(type);
+
+ JSONWalk.JSONWrapper tsEl = JSONWalk.on(item).next("timestamp");
+ if(tsEl!=null)
+ ref.setTimestamp(tsEl.asLong());
+
+ JSONWalk.JSONWrapper err = JSONWalk.on(item).next("errMsg");
+ if(err!=null) // optional
+ ref.setErrMsg(err.asString());
+
+ result.add(ref);
+ }
+
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -21,12 +21,14 @@
*/
package org.jboss.bpm.console.client.model;
+import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import java.util.ArrayList;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
+ at XmlRootElement(name = "deploymentRef")
public class DeploymentRef
{
private String id;
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,95 @@
+/*
+ * 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;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name ="jobRef")
+public class JobRef
+{
+
+ private String id;
+ private long timestamp;
+ private String type;
+ private String errMsg;
+
+
+ public JobRef(String id, long timestamp, String type)
+ {
+ this.id = id;
+ this.timestamp = timestamp;
+ this.type = type;
+ }
+
+
+ public JobRef()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public void setError(String msg)
+ {
+ this.errMsg = msg;
+ }
+
+ public String getErrMsg()
+ {
+ return errMsg;
+ }
+
+ public void setErrMsg(String errMsg)
+ {
+ this.errMsg = errMsg;
+ }
+}
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class JobRefWrapper
+{
+ List<JobRef> jobs = new ArrayList<JobRef>();
+
+
+ public JobRefWrapper()
+ {
+ }
+
+ public JobRefWrapper(List<JobRef> deployments)
+ {
+ this.jobs = deployments;
+ }
+
+ public List<JobRef> getJobs()
+ {
+ return jobs;
+ }
+
+ public void setJobs(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+ }
+
+ public int getTotalCount()
+ {
+ return jobs.size();
+ }
+}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -44,7 +44,7 @@
singletons.add(new TaskMgmtFacade());
singletons.add(new UserMgmtFacade());
singletons.add(new TestFacade());
- singletons.add(new DeploymentFacade());
+ singletons.add(new EngineFacade());
singletons.add( new ReportFacade() );
}
Deleted: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -1,147 +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.server;
-
-import com.google.gson.Gson;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.console.client.model.DeploymentRef;
-import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
-import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
-import org.jboss.bpm.console.server.plugin.PluginMgr;
-
-import javax.ws.rs.*;
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Manage process deployments
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
- at Path("repository")
-public class DeploymentFacade
-{
- private static final Log log = LogFactory.getLog(DeploymentFacade.class);
-
- private ProcessEnginePlugin processEnginePlugin;
-
- private ProcessEnginePlugin getDeploymentPlugin()
- {
- if(null==this.processEnginePlugin)
- {
- this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
- }
-
- return this.processEnginePlugin;
- }
-
- @GET
- @Path("deployments")
- @Produces("application/json")
- public Response getDeployments()
- {
-
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- List<DeploymentRef> dpls = dplPlugin.getDeployments();
- return createJsonResponse(
- new DeploymentRefWrapper(dpls)
- );
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
-
- }
-
- @POST
- @Path("deployment/{id}/suspend")
- @Produces("application/json")
- public Response suspendDeployment(
- @PathParam("id")
- String id
- )
- {
- return doSuspend(id, true);
- }
-
- @POST
- @Path("deployment/{id}/resume")
- @Produces("application/json")
- public Response resumeDeployment(
- @PathParam("id")
- String id
- )
- {
- return doSuspend(id, false);
- }
-
- private Response doSuspend(String id, boolean suspended)
- {
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- processEnginePlugin.suspendDeployment(id, suspended);
- return Response.ok().build();
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
- }
-
- @POST
- @Path("deployment/{id}/delete")
- @Produces("application/json")
- public Response deleteDeployment(
- @PathParam("id")
- String id
- )
- {
-
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- processEnginePlugin.deleteDeployment(id);
- return Response.ok().build();
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
-
- }
-
- private Response createJsonResponse(Object wrapper)
- {
- Gson gson = GsonFactory.createInstance();
- String json = gson.toJson(wrapper);
- return Response.ok(json).type("application/json").build();
- }
-}
Copied: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java (from rev 5126, projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java)
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java (rev 0)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,172 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.JobRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import java.util.List;
+
+/**
+ * Manage process deployments
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("engine")
+public class EngineFacade
+{
+ private static final Log log = LogFactory.getLog(EngineFacade.class);
+
+ private ProcessEnginePlugin processEnginePlugin;
+
+ private ProcessEnginePlugin getDeploymentPlugin()
+ {
+ if(null==this.processEnginePlugin)
+ {
+ this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
+ }
+
+ return this.processEnginePlugin;
+ }
+
+ @GET
+ @Path("deployments")
+ @Produces("application/json")
+ public Response getDeployments()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<DeploymentRef> dpls = dplPlugin.getDeployments();
+ return createJsonResponse(
+ new DeploymentRefWrapper(dpls)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ @POST
+ @Path("deployment/{id}/suspend")
+ @Produces("application/json")
+ public Response suspendDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, true);
+ }
+
+ @POST
+ @Path("deployment/{id}/resume")
+ @Produces("application/json")
+ public Response resumeDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, false);
+ }
+
+ private Response doSuspend(String id, boolean suspended)
+ {
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.suspendDeployment(id, suspended);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+ }
+
+ @POST
+ @Path("deployment/{id}/delete")
+ @Produces("application/json")
+ public Response deleteDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.deleteDeployment(id);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+
+ @GET
+ @Path("jobs")
+ @Produces("application/json")
+ public Response getJobs()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<JobRef> jobs = dplPlugin.getJobs();
+ return createJsonResponse(
+ new JobRefWrapper(jobs)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -22,10 +22,13 @@
package org.jboss.bpm.console.server.plugin;
import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.JobRef;
import java.util.List;
/**
+ * Manages runtime aspects of the underlying process engine.
+ *
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
public interface ProcessEnginePlugin
@@ -35,4 +38,6 @@
void deleteDeployment(String id);
void suspendDeployment(String id, boolean isSuspended);
+
+ List<JobRef> getJobs();
}
More information about the jbpm-commits
mailing list