Removed the HL dependencies

Added a patch to convert FolderItem to SocialItemFolder

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@181955 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-10-09 15:06:07 +00:00
parent 4322d3c2c6
commit d7366068c9
2 changed files with 33 additions and 14 deletions

22
pom.xml
View File

@ -148,17 +148,17 @@
<!-- </dependency> -->
<!-- HL dependency is needed due to social-networking-library interface -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>asm-all</artifactId>
<groupId>asm</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.gcube.common</groupId> -->
<!-- <artifactId>home-library</artifactId> -->
<!-- <scope>provided</scope> -->
<!-- <exclusions> -->
<!-- <exclusion> -->
<!-- <artifactId>asm-all</artifactId> -->
<!-- <groupId>asm</groupId> -->
<!-- </exclusion> -->
<!-- </exclusions> -->
<!-- </dependency> -->
<dependency>
<groupId>commons-httpclient</groupId>

View File

@ -6,6 +6,7 @@ package org.gcube.portlets.widgets.workspaceuploader.server.notification;
import org.gcube.applicationsupportlayer.social.shared.SocialFileItem;
import org.gcube.applicationsupportlayer.social.shared.SocialSharedFolder;
import org.gcube.common.storagehub.model.items.FolderItem;
import org.gcube.common.storagehub.model.items.Item;
import org.gcube.common.storagehub.model.items.SharedFolder;
import org.gcube.common.storagehub.model.items.VreFolder;
@ -15,6 +16,7 @@ import org.slf4j.LoggerFactory;
/**
* The Class NotificationMapper.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 26, 2018
@ -23,6 +25,7 @@ public class NotificationMapper {
protected static Logger logger = LoggerFactory.getLogger(NotificationMapper.class);
/**
* To social folder.
*
@ -33,6 +36,17 @@ public class NotificationMapper {
return new SocialSharedFolder(sharedFolder.getId(), sharedFolder.getName(), sharedFolder.getTitle(), sharedFolder.getDisplayName(), sharedFolder.getPath(), sharedFolder.getParentId(), sharedFolder.isVreFolder());
}
/**
* To social folder.
*
* @param folderItem the folder item
* @return the social shared folder
*/
public static SocialSharedFolder toSocialFolder(FolderItem folderItem){
return new SocialSharedFolder(folderItem.getId(), folderItem.getName(), folderItem.getTitle(), folderItem.getName(), folderItem.getPath(), folderItem.getParentId(), false);
}
/**
* To social item.
@ -48,12 +62,17 @@ public class NotificationMapper {
theFolder = storageWrapper.getStorageHubClientService().getItem(item.getParentId());
}
catch (Exception e) {
logger.warn("Impossible the item using the parent id: "+item.getParentId());
logger.warn("Impossible to read the item parent by using the parent id: "+item.getParentId(), e);
}
SocialSharedFolder parent = null;
if(theFolder!=null && theFolder instanceof SharedFolder || theFolder instanceof VreFolder)
parent = toSocialFolder((SharedFolder) theFolder);
if(theFolder!=null) {
if(theFolder instanceof SharedFolder || theFolder instanceof VreFolder) {
parent = toSocialFolder((SharedFolder) theFolder);
}else if(theFolder instanceof FolderItem){
parent = toSocialFolder((FolderItem) theFolder);
}
}
return new SocialFileItem(item.getId(), item.getName(), item.getTitle(), item.getPath(), parent);
}