changed WSFolder to WsItem

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/ws-task-executor-widget@167381 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-05-09 14:19:41 +00:00
parent a04c1dfd0d
commit 57f4f0fbb3
16 changed files with 505 additions and 217 deletions

View File

@ -3,7 +3,7 @@
*/
package org.gcube.portlets.widgets.wstaskexecutor.client;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
@ -30,21 +30,21 @@ public class TaskCompletedNotification {
*
* @param folder the folder
*/
void onTaskComputationCompleted(WsFolder folder);
void onTaskComputationCompleted(WSItem folder);
/**
* On task computation error.
*
* @param folder the folder
*/
void onTaskComputationError(WsFolder folder);
void onTaskComputationError(WSItem folder);
/**
* On remove task configurations performed.
*
* @param folder the folder
*/
void onRemoveTaskConfigurationsPerformed(WsFolder folder);
void onRemoveTaskConfigurationsPerformed(WSItem folder);
}

View File

@ -12,11 +12,13 @@ import org.gcube.portlets.widgets.wstaskexecutor.client.event.CreateTaskConfigur
import org.gcube.portlets.widgets.wstaskexecutor.client.event.CreateTaskConfigurationEventHandler;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.PerformRunTaskEvent;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.PerformRunTaskEventHandler;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.ShowCreateTaskConfigurationEvent;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.ShowCreateTaskConfigurationEventHandler;
import org.gcube.portlets.widgets.wstaskexecutor.client.rpc.WsTaskExecutorWidgetServiceAsync;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.LoaderIcon;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.WsTaskExecutorWidgetViewManager;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.binder.MonitorFolderTaskExecutionStatusView;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Modal;
@ -86,14 +88,29 @@ public class WsTaskExecutorWidget {
}
});
eventBus.addHandler(ShowCreateTaskConfigurationEvent.TYPE, new ShowCreateTaskConfigurationEventHandler() {
@Override
public void onShowCreateConfiguration(
ShowCreateTaskConfigurationEvent showCreateTaskConfigurationEvent) {
if(showCreateTaskConfigurationEvent.getFolder()!=null)
viewManager.showCreateTaskConfigurationForFolder(showCreateTaskConfigurationEvent.getFolder(), null);
}
});
eventBus.addHandler(CreateTaskConfigurationEvent.TYPE, new CreateTaskConfigurationEventHandler() {
@Override
public void onCreateConfiguration(
final CreateTaskConfigurationEvent createTCE) {
if(createTCE.getFolder()!=null && createTCE.getConf()!=null){
WsTaskExecutorWidget.wsTaskService.createTaskConfiguration(createTCE.getFolder().getFolderId(), createTCE.getConf(), createTCE.isUpdate(), new AsyncCallback<Boolean>() {
if(createTCE.getWsItem()!=null && createTCE.getConf()!=null){
GWT.log("Creating the configuration: "+createTCE.getConf());
WsTaskExecutorWidget.wsTaskService.createTaskConfiguration(createTCE.getWsItem().getItemId(), createTCE.getConf(), createTCE.isUpdate(), new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
@ -106,7 +123,7 @@ public class WsTaskExecutorWidget {
public void onSuccess(Boolean result) {
try {
showTaskConfigurationsForFolder(createTCE.getFolder());
showTaskConfigurationsForFolder(createTCE.getWsItem());
}
catch (Exception e) {
// TODO Auto-generated catch block
@ -125,14 +142,14 @@ public class WsTaskExecutorWidget {
/**
* Perform run task.
*
* @param folder the folder
* @param wsItem the folder
* @param conf the conf
* @throws Exception the exception
*/
public void performRunTask(WsFolder folder, TaskConfiguration conf) throws Exception {
public void performRunTask(WSItem wsItem, TaskConfiguration conf) throws Exception {
if(folder==null || folder.getFolderId()==null)
throw new Exception("Invalid parameter folder null");
if(wsItem==null || wsItem.getItemId()==null)
throw new Exception("Invalid parameter workpace item or its id is null");
if(conf==null)
throw new Exception("Invalid parameter the configuration is null");
@ -145,20 +162,20 @@ public class WsTaskExecutorWidget {
/**
* Show task configurations for folder.
*
* @param folder the folder
* @param wsItem the folder
* @throws Exception the exception
*/
public void showTaskConfigurationsForFolder(final WsFolder folder) throws Exception {
public void showTaskConfigurationsForFolder(final WSItem wsItem) throws Exception {
if(folder==null || folder.getFolderId()==null)
throw new Exception("Invalid parameter folder null");
if(wsItem==null || wsItem.getItemId()==null)
throw new Exception("Invalid parameter workpace item or its id is null");
MonitorFolderTaskExecutionStatusView monitor = viewManager.getMonitor(folder);
MonitorFolderTaskExecutionStatusView monitor = viewManager.getMonitor(wsItem);
//SHOWING CURRENT ACTIVE MONITOR
if(monitor!=null) {
GWT.log("Monitor for folder: "+folder.getFolderId() +" exists showing it..");
viewManager.showMonitorTaskStatusFor(folder, monitor.getTaskConfiguration(), monitor.getTaskComputation(), taskEventsListeners);
GWT.log("Monitor for workpace item: "+wsItem.getItemId() +" exists showing it..");
viewManager.showMonitorTaskStatusFor(wsItem, monitor.getTaskConfiguration(), monitor.getTaskComputation(), taskEventsListeners);
return;
}
@ -167,15 +184,15 @@ public class WsTaskExecutorWidget {
LoaderIcon loader = new LoaderIcon("Checking folder configurations...");
box.add(loader);
GWT.log("Performing checkItemTaskConfigurations: "+folder.getFolderId());
GWT.log("Performing checkItemTaskConfigurations: "+wsItem.getItemId());
WsTaskExecutorWidget.wsTaskService.checkItemTaskConfigurations(folder.getFolderId(), new AsyncCallback<List<TaskConfiguration>>() {
WsTaskExecutorWidget.wsTaskService.checkItemTaskConfigurations(wsItem.getItemId(), new AsyncCallback<List<TaskConfiguration>>() {
@Override
public void onSuccess(List<TaskConfiguration> result) {
box.hide();
viewManager.showTaskConfigurationsFolderInfo(folder, result, taskEventsListeners);
viewManager.showTaskConfigurationsFolderInfo(wsItem, result, taskEventsListeners);
}
@Override
@ -184,7 +201,7 @@ public class WsTaskExecutorWidget {
if(caught instanceof ItemNotConfiguredException){
viewManager.showCreateTaskConfigurationForFolder(folder, null);
viewManager.showCreateTaskConfigurationForFolder(wsItem, null);
}else if(caught instanceof WorkspaceFolderLocked){
VerticalPanel v = new VerticalPanel();

View File

@ -4,7 +4,7 @@
package org.gcube.portlets.widgets.wstaskexecutor.client.event;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.google.gwt.event.shared.GwtEvent;
@ -21,18 +21,19 @@ public class CreateTaskConfigurationEvent extends GwtEvent<CreateTaskConfigurati
/** The type. */
public static Type<CreateTaskConfigurationEventHandler> TYPE = new Type<CreateTaskConfigurationEventHandler>();
private TaskConfiguration conf;
private WsFolder folder;
private WSItem wsItem;
private boolean isUpdate;
/**
* Instantiates a new creates the task configuration event.
*
* @param folder the folder
* @param wsItem the ws item
* @param conf the conf
* @param isUpdate the is update
*/
public CreateTaskConfigurationEvent(WsFolder folder, TaskConfiguration conf, boolean isUpdate) {
this.folder = folder;
public CreateTaskConfigurationEvent(WSItem wsItem, TaskConfiguration conf, boolean isUpdate) {
this.wsItem = wsItem;
this.conf = conf;
this.isUpdate = isUpdate;
@ -79,8 +80,8 @@ public class CreateTaskConfigurationEvent extends GwtEvent<CreateTaskConfigurati
*
* @return the folder
*/
public WsFolder getFolder() {
return folder;
public WSItem getWsItem() {
return wsItem;
}
}

View File

@ -4,7 +4,7 @@
package org.gcube.portlets.widgets.wstaskexecutor.client.event;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.google.gwt.event.shared.GwtEvent;
@ -20,7 +20,7 @@ public class PerformRunTaskEvent extends GwtEvent<PerformRunTaskEventHandler> {
/** The type. */
public static Type<PerformRunTaskEventHandler> TYPE = new Type<PerformRunTaskEventHandler>();
private TaskConfiguration conf;
private WsFolder folder;
private WSItem folder;
/**
@ -29,7 +29,7 @@ public class PerformRunTaskEvent extends GwtEvent<PerformRunTaskEventHandler> {
* @param folder the folder
* @param conf the conf
*/
public PerformRunTaskEvent(WsFolder folder, TaskConfiguration conf) {
public PerformRunTaskEvent(WSItem folder, TaskConfiguration conf) {
this.folder = folder;
this.conf = conf;
@ -67,7 +67,7 @@ public class PerformRunTaskEvent extends GwtEvent<PerformRunTaskEventHandler> {
*
* @return the folder
*/
public WsFolder getFolder() {
public WSItem getFolder() {
return folder;
}

View File

@ -0,0 +1,63 @@
/*
*
*/
package org.gcube.portlets.widgets.wstaskexecutor.client.event;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class CreateTaskConfigurationEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 9, 2018
*/
public class ShowCreateTaskConfigurationEvent extends GwtEvent<ShowCreateTaskConfigurationEventHandler> {
/** The type. */
public static Type<ShowCreateTaskConfigurationEventHandler> TYPE = new Type<ShowCreateTaskConfigurationEventHandler>();
private WSItem folder;
/**
* Instantiates a new creates the task configuration event.
*
* @param folder the folder
*/
public ShowCreateTaskConfigurationEvent(WSItem folder) {
this.folder = folder;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<ShowCreateTaskConfigurationEventHandler> getAssociatedType() {
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
*/
@Override
protected void dispatch(ShowCreateTaskConfigurationEventHandler handler) {
handler.onShowCreateConfiguration(this);
}
/* Gets the folder.
*
* @return the folder
*/
/**
* Gets the folder.
*
* @return the folder
*/
public WSItem getFolder() {
return folder;
}
}

View File

@ -0,0 +1,22 @@
package org.gcube.portlets.widgets.wstaskexecutor.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ShowCreateTaskConfigurationEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 9, 2018
*/
public interface ShowCreateTaskConfigurationEventHandler extends EventHandler {
/**
* On show create configuration.
*
* @param showCreateTaskConfigurationEvent the show create task configuration event
*/
void onShowCreateConfiguration(
ShowCreateTaskConfigurationEvent showCreateTaskConfigurationEvent);
}

View File

@ -10,11 +10,12 @@ import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskExecutionStatus;
import org.gcube.portlets.widgets.wstaskexecutor.client.TaskCompletedNotification.TaskCompletedNotificationListner;
import org.gcube.portlets.widgets.wstaskexecutor.client.WsTaskExecutorWidget;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.PerformRunTaskEvent;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.CreateTaskConfigurationEvent;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.binder.AbstractViewDialogBox;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.binder.CreateTaskConfigurationView;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.binder.MonitorFolderTaskExecutionStatusView;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.binder.ShowTaskConfigurationsView;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.github.gwtbootstrap.client.ui.Modal;
import com.google.gwt.core.shared.GWT;
@ -34,18 +35,17 @@ public class WsTaskExecutorWidgetViewManager {
private Map<String, MonitorFolderTaskExecutionStatusView> mapMonitor = new HashMap<String, MonitorFolderTaskExecutionStatusView>();
/**
* Cancel scheduler.
*
* @param folder the folder
* @param wsItem the ws item
* @return the monitor folder task execution status view
*/
private MonitorFolderTaskExecutionStatusView cancelScheduler(final WsFolder folder) {
private MonitorFolderTaskExecutionStatusView cancelScheduler(final WSItem wsItem) {
MonitorFolderTaskExecutionStatusView monitor = getMonitor(folder);
MonitorFolderTaskExecutionStatusView monitor = getMonitor(wsItem);
if(monitor.getSchedulerTime()!=null) {
GWT.log("Cancelling scheduler time on folder: "+folder.getFolderId());
GWT.log("Cancelling scheduler time on folder: "+wsItem.getItemId());
monitor.getSchedulerTime().cancel();
}
@ -53,20 +53,21 @@ public class WsTaskExecutorWidgetViewManager {
}
/**
* Cancel monitor.
*
* @param folder the folder
* @param wsItem the ws item
*/
public void cancelMonitor(WsFolder folder) {
public void cancelMonitor(WSItem wsItem) {
try {
MonitorFolderTaskExecutionStatusView monitor = cancelScheduler(folder);
MonitorFolderTaskExecutionStatusView monitor = cancelScheduler(wsItem);
if(monitor!=null) {
GWT.log("Removed monitor for folder: "+folder.getFolderId());
mapMonitor.remove(folder.getFolderId());
GWT.log("Removed monitor for folder: "+wsItem.getItemId());
mapMonitor.remove(wsItem.getItemId());
}
}catch (Exception e) {
GWT.log("Error on removing map monitor for id: "+folder.getFolderId());
GWT.log("Error on removing map monitor for id: "+wsItem.getItemId());
}
}
@ -74,26 +75,27 @@ public class WsTaskExecutorWidgetViewManager {
/**
* Gets the monitor.
*
* @param folder the folder
* @param wsItem the ws item
* @return the monitor
*/
public MonitorFolderTaskExecutionStatusView getMonitor(WsFolder folder){
public MonitorFolderTaskExecutionStatusView getMonitor(WSItem wsItem){
if(folder==null)
if(wsItem==null)
return null;
return mapMonitor.get(folder.getFolderId());
return mapMonitor.get(wsItem.getItemId());
}
/**
* Save monitor.
*
* @param folder the folder
* @param wsItem the ws item
* @param monitor the monitor
*/
private void saveMonitor(WsFolder folder, MonitorFolderTaskExecutionStatusView monitor) {
GWT.log("Saving monitor for folder: "+folder.getFolderId());
mapMonitor.put(folder.getFolderId(), monitor);
private void saveMonitor(WSItem wsItem, MonitorFolderTaskExecutionStatusView monitor) {
GWT.log("Saving monitor for folder: "+wsItem.getItemId());
mapMonitor.put(wsItem.getItemId(), monitor);
}
@ -108,14 +110,14 @@ public class WsTaskExecutorWidgetViewManager {
* @param taskEventsListeners the task events listeners
*/
public void showMonitorTaskStatusFor(
final WsFolder folder,
final WSItem folder,
final TaskConfiguration configuration, final TaskComputation taskComputation, final List<TaskCompletedNotificationListner> taskEventsListeners) {
GWT.log("showMonitorSyncToFolder for folder: "+folder.getFolderId());
GWT.log("showMonitorSyncToFolder for folder: "+folder.getItemId());
final Modal box = new Modal(true);
box.addStyleName("ws-thredds-modal-body");
box.setTitle("Monitor transferring of: "+FormatUtil.getFolderTitle(folder.getFoderName(), 20));
box.setTitle("Monitor transferring of: "+FormatUtil.getFolderTitle(folder.getItemName(), 20));
box.setWidth(800);
box.hide(false);
@ -223,29 +225,38 @@ public class WsTaskExecutorWidgetViewManager {
}
/**
* Show task configurations folder info.
*
* @param folder the folder
* @param result the result
* @param wsItem the ws item
* @param listTaskConfigurations the list task configurations
* @param taskEventsListeners the task events listeners
*/
public void showTaskConfigurationsFolderInfo(WsFolder folder, final List<TaskConfiguration> result, final List<TaskCompletedNotificationListner> taskEventsListeners) {
}
public void showTaskConfigurationsFolderInfo(WSItem wsItem, final List<TaskConfiguration> listTaskConfigurations, final List<TaskCompletedNotificationListner> taskEventsListeners) {
final Modal box = new Modal(true);
//box.setWidth(AbstractViewDialogBox.DEFAULT_WIDTH+20+"px");
box.setTitle("Task Configuration created for: "+FormatUtil.getFolderTitle(wsItem.getItemName(), 20));
box.addStyleName("ws-task-modal-body");
box.setWidth(AbstractViewDialogBox.DEFAULT_WIDTH+50);
ShowTaskConfigurationsView panelConfigs = new ShowTaskConfigurationsView(wsItem, listTaskConfigurations);
box.add(panelConfigs);
box.show();
}
/**
* Show create task configuration for folder.
*
* @param folder the folder
* @param wsItem the ws item
* @param conf the conf
*/
public void showCreateTaskConfigurationForFolder(final WsFolder folder, TaskConfiguration conf){
public void showCreateTaskConfigurationForFolder(final WSItem wsItem, TaskConfiguration conf){
final Modal box = new Modal(true);
//box.setWidth(AbstractViewDialogBox.DEFAULT_WIDTH+20+"px");
box.setTitle("Create Task Configuration for: "+FormatUtil.getFolderTitle(folder.getFoderName(), 20));
box.setTitle("Create Task Configuration for: "+FormatUtil.getFolderTitle(wsItem.getItemName(), 20));
box.addStyleName("ws-task-modal-body");
box.setWidth(AbstractViewDialogBox.DEFAULT_WIDTH+50);
//box.getElement().getStyle().setZIndex(10000);
@ -271,7 +282,7 @@ public class WsTaskExecutorWidgetViewManager {
}
};
CreateTaskConfigurationView createTaskConfiguration = new CreateTaskConfigurationView(folder) {
CreateTaskConfigurationView createTaskConfiguration = new CreateTaskConfigurationView(wsItem) {
@Override
public void submitHandler() {
@ -279,11 +290,11 @@ public class WsTaskExecutorWidgetViewManager {
TaskConfiguration conf = new TaskConfiguration();
conf.setScope(getSelectedScope().getScopeName());
conf.setTaskId(getTaskId());
conf.setTaskDescription("");
conf.setWorkspaceItemId(folder.getFolderId());
conf.setTaskDescription(getDescription());
conf.setWorkspaceItemId(wsItem.getItemId());
conf.setListParameters(getParameters());
WsTaskExecutorWidget.eventBus.fireEvent(new PerformRunTaskEvent(folder, conf));
WsTaskExecutorWidget.eventBus.fireEvent(new CreateTaskConfigurationEvent(wsItem, conf, false));
}
@Override

View File

@ -13,7 +13,7 @@ import org.gcube.portlets.widgets.wstaskexecutor.client.event.DeleteCustomFieldE
import org.gcube.portlets.widgets.wstaskexecutor.client.event.DeleteCustomFieldEventHandler;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.FormatUtil;
import org.gcube.portlets.widgets.wstaskexecutor.shared.GcubeScope;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ControlGroup;
@ -21,6 +21,7 @@ import com.github.gwtbootstrap.client.ui.Controls;
import com.github.gwtbootstrap.client.ui.Fieldset;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.Pager;
import com.github.gwtbootstrap.client.ui.TextArea;
import com.github.gwtbootstrap.client.ui.TextBox;
import com.github.gwtbootstrap.client.ui.constants.ControlGroupType;
import com.google.gwt.core.client.GWT;
@ -92,6 +93,9 @@ public abstract class CreateTaskConfigurationView extends Composite {
@UiField
HTMLPanel html_panel_field;
@UiField
TextArea field_task_description;
/** The map VR es. */
private Map<String, GcubeScope> mapScopes = new HashMap<String, GcubeScope>();
@ -104,7 +108,7 @@ public abstract class CreateTaskConfigurationView extends Composite {
private List<CustomFieldEntry> customFieldEntriesList = new ArrayList<CustomFieldEntry>();
private WsFolder folder;
private WSItem folder;
/**
* Submit handler.
@ -143,7 +147,7 @@ public abstract class CreateTaskConfigurationView extends Composite {
*
* @param folder the folder
*/
public CreateTaskConfigurationView(WsFolder folder) {
public CreateTaskConfigurationView(WSItem folder) {
this.folder = folder;
initWidget(uiBinder.createAndBindUi(this));
@ -193,13 +197,14 @@ public abstract class CreateTaskConfigurationView extends Composite {
}
});
CustomFieldEntry customFieldEntry;
if(folder.getPublicLink()!=null){
customFieldEntry = new CustomFieldEntry(eventBus, "publicLink", folder.getPublicLink(), "FILE");
customFieldEntriesList.add(customFieldEntry);
cg_parameters_control.add(customFieldEntry);
}else
addCustomFieldEvent(null);
// CustomFieldEntry customFieldEntry;
// if(folder.getPublicLink()!=null){
// customFieldEntry = new CustomFieldEntry(eventBus, "publicLink", folder.getPublicLink(), "FILE");
// customFieldEntry.setEnableValue(false);
// customFieldEntriesList.add(customFieldEntry);
// cg_parameters_control.add(customFieldEntry);
// }else
addCustomFieldEvent(null);
}
@ -308,4 +313,13 @@ public abstract class CreateTaskConfigurationView extends Composite {
return listParameters;
}
/**
* Gets the description.
*
* @return the description
*/
public String getDescription(){
return field_task_description.getValue();
}
}

View File

@ -28,6 +28,14 @@
ui:field="field_task_id" addStyleNames="my-external-input-width"></b:TextBox>
</b:Controls>
</b:ControlGroup>
<b:ControlGroup ui:field="cg_input_task_descritption">
<b:ControlLabel for="cl_input_task_descritption">Description</b:ControlLabel>
<b:Controls>
<b:TextArea placeholder="Type the Task Description..."
title="This is the Task Description..." b:id="field_task_description"
ui:field="field_task_description" addStyleNames="my-external-input-width"></b:TextArea>
</b:Controls>
</b:ControlGroup>
<b:ControlGroup ui:field="cg_parameters_control">
<b:Controls ui:field="task_parameters_control">
</b:Controls>
@ -40,7 +48,7 @@
</b:Fieldset>
</b:Form>
</g:HTMLPanel>
<b:Pager left="Older" right="Create Configuration"
aligned="true" ui:field="pager" />
<b:Pager left="Older" right="Create Configuration" aligned="true"
ui:field="pager" />
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -70,7 +70,7 @@ public class CustomFieldEntry extends Composite {
* @param eventBus the event bus
* @param key the key
* @param value the value
* @param isCustomCreatedByUser the is custom created by user
* @param parameterType the parameter type
*/
public CustomFieldEntry(HandlerManager eventBus, String key, String value, final String parameterType) {
initWidget(uiBinder.createAndBindUi(this));
@ -96,15 +96,6 @@ public class CustomFieldEntry extends Composite {
((TextBox)this.valueFieldPrepend.getWidget(1)).setText(value);
}
//this.isCustomCreatedByUser = isCustomCreatedByUser;
// remove the first appendbox
// if(!isCustomCreatedByUser){
// this.valueFieldPrepend.removeFromParent();
// this.keyFieldPrepend.setPrependText(key + ":");
// ((TextBox)this.keyFieldPrepend.getWidget(1)).setText(value);
// }
WsTaskExecutorWidget.wsTaskService.getAvailableParameterTypes(new AsyncCallback<List<TaskParameterType>>() {
@ -138,8 +129,19 @@ public class CustomFieldEntry extends Composite {
}
/**
* Sets the enable value.
*
* @param enabled the new enable value
*/
public void setEnableValue(boolean enabled){
((TextBox)this.valueFieldPrepend.getWidget(1)).setEnabled(enabled);
}
/**
* Gets the control group.
*
* @return the cg_parameter
*/
public ControlGroup getControlGroup() {

View File

@ -6,7 +6,7 @@ import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskComputation;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskExecutionStatus;
import org.gcube.portlets.widgets.wstaskexecutor.client.view.LoaderIcon;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WsFolder;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Form;
@ -93,7 +93,7 @@ public abstract class MonitorFolderTaskExecutionStatusView extends Composite {
@UiField
Form field_form;
private WsFolder folder;
private WSItem folder;
/** The scheduler time. */
@ -171,7 +171,7 @@ public abstract class MonitorFolderTaskExecutionStatusView extends Composite {
* @param folder the folder
* @param taskExecutionStatus the sync status
*/
public void updateStatusView(WsFolder folder, TaskExecutionStatus taskExecutionStatus) {
public void updateStatusView(WSItem folder, TaskExecutionStatus taskExecutionStatus) {
this.folder = folder;
field_loader.clear();

View File

@ -0,0 +1,133 @@
/**
*
*/
package org.gcube.portlets.widgets.wstaskexecutor.client.view.binder;
import java.util.List;
import org.gcube.common.workspacetaskexecutor.shared.dataminer.TaskConfiguration;
import org.gcube.portlets.widgets.wstaskexecutor.client.WsTaskExecutorWidget;
import org.gcube.portlets.widgets.wstaskexecutor.client.event.ShowCreateTaskConfigurationEvent;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* May 9, 2018
*/
public class ShowTaskConfigurationsView extends Composite {
private static ShowTaskConfigurationViewUiBinder uiBinder =
GWT.create(ShowTaskConfigurationViewUiBinder.class);
interface ShowTaskConfigurationViewUiBinder
extends UiBinder<Widget, ShowTaskConfigurationsView> {
}
@UiField
Button butt_CreateNewConfiguration;
@UiField
FlexTable flex_table_configurations;
private WSItem folder;
/**
* Because this class has a default constructor, it can
* be used as a binder template. In other words, it can be used in other
* *.ui.xml files as follows:
* <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
* xmlns:g="urn:import:**user's package**">
* <g:**UserClassName**>Hello!</g:**UserClassName>
* </ui:UiBinder>
* Note that depending on the widget that is used, it may be necessary to
* implement HasHTML instead of HasText.
*/
public ShowTaskConfigurationsView(WSItem folder, List<TaskConfiguration> listTaskConfigurations) {
this.folder = folder;
initWidget(uiBinder.createAndBindUi(this));
flex_table_configurations.setCellSpacing(4);
flex_table_configurations.getElement().getStyle().setMarginTop(10, Unit.PX);
flex_table_configurations.addStyleName("table-fixed");
//flex_table_configurations.setWidget(0, 0, new HTML("<b>Config Id<b>"));
flex_table_configurations.setWidget(0, 0, new HTML("<b>Algorithm Id<b>"));
flex_table_configurations.setWidget(0, 1, new HTML("<b>VRE<b>"));
flex_table_configurations.setWidget(0, 2, new HTML("<b>Owner<b>"));
flex_table_configurations.setWidget(0, 3, new HTML("<b>Oper.<b>"));
flex_table_configurations.setWidget(0, 4, new HTML("<b>Oper.<b>"));
//flex_table_configurations.getColumnFormatter().setWidth(0, "10%");
flex_table_configurations.getColumnFormatter().setWidth(0, "35%");
flex_table_configurations.getColumnFormatter().setWidth(1, "30%");
flex_table_configurations.getColumnFormatter().setWidth(2, "20%");
flex_table_configurations.getColumnFormatter().setWidth(3, "7%");
flex_table_configurations.getColumnFormatter().setWidth(4, "7%");
//flex_table_configurations.getColumnFormatter().setWidth(5, "7%");
// flt.setWidget(0, 1, new HTML("<b>Description<b>"));
for (int i = 0; i<listTaskConfigurations.size(); i++) {
final TaskConfiguration taskConfiguration = listTaskConfigurations.get(i);
//flex_table_configurations.setWidget(i+1, 0, new HTML(taskConfiguration.getConfigurationKey()));
flex_table_configurations.setWidget(i+1, 0, new HTML(taskConfiguration.getTaskId()));
flex_table_configurations.setWidget(i+1, 1, new HTML(taskConfiguration.getScope().substring(taskConfiguration.getScope().lastIndexOf("/")+1, taskConfiguration.getScope().length())));
flex_table_configurations.setWidget(i+1, 2, new HTML(taskConfiguration.getOwner()));
Button buttEdit = new Button();
buttEdit.setIcon(IconType.EDIT_SIGN);
//buttEdit.setType(ButtonType.LINK);
buttEdit.setTitle("Edit/Show the Configuration");
buttEdit.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
}
});
flex_table_configurations.setWidget(i+1, 3, buttEdit);
Button buttRemove = new Button();
buttRemove.setIcon(IconType.REMOVE_SIGN);
//buttRemove.setType(ButtonType.LINK);
buttRemove.setTitle("Delete the Configuration");
buttRemove.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
}
});
flex_table_configurations.setWidget(i+1, 4, buttRemove);
}
}
/**
* Adds the custom field event.
*
* @param e the e
*/
@UiHandler("butt_CreateNewConfiguration")
void addCustomFieldEvent(ClickEvent e){
WsTaskExecutorWidget.eventBus.fireEvent(new ShowCreateTaskConfigurationEvent(folder));
}
}

View File

@ -0,0 +1,13 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
</ui:style>
<g:HTMLPanel>
<g:FlexTable ui:field="flex_table_configurations">
</g:FlexTable>
<b:Button icon="PLUS_SIGN" title="Create New Configuration"
ui:field="butt_CreateNewConfiguration">Create New Configuration</b:Button>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -30,7 +30,7 @@
}
.my-input-width {
width: 300px !important;
width: 370px !important;
}
.my-prepend-width .add-on {
@ -39,13 +39,35 @@
}
.my-select-width {
width: 312px !important;
width: 382px !important;
}
.my-external-select-width {
width: 370px !important;
width: 440px !important;
}
.my-external-input-width {
width: 360px !important;
width: 430px !important;
}
table.table-fixed {
table-layout: fixed;
width: 100%;
text-align: center;
padding-top: 12px;
padding-bottom: 12px;
overflow-y: scroll;
}
table.table-fixed tr {
border-bottom: 1px solid #ccc;
text-align: center;
}
table.table-fixed td {
text-overflow: ellipsis;
white-space: nowrap;
border: 1px solid #ddd;
padding: 2px;
text-align: center;
}

View File

@ -0,0 +1,101 @@
package org.gcube.portlets.widgets.wstaskexecutor.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class WSItem.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 9, 2018
*/
public class WSItem implements Serializable, IsSerializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String itemId;
private String itemName;
/**
* Instantiates a new ws folder.
*/
public WSItem() {
}
/**
* Instantiates a new workspace file.
*
* @param itemId
* the item id
* @param itemName
* the item name
*/
public WSItem(String itemId, String itemName) {
this.itemId = itemId;
this.itemName = itemName;
}
/**
* Gets the item id.
*
* @return the itemId
*/
public String getItemId() {
return itemId;
}
/**
* Gets the item name.
*
* @return the itemName
*/
public String getItemName() {
return itemName;
}
/**
* Sets the item id.
*
* @param itemId
* the itemId to set
*/
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* Sets the item name.
*
* @param itemName
* the itemName to set
*/
public void setItemName(String itemName) {
this.itemName = itemName;
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("WorkspaceFile [itemId=");
builder.append(itemId);
builder.append(", itemName=");
builder.append(itemName);
builder.append("]");
return builder.toString();
}
}

View File

@ -1,119 +0,0 @@
package org.gcube.portlets.widgets.wstaskexecutor.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class WsFolder.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 8, 2018
*/
public class WsFolder implements Serializable, IsSerializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String folderId;
private String foderName;
private String publicLink;
/**
* Instantiates a new ws folder.
*/
public WsFolder() {
}
/**
* Instantiates a new ws folder.
*
* @param folderId the folder id
* @param foderName the foder name
* @param publicLink the public link
*/
public WsFolder(String folderId, String foderName, String publicLink) {
this.folderId = folderId;
this.foderName = foderName;
this.publicLink = publicLink;
}
/**
* Gets the folder id.
*
* @return the folder id
*/
public String getFolderId() {
return folderId;
}
/**
* Sets the folder id.
*
* @param folderId the new folder id
*/
public void setFolderId(String folderId) {
this.folderId = folderId;
}
/**
* Gets the foder name.
*
* @return the foder name
*/
public String getFoderName() {
return foderName;
}
/**
* Gets the public link.
*
* @return the public link
*/
public String getPublicLink() {
return publicLink;
}
/**
* Sets the foder name.
*
* @param foderName the new foder name
*/
public void setFoderName(String foderName) {
this.foderName = foderName;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("WsFolder [folderId=");
builder.append(folderId);
builder.append(", foderName=");
builder.append(foderName);
builder.append(", publicLink=");
builder.append(publicLink);
builder.append("]");
return builder.toString();
}
}