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
|
## [v2.0.1] - 2022-06-16
|
||||||
|
|
||||||
- Release for HL portal removal
|
- Release for HL portal removal
|
||||||
|
- Removed Social Networking Library dependency #26523
|
||||||
|
|
||||||
## [v2.0.0] - 2020-07-21
|
## [v2.0.0] - 2020-07-21
|
||||||
|
|
||||||
|
|
12
pom.xml
12
pom.xml
|
@ -56,10 +56,16 @@
|
||||||
<artifactId>json-simple</artifactId>
|
<artifactId>json-simple</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- should be provided -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.social-networking</groupId>
|
||||||
<artifactId>social-networking-library</artifactId>
|
<artifactId>social-service-model</artifactId>
|
||||||
<scope>provided</scope>
|
<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>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.dvos</groupId>
|
<groupId>org.gcube.dvos</groupId>
|
||||||
|
|
|
@ -25,12 +25,11 @@ import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
import org.apache.commons.codec.binary.Base64;
|
||||||
import org.gcube.common.portal.PortalContext;
|
import org.gcube.common.portal.PortalContext;
|
||||||
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
import org.gcube.social_networking.social_networking_client_library.LibClient;
|
||||||
import org.gcube.portal.databook.server.DatabookStore;
|
import org.gcube.social_networking.socialnetworking.model.shared.Invite;
|
||||||
import org.gcube.portal.databook.shared.Invite;
|
import org.gcube.social_networking.socialnetworking.model.shared.InviteStatus;
|
||||||
import org.gcube.portal.databook.shared.InviteStatus;
|
import org.gcube.social_networking.socialnetworking.model.shared.exceptions.InviteIDNotFoundException;
|
||||||
import org.gcube.portal.databook.shared.ex.InviteIDNotFoundException;
|
import org.gcube.social_networking.socialnetworking.model.shared.exceptions.InviteStatusNotFoundException;
|
||||||
import org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException;
|
|
||||||
import org.gcube.portal.invites.InvitesManager;
|
import org.gcube.portal.invites.InvitesManager;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||||
|
@ -74,17 +73,21 @@ public class PortletViewController {
|
||||||
|
|
||||||
private static String MODEL_ATTR = "theModel";
|
private static String MODEL_ATTR = "theModel";
|
||||||
|
|
||||||
private static DatabookStore store;
|
private static LibClient libClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the unique instance of the store
|
* @return the unique instance of the store
|
||||||
*/
|
*/
|
||||||
public static synchronized DatabookStore getStore() {
|
public static synchronized LibClient getClient() {
|
||||||
if (store == null) {
|
if (libClient == null) {
|
||||||
store = new DBCassandraAstyanaxImpl();
|
try {
|
||||||
|
libClient = new LibClient();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return store;
|
return libClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RenderMapping
|
@RenderMapping
|
||||||
|
@ -114,12 +117,7 @@ public class PortletViewController {
|
||||||
|
|
||||||
Invite invite = null;
|
Invite invite = null;
|
||||||
|
|
||||||
try {
|
invite = getClient().readInviteLib(inviteId);
|
||||||
invite = getStore().readInvite(inviteId);
|
|
||||||
} catch (InviteIDNotFoundException | InviteStatusNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return PAGE_INVITE_NOTFOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invite.getStatus() == InviteStatus.ACCEPTED)
|
if (invite.getStatus() == InviteStatus.ACCEPTED)
|
||||||
return PAGE_INVITE_EXPIRED;
|
return PAGE_INVITE_EXPIRED;
|
||||||
|
|
Loading…
Reference in New Issue