removed home library dependency

This commit is contained in:
Massimiliano Assante 2021-04-14 16:33:16 +02:00
parent 80117c2418
commit 83ebb52e89
6 changed files with 54 additions and 56 deletions

View File

@ -1,22 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="social-networking-library-ws">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="portal-manager-2.4.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/portal-manager/portal-manager">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="social-util-library-1.7.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
<dependent-module archiveName="aslsocial-1.8.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/aslsocial/aslsocial">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="usermanagement-core-2.5.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/usermanagement-core/usermanagement-core">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="aslsocial-1.7.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/aslsocial/aslsocial">
<dependent-module archiveName="rmp-common-library-2.8.4.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/rmp-common-library/rmp-common-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/social-networking-library-ws/target/classes"/>
<property name="context-root" value="social-networking-library-ws"/>
</wb-module>
</project-modules>

View File

@ -4,6 +4,8 @@
- removed jackson dependency
- removed home library dependency
## [v2.3.0] - 2019-10-02
- added support for mentions with @ in user's post as well as application posts

30
pom.xml
View File

@ -25,19 +25,17 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/social-networking-library-ws.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/social-networking-library-ws.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/social-networking-library-ws</url>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem//${project.artifactId}</url>
</scm>
<dependencyManagement>
<dependencies>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-smartgears-bom</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -151,6 +149,12 @@
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
<version>[1.2.2-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
@ -166,18 +170,6 @@
<artifactId>authorization-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -17,9 +17,9 @@ import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.authorization.library.utils.Caller;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
import org.gcube.common.storagehub.client.proxies.MessageManagerClient;
import org.gcube.portal.notifications.bean.GenericItemBean;
import org.gcube.portal.notifications.thread.MessageNotificationsThread;
import org.gcube.portal.social.networking.caches.SocialNetworkingSiteFinder;
@ -115,13 +115,13 @@ public class Messages {
// sender info
GCubeUser senderUser = uManager.getUserByUsername(senderId);
Workspace workspace = HomeLibrary.getUserWorkspace(senderId);
MessageManagerClient client = AbstractPlugin.messages().build();
// send message
logger.debug("Sending message to " + recipientsListFiltered);
String messageId = workspace.getWorkspaceMessageManager()
.sendMessageToPortalLogins(subject, body,
new ArrayList<String>(), recipientsListFiltered);
logger.info("Sending message (v1) to: " + recipientsListFiltered);
String checkedSubject = subject;
String checkedBody = body;
String messageId = client.sendMessage(recipientsListFiltered, checkedSubject, checkedBody, null);
// send notification
logger.debug("Message sent to " + recipientsIds + ". Sending message notification to: " + recipientsIds);

View File

@ -1,12 +1,5 @@
package org.gcube.portal.social.networking.ws.methods.v2;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -32,10 +25,10 @@ import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.authorization.library.utils.Caller;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
import org.gcube.common.storagehub.client.proxies.MessageManagerClient;
import org.gcube.common.storagehub.model.messages.Message;
import org.gcube.portal.notifications.bean.GenericItemBean;
import org.gcube.portal.notifications.thread.MessageNotificationsThread;
import org.gcube.portal.social.networking.caches.SocialNetworkingSiteFinder;
@ -53,6 +46,13 @@ import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.LoggerFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
/**
* Messages services REST interface
* @author Costantino Perciante at ISTI-CNR
@ -136,15 +136,13 @@ public class Messages {
// sender info
GCubeUser senderUser = UserManagerWSBuilder.getInstance().getUserManager().getUserByUsername(senderId);
Workspace workspace = HomeLibrary.getUserWorkspace(senderId);
logger.debug("Workspace is " + workspace.getRoot());
MessageManagerClient client = AbstractPlugin.messages().build();
// send message
logger.debug("Sending message to " + recipientsListFiltered);
String messageId = workspace.getWorkspaceMessageManager()
.sendMessageToPortalLogins(subject, body,
new ArrayList<String>(), recipientsListFiltered);
logger.debug("Sending message (v2) to: " + recipientsListFiltered);
String checkedSubject = subject;
String checkedBody = body;
String messageId = client.sendMessage(recipientsListFiltered, checkedSubject, checkedBody, null);
// send notification
logger.debug("Message sent to " + recipientsIds + ". Sending message notification to: " + recipientsIds);
@ -183,14 +181,14 @@ public class Messages {
logger.info("Request for retrieving sent messages by " + username);
try{
Workspace workspace = HomeLibrary.getUserWorkspace(username);
List<WorkspaceMessage> sentMessages = workspace.getWorkspaceMessageManager().getSentMessages();
try {
MessageManagerClient client = AbstractPlugin.messages().build();
List<Message> sentMessages = client.getSentMessages();
Collections.reverse(sentMessages);
responseBean.setSuccess(true);
logger.debug("Result is " + sentMessages);
responseBean.setResult(sentMessages);
}catch(Exception e){
} catch(Exception e){
logger.error("Unable to retrieve sent messages", e);
responseBean.setMessage(e.getMessage());
status = Status.INTERNAL_SERVER_ERROR;
@ -215,9 +213,9 @@ public class Messages {
Status status = Status.OK;
logger.info("Request for retrieving received messages by " + username);
try{
Workspace workspace = HomeLibrary.getUserWorkspace(username);
List<WorkspaceMessage> getMessages = workspace.getWorkspaceMessageManager().getReceivedMessages();
try {
MessageManagerClient client = AbstractPlugin.messages().build();
List<Message> getMessages = client.getReceivedMessages();
Collections.reverse(getMessages);
responseBean.setSuccess(true);
responseBean.setResult(getMessages);

View File

@ -26,7 +26,7 @@ public class CustomObjectMapper implements ContextResolver<ObjectMapper> {
logger.debug("new ObjectMapperResolver()");
mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
}
@Override