ref 9114: DataMiner - Add pagination to Workspace Explorer
https://support.d4science.org/issues/9114 Added pagination to Workspace Explorer git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@151145 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
79e0df3def
commit
70f484c387
|
@ -59,7 +59,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
//private WorkspaceResourcesExplorerPanel ;
|
||||
// private WorkspaceResourcesExplorerPanel ;
|
||||
private WorkspaceResourcesExplorerPanelPaginated wsResourcesExplorerPanel;
|
||||
private TextButton btnShow;
|
||||
private TextButton btnDownload;
|
||||
|
@ -94,15 +94,14 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private void bindToEvents() {
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE, new UIStateEvent.UIStateEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||
|
@ -115,19 +114,16 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
@Override
|
||||
public void onRefresh(RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -152,8 +148,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||
|
||||
Log.debug("ComputationsExecutedPanel recieved DataMinerWorkAreaEvent: "
|
||||
+ event);
|
||||
Log.debug("ComputationsExecutedPanel recieved DataMinerWorkAreaEvent: " + event);
|
||||
if (event == null) {
|
||||
Log.error("DataMinerWorkAreaEvent null");
|
||||
return;
|
||||
|
@ -183,10 +178,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
private void manageRefreshDataMinerWorkAreaEvents(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
Log.debug("ComputationsExecutedPanel recieved RefreshDataMinerWorkAreaEvent: "
|
||||
+ event);
|
||||
private void manageRefreshDataMinerWorkAreaEvents(RefreshDataMinerWorkAreaEvent event) {
|
||||
Log.debug("ComputationsExecutedPanel recieved RefreshDataMinerWorkAreaEvent: " + event);
|
||||
if (event == null) {
|
||||
Log.error("RefreshDataMinerWorkAreaEvent null");
|
||||
return;
|
||||
|
@ -206,17 +199,14 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void create(DataMinerWorkAreaEvent event) {
|
||||
Log.debug("Create ComputationsExecutedPanel");
|
||||
try {
|
||||
|
||||
if (event == null
|
||||
|| event.getDataMinerWorkArea() == null
|
||||
if (event == null || event.getDataMinerWorkArea() == null
|
||||
|| event.getDataMinerWorkArea().getComputations() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId().isEmpty()) {
|
||||
|| event.getDataMinerWorkArea().getComputations().getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getComputations().getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getComputations().getFolder().getId().isEmpty()) {
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
forceLayout();
|
||||
|
@ -226,23 +216,27 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
List<String> showProperties = new ArrayList<String>();
|
||||
for (ComputationsPropertiesType computationsProperties : ComputationsPropertiesType
|
||||
.values()) {
|
||||
for (ComputationsPropertiesType computationsProperties : ComputationsPropertiesType.values()) {
|
||||
showProperties.add(computationsProperties.getLabel());
|
||||
}
|
||||
FilterCriteria filterCriteria = new FilterCriteria();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
filterCriteria.setRequiredProperties(map);
|
||||
|
||||
/*wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||
event.getDataMinerWorkArea().getComputations().getFolder()
|
||||
.getId(), false, showProperties, filterCriteria,
|
||||
true, DISPLAY_FIELD.CREATION_DATE);*/
|
||||
|
||||
wsResourcesExplorerPanel=new WorkspaceResourcesExplorerPanelPaginated(event.getDataMinerWorkArea().getComputations().getFolder()
|
||||
.getId(), false, showProperties, filterCriteria,
|
||||
true, DISPLAY_FIELD.CREATION_DATE);
|
||||
|
||||
/*
|
||||
* wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||
* event.getDataMinerWorkArea().getComputations().getFolder()
|
||||
* .getId(), false, showProperties, filterCriteria, true,
|
||||
* DISPLAY_FIELD.CREATION_DATE);
|
||||
*/
|
||||
Log.debug("Create wsResourcesExplorerPanel for Computations: ["
|
||||
+ event.getDataMinerWorkArea().getComputations().getFolder().getId() + ", false, " + showProperties
|
||||
+ ", " + filterCriteria + ", true, " + DISPLAY_FIELD.CREATION_DATE + "]");
|
||||
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanelPaginated(
|
||||
event.getDataMinerWorkArea().getComputations().getFolder().getId(), false, showProperties,
|
||||
filterCriteria, true, DISPLAY_FIELD.CREATION_DATE);
|
||||
Log.debug("Created wsResourcesExplorerPanel");
|
||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||
@Override
|
||||
public void onSelectedItem(Item item) {
|
||||
|
@ -267,10 +261,10 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
selectedItem = null;
|
||||
}
|
||||
};
|
||||
|
||||
wsResourcesExplorerPanel
|
||||
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||
Log.debug("Add WorkspaceExplorerSelectNotificationListener");
|
||||
wsResourcesExplorerPanel.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanelComputaions");
|
||||
Log.debug("Set Height to internal SCROLL 300");
|
||||
wsResourcesExplorerPanel.setHeightToInternalScroll(300);
|
||||
|
||||
/*
|
||||
|
@ -280,18 +274,17 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
* vResourcesExplorerContainer.add(wsResourcesExplorerPanel, new
|
||||
* VerticalLayoutData(1, -1, new Margins(0)));
|
||||
*/
|
||||
Log.debug("Define DND for Computations");
|
||||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getComputations()
|
||||
.getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getComputations().getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.addUniqueContainer(wsResourcesExplorerPanel);
|
||||
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||
|
||||
@Override
|
||||
public void onUploadCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload completed: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload completed: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
|
||||
|
@ -299,22 +292,18 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onUploadAborted(String parentId, String itemId) {
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String parentId, String itemId,
|
||||
Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
public void onError(String parentId, String itemId, Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload Override Completed: [parentID: "
|
||||
+ parentId + ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload Override Completed: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
}
|
||||
|
@ -425,11 +414,9 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onResize(ResizeEvent event) {
|
||||
int scrollBarHeight = event.getHeight()
|
||||
- toolBar.getElement().getHeight(false);
|
||||
int scrollBarHeight = event.getHeight() - toolBar.getElement().getHeight(false);
|
||||
Log.debug("ScrollBarHeight: " + scrollBarHeight);
|
||||
wsResourcesExplorerPanel
|
||||
.setHeightToInternalScroll(scrollBarHeight);
|
||||
wsResourcesExplorerPanel.setHeightToInternalScroll(scrollBarHeight);
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
@ -437,7 +424,7 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
forceLayout();
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error opening wsResourceExplorerPanel: "+e.getLocalizedMessage(),e);
|
||||
Log.error("Error opening wsResourceExplorerPanel: " + e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -447,8 +434,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
try {
|
||||
wsResourcesExplorerPanel.hardRefresh();
|
||||
} catch (Exception e) {
|
||||
Log.error("Error retrieving data: "+e.getLocalizedMessage());
|
||||
|
||||
Log.error("Error retrieving data: " + e.getLocalizedMessage());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -470,12 +457,10 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void deleteItem(SelectEvent event) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.Computations, itemDescription);
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(DataMinerWorkAreaElementType.Computations,
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
}
|
||||
|
@ -483,13 +468,10 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
private void showComputation() {
|
||||
if (selectedItem != null) {
|
||||
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
final ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
|
||||
ComputationDataRequestEvent event = new ComputationDataRequestEvent(
|
||||
itemDescription);
|
||||
ComputationDataRequestEvent event = new ComputationDataRequestEvent(itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(event);
|
||||
|
||||
} else {
|
||||
|
@ -503,53 +485,41 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
if (selectedItem.isFolder()) {
|
||||
StringBuilder actionUrl = new StringBuilder();
|
||||
actionUrl.append(GWT.getModuleBaseURL());
|
||||
actionUrl
|
||||
.append(Constants.DOWNLOAD_FOLDER_SERVLET
|
||||
+ "?"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_ITEM_ID_PARAMETER
|
||||
+ "="
|
||||
+ selectedItem.getId()
|
||||
+ "&"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_FOLDER_NAME_PARAMETER
|
||||
+ "=" + selectedItem.getName() + "&"
|
||||
+ Constants.CURR_GROUP_ID + "="
|
||||
+ GCubeClientContext.getCurrentContextId());
|
||||
actionUrl.append(Constants.DOWNLOAD_FOLDER_SERVLET + "?"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_ITEM_ID_PARAMETER + "=" + selectedItem.getId() + "&"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_FOLDER_NAME_PARAMETER + "=" + selectedItem.getName() + "&"
|
||||
+ Constants.CURR_GROUP_ID + "=" + GCubeClientContext.getCurrentContextId());
|
||||
|
||||
Log.debug("Retrieved link: " + actionUrl);
|
||||
Window.open(actionUrl.toString(), selectedItem.getName(), "");
|
||||
|
||||
} else {
|
||||
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
final ItemDescription itemDescription = new ItemDescription(selectedItem.getId(),
|
||||
selectedItem.getName(), selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
|
||||
itemDescription, new AsyncCallback<String>() {
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(itemDescription, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof SessionExpiredServiceException) {
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof SessionExpiredServiceException) {
|
||||
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: " + caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error", caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a file!");
|
||||
|
@ -559,10 +529,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private void cancelComputation() {
|
||||
if (selectedItem != null) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
CancelExecutionFromComputationsRequestEvent cancelComputationEvent = new CancelExecutionFromComputationsRequestEvent(
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(cancelComputationEvent);
|
||||
|
@ -574,10 +542,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private void resubmitComputation() {
|
||||
if (selectedItem != null) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
ResubmitComputationExecutionRequestEvent resubmitComputationEvent = new ResubmitComputationExecutionRequestEvent(
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(resubmitComputationEvent);
|
||||
|
|
|
@ -190,6 +190,7 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void create(DataMinerWorkAreaEvent event) {
|
||||
Log.debug("Create InputDataSetsPanel");
|
||||
try {
|
||||
|
||||
if (event == null || event.getDataMinerWorkArea() == null
|
||||
|
@ -213,6 +214,10 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
Map<String, String> map = new HashMap<String, String>();
|
||||
filterCriteria.setRequiredProperties(map);
|
||||
|
||||
Log.debug("Create wsResourcesExplorerPanel for Input: ["
|
||||
+ event.getDataMinerWorkArea().getInputDataSets().getFolder().getId() + ", false, "
|
||||
+ showProperties+", "+ filterCriteria + ", true, " + DISPLAY_FIELD.CREATION_DATE + "]");
|
||||
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanelPaginated(
|
||||
event.getDataMinerWorkArea().getInputDataSets().getFolder().getId(), false, showProperties,
|
||||
filterCriteria, true, DISPLAY_FIELD.CREATION_DATE);
|
||||
|
@ -242,9 +247,11 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
};
|
||||
|
||||
wsResourcesExplorerPanel.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanelForInput");
|
||||
wsResourcesExplorerPanel.setHeightToInternalScroll(300);
|
||||
|
||||
Log.debug("Define DND for InputDataSetsPanel");
|
||||
|
||||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
|
@ -350,7 +357,7 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
forceLayout();
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error opening wsResourceExplorerPanel: "+e.getLocalizedMessage(),e);
|
||||
Log.error("Error opening wsResourceExplorerPanel: " + e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -384,12 +391,18 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void deleteItem(SelectEvent event) {
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(DataMinerWorkAreaElementType.InputDataSets,
|
||||
itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
Log.debug("Selected Item: " + selectedItem);
|
||||
if (selectedItem != null) {
|
||||
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.InputDataSets, itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a item!");
|
||||
}
|
||||
}
|
||||
|
||||
private void downloadFile() {
|
||||
|
|
|
@ -86,15 +86,14 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
private void bindToEvents() {
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE, new UIStateEvent.UIStateEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
@Override
|
||||
public void onChange(UIStateEvent event) {
|
||||
manageStateEvents(event);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||
|
@ -107,19 +106,16 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
});
|
||||
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(RefreshDataMinerWorkAreaEvent.TYPE,
|
||||
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onRefresh(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
@Override
|
||||
public void onRefresh(RefreshDataMinerWorkAreaEvent event) {
|
||||
manageRefreshDataMinerWorkAreaEvents(event);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -142,8 +138,7 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||
Log.debug("OutputDataSetsPanel recieved DataMinerWorkAreaEvent: "
|
||||
+ event);
|
||||
Log.debug("OutputDataSetsPanel recieved DataMinerWorkAreaEvent: " + event);
|
||||
if (event == null) {
|
||||
Log.error("DataMinerWorkAreaEvent");
|
||||
return;
|
||||
|
@ -172,10 +167,8 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
private void manageRefreshDataMinerWorkAreaEvents(
|
||||
RefreshDataMinerWorkAreaEvent event) {
|
||||
Log.debug("OutputDataSetsPanel recieved RefreshDataMinerWorkAreaEvent: "
|
||||
+ event);
|
||||
private void manageRefreshDataMinerWorkAreaEvents(RefreshDataMinerWorkAreaEvent event) {
|
||||
Log.debug("OutputDataSetsPanel recieved RefreshDataMinerWorkAreaEvent: " + event);
|
||||
if (event == null) {
|
||||
Log.error("RefreshDataMinerWorkAreaEvent");
|
||||
return;
|
||||
|
@ -195,17 +188,14 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void create(DataMinerWorkAreaEvent event) {
|
||||
Log.debug("Create OutputDataSetsPanel");
|
||||
try {
|
||||
|
||||
if (event == null
|
||||
|| event.getDataMinerWorkArea() == null
|
||||
if (event == null || event.getDataMinerWorkArea() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets()
|
||||
.getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets()
|
||||
.getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets()
|
||||
.getFolder().getId().isEmpty()) {
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets().getFolder() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets().getFolder().getId() == null
|
||||
|| event.getDataMinerWorkArea().getOutputDataSets().getFolder().getId().isEmpty()) {
|
||||
if (v != null) {
|
||||
remove(v);
|
||||
forceLayout();
|
||||
|
@ -215,17 +205,18 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
List<String> showProperties = new ArrayList<String>();
|
||||
for (DataSpacePropertiesType dataSpaceProperties : DataSpacePropertiesType
|
||||
.values()) {
|
||||
for (DataSpacePropertiesType dataSpaceProperties : DataSpacePropertiesType.values()) {
|
||||
showProperties.add(dataSpaceProperties.getLabel());
|
||||
}
|
||||
FilterCriteria filterCriteria = new FilterCriteria();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
filterCriteria.setRequiredProperties(map);
|
||||
|
||||
Log.debug("Create wsResourcesExplorerPanel for Output: ["
|
||||
+ event.getDataMinerWorkArea().getOutputDataSets().getFolder().getId() + ", false, "
|
||||
+ showProperties + ", " + filterCriteria + ", true, " + DISPLAY_FIELD.CREATION_DATE + "]");
|
||||
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanelPaginated(
|
||||
event.getDataMinerWorkArea().getOutputDataSets()
|
||||
.getFolder().getId(), false, showProperties,
|
||||
event.getDataMinerWorkArea().getOutputDataSets().getFolder().getId(), false, showProperties,
|
||||
filterCriteria, true, DISPLAY_FIELD.CREATION_DATE);
|
||||
|
||||
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||
|
@ -253,23 +244,22 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
};
|
||||
|
||||
wsResourcesExplorerPanel
|
||||
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||
wsResourcesExplorerPanel.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanelForOutput");
|
||||
wsResourcesExplorerPanel.setHeightToInternalScroll(300);
|
||||
|
||||
Log.debug("Define DND for InputDataSetsPanel");
|
||||
|
||||
// DND
|
||||
|
||||
dnd = new MultipleDNDUpload();
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getOutputDataSets()
|
||||
.getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.setParameters(event.getDataMinerWorkArea().getOutputDataSets().getFolder().getId(), UPLOAD_TYPE.File);
|
||||
dnd.addUniqueContainer(wsResourcesExplorerPanel);
|
||||
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||
|
||||
@Override
|
||||
public void onUploadCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload completed: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload completed: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
|
||||
|
@ -277,22 +267,18 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onUploadAborted(String parentId, String itemId) {
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload Aborted: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String parentId, String itemId,
|
||||
Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId
|
||||
+ ", itemId: " + itemId + "]");
|
||||
public void onError(String parentId, String itemId, Throwable throwable) {
|
||||
Log.debug("Upload Error: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||
Log.debug("Upload Override Completed: [parentID: "
|
||||
+ parentId + ", itemId: " + itemId + "]");
|
||||
Log.debug("Upload Override Completed: [parentID: " + parentId + ", itemId: " + itemId + "]");
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
forceLayout();
|
||||
}
|
||||
|
@ -358,11 +344,9 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onResize(ResizeEvent event) {
|
||||
int scrollBarHeight = event.getHeight()
|
||||
- toolBar.getElement().getHeight(false);
|
||||
int scrollBarHeight = event.getHeight() - toolBar.getElement().getHeight(false);
|
||||
Log.debug("ScrollBarHeight: " + scrollBarHeight);
|
||||
wsResourcesExplorerPanel
|
||||
.setHeightToInternalScroll(scrollBarHeight);
|
||||
wsResourcesExplorerPanel.setHeightToInternalScroll(scrollBarHeight);
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
@ -370,7 +354,7 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
forceLayout();
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error opening wsResourceExplorerPanel: "+e.getLocalizedMessage(),e);
|
||||
Log.error("Error opening wsResourceExplorerPanel: " + e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -398,21 +382,24 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in OutputDataSetsPanel: "
|
||||
+ e.getLocalizedMessage());
|
||||
Log.error("Error in OutputDataSetsPanel: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteItem(SelectEvent event) {
|
||||
ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||
.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.OutputDataSets, itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
Log.debug("Selected Item: " + selectedItem);
|
||||
if (selectedItem != null) {
|
||||
|
||||
ItemDescription itemDescription = new ItemDescription(selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(), selectedItem.getType().name());
|
||||
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||
DataMinerWorkAreaElementType.OutputDataSets, itemDescription);
|
||||
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||
Log.debug("Fired: " + deleteItemEvent);
|
||||
} else {
|
||||
UtilsGXT3.info("Attention", "Select a item!");
|
||||
}
|
||||
}
|
||||
|
||||
private void downloadFile() {
|
||||
|
@ -420,51 +407,39 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
if (selectedItem.isFolder()) {
|
||||
StringBuilder actionUrl = new StringBuilder();
|
||||
actionUrl.append(GWT.getModuleBaseURL());
|
||||
actionUrl
|
||||
.append(Constants.DOWNLOAD_FOLDER_SERVLET
|
||||
+ "?"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_ITEM_ID_PARAMETER
|
||||
+ "="
|
||||
+ selectedItem.getId()
|
||||
+ "&"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_FOLDER_NAME_PARAMETER
|
||||
+ "=" + selectedItem.getName() + "&"
|
||||
+ Constants.CURR_GROUP_ID + "="
|
||||
+ GCubeClientContext.getCurrentContextId());
|
||||
actionUrl.append(Constants.DOWNLOAD_FOLDER_SERVLET + "?"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_ITEM_ID_PARAMETER + "=" + selectedItem.getId() + "&"
|
||||
+ Constants.DOWNLOAD_FOLDER_SERVLET_FOLDER_NAME_PARAMETER + "=" + selectedItem.getName() + "&"
|
||||
+ Constants.CURR_GROUP_ID + "=" + GCubeClientContext.getCurrentContextId());
|
||||
|
||||
Log.debug("Retrieved link: " + actionUrl);
|
||||
Window.open(actionUrl.toString(), selectedItem.getName(), "");
|
||||
} else {
|
||||
final ItemDescription itemDescription = new ItemDescription(
|
||||
selectedItem.getId(), selectedItem.getName(),
|
||||
selectedItem.getOwner(), selectedItem.getPath(),
|
||||
final ItemDescription itemDescription = new ItemDescription(selectedItem.getId(),
|
||||
selectedItem.getName(), selectedItem.getOwner(), selectedItem.getPath(),
|
||||
selectedItem.getType().name());
|
||||
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
|
||||
itemDescription, new AsyncCallback<String>() {
|
||||
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(itemDescription, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof SessionExpiredServiceException) {
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: "
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof SessionExpiredServiceException) {
|
||||
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
|
||||
} else {
|
||||
Log.error("Error open file: " + caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error", caught.getLocalizedMessage());
|
||||
}
|
||||
caught.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(String link) {
|
||||
Log.debug("Retrieved link: " + link);
|
||||
Window.open(link, itemDescription.getName(), "");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -31,17 +31,17 @@
|
|||
|
||||
<entry-point
|
||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||
<!--
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||
/> -->
|
||||
/>
|
||||
|
||||
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" /> -->
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ package org.gcube.portlets.user.dataminermanager.shared;
|
|||
*
|
||||
*/
|
||||
public class Constants {
|
||||
public static final boolean DEBUG_MODE = false;
|
||||
public static final boolean DEBUG_MODE = true;
|
||||
public static final boolean TEST_ENABLE = false;
|
||||
|
||||
public static final String APPLICATION_ID = "org.gcube.portlets.user.dataminermanager.portlet.DataMinerManager";
|
||||
|
|
|
@ -31,17 +31,18 @@
|
|||
|
||||
<entry-point
|
||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||
<!--
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||
/> -->
|
||||
/>
|
||||
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
|
||||
-->
|
||||
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
|
Loading…
Reference in New Issue