removed Workspace Notification Message class

This commit is contained in:
Massimiliano Assante 2022-05-02 18:47:52 +02:00
parent d923f21c2d
commit b69fd1270e
5 changed files with 14 additions and 164 deletions

View File

@ -9,6 +9,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>

View File

@ -1,145 +1 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<wb-module deploy-name="social-networking-library-ws">
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<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.3.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="social-networking-library-1.16.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-networking-library/social-networking-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="usermanagement-core-2.5.3.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.8.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/aslsocial/aslsocial">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="rmp-common-library-2.8.5.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/rmp-common-library/rmp-common-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<property name="java-output-path" value="/social-networking-library-ws/target/classes"/>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
<property name="context-root" value="social-networking-library-ws"/>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
</wb-module>
<<<<<<< HEAD
=======
>>>>>>> refs/heads/EnunciateIntegration
</project-modules>
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId"/>

View File

@ -63,18 +63,11 @@
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- Required for Enunciate plugin -->
<dependency>
<groupId>org.geotoolkit</groupId>
<artifactId>geotk-xml-base</artifactId>
<version>3.20-geoapi-3.0</version>
<scope>provided</scope>
</dependency>
<!-- end enunciate deps -->
<dependency>
<groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-model</artifactId>
<version>[1.1.1-SNAPSHOT, 2.0.0)</version>
<version>[1.1.5-SNAPSHOT, 2.0.0)</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>

View File

@ -2,7 +2,7 @@ package org.gcube.portal.social.networking.ws.mappers;
import org.gcube.applicationsupportlayer.social.shared.SocialFileItem;
import org.gcube.applicationsupportlayer.social.shared.SocialSharedFolder;
import org.gcube.social_networking.socialnetworking.model.beans.SharedFolderBean;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceFolderBean;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceFileItemBean;
public class WorkspaceItemMapper {
@ -31,7 +31,7 @@ public class WorkspaceItemMapper {
return toReturn;
}
public static SocialSharedFolder getSharedFolder(SharedFolderBean item) {
public static SocialSharedFolder getSharedFolder(WorkspaceFolderBean item) {
String id = null;
String name= null;

View File

@ -38,10 +38,10 @@ import org.gcube.portal.social.networking.ws.outputs.ResponseBean;
import org.gcube.portal.social.networking.ws.utils.CassandraConnection;
import org.gcube.portal.social.networking.ws.utils.ErrorMessages;
import org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean;
import org.gcube.social_networking.socialnetworking.model.beans.WSAddedItemNotificationBean;
import org.gcube.social_networking.socialnetworking.model.beans.WSSharedFolderNotificationBean;
import org.gcube.social_networking.socialnetworking.model.beans.WSUnsharedFolderNotificationBean;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceNotificationMessage;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceNotification;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceNotificationAddedItem;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceNotificationSharedFolder;
import org.gcube.social_networking.socialnetworking.model.beans.WorkspaceNotificationUnsharedFolder;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.LoggerFactory;
@ -181,13 +181,13 @@ public class Notifications {
public Response workspace(
@NotNull(message="input is missing")
@Valid
WorkspaceNotificationMessage message) throws ValidationException{
WorkspaceNotification message) throws ValidationException{
Caller caller = AuthorizationProvider.instance.get();
String context = ScopeProvider.instance.get();
String username = caller.getClient().getId();
if (!message.getType().getNotificationClass().isInstance(message.getBean())) {
if (!message.getType().getNotificationClass().isInstance(message)) {
//invalid call
return Response.status(Status.BAD_REQUEST).build();
}
@ -202,19 +202,19 @@ public class Notifications {
NotificationsManager nm = new ApplicationNotificationsManager(UserManagerWSBuilder.getInstance().getUserManager(), site, context, user);
switch (message.getType()) {
case ITEM_NEW: {
WSAddedItemNotificationBean itemBean = (WSAddedItemNotificationBean) message.getBean();
WorkspaceNotificationAddedItem itemBean = (WorkspaceNotificationAddedItem) message;
String userIdToNotify = itemBean.getUserIdToNotify();
nm.notifyAddedItem(userIdToNotify, WorkspaceItemMapper.getFileItem(itemBean.getItem()), WorkspaceItemMapper.getSharedFolder(itemBean.getFolder()));
break;
}
case FOLDER_SHARE: {
WSSharedFolderNotificationBean itemBean = (WSSharedFolderNotificationBean) message.getBean();
WorkspaceNotificationSharedFolder itemBean = (WorkspaceNotificationSharedFolder) message;
String userIdToNotify = itemBean.getUserIdToNotify();
nm.notifyFolderSharing(userIdToNotify, WorkspaceItemMapper.getSharedFolder(itemBean.getFolder()));
break;
}
case FOLDER_UNSHARE: {
WSUnsharedFolderNotificationBean itemBean = (WSUnsharedFolderNotificationBean) message.getBean();
WorkspaceNotificationUnsharedFolder itemBean = (WorkspaceNotificationUnsharedFolder) message;
String userIdToNotify = itemBean.getUserIdToNotify();
nm.notifyFolderUnsharing(userIdToNotify, itemBean.getUnsharedFolderId(), itemBean.getUnsharedFolderName());
break;