Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget@112016 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b4dcc0c78a
commit
00c4ad2876
|
@ -16,7 +16,7 @@ import com.sencha.gxt.widget.core.client.ProgressBar;
|
|||
*/
|
||||
public class MonitorBarUpdater implements MonitorUpdaterListener {
|
||||
|
||||
protected ProgressBar progressBar;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
/**
|
||||
* Creates a new {@link ProgressBar} updater.
|
||||
|
|
|
@ -19,8 +19,8 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||
*/
|
||||
public class MonitorUpdater extends Timer implements MonitorDialogEventUIListener {
|
||||
|
||||
protected ArrayList<MonitorUpdaterListener> listeners = new ArrayList<MonitorUpdaterListener>();
|
||||
protected OperationMonitorSession operationMonitorSession;
|
||||
private ArrayList<MonitorUpdaterListener> listeners = new ArrayList<MonitorUpdaterListener>();
|
||||
private OperationMonitorSession operationMonitorSession;
|
||||
|
||||
public MonitorUpdater(OperationMonitorSession operationMonitorSession){
|
||||
this.operationMonitorSession=operationMonitorSession;
|
||||
|
|
|
@ -19,11 +19,11 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
*/
|
||||
public class MonitorBackgroundDialog extends Window {
|
||||
|
||||
protected static final String WIDTH = "640px";
|
||||
protected static final String HEIGHT = "520px";
|
||||
private static final String WIDTH = "640px";
|
||||
private static final String HEIGHT = "520px";
|
||||
|
||||
protected EventBus eventBus;
|
||||
protected MonitorBackgroundPanel monitorBackgroundPanel;
|
||||
private EventBus eventBus;
|
||||
private MonitorBackgroundPanel monitorBackgroundPanel;
|
||||
|
||||
public MonitorBackgroundDialog(EventBus eventBus) {
|
||||
super();
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
public class MonitorBackgroundInfoDialog extends Window {
|
||||
|
||||
private static final String WIDTH = "640px";
|
||||
private static final String HEIGHT = "408px";
|
||||
private static final String HEIGHT = "428px";
|
||||
|
||||
private EventBus eventBus;
|
||||
private MonitorBackgroundInfoPanel monitorBackgroundInfoPanel;
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
|
|||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
|
@ -43,6 +44,8 @@ import com.sencha.gxt.widget.core.client.event.ExpandItemEvent;
|
|||
import com.sencha.gxt.widget.core.client.event.ExpandItemEvent.ExpandItemHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
@ -56,10 +59,13 @@ import com.sencha.gxt.widget.core.client.treegrid.TreeGrid;
|
|||
*/
|
||||
public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
||||
MonitorBackgroundInfoUpdaterListener {
|
||||
private DateTimeFormat sdf = DateTimeFormat
|
||||
.getFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private static final int STATUS_POLLING_DELAY = 1000;
|
||||
|
||||
|
||||
private static final String WIDTH = "618px";
|
||||
private static final String HEIGHT = "400px";
|
||||
private static final String HEIGHT = "420px";
|
||||
private static final String HEIGHTGRID = "290px";
|
||||
|
||||
private static final int CC1WIDTH = 168;
|
||||
|
@ -68,19 +74,22 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
private static final int CC4WIDTH = 100;
|
||||
|
||||
private MonitorBackgroundInfoDialog parent;
|
||||
|
||||
|
||||
private VerticalLayoutContainer con;
|
||||
|
||||
|
||||
private MonitorTreeDataGenerator gen;
|
||||
private TreeStore<MonitorBaseDto> store;
|
||||
private TreeGrid<MonitorBaseDto> tree;
|
||||
private OperationMonitor operationMonitor;
|
||||
private OperationMonitorSession operationMonitorSession;
|
||||
private BackgroundOperationMonitor backgroundOperationMonitor;
|
||||
|
||||
|
||||
private MonitorBackgroundInfoUpdater monitorBackgroundInfoUpdater;
|
||||
private TextButton btnClose;
|
||||
private OperationMonitorSession operationMonitorSession;
|
||||
|
||||
private TextField startDateField;
|
||||
private FieldLabel startLabel;
|
||||
|
||||
|
||||
class KeyProvider implements ModelKeyProvider<MonitorBaseDto> {
|
||||
@Override
|
||||
|
@ -95,8 +104,10 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
EventBus eventBus) {
|
||||
super();
|
||||
this.parent = parent;
|
||||
this.backgroundOperationMonitor = backgroundOperationMonitor;
|
||||
this.operationMonitorSession = new OperationMonitorSession(
|
||||
backgroundOperationMonitor.getTaskId());
|
||||
|
||||
operationMonitorSession.setInBackground(true);
|
||||
forceLayoutOnResize = true;
|
||||
init();
|
||||
|
@ -116,6 +127,18 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
con = new VerticalLayoutContainer();
|
||||
// con.setScrollMode(ScrollMode.AUTO);
|
||||
|
||||
// StartDate
|
||||
startDateField = new TextField();
|
||||
if (backgroundOperationMonitor != null
|
||||
&& backgroundOperationMonitor.getStartTime() != null) {
|
||||
startDateField.setValue(sdf.format(backgroundOperationMonitor
|
||||
.getStartTime()));
|
||||
}
|
||||
startLabel = new FieldLabel(startDateField, "Start Date");
|
||||
|
||||
|
||||
|
||||
// Tree
|
||||
store = new TreeStore<MonitorBaseDto>(new KeyProvider());
|
||||
|
||||
addChildrensToStore();
|
||||
|
@ -363,7 +386,8 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
|
||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(0, 4, 0, 4)));
|
||||
|
||||
//
|
||||
//
|
||||
con.add(startLabel, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
con.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
con.add(tree, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
con.add(flowButton, new VerticalLayoutData(1, 36, new Margins(5, 5, 5,
|
||||
|
@ -379,7 +403,8 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
protected void addMonitor() {
|
||||
monitorBackgroundInfoUpdater = new MonitorBackgroundInfoUpdater(operationMonitorSession);
|
||||
monitorBackgroundInfoUpdater = new MonitorBackgroundInfoUpdater(
|
||||
operationMonitorSession);
|
||||
monitorBackgroundInfoUpdater.addListener(this);
|
||||
monitorBackgroundInfoUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
monitorBackgroundInfoUpdater.run();
|
||||
|
@ -428,6 +453,14 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
store.commitChanges();
|
||||
tree.expandAll();
|
||||
|
||||
|
||||
// StartDate
|
||||
if (backgroundOperationMonitor != null
|
||||
&& backgroundOperationMonitor.getStartTime() != null) {
|
||||
startDateField.setValue(sdf.format(backgroundOperationMonitor
|
||||
.getStartTime()));
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
@ -457,8 +490,12 @@ public class MonitorBackgroundInfoPanel extends FramedPanel implements
|
|||
|
||||
@Override
|
||||
public void retrieveBackgroundOperationMonitorFailed(Throwable caught) {
|
||||
Log.error("Error retrieving background operation monitor: "+caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error", "Error generating informations: "+caught.getLocalizedMessage());
|
||||
Log.error("Error retrieving background operation monitor: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert(
|
||||
"Error",
|
||||
"Error generating informations: "
|
||||
+ caught.getLocalizedMessage());
|
||||
close();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||
*/
|
||||
public class MonitorBackgroundInfoUpdater extends Timer {
|
||||
|
||||
protected ArrayList<MonitorBackgroundInfoUpdaterListener> listeners = new ArrayList<MonitorBackgroundInfoUpdaterListener>();
|
||||
protected OperationMonitorSession operationMonitorSession;
|
||||
private ArrayList<MonitorBackgroundInfoUpdaterListener> listeners = new ArrayList<MonitorBackgroundInfoUpdaterListener>();
|
||||
private OperationMonitorSession operationMonitorSession;
|
||||
|
||||
public MonitorBackgroundInfoUpdater(
|
||||
OperationMonitorSession operationMonitorSession) {
|
||||
|
|
|
@ -6,12 +6,10 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.monitor.BackgroundOperationMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
|
@ -48,33 +46,33 @@ import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|||
*/
|
||||
public class MonitorBackgroundPanel extends FramedPanel implements
|
||||
MonitorBackgroundUpdaterListener {
|
||||
protected static final int STATUS_POLLING_DELAY = 5000;
|
||||
protected static final String WIDTH = "640px";
|
||||
protected static final String HEIGHT = "520px";
|
||||
protected static final int CC1WIDTH = 104;
|
||||
protected static final int CC2WIDTH = 52;
|
||||
protected static final int CC3WIDTH = 104;
|
||||
protected MonitorBackgroundDialog parent;
|
||||
private static final int STATUS_POLLING_DELAY = 5000;
|
||||
private static final String WIDTH = "640px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private static final int CC1WIDTH = 90;
|
||||
private static final int CC2WIDTH = 60;
|
||||
private static final int CC3WIDTH = 110;
|
||||
private static final int PROGRESS_WIDTH = 110;
|
||||
private MonitorBackgroundDialog parent;
|
||||
|
||||
protected ArrayList<MonitorBackgroundEventUIListener> monitorBackgroundEventUIListeners = new ArrayList<MonitorBackgroundEventUIListener>();
|
||||
private ArrayList<MonitorBackgroundEventUIListener> monitorBackgroundEventUIListeners = new ArrayList<MonitorBackgroundEventUIListener>();
|
||||
|
||||
protected MonitorBackgroundPanel thisPanel;
|
||||
|
||||
private Menu contextMenu;
|
||||
private MenuItem infoItem;
|
||||
private MenuItem abortItem;
|
||||
private MenuItem hideItem;
|
||||
|
||||
protected Menu contextMenu;
|
||||
protected MenuItem infoItem;
|
||||
protected MenuItem abortItem;
|
||||
protected MenuItem hideItem;
|
||||
//private TRId trId;
|
||||
private VerticalLayoutContainer con;
|
||||
//private ValidationsTasksMetadata validationsTasksMetadata;
|
||||
|
||||
protected TRId trId;
|
||||
protected VerticalLayoutContainer con;
|
||||
protected ValidationsTasksMetadata validationsTasksMetadata;
|
||||
private ListStore<BackgroundOperationMonitor> store;
|
||||
private Grid<BackgroundOperationMonitor> grid;
|
||||
private ArrayList<BackgroundOperationMonitor> backgroundOperationMonitorList;
|
||||
|
||||
protected ListStore<BackgroundOperationMonitor> store;
|
||||
protected Grid<BackgroundOperationMonitor> grid;
|
||||
protected ArrayList<BackgroundOperationMonitor> backgroundOperationMonitorList;
|
||||
|
||||
protected EventBus eventBus;
|
||||
protected MonitorBackgroundUpdater monitorBackgroundUpdater;
|
||||
private EventBus eventBus;
|
||||
private MonitorBackgroundUpdater monitorBackgroundUpdater;
|
||||
|
||||
public interface BackgroundOperationMonitorProperties extends
|
||||
PropertyAccess<BackgroundOperationMonitor> {
|
||||
|
@ -128,6 +126,7 @@ public class MonitorBackgroundPanel extends FramedPanel implements
|
|||
ColumnConfig<BackgroundOperationMonitor, String> cc1 = new ColumnConfig<BackgroundOperationMonitor, String>(
|
||||
props.tabularResourceName());
|
||||
cc1.setHeader("Tabular Resource");
|
||||
cc1.setWidth(CC1WIDTH);
|
||||
cc1.setCell(new AbstractCell<String>() {
|
||||
|
||||
@Override
|
||||
|
@ -142,7 +141,8 @@ public class MonitorBackgroundPanel extends FramedPanel implements
|
|||
ColumnConfig<BackgroundOperationMonitor, State> cc2 = new ColumnConfig<BackgroundOperationMonitor, State>(
|
||||
props.state());
|
||||
cc2.setHeader("Status");
|
||||
|
||||
cc2.setWidth(CC2WIDTH);
|
||||
|
||||
ColumnConfig<BackgroundOperationMonitor, Double> cc3 = new ColumnConfig<BackgroundOperationMonitor, Double>(
|
||||
new ValueProvider<BackgroundOperationMonitor, Double>() {
|
||||
|
||||
|
@ -174,7 +174,7 @@ public class MonitorBackgroundPanel extends FramedPanel implements
|
|||
}
|
||||
};
|
||||
progress.setProgressText("{0}% Complete");
|
||||
progress.setWidth(100);
|
||||
progress.setWidth(PROGRESS_WIDTH);
|
||||
|
||||
cc3.setCell(progress);
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||
*/
|
||||
public class MonitorBackgroundUpdater extends Timer implements MonitorBackgroundEventUIListener {
|
||||
|
||||
protected ArrayList<MonitorBackgroundUpdaterListener> listeners = new ArrayList<MonitorBackgroundUpdaterListener>();
|
||||
protected BackgroundOperationMonitorSession backgroundOperationMonitorSession;
|
||||
private ArrayList<MonitorBackgroundUpdaterListener> listeners = new ArrayList<MonitorBackgroundUpdaterListener>();
|
||||
private BackgroundOperationMonitorSession backgroundOperationMonitorSession;
|
||||
|
||||
public MonitorBackgroundUpdater(){
|
||||
backgroundOperationMonitorSession=new BackgroundOperationMonitorSession();
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.monitor.OperationMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.WorkerState;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.WorkerStateParser;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.custom.ExtendedTreeGridView;
|
||||
|
@ -14,7 +13,6 @@ import org.gcube.portlets.user.td.monitorwidget.client.details.tree.MonitorTreeD
|
|||
import org.gcube.portlets.user.td.monitorwidget.client.details.tree.MonitorValidationJobSDto;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
|
@ -43,35 +41,25 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
import com.sencha.gxt.widget.core.client.menu.Menu;
|
||||
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
import com.sencha.gxt.widget.core.client.treegrid.TreeGrid;
|
||||
|
||||
public class MonitorDetailPanel extends FramedPanel {
|
||||
protected static final String WIDTH = "618px";
|
||||
protected static final String HEIGHT = "256px";
|
||||
protected static final String GRIDHEIGHT = "332px";
|
||||
private static final String WIDTH = "618px";
|
||||
private static final String HEIGHT = "256px";
|
||||
private static final String GRIDHEIGHT = "332px";
|
||||
|
||||
protected static final int CC1WIDTH = 168;
|
||||
protected static final int CC2WIDTH = 100;
|
||||
protected static final int CC3WIDTH = 140;
|
||||
protected static final int CC4WIDTH = 100;
|
||||
private static final int CC1WIDTH = 168;
|
||||
private static final int CC2WIDTH = 100;
|
||||
private static final int CC3WIDTH = 140;
|
||||
private static final int CC4WIDTH = 100;
|
||||
|
||||
protected MonitorDetailPanel thisPanel;
|
||||
|
||||
protected Menu contextMenu;
|
||||
protected MenuItem resumeItem;
|
||||
protected MenuItem resolveItem;
|
||||
|
||||
protected TRId trId;
|
||||
protected VerticalLayoutContainer con;
|
||||
protected EventBus eventBus;
|
||||
protected ValidationsTasksMetadata validationsTasksMetadata;
|
||||
|
||||
protected MonitorTreeDataGenerator gen;
|
||||
protected TreeStore<MonitorBaseDto> store;
|
||||
protected TreeGrid<MonitorBaseDto> tree;
|
||||
|
||||
private VerticalLayoutContainer con;
|
||||
|
||||
private MonitorTreeDataGenerator gen;
|
||||
private TreeStore<MonitorBaseDto> store;
|
||||
private TreeGrid<MonitorBaseDto> tree;
|
||||
private OperationMonitor operationMonitor;
|
||||
private ExtendedTreeGridView<MonitorBaseDto> gridView;
|
||||
|
||||
|
@ -90,8 +78,6 @@ public class MonitorDetailPanel extends FramedPanel {
|
|||
public MonitorDetailPanel(EventBus eventBus) {
|
||||
super();
|
||||
Log.debug("MonitorDetailPanel");
|
||||
this.eventBus = eventBus;
|
||||
this.thisPanel = this;
|
||||
forceLayoutOnResize = true;
|
||||
init();
|
||||
create();
|
||||
|
|
|
@ -11,14 +11,14 @@ import java.util.ArrayList;
|
|||
public class MonitorFolderDto extends MonitorBaseDto {
|
||||
|
||||
private static final long serialVersionUID = 4644048540524701598L;
|
||||
protected String description;
|
||||
protected ArrayList<MonitorBaseDto> childrens;
|
||||
protected String type;
|
||||
protected String state;
|
||||
protected String humanReadableStatus;
|
||||
protected float progress;
|
||||
protected String startTime;
|
||||
protected String endTime;
|
||||
private String description;
|
||||
private ArrayList<MonitorBaseDto> childrens;
|
||||
private String type;
|
||||
private String state;
|
||||
private String humanReadableStatus;
|
||||
private float progress;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
|
||||
public MonitorFolderDto(){
|
||||
|
||||
|
|
|
@ -17,13 +17,12 @@ import com.google.gwt.i18n.client.DateTimeFormat;
|
|||
*
|
||||
*/
|
||||
public class MonitorTreeDataGenerator {
|
||||
protected DateTimeFormat sdf = DateTimeFormat
|
||||
private DateTimeFormat sdf = DateTimeFormat
|
||||
.getFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
protected MonitorFolderDto root;
|
||||
|
||||
protected boolean singleOperation;
|
||||
private MonitorFolderDto root;
|
||||
|
||||
|
||||
public MonitorTreeDataGenerator() {
|
||||
Log.debug("MonitorTreeDataGenerator");
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ public class MonitorValidationJobSDto extends MonitorBaseDto {
|
|||
|
||||
private static final long serialVersionUID = -4353641080571614057L;
|
||||
|
||||
protected WorkerState workerState;
|
||||
protected float progress;
|
||||
protected String description;
|
||||
protected Throwable errorMessage;
|
||||
protected String humanReadableStatus;
|
||||
protected InvocationS invocation;
|
||||
private WorkerState workerState;
|
||||
private float progress;
|
||||
private String description;
|
||||
private Throwable errorMessage;
|
||||
private String humanReadableStatus;
|
||||
private InvocationS invocation;
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue