diff --git a/CHANGELOG.md b/CHANGELOG.md
index d25d50f..fef491d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@ 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).
+## [v1.2.2] - [2020-06-20]
+
+method for description update added
+
## [v1.2.1] - [2020-06-20]
bug on Archive uploader solved
diff --git a/FUNDING.md b/FUNDING.md
new file mode 100644
index 0000000..6fa9eac
--- /dev/null
+++ b/FUNDING.md
@@ -0,0 +1,26 @@
+# Acknowledgments
+
+The projects leading to this software have received funding from a series of European Union programmes including:
+
+- the Sixth Framework Programme for Research and Technological Development
+ - [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
+- the Seventh Framework Programme for research, technological development and demonstration
+ - [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
+ - [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
+ - [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
+ - [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
+ - [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
+- the H2020 research and innovation programme
+ - [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
+ - [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
+ - [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
+ - [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
+ - [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
+ - [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
+ - [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
+ - [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
+ - [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
+ - [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
+ - [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
+ - [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
+ - [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);
\ No newline at end of file
diff --git a/LICENSE.md b/LICENSE.md
index 1932b4c..9351ad1 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,4 @@
-#European Union Public Licence V.1.1
+#European Union Public Licence V.1.2
##*EUPL © the European Community 2007*
@@ -12,7 +12,7 @@ The Original Work is provided under the terms of this Licence when the Licensor
(as defined below) has placed the following notice immediately following the
copyright notice for the Original Work:
-**Licensed under the EUPL V.1.1**
+**Licensed under the EUPL V.1.2**
or has expressed by any other mean his willingness to license under the EUPL.
diff --git a/changelog.xml b/changelog.xml
deleted file mode 100644
index 9c15aa4..0000000
--- a/changelog.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- bug on Archive uploader solved
-
-
- trash items changes owner on restore
- restore with new destination folder added
- move between shared and private or different shared folder enabled
-
-
- Bug on ushare owner fixed
-
-
- Active wait for lock in case of item creation added
-
-
- First commit
-
-
\ No newline at end of file
diff --git a/descriptor.xml b/descriptor.xml
deleted file mode 100644
index bb35e25..0000000
--- a/descriptor.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
- servicearchive
-
- tar.gz
-
- /
-
-
- .
- /
- true
-
- README.md
- LICENSE.md
- changelog.xml
- profile.xml
-
- 755
- true
-
-
-
-
-
- /${artifactId}
-
-
-
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b3e0ab6..826d8c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
4.0.0
org.gcube.data.access
storagehub
- 1.2.1
+ 1.2.2-SNAPSHOT
storagehub
diff --git a/profile.xml b/profile.xml
deleted file mode 100644
index a163484..0000000
--- a/profile.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Service
-
- Storage Hub Webapp
- DataAccess
- ${artifactId}
- 1.0.0
-
-
- ${artifactId}
- ${version}
-
- ${groupId}
- ${artifactId}
- ${version}
-
-
- ${build.finalName}.jar
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/org/gcube/data/access/storagehub/handlers/items/Item2NodeConverter.java b/src/main/java/org/gcube/data/access/storagehub/handlers/items/Item2NodeConverter.java
index 963b2dd..5c4d17a 100644
--- a/src/main/java/org/gcube/data/access/storagehub/handlers/items/Item2NodeConverter.java
+++ b/src/main/java/org/gcube/data/access/storagehub/handlers/items/Item2NodeConverter.java
@@ -226,6 +226,10 @@ public class Item2NodeConverter {
node.setProperty(NodeProperty.HIDDEN.toString(), hidden);
}
+ public void updateDescription(Node node, String description,String login) throws RepositoryException {
+ Utils.setPropertyOnChangeNode(node, login, ItemAction.UPDATED);
+ node.setProperty(NodeProperty.DESCRIPTION.toString(), description);
+ }
public void updateOwnerOnSubTree(Node node, String owner) throws RepositoryException, BackendGenericError {
Class extends Item> classToHandle = (Class extends Item>)ClassHandler.instance().get(node.getPrimaryNodeType().getName());
diff --git a/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java b/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java
index ca3196f..0f81422 100644
--- a/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java
+++ b/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java
@@ -45,7 +45,7 @@ import javax.ws.rs.core.StreamingOutput;
import org.apache.commons.io.FilenameUtils;
import org.gcube.common.authorization.control.annotations.AuthorizationControl;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
-import org.gcube.common.encryption.encrypter.*;
+import org.gcube.common.encryption.encrypter.StringEncrypter;
import org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.impl.ScopeBean;
@@ -412,14 +412,14 @@ public class ItemsManager {
}
log.warn("item id to retrieve is {}",itemId);
-
+
Node selectedNode;
try {
selectedNode= ses.getNodeByIdentifier(itemId);
}catch (ItemNotFoundException e) {
throw new IdNotFoundException(itemId);
}
-
+
Item item = node2Item.getItem(selectedNode, Arrays.asList(NodeConstants.ACCOUNTING_NAME, NodeConstants.METADATA_NAME));
if (!(item instanceof AbstractFileItem)) throw new InvalidCallParameters("the choosen item is not a File");
@@ -1105,6 +1105,52 @@ public class ItemsManager {
return Response.ok(id).build();
}
+ //TODO: transform this and setMetadata in a generic method for all properties
+ @PUT
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Path("/{id}/description")
+ public Response setDescription(String description){
+ InnerMethodName.instance.set("setDescription");
+
+ Session ses = null;
+
+ try{
+ final String login = AuthorizationProvider.instance.get().getClient().getId();
+
+ ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
+
+ authChecker.checkWriteAuthorizationControl(ses, id, false);
+
+ final Node nodeToUpdate = ses.getNodeByIdentifier(id);
+
+ try {
+ ses.getWorkspace().getLockManager().lock(nodeToUpdate.getPath(), false, true, 0,login);
+ }catch (LockException e) {
+ throw new ItemLockedException(e);
+ }
+ try {
+ item2Node.updateDescription(nodeToUpdate, description, login);
+ ses.save();
+ }finally {
+ ses.getWorkspace().getLockManager().unlock(nodeToUpdate.getPath());
+ }
+ //TODO: UPDATE accounting
+
+ }catch(RepositoryException re ){
+ log.error("jcr error moving item", re);
+ GXOutboundErrorResponse.throwException(new BackendGenericError(re));
+ }catch(StorageHubException she ){
+ log.error(she.getErrorMessage(), she);
+ GXOutboundErrorResponse.throwException(she, Response.Status.fromStatusCode(she.getStatus()));
+ }finally{
+ if (ses!=null) {
+ ses.logout();
+ }
+
+ }
+ return Response.ok(id).build();
+ }
+
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{id}/metadata")
@@ -1170,7 +1216,7 @@ public class ItemsManager {
final Node nodeToDelete = ses.getNodeByIdentifier(id);
Item itemToDelete = node2Item.getItem(nodeToDelete, Excludes.GET_ONLY_CONTENT);
-
+
if (itemToDelete instanceof SharedFolder || itemToDelete instanceof VreFolder || (itemToDelete instanceof FolderItem && Utils.hasSharedChildren(nodeToDelete)))
throw new InvalidItemException("SharedFolder, VreFolder or folders with shared children cannot be deleted");
diff --git a/src/main/webapp/WEB-INF/README b/src/main/webapp/WEB-INF/README
index b186949..da16096 100644
--- a/src/main/webapp/WEB-INF/README
+++ b/src/main/webapp/WEB-INF/README
@@ -25,7 +25,7 @@ The projects leading to this software have received funding from a series of
Version
--------------------------------------------------
-1.2.1 (2020-05-26)
+1.2.2-SNAPSHOT (2020-09-16)
Please see the file named "changelog.xml" in this directory for the release notes.
diff --git a/src/main/webapp/WEB-INF/gcube-app.xml b/src/main/webapp/WEB-INF/gcube-app.xml
index 2bd7d77..4d1123c 100644
--- a/src/main/webapp/WEB-INF/gcube-app.xml
+++ b/src/main/webapp/WEB-INF/gcube-app.xml
@@ -1,7 +1,7 @@
StorageHub
DataAccess
- 1.2.1
+ 1.2.2-SNAPSHOT
Storage Hub webapp
\ No newline at end of file