From 1607946a42e7d4b4331bc603a81bf275b9c6e324 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 31 Jul 2015 09:23:46 +0000 Subject: [PATCH] Updated pom at 6.9.0 Locked rename operation git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@117584 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 2 +- .../client/AppControllerExplorer.java | 43 +++---------------- .../client/view/windows/DialogText.java | 9 +--- 3 files changed, 8 insertions(+), 46 deletions(-) diff --git a/pom.xml b/pom.xml index d118a12..c6db7b0 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.portlets.user workspace-tree-widget - 6.8.0-SNAPSHOT + 6.9.0-SNAPSHOT gCube Workspace Tree Widget gCube Workspace Tree Widget. diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index c599dbf..7a7fd19 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -1090,9 +1090,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot(); } } - -// markItemInTreeAsRead(fileDownloadEvent.getItemIdentifier(), true); - notifySubscriber(fileDownloadEvent); } @@ -1120,14 +1117,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt } else fileUploader = new FileUploader(eventBus, folder, ConstantsExplorer.FILE); - -// new DialogUpload(ConstantsExplorer.FILEUPLOADHEADER, folder.getName(), folder, ConstantsExplorer.FILE); - -// if(fileUploadEvent.getUploadTypeToString().equals(UploadType.ARCHIVE.toString())) -// new DialogUpload(ConstantsExplorer.ARCHIVEUPLOADHEADER, folder.getName(), folder, ConstantsExplorer.ARCHIVE); -// else -// new DialogUpload(ConstantsExplorer.FILEUPLOADHEADER, folder.getName(), folder, ConstantsExplorer.FILE); - } }); @@ -1142,11 +1131,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt try { String normalizedFileName = fileName; - -// com.google.gwt.user.client.Window.alert("fileUploadField.getValue() "+fileUploadField.getValue()); if (normalizedFileName.contains("\\")) { normalizedFileName = normalizedFileName.substring(normalizedFileName.lastIndexOf("\\")+1); //remove C:\fakepath\ if exists -// com.google.gwt.user.client.Window.alert("normalizedFileName= "+normalizedFileName); } final String label = normalizedFileName; @@ -1159,22 +1145,16 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt public void onSuccess(final String itemId) { if(itemId!=null){ - boolean result = Window.confirm(label + " exists in folder "+fileUploader.getFolderParent().getName() + ". Overwrite?"); - if(result){ - fileUploader.overwrite(); fileUploader.submitForm(); } - }else fileUploader.submitForm(); //ITEM does NOT EXIST SO SUBMIT FORM; } - - @Override public void onFailure(Throwable caught) { Info.display("Error", "Sorry an error occurred on the server "+caught.getLocalizedMessage() + ". Please try again later"); @@ -1315,13 +1295,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onSuccess(SmartFolderModel smart) { - -// System.out.println("In client: " + smart.getIdentifier()); - explorerPanel.getShortuctsPanel().loadSmartFolder(smart); - } - }); } @@ -1366,14 +1341,13 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt final String newName = dgt.getTxtValue(); if(dgt.isValidForm()){ - + dgt.mask("Renaming..."); rpcWorkspaceService.renameItem(target.getIdentifier(), newName, target.getName(), new AsyncCallback(){ @Override public void onFailure(Throwable caught) { - - explorerPanel.getAsycTreePanel().unmask(); - + dgt.unmask(); + dgt.hide(); if(caught instanceof SessionExpiredException){ GWT.log("Session expired"); eventBus.fireEvent(new SessionExpiredEvent()); @@ -1387,13 +1361,12 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onSuccess(Boolean result) { + dgt.unmask(); + dgt.hide(); explorerPanel.getAsycTreePanel().renameItem(target.getIdentifier(), newName, null); event.setNewName(newName); - // event.setExtension(extension); notifySubscriber(event); - } - }); } } @@ -1636,8 +1609,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onClickPreview(ImagePreviewEvent imagePreviewEvent) { - // System.out.println("x e y " + imagePreviewEvent.getClientX() + " e " + imagePreviewEvent.getClientY()); - if(imagePreviewEvent.getClientX() > 0 && imagePreviewEvent.getClientY() > 0) doClickPreview(imagePreviewEvent, imagePreviewEvent.getClientX(), imagePreviewEvent.getClientY() ); else @@ -1807,10 +1778,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt private void doClickOpenReportTemplate(OpenReportsEvent openReportTemplateEvent) { - // System.out.println("IDTEMPLATE " + ConstantsExplorer.IDTEMPLATE); - // System.out.println("id " +openReportTemplateEvent.getSourceFileModel().getIdentifier()); - // System.out.println("name " +openReportTemplateEvent.getSourceFileModel().getName()); - rpcWorkspaceService.getURLFromApplicationProfile(openReportTemplateEvent.getSourceFileModel().getIdentifier(), new AsyncCallback() { @Override diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogText.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogText.java index a58fa9e..4113b81 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogText.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogText.java @@ -61,9 +61,8 @@ public class DialogText extends Dialog { @Override public void componentSelected(ButtonEvent ce) { - - if (isValidForm()) - hide(); +// if (isValidForm()) COMMENTED TO PREVENT BACK END EXCEPTION +// hide(); } }); @@ -72,16 +71,12 @@ public class DialogText extends Dialog { @Override public void componentSelected(ButtonEvent ce) { - hide(); } - }); setFocusWidget(txt); - add(txt); - this.show(); }