git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@178574 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5271923cee
commit
f44f3fc0ad
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.data.access</groupId>
|
<groupId>org.gcube.data.access</groupId>
|
||||||
<artifactId>storagehub</artifactId>
|
<artifactId>storagehub</artifactId>
|
||||||
<version>1.0.3-SNAPSHOT</version>
|
<version>1.0.4-SNAPSHOT</version>
|
||||||
<name>storagehub</name>
|
<name>storagehub</name>
|
||||||
|
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
|
@ -94,6 +94,7 @@ public class AccountingHandler {
|
||||||
}
|
}
|
||||||
if (version!=null)
|
if (version!=null)
|
||||||
accountingNode.setProperty(VERSION_ACCOUNTING, version.getName());
|
accountingNode.setProperty(VERSION_ACCOUNTING, version.getName());
|
||||||
|
|
||||||
}catch(UnsupportedRepositoryOperationException uropex) {
|
}catch(UnsupportedRepositoryOperationException uropex) {
|
||||||
logger.warn("version cannot be retrieved", uropex);
|
logger.warn("version cannot be retrieved", uropex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,23 +235,11 @@ public class ItemsCreator {
|
||||||
if (!node2Item.checkNodeType(destination, FolderItem.class))
|
if (!node2Item.checkNodeType(destination, FolderItem.class))
|
||||||
throw new InvalidItemException("the destination item is not a folder");
|
throw new InvalidItemException("the destination item is not a folder");
|
||||||
|
|
||||||
LockManager lockManager = ses.getWorkspace().getLockManager();
|
|
||||||
lockManager.lock(destination.getPath(), false, true, 0,login);
|
|
||||||
log.info("session: {}",ses.toString());
|
log.info("session: {}",ses.toString());
|
||||||
|
|
||||||
Node newNode;
|
Node newNode = createFileItemInternally(ses, destination, stream, name, description, login);
|
||||||
try {
|
ses.save();
|
||||||
newNode = createFileItemInternally(ses, destination, stream, name, description, login);
|
|
||||||
|
|
||||||
ses.save();
|
|
||||||
} finally {
|
|
||||||
log.info("session: {}",ses.toString());
|
|
||||||
try {
|
|
||||||
lockManager.unlock(destination.getPath());
|
|
||||||
}catch(LockException e) {
|
|
||||||
log.warn("error unlocking item id {} with path {}",destination.getIdentifier(), destination.getPath(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
versionHandler.checkinContentNode(newNode, ses);
|
versionHandler.checkinContentNode(newNode, ses);
|
||||||
log.info("file with id {} correctly created",newNode.getIdentifier());
|
log.info("file with id {} correctly created",newNode.getIdentifier());
|
||||||
|
@ -304,7 +292,6 @@ public class ItemsCreator {
|
||||||
accountingHandler.createFolderAddObj(name, item.getClass().getSimpleName(), item.getContent().getMimeType(), ses, newNode, false);
|
accountingHandler.createFolderAddObj(name, item.getClass().getSimpleName(), item.getContent().getMimeType(), ses, newNode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return newNode;
|
return newNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -474,6 +474,7 @@ public class ItemsManager {
|
||||||
|
|
||||||
for (Version version: jcrVersions) {
|
for (Version version: jcrVersions) {
|
||||||
boolean currentVersion = ((AbstractFileItem)currentItem).getContent().getStorageId().equals(version.getFrozenNode().getProperty(NodeProperty.STORAGE_ID.toString()).getString());
|
boolean currentVersion = ((AbstractFileItem)currentItem).getContent().getStorageId().equals(version.getFrozenNode().getProperty(NodeProperty.STORAGE_ID.toString()).getString());
|
||||||
|
|
||||||
versions.add(new org.gcube.common.storagehub.model.service.Version(version.getIdentifier(), version.getName(), version.getCreated(), currentVersion));
|
versions.add(new org.gcube.common.storagehub.model.service.Version(version.getIdentifier(), version.getName(), version.getCreated(), currentVersion));
|
||||||
}
|
}
|
||||||
}catch(RepositoryException re ){
|
}catch(RepositoryException re ){
|
||||||
|
|
Loading…
Reference in New Issue