diff --git a/CHANGELOG.md b/CHANGELOG.md index dcaf38c..f2196c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,17 +4,18 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [v6.31.0] [r4.25.0] - 2020-07-08 +## [v6.31.0] [r4.25.0] - 2020-07-16 #### Enhancements [#19600] revisit the "Get Info" Dialog in a modern view + ## [v6.30.1] [r4.24.0] - 2020-06-25 #### Fixes -[Task #19544] update the unsharing messages in the accounting history +[#19544] update the unsharing messages in the accounting history ## [v6.30.0] [r4.23.0] - 2020-05-18 diff --git a/pom.xml b/pom.xml index 30222f5..01b5b5a 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.gcube.common storagehub-client-wrapper - [0.6.2, 1.0.0-SNAPSHOT) + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) compile diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java index 7ea5780..0c7d432 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java @@ -28,6 +28,7 @@ import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; +// TODO: Auto-generated Javadoc /** * The Interface GWTWorkspaceService. * @@ -676,4 +677,15 @@ public interface GWTWorkspaceService extends RemoteService { */ FileModel getItemForFileTree(String itemId) throws Exception; + + /** + * Update description for item. + * + * @param itemId the item id + * @param newDescription the new description + * @return the description updated on the server + * @throws Exception the exception + */ + String updateDescriptionForItem(String itemId, String newDescription) throws Exception; + } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java index f040300..93f1296 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java @@ -612,5 +612,15 @@ public interface GWTWorkspaceServiceAsync { * @return the link for send to switch board */ void getLinkForSendToSwitchBoard(String itemId, AsyncCallback callback); + + + /** + * Update description for item. + * + * @param itemId the item id + * @param newDescription the new description + * @param callback the callback + */ + void updateDescriptionForItem(String itemId, String newDescription, AsyncCallback callback); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java index 0a9c321..7eedce6 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java @@ -304,21 +304,6 @@ public class DialogGetInfoBootstrap extends Composite { } }); -// txtAreaDescription.addKeyPressHandler(new KeyPressHandler() { -// -// @Override -// public void onKeyPress(KeyPressEvent event) { -// -// GWT.log(event.getUnicodeCharCode() + ""); -// -// if (event.getUnicodeCharCode() == 13) { -// txtAreaDescription.setReadOnly(true); -// Window.alert("Updating description"); -// } -// -// } -// }); - buttonUpdateDescription.addClickHandler(new ClickHandler() { @Override @@ -335,7 +320,20 @@ public class DialogGetInfoBootstrap extends Composite { public void onClick(ClickEvent event) { buttonSaveDescription.setVisible(false); txtAreaDescription.setReadOnly(true); - Window.alert("To be implemented"); + + AppControllerExplorer.rpcWorkspaceService.updateDescriptionForItem(fileModel.getIdentifier(), txtAreaDescription.getValue(), new AsyncCallback() { + + @Override + public void onFailure(Throwable caught) { + new MessageBoxAlert("Error on updating description...", caught.getMessage(), null); + } + + @Override + public void onSuccess(String result) { + GWT.log("Updated the description as: "+result); + txtAreaDescription.setValue(result); + } + }); } }); diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java index c4be0d8..2ccf2a7 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java @@ -3075,5 +3075,30 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT throw new Exception(error); } } + + + @Override + public String updateDescriptionForItem(String itemId, String newDescription) throws Exception { + workspaceLogger.info("Called updateDescriptionForItem for itemID: " + itemId); + + if (itemId == null || itemId.isEmpty()) + throw new Exception("I can't update the description, the itemId is null"); + + workspaceLogger.debug("New description is: " + newDescription); + + try { + + org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace = getWorkspaceFromStorageHub(); + newDescription = workspace.updateDescriptionForItem(itemId, newDescription); + + } catch (Exception e) { + workspaceLogger.error("Error on updating the description for item: " + itemId, e); + String error = ConstantsExplorer.SERVER_ERROR + " updating the description for item with id: " + + "" + itemId+". Error reported: "+e.getMessage(); + throw new Exception(error); + } + + return newDescription; + } }