Compatible with social model 2.0.0
This commit is contained in:
parent
742e5ca99c
commit
b4e312482c
|
@ -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
12
pom.xml
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue