Compare commits

...

1 Commits

Author SHA1 Message Date
Ahmed Salah Tawfik Ibrahim b4e312482c Compatible with social model 2.0.0 2024-01-30 18:23:46 +01:00
3 changed files with 25 additions and 20 deletions

View File

@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v2.0.1] - 2022-06-16
- Release for HL portal removal
- Removed Social Networking Library dependency #26523
## [v2.0.0] - 2020-07-21

12
pom.xml
View File

@ -56,10 +56,16 @@
<artifactId>json-simple</artifactId>
<scope>provided</scope>
</dependency>
<!-- should be provided -->
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<scope>provided</scope>
<groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-model</artifactId>
<version>[1.2.0-SNAPSHOT, 2.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-client</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>

View File

@ -25,12 +25,11 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.codec.binary.Base64;
import org.gcube.common.portal.PortalContext;
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
import org.gcube.portal.databook.server.DatabookStore;
import org.gcube.portal.databook.shared.Invite;
import org.gcube.portal.databook.shared.InviteStatus;
import org.gcube.portal.databook.shared.ex.InviteIDNotFoundException;
import org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException;
import org.gcube.social_networking.social_networking_client_library.LibClient;
import org.gcube.social_networking.socialnetworking.model.shared.Invite;
import org.gcube.social_networking.socialnetworking.model.shared.InviteStatus;
import org.gcube.social_networking.socialnetworking.model.shared.exceptions.InviteIDNotFoundException;
import org.gcube.social_networking.socialnetworking.model.shared.exceptions.InviteStatusNotFoundException;
import org.gcube.portal.invites.InvitesManager;
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
@ -74,17 +73,21 @@ public class PortletViewController {
private static String MODEL_ATTR = "theModel";
private static DatabookStore store;
private static LibClient libClient;
/**
*
* @return the unique instance of the store
*/
public static synchronized DatabookStore getStore() {
if (store == null) {
store = new DBCassandraAstyanaxImpl();
public static synchronized LibClient getClient() {
if (libClient == null) {
try {
libClient = new LibClient();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return store;
return libClient;
}
@RenderMapping
@ -114,12 +117,7 @@ public class PortletViewController {
Invite invite = null;
try {
invite = getStore().readInvite(inviteId);
} catch (InviteIDNotFoundException | InviteStatusNotFoundException e) {
e.printStackTrace();
return PAGE_INVITE_NOTFOUND;
}
invite = getClient().readInviteLib(inviteId);
if (invite.getStatus() == InviteStatus.ACCEPTED)
return PAGE_INVITE_EXPIRED;