From b69fd1270e6ac3aef279beb39099f73ff281a81a Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Mon, 2 May 2022 18:47:52 +0200 Subject: [PATCH] removed Workspace Notification Message class --- .classpath | 1 + .settings/org.eclipse.wst.common.component | 146 +----------------- pom.xml | 9 +- .../ws/mappers/WorkspaceItemMapper.java | 4 +- .../ws/methods/v2/Notifications.java | 18 +-- 5 files changed, 14 insertions(+), 164 deletions(-) diff --git a/.classpath b/.classpath index 797dbe0..165f1c5 100644 --- a/.classpath +++ b/.classpath @@ -9,6 +9,7 @@ + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index aa2982b..bcc91bc 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,145 +1 @@ - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - - - uses - - - uses - - - uses - - - uses - - - uses - - - uses - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - -<<<<<<< HEAD - -======= - - - - - - ->>>>>>> refs/heads/EnunciateIntegration - - - - + diff --git a/pom.xml b/pom.xml index 4f67c65..a6b1e3a 100644 --- a/pom.xml +++ b/pom.xml @@ -63,18 +63,11 @@ 3.1.0 provided - - - org.geotoolkit - geotk-xml-base - 3.20-geoapi-3.0 - provided - org.gcube.social-networking social-service-model - [1.1.1-SNAPSHOT, 2.0.0) + [1.1.5-SNAPSHOT, 2.0.0) net.sf.ehcache diff --git a/src/main/java/org/gcube/portal/social/networking/ws/mappers/WorkspaceItemMapper.java b/src/main/java/org/gcube/portal/social/networking/ws/mappers/WorkspaceItemMapper.java index 11683d9..bc71c17 100644 --- a/src/main/java/org/gcube/portal/social/networking/ws/mappers/WorkspaceItemMapper.java +++ b/src/main/java/org/gcube/portal/social/networking/ws/mappers/WorkspaceItemMapper.java @@ -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; diff --git a/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Notifications.java b/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Notifications.java index a86574c..5a1bb41 100644 --- a/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Notifications.java +++ b/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Notifications.java @@ -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;