fixed bug
This commit is contained in:
parent
e4f320f39c
commit
9f77b168aa
|
@ -1,6 +1,9 @@
|
||||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||||
|
@ -16,11 +19,13 @@ include = As.PROPERTY, property = "type") @JsonSubTypes({
|
||||||
@JsonSubTypes.Type(value = WorkspaceNotificationAddedItem.class, name = "ITEM_NEW")
|
@JsonSubTypes.Type(value = WorkspaceNotificationAddedItem.class, name = "ITEM_NEW")
|
||||||
})
|
})
|
||||||
public abstract class WorkspaceNotification {
|
public abstract class WorkspaceNotification {
|
||||||
WorkspaceNotificationType type;
|
protected final WorkspaceNotificationType TYPE;
|
||||||
|
|
||||||
public WorkspaceNotificationType getType() {
|
WorkspaceNotification(WorkspaceNotificationType TYPE) {
|
||||||
return type;
|
this.TYPE = TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WorkspaceNotificationType TYPE() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,16 +25,15 @@ public class WorkspaceNotificationAddedItem extends WorkspaceNotification {
|
||||||
private WorkspaceFolderBean folder;
|
private WorkspaceFolderBean folder;
|
||||||
|
|
||||||
public WorkspaceNotificationAddedItem() {
|
public WorkspaceNotificationAddedItem() {
|
||||||
super();
|
super(WorkspaceNotificationType.ITEM_NEW);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationAddedItem(String userIdToNotify, WorkspaceFileItemBean item, WorkspaceFolderBean folder) {
|
public WorkspaceNotificationAddedItem(String userIdToNotify, WorkspaceFileItemBean item, WorkspaceFolderBean folder) {
|
||||||
super();
|
super(WorkspaceNotificationType.ITEM_NEW);
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
this.type = WorkspaceNotificationType.ITEM_NEW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserIdToNotify() {
|
public String getUserIdToNotify() {
|
||||||
|
|
|
@ -22,11 +22,15 @@ public class WorkspaceNotificationSharedFolder extends WorkspaceNotification {
|
||||||
@NotNull(message="folderItem cannot be missing")
|
@NotNull(message="folderItem cannot be missing")
|
||||||
private WorkspaceFolderBean folder;
|
private WorkspaceFolderBean folder;
|
||||||
|
|
||||||
|
|
||||||
|
public WorkspaceNotificationSharedFolder(WorkspaceNotificationType TYPE) {
|
||||||
|
super(WorkspaceNotificationType.FOLDER_SHARE);
|
||||||
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationSharedFolder(String userIdToNotify, WorkspaceFolderBean folder) {
|
public WorkspaceNotificationSharedFolder(String userIdToNotify, WorkspaceFolderBean folder) {
|
||||||
super();
|
super(WorkspaceNotificationType.FOLDER_SHARE);
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
this.type = WorkspaceNotificationType.FOLDER_SHARE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserIdToNotify() {
|
public String getUserIdToNotify() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
@JsonTypeName("UNSHARED_FOLDER")
|
@JsonTypeName("UNSHARED_FOLDER")
|
||||||
public class WorkspaceNotificationUnsharedFolder extends WorkspaceNotification {
|
public class WorkspaceNotificationUnsharedFolder extends WorkspaceNotification {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
*/
|
*/
|
||||||
|
@ -26,23 +27,27 @@ public class WorkspaceNotificationUnsharedFolder extends WorkspaceNotification {
|
||||||
private String unsharedFolderName;
|
private String unsharedFolderName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public WorkspaceNotificationUnsharedFolder() {
|
public WorkspaceNotificationUnsharedFolder() {
|
||||||
super();
|
super(WorkspaceNotificationType.FOLDER_UNSHARE);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationUnsharedFolder(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
public WorkspaceNotificationUnsharedFolder(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
||||||
super();
|
super(WorkspaceNotificationType.FOLDER_UNSHARE);
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.unsharedFolderId = unsharedFolderId;
|
this.unsharedFolderId = unsharedFolderId;
|
||||||
this.unsharedFolderName = unsharedFolderName;
|
this.unsharedFolderName = unsharedFolderName;
|
||||||
this.type = WorkspaceNotificationType.FOLDER_UNSHARE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "WorkspaceNotificationUnsharedFolder [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
|
return "WorkspaceNotificationUnsharedFolder [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
|
||||||
+ unsharedFolderId + ", unsharedFolderName=" + unsharedFolderName + "]";
|
+ unsharedFolderId + ", unsharedFolderName=" + unsharedFolderName + ", Type=" + TYPE + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserIdToNotify() {
|
public String getUserIdToNotify() {
|
||||||
|
|
Loading…
Reference in New Issue