Removed home library

This commit is contained in:
Luca Frosini 2021-06-10 16:22:25 +02:00
parent f668da6a7c
commit eaa0de49ea
6 changed files with 49 additions and 112 deletions

View File

@ -3,8 +3,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for StorageHub Application Persistence
## [v2.0.0-SNAPSHOT] [r5.0.0] -
## [v2.0.0-SNAPSHOT]
- Removed home library [#21435]
- Switched HTTP requests gxHTTP 2.0.0 [#19283]
- Switched gCube BOM to 2.0.0 [#19283]

26
FUNDING.md Normal file
View File

@ -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);

View File

@ -50,26 +50,4 @@ open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
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 (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488);
- D4Science-II (grant no.239019);
- ENVRI (grant no. 283465);
- iMarine(grant no. 283644);
- EUBrazilOpenBio (grant no. 288754).
- the H2020 research and innovation programme
- SoBigData (grant no. 654024);
- PARTHENOS (grant no. 654119);
- EGIEngage (grant no. 654142);
- ENVRIplus (grant no. 654182);
- BlueBRIDGE (grant no. 675680);
- PerformFish (grant no. 727610);
- AGINFRAplus (grant no. 731001);
- DESIRA (grant no. 818194);
- ARIADNEplus (grant no. 823914);
- RISIS2 (grant no. 824091);
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)

12
pom.xml
View File

@ -57,18 +57,6 @@
<groupId>org.gcube.common</groupId>
<artifactId>gxHTTP</artifactId>
</dependency>
<!-- Home Library dependencies MUST be removed when the storagehub add missing features -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<!-- END of Home Library dependencies -->
<!-- Test libraries -->
<dependency>
<groupId>junit</groupId>

View File

@ -5,14 +5,6 @@ import java.io.StringWriter;
import java.net.URL;
import java.util.List;
import org.gcube.common.homelibrary.home.Home;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.HomeManager;
import org.gcube.common.homelibrary.home.HomeManagerFactory;
import org.gcube.common.homelibrary.home.User;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.homelibrary.home.workspace.WorkspaceSharedFolder;
import org.gcube.common.homelibrary.home.workspace.usermanager.UserManager;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.common.storagehub.client.dsl.ContainerType;
@ -21,7 +13,6 @@ import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.client.dsl.ItemContainer;
import org.gcube.common.storagehub.client.dsl.ListResolver;
import org.gcube.common.storagehub.client.dsl.ListResolverTyped;
import org.gcube.common.storagehub.client.dsl.OpenResolver;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
import org.gcube.common.storagehub.model.Metadata;
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
@ -88,25 +79,7 @@ public class StorageHubManagement {
}
protected FolderContainer getWorkspaceRoot() {
try {
return storageHubClient.getWSRoot();
} catch(Exception e) {
String username = ContextUtility.getUsername();
logger.info("Unable to obtain the Workspace Root for {}. Going to create it.", username);
try {
HomeManagerFactory factory = HomeLibrary.getHomeManagerFactory();
HomeManager manager = factory.getHomeManager();
User user = manager.createUser(username);
@SuppressWarnings("deprecation")
Home home = manager.getHome(user);
Workspace ws = home.getWorkspace();
ws.getRoot();
return storageHubClient.getWSRoot();
} catch(Exception ex) {
logger.info("Unable to create the Workspace Root for {}.", username);
throw e;
}
}
return storageHubClient.getWSRoot();
}
protected FolderContainer getOrCreateFolder(FolderContainer parent, String name, String description, boolean hidden)
@ -143,28 +116,7 @@ public class StorageHubManagement {
break;
case VRE:
String username = ContextUtility.getUsername();
try {
destinationFolder = storageHubClient.openVREFolder();
}catch (Exception e) {
try {
HomeManagerFactory factory = HomeLibrary.getHomeManagerFactory();
UserManager userManager = factory.getUserManager();
userManager.associateUserToGroup(currentContext, username);
HomeManager manager = factory.getHomeManager();
@SuppressWarnings("deprecation")
Home home = manager.getHome(username);
Workspace ws = home.getWorkspace();
WorkspaceSharedFolder vreFolder= ws.getVREFolderByScope(currentContext);
String id = vreFolder.getId();
// destinationFolder = storageHubClient.openVREFolder();
OpenResolver openResolver = storageHubClient.open(id);
destinationFolder = openResolver.asFolder();
}catch (Exception ex) {
throw e;
}
}
destinationFolder = storageHubClient.openVREFolder();
break;
default:

View File

@ -3,14 +3,6 @@ package org.gcube.storagehub;
import java.util.List;
import java.util.Map;
import org.gcube.common.homelibrary.home.Home;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.HomeManager;
import org.gcube.common.homelibrary.home.HomeManagerFactory;
import org.gcube.common.homelibrary.home.User;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.storagehub.client.dsl.FileContainer;
import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.client.dsl.ItemContainer;
@ -28,24 +20,24 @@ public class StorageHubManagementTest extends ContextTest {
private static final Logger logger = LoggerFactory.getLogger(StorageHubManagementTest.class);
//@Test
public void testHL() throws Exception {
ApplicationMode applicationMode = new ApplicationMode(ContextTest.properties.getProperty(DEFAULT_TEST_SCOPE_NAME));
applicationMode.start();
String username = ContextUtility.getUsername();
HomeManagerFactory factory = HomeLibrary.getHomeManagerFactory();
HomeManager manager = factory.getHomeManager();
User user = manager.createUser(username);
@SuppressWarnings("deprecation")
Home home = manager.getHome(user);
Workspace ws = home.getWorkspace();
WorkspaceFolder workspaceFolder = ws.getRoot();
workspaceFolder = ws.getVREFolderByScope(ContextUtility.getCurrentContext());
// logger.debug("VRE Folder ID : {} - Owner: {}", workspaceFolder.getId(), workspaceFolder.getOwner().getPortalLogin());
List<WorkspaceItem> workspaceItems = workspaceFolder.getChildren(true);
for(WorkspaceItem workspaceItem : workspaceItems) {
logger.debug("{} {}{} ID:{}", workspaceFolder.getType(), workspaceItem.getName(), workspaceItem.isHidden()? " (hidden)":"", workspaceItem.getId());
}
}
// public void testHL() throws Exception {
// ApplicationMode applicationMode = new ApplicationMode(ContextTest.properties.getProperty(DEFAULT_TEST_SCOPE_NAME));
// applicationMode.start();
// String username = ContextUtility.getUsername();
// HomeManagerFactory factory = HomeLibrary.getHomeManagerFactory();
// HomeManager manager = factory.getHomeManager();
// User user = manager.createUser(username);
// @SuppressWarnings("deprecation")
// Home home = manager.getHome(user);
// Workspace ws = home.getWorkspace();
// WorkspaceFolder workspaceFolder = ws.getRoot();
// workspaceFolder = ws.getVREFolderByScope(ContextUtility.getCurrentContext());
// // logger.debug("VRE Folder ID : {} - Owner: {}", workspaceFolder.getId(), workspaceFolder.getOwner().getPortalLogin());
// List<WorkspaceItem> workspaceItems = workspaceFolder.getChildren(true);
// for(WorkspaceItem workspaceItem : workspaceItems) {
// logger.debug("{} {}{} ID:{}", workspaceFolder.getType(), workspaceItem.getName(), workspaceItem.isHidden()? " (hidden)":"", workspaceItem.getId());
// }
// }
@Test
public void myTest() throws Exception {