workspace-sharing-widget/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/notifications/SocialItemFactory.java

27 lines
919 B
Java

package org.gcube.portlets.widgets.workspacesharingwidget.server.notifications;
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;
/**
*
* @author Giancarlo Panichi
*
*/
public class SocialItemFactory {
public SocialFileItem createSocialFileItem(Item item, FolderItem parent) {
SocialSharedFolder socialSharedFolder=createSocialSharedFolder(parent);
return new SocialFileItem(item.getId(), item.getName(), item.getTitle(), item.getPath(), socialSharedFolder);
}
public SocialSharedFolder createSocialSharedFolder(FolderItem folder) {
return new SocialSharedFolder(folder.getId(), folder.getName(), folder.getTitle(), folder.getName(),
folder.getPath(), folder.getParentId(), false);
}
}