refactor and updated log
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@120193 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
84526b1536
commit
4cb3b6d3e0
|
@ -20,7 +20,7 @@ import com.google.gwt.event.shared.HandlerManager;
|
|||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Oct 5, 2015
|
||||
*/
|
||||
public class WorkspaceExplorerListenerController {
|
||||
public class WorkspaceUploaderListenerController {
|
||||
|
||||
private static HandlerManager controllerEventBus = null;
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class WorkspaceExplorerListenerController {
|
|||
/**
|
||||
* Instantiates a new workspace explorer listener controller.
|
||||
*/
|
||||
public WorkspaceExplorerListenerController(){
|
||||
public WorkspaceUploaderListenerController(){
|
||||
controllerEventBus = new HandlerManager(null);
|
||||
bindEvents();
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class WorkspaceExplorerListenerController {
|
|||
* @param itemId the item id
|
||||
*/
|
||||
private void notifyUploadCompleted(String parentId, String itemId){
|
||||
listnersSize();
|
||||
listenersSize();
|
||||
for (WorskpaceUploadNotificationListener listener : listenersUpload) {
|
||||
listener.onUploadCompleted(parentId, itemId);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class WorkspaceExplorerListenerController {
|
|||
}
|
||||
}
|
||||
|
||||
private int listnersSize(){
|
||||
private int listenersSize(){
|
||||
GWT.log("listenersUpload.size() "+listenersUpload.size());
|
||||
return listenersUpload.size();
|
||||
}
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.widgets.workspaceuploader.client.ClosableDialog;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.ConstantsWorkspaceUploader;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.DialogResult;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceExplorerListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.HasWorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderServiceAsync;
|
||||
|
@ -51,7 +51,7 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
|
|||
protected FileUpload fileUpload;
|
||||
protected Hidden jsonClientKeys;
|
||||
protected List<WorkspaceUploaderItem> fakeUploaders = new ArrayList<WorkspaceUploaderItem>();
|
||||
protected WorkspaceExplorerListenerController controller = new WorkspaceExplorerListenerController();
|
||||
protected WorkspaceUploaderListenerController controller = new WorkspaceUploaderListenerController();
|
||||
|
||||
/**
|
||||
* The Enum UPLOAD_TYPE.
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Map;
|
|||
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.ClosableDialog;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.ConstantsWorkspaceUploader;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceExplorerListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderServiceAsync;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.events.CancelUploadEvent;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.events.CancelUploadEventHandler;
|
||||
|
@ -235,7 +235,7 @@ public class UploaderMonitor {
|
|||
*/
|
||||
private void notifyOverwriteCompleted(String parentId, String itemId){
|
||||
GWT.log("notifyOverwriteCompleted in monitor");
|
||||
WorkspaceExplorerListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.OVERWRITE_COMPLETED, parentId, itemId));
|
||||
WorkspaceUploaderListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.OVERWRITE_COMPLETED, parentId, itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -246,7 +246,7 @@ public class UploaderMonitor {
|
|||
*/
|
||||
private void notifyUploadCompleted(String parentId, String itemId){
|
||||
GWT.log("notifyUploadCompleted in monitor");
|
||||
WorkspaceExplorerListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.UPLOAD_COMPLETED, parentId, itemId));
|
||||
WorkspaceUploaderListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.UPLOAD_COMPLETED, parentId, itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -256,7 +256,7 @@ public class UploaderMonitor {
|
|||
* @param itemId the item id
|
||||
*/
|
||||
private void notifyUploadAborted(String parentId, String itemId){
|
||||
WorkspaceExplorerListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.ABORTED, parentId, itemId));
|
||||
WorkspaceUploaderListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.ABORTED, parentId, itemId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -267,6 +267,6 @@ public class UploaderMonitor {
|
|||
* @param t the t
|
||||
*/
|
||||
private void notifyUploadError(String parentId, String itemId, Throwable t){
|
||||
WorkspaceExplorerListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.FAILED, parentId, itemId, t));
|
||||
WorkspaceUploaderListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.FAILED, parentId, itemId, t));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.ConstantsWorkspaceUploader;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceExplorerListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderListenerController;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.HasWorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
|
||||
|
@ -40,7 +40,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
|||
|
||||
private Map<String, WorkspaceFieldsUploadManager> fields = new HashMap<String, WorkspaceFieldsUploadManager>();
|
||||
private Map<String, String> jsonKeys = new HashMap<String, String>();
|
||||
protected WorkspaceExplorerListenerController controller = new WorkspaceExplorerListenerController();
|
||||
protected WorkspaceUploaderListenerController controller = new WorkspaceUploaderListenerController();
|
||||
|
||||
private String currentJsonKey;
|
||||
private boolean isLimitExceeded;
|
||||
|
|
|
@ -81,7 +81,7 @@ public class WorkspaceUploaderMng {
|
|||
|
||||
if(createdItem!=null){
|
||||
WorkspaceUploadServletStream.printElapsedTime(startTime);
|
||||
logger.debug("HL file "+createdItem.getName() + " uploaded correctly in "+destinationFolder.getPath());
|
||||
logger.debug("HL file: "+createdItem.getName() + " with id: "+createdItem.getId() + " uploaded correctly in "+destinationFolder.getPath());
|
||||
workspaceUploader.setUploadStatus(UPLOAD_STATUS.COMPLETED);
|
||||
workspaceUploader.setStatusDescription("File \""+createdItem.getName()+"\" uploaded correctly in "+destinationFolder.getPath());
|
||||
workspaceUploader.getFile().setItemId(createdItem.getId()); //SET HL ID
|
||||
|
|
Loading…
Reference in New Issue