diff --git a/pom.xml b/pom.xml
index 60b2d6f..db23e8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,6 +27,7 @@
${project.build.directory}/${project.build.finalName}
UTF-8
UTF-8
+ 2.8.1
@@ -102,6 +103,22 @@
4.11
test
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1.1
+
+
+ com.google
+ gwt-jsonmaker
+ 1.2.1
+
+
+ com.google.gwt
+ gwt-user
+ ${gwtVersion}
+ provided
+
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/GCubeSocialNetworking.gwt.xml b/src/main/java/org/gcube/social_networking/socialnetworking/model/GCubeSocialNetworking.gwt.xml
new file mode 100644
index 0000000..4b0384f
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/GCubeSocialNetworking.gwt.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/client/GCubeSocialNetworking.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/client/GCubeSocialNetworking.java
new file mode 100644
index 0000000..ab3be11
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/client/GCubeSocialNetworking.java
@@ -0,0 +1,17 @@
+package org.gcube.social_networking.socialnetworking.model.client;
+
+import com.google.gwt.core.client.EntryPoint;
+
+/**
+ * Entry point classes define onModuleLoad()
and instances the HandlerManager
for IPC
+ */
+public class GCubeSocialNetworking implements EntryPoint {
+ public static final String USER_PROFILE_OID = "userIdentificationParameter";
+ public static final String HASHTAG_OID = "hashtagIdentificationParameter";
+ public static final String SEARCH_OID = "elasticSearchIdentificationParameter";
+ public static final String SHOW_STATISTICS_ACTION_OID = "showUserStatisticsActionParameter"; // see ShowUserStatisticAction
+ public static final String GROUP_MEMBERS_OID = "teamIdentificationParameter";
+ public void onModuleLoad() {
+ }
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/client/util/Encoder.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/client/util/Encoder.java
new file mode 100644
index 0000000..12bed0c
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/client/util/Encoder.java
@@ -0,0 +1,15 @@
+package org.gcube.social_networking.socialnetworking.model.client.util;
+/**
+ * simply encode base64 strings
+ * @author massi
+ *
+ */
+public class Encoder {
+ public static native String encode(String toEncode) /*-{
+ return btoa(toEncode);
+ }-*/;
+
+ public static native String decode(String toDecode) /*-{
+ return atob(toDecode);
+}-*/;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ApplicationProfile.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ApplicationProfile.java
new file mode 100644
index 0000000..61bf77b
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ApplicationProfile.java
@@ -0,0 +1,77 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ * @version 0.1 Dec 2012
+ *
+ */
+@SuppressWarnings("serial")
+public class ApplicationProfile implements Serializable {
+
+ private String key;
+ private String name;
+ private String description;
+ private String imageUrl;
+ private String scope;
+ private String url;
+
+ public ApplicationProfile() {
+ super();
+ }
+
+ public ApplicationProfile(String key, String name, String description, String imageUrl, String scope, String url) {
+ super();
+ this.key = key;
+ this.name = name;
+ this.description = description;
+ this.imageUrl = imageUrl;
+ this.scope = scope;
+ this.url = url;
+ }
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public String getImageUrl() {
+ return imageUrl;
+ }
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+ public String getScope() {
+ return scope;
+ }
+ public void setScope(String scope) {
+ this.scope = scope;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+ public void setUrl(String url) {
+ this.url = url;
+ }
+ @Override
+ public String toString() {
+ return "ApplicationProfile [key=" + key + ", name=" + name + ", description="
+ + description + ", imageUrl=" + imageUrl + ", scope=" + scope
+ + ", url=" + url + "]";
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Attachment.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Attachment.java
new file mode 100644
index 0000000..bf81edd
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Attachment.java
@@ -0,0 +1,104 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+
+import org.jsonmaker.gwt.client.Jsonizer;
+
+@SuppressWarnings("serial")
+public class Attachment implements Serializable {
+
+ public interface AttachmentJsonizer extends Jsonizer {}
+
+ private String id;
+ private String uri;
+ private String name;
+ private String description;
+ private String thumbnailURL;
+ private String mimeType;
+
+ public Attachment() {
+ super();
+ }
+
+ /**
+ * @param id the id in the cassandra CF
+ * @param uri where you can download the file from
+ * @param name the name of the attached file
+ * @param description the description of the attached file
+ * @param thumbnailURL the URL of the image representing the attached file
+ * @param mimeType the type of file
+ */
+ public Attachment(String id, String uri, String name, String description,
+ String thumbnailURL, String mimeType) {
+ super();
+ this.id = id;
+ this.uri = uri;
+ this.name = name;
+ this.description = description;
+ this.thumbnailURL = thumbnailURL;
+ this.mimeType = mimeType;
+ }
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+
+ public String getName() {
+ return name;
+ }
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ public String getDescription() {
+ return description;
+ }
+
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+
+ public String getThumbnailURL() {
+ return thumbnailURL;
+ }
+
+
+ public void setThumbnailURL(String thumbnailURL) {
+ this.thumbnailURL = thumbnailURL;
+ }
+
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ public void setMimeType(String mimeType) {
+ this.mimeType = mimeType;
+ }
+
+ @Override
+ public String toString() {
+ return "Attachment [uri=" + uri + ", name=" + name + ", description="
+ + description + ", thumbnailURL=" + thumbnailURL
+ + ", mimeType=" + mimeType + "]";
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientAttachment.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientAttachment.java
new file mode 100644
index 0000000..2230791
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientAttachment.java
@@ -0,0 +1,34 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import jsinterop.annotations.JsOverlay;
+import jsinterop.annotations.JsPackage;
+import jsinterop.annotations.JsType;
+
+@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
+public class ClientAttachment {
+ public String id;
+ public String uri;
+ public String name;
+ public String description;
+ public String thumbnailURL;
+ public String mimeType;
+ /**
+ * @param id the id in the cassandra CF
+ * @param uri where you can download the file from
+ * @param name the name of the attached file
+ * @param description the description of the attached file
+ * @param thumbnailURL the URL of the image representing the attached file
+ * @param mimeType the type of file
+ */
+ @JsOverlay
+ public static ClientAttachment create(String id, String uri, String name, String description, String thumbnailURL, String mimeType) {
+ ClientAttachment o = new ClientAttachment();
+ o.id = id;
+ o.uri = uri;
+ o.name = name;
+ o.description = description;
+ o.thumbnailURL = thumbnailURL;
+ o.mimeType = mimeType;
+ return o;
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientPost.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientPost.java
new file mode 100644
index 0000000..d1b6e10
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ClientPost.java
@@ -0,0 +1,51 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.util.Date;
+
+import jsinterop.annotations.JsOverlay;
+import jsinterop.annotations.JsPackage;
+import jsinterop.annotations.JsType;
+/**
+ *
+ * @author Massimiliano Assante, CNR-ISTI
+ * Uses JsInterop annotations to deserialize the object
+ */
+@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
+public class ClientPost {
+ public String key;
+ public String type;
+ public String userid;
+ public Date time;
+ public String uri;
+ public String description;
+ public String fullName;
+ public String email;
+ public String thumbnailURL;
+ public String linkTitle;
+ public String linkDescription;
+ public String linkUrlThumbnail;
+ public String linkHost;
+ public ClientAttachment[] attachments;
+ @JsOverlay
+ public static ClientPost create(String key, String type, String userid, Date time,
+ String uri, String description, String fullName, String email,
+ String thumbnailURL, String linkTitle, String linkDescription,
+ String linkUrlThumbnail, String linkHost, ClientAttachment[] attachments) {
+ ClientPost o = new ClientPost();
+ o.key = key;
+ o.type = type;
+ o.userid = userid;
+ o.time = time;
+ o.uri = uri;
+ o.description = description;
+ o.fullName = fullName;
+ o.email = email;
+ o.thumbnailURL = thumbnailURL;
+ o.linkTitle = linkTitle;
+ o.linkDescription = linkDescription;
+ o.linkUrlThumbnail = linkUrlThumbnail;
+ o.linkHost = linkHost;
+ o.attachments = attachments;
+ return o;
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Comment.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Comment.java
new file mode 100644
index 0000000..4b06ac6
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Comment.java
@@ -0,0 +1,175 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ * @version 0.1 July 2012
+ *
+ */
+@SuppressWarnings("serial")
+public class Comment implements Serializable, Comparable {
+
+ private String key;
+ private String userid;
+ private Date time;
+ private String postid;
+ private String text;
+ private String fullName;
+ private String thumbnailURL;
+ private boolean isEdit; // false default
+ private Date lastEditTime; // null default
+
+ /**
+ *
+ */
+ public Comment() {
+ super();
+ }
+ /**
+ *
+ * @param key
+ * @param userid
+ * @param time
+ * @param postid
+ * @param text
+ * @param fullName
+ * @param thumbnailURL
+ */
+ public Comment(String key, String userid, Date time, String postid,
+ String text, String fullName, String thumbnailURL) {
+ super();
+ this.key = key;
+ this.userid = userid;
+ this.time = time;
+ this.postid = postid;
+ this.text = text;
+ this.fullName = fullName;
+ this.thumbnailURL = thumbnailURL;
+ this.isEdit = false;
+ this.lastEditTime = null;
+
+ }
+
+ /**
+ * Constructor for edited comment
+ * @param key
+ * @param userid
+ * @param time
+ * @param postid
+ * @param text
+ * @param fullName
+ * @param thumbnailURL
+ * @param isEdit
+ * @param editDate
+ */
+ public Comment(String key, String userid, Date time, String postid,
+ String text, String fullName, String thumbnailURL, boolean isEdit, Date editDate) {
+ super();
+ this.key = key;
+ this.userid = userid;
+ this.time = time;
+ this.postid = postid;
+ this.text = text;
+ this.fullName = fullName;
+ this.thumbnailURL = thumbnailURL;
+ this.isEdit = isEdit;
+ this.lastEditTime = editDate;
+ }
+
+ /**
+ *
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+ /**
+ *
+ * @param text text to add as string
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+ /**
+ *
+ * @return the uuid
+ */
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getUserid() {
+ return userid;
+ }
+
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public String getPostid() {
+ return postid;
+ }
+
+ public void setPostid(String postid) {
+ this.postid = postid;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getThumbnailURL() {
+ return thumbnailURL;
+ }
+
+ public void setThumbnailURL(String thumbnailURL) {
+ this.thumbnailURL = thumbnailURL;
+ }
+
+ public boolean isEdit() {
+ return isEdit;
+ }
+ public void setEdit(boolean isEdit) {
+ this.isEdit = isEdit;
+ }
+ public Date getLastEditTime() {
+ return lastEditTime;
+ }
+ public void setLastEditTime(Date lastEditTime) {
+ this.lastEditTime = lastEditTime;
+ }
+ public int compareTo(Comment toCompare) {
+ if (this.time.after(toCompare.getTime()))
+ return 1;
+ if (this.time.before(toCompare.getTime()))
+ return -1;
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return "Comment [key=" + key + ", userid=" + userid + ", time=" + time
+ + ", postid=" + postid + ", text=" + text + ", fullName="
+ + fullName + ", thumbnailURL=" + thumbnailURL + ", isEdit="
+ + isEdit + ", lastEditTime=" + lastEditTime + "]";
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/EnhancedPost.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/EnhancedPost.java
new file mode 100644
index 0000000..1b61ff3
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/EnhancedPost.java
@@ -0,0 +1,85 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+/**
+ *
+ * @author massi
+ * This class contains addtional user related information about a post
+ * e.g. if this user has liked it
+ */
+@SuppressWarnings("serial")
+public class EnhancedPost implements Serializable{
+ private Post post;
+ private boolean liked;
+ private boolean isUsers;
+ private ArrayList comments;
+ private ArrayList attachments;
+
+
+ public EnhancedPost() {
+ super();
+ }
+ public EnhancedPost(Post post, boolean liked, boolean isUsers) {
+ super();
+ this.post = post;
+ this.liked = liked;
+ this.isUsers = isUsers;
+ }
+
+ public EnhancedPost(Post post, boolean liked, boolean isUsers, ArrayList comments) {
+ super();
+ this.isUsers = isUsers;
+ this.post = post;
+ this.liked = liked;
+ this.comments = comments;
+ }
+
+
+ public EnhancedPost(Post post, boolean liked, boolean isUsers,
+ ArrayList comments, ArrayList attachments) {
+ super();
+ this.post = post;
+ this.liked = liked;
+ this.isUsers = isUsers;
+ this.comments = comments;
+ this.attachments = attachments;
+ }
+ public ArrayList getComments() {
+ return comments;
+ }
+ public void setComments(ArrayList comments) {
+ this.comments = comments;
+ }
+ public Post getPost() {
+ return post;
+ }
+ public void setPost(Post post) {
+ this.post = post;
+ }
+ public boolean isLiked() {
+ return liked;
+ }
+ public void setLiked(boolean liked) {
+ this.liked = liked;
+ }
+ public boolean isUsers() {
+ return isUsers;
+ }
+ public void setUsers(boolean isUsers) {
+ this.isUsers = isUsers;
+ }
+ public ArrayList getAttachments() {
+ return attachments;
+ }
+ public void setAttachments(ArrayList attachments) {
+ this.attachments = attachments;
+ }
+ @Override
+ public String toString() {
+ return "EnhancedPost [post=" + post + ", liked=" + liked + ", isUsers="
+ + isUsers + ", comments=" + comments + ", attachments="
+ + attachments + "]";
+ }
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ImageType.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ImageType.java
new file mode 100644
index 0000000..9e4f52c
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ImageType.java
@@ -0,0 +1,5 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+public enum ImageType {
+ JPG, GIF, PNG, TIFF, PDF, BMP;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Invite.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Invite.java
new file mode 100644
index 0000000..cca66f6
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Invite.java
@@ -0,0 +1,144 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ *
+ */
+@SuppressWarnings("serial")
+public class Invite implements Serializable {
+
+ private String key;
+ private String senderUserId;
+ private String vreid;
+ private String invitedEmail;
+ private String controlCode;
+ private InviteStatus status;
+ private Date time;
+ private String senderFullName;
+
+
+ public Invite() {
+ super();
+ }
+
+
+
+
+ public Invite(String key, String senderUserId, String vreid,
+ String invitedEmail, String controlCode, InviteStatus status,
+ Date time, String senderFullName) {
+ super();
+ this.key = key;
+ this.senderUserId = senderUserId;
+ this.vreid = vreid;
+ this.invitedEmail = invitedEmail;
+ this.controlCode = controlCode;
+ this.status = status;
+ this.time = time;
+ this.senderFullName = senderFullName;
+ }
+
+
+
+
+ public String getKey() {
+ return key;
+ }
+
+
+
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+
+
+
+ public String getSenderUserId() {
+ return senderUserId;
+ }
+
+
+ public void setSenderUserId(String senderUserId) {
+ this.senderUserId = senderUserId;
+ }
+
+
+ public String getVreid() {
+ return vreid;
+ }
+
+
+ public void setVreid(String vreid) {
+ this.vreid = vreid;
+ }
+
+
+ public String getInvitedEmail() {
+ return invitedEmail;
+ }
+
+
+ public void setInvitedEmail(String invitedEmail) {
+ this.invitedEmail = invitedEmail;
+ }
+
+
+ public String getControlCode() {
+ return controlCode;
+ }
+
+
+ public void setControlCode(String controlCode) {
+ this.controlCode = controlCode;
+ }
+
+
+ public InviteStatus getStatus() {
+ return status;
+ }
+
+
+ public void setStatus(InviteStatus status) {
+ this.status = status;
+ }
+
+
+ public Date getTime() {
+ return time;
+ }
+
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+
+ public String getSenderFullName() {
+ return senderFullName;
+ }
+
+
+ public void setSenderFullName(String senderFullName) {
+ this.senderFullName = senderFullName;
+ }
+
+
+
+
+ @Override
+ public String toString() {
+ return "Invite [key=" + key + ", senderUserId=" + senderUserId
+ + ", vreid=" + vreid + ", invitedEmail=" + invitedEmail
+ + ", controlCode=" + controlCode + ", status=" + status
+ + ", time=" + time + ", senderFullName=" + senderFullName + "]";
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteOperationResult.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteOperationResult.java
new file mode 100644
index 0000000..dbd57df
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteOperationResult.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+public enum InviteOperationResult {
+ SUCCESS,
+ FAILED,
+ //If I send an invite the same email in the same environment more than once
+ ALREADY_INVITED;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteStatus.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteStatus.java
new file mode 100644
index 0000000..b838d6e
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/InviteStatus.java
@@ -0,0 +1,20 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+public enum InviteStatus {
+ /**
+ * First status of anyh invite
+ */
+ PENDING,
+ /**
+ * User accepted the invite
+ */
+ ACCEPTED,
+ /**
+ * User rejected the invite
+ */
+ REJECTED,
+ /**
+ * Manager withdrawed the invite
+ */
+ RETRACTED;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JSON.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JSON.java
new file mode 100644
index 0000000..98a2c4f
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JSON.java
@@ -0,0 +1,10 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import jsinterop.annotations.JsPackage;
+import jsinterop.annotations.JsType;
+
+@JsType(isNative = true, namespace = JsPackage.GLOBAL)
+public class JSON {
+ public static native String stringify(Object o);
+ public static native O parse(String json);
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JobStatusType.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JobStatusType.java
new file mode 100644
index 0000000..a786e94
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/JobStatusType.java
@@ -0,0 +1,53 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ * @version 0.1 Dec 2012
+ *
+ */
+public enum JobStatusType {
+ /**
+ * The job has been cancelled.
+ */
+ CANCELLED,
+ /**
+ * The job is in the process of being cancelled.
+ */
+ CANCELLING,
+ /**
+ * The job has been deleted.
+ */
+ DELETED,
+ /**
+ * The job is in the process of being deleted.
+ */
+ DELETING,//
+ /**
+ * The job is being executed by job processor.
+ */
+ EXECUTING,//
+ /**
+ * he job execution has failed.
+ */
+ FAILED,
+ /**
+ * The job is new.
+ */
+ NEW,//
+ /**
+ * The job is submitted for execution.
+ */
+ SUBMITTED,
+ /**
+ * The job has completed successfully
+ */
+ SUCCEEDED,
+ /**
+ * The job execution has timed out.
+ */
+ TIMED_OUT,
+ /**
+ * The job is waiting for available job processor.
+ */
+ WAITING
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Like.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Like.java
new file mode 100644
index 0000000..1b41681
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Like.java
@@ -0,0 +1,88 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ * @version 0.1 July 2012
+ *
+ */
+@SuppressWarnings("serial")
+public class Like implements Serializable {
+
+ private String key;
+ private String userid;
+ private Date time;
+ private String postid;
+ private String fullName;
+ private String thumbnailURL;
+
+ public Like() {
+ super();
+ }
+
+ public Like(String key, String userid, Date time, String postid,
+ String fullName, String thumbnailURL) {
+ super();
+ this.key = key;
+ this.userid = userid;
+ this.time = time;
+ this.postid = postid;
+ this.fullName = fullName;
+ this.thumbnailURL = thumbnailURL;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getUserid() {
+ return userid;
+ }
+
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public String getPostid() {
+ return postid;
+ }
+
+ public void setPostid(String postid) {
+ this.postid = postid;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getThumbnailURL() {
+ return thumbnailURL;
+ }
+
+ public void setThumbnailURL(String thumbnailURL) {
+ this.thumbnailURL = thumbnailURL;
+ }
+
+ public String toString() {
+ return "KEY: " + key + " Time: "+ time + "\nuserid: "+userid + " Full name: " + fullName;
+
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Notification.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Notification.java
new file mode 100644
index 0000000..1ab36b1
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Notification.java
@@ -0,0 +1,193 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ *
+ */
+@SuppressWarnings("serial")
+public class Notification implements Serializable {
+
+ private String key;
+ private NotificationType type;
+ private String userid;
+ private String subjectid;
+ private Date time;
+ private String uri;
+ private String description;
+ private boolean read;
+ private String senderid;
+ private String senderFullName;
+ private String senderThumbnail;
+ private String commentKey;
+
+
+ /**
+ * default constructor
+ */
+ public Notification() {
+ super();
+ }
+
+
+
+ /**
+ *
+ * @param key
+ * @param type
+ * @param userid
+ * @param subjectid the subject id of this notification, if is a like on a post then is the postid, it is a message then is the messageid and so on
+ * @param time
+ * @param uri
+ * @param description
+ * @param read
+ * @param senderid
+ * @param senderFullName
+ * @param senderThumbnail
+ */
+ public Notification(String key, NotificationType type, String userid,
+ String subjectid, Date time, String uri, String description,
+ boolean read, String senderid, String senderFullName,
+ String senderThumbnail) {
+ super();
+ this.key = key;
+ this.type = type;
+ this.userid = userid;
+ this.subjectid = subjectid;
+ this.time = time;
+ this.uri = uri;
+ this.description = description;
+ this.read = read;
+ this.senderid = senderid;
+ this.senderFullName = senderFullName;
+ this.senderThumbnail = senderThumbnail;
+ }
+
+ /**
+ *
+ * @param key
+ * @param type
+ * @param userid
+ * @param subjectid the subject id of this notification, if is a like on a post then is the postid, it is a message then is the messageid and so on
+ * @param time
+ * @param uri
+ * @param description
+ * @param read
+ * @param senderid
+ * @param senderFullName
+ * @param senderThumbnail
+ * @param commentKey when a mail notification must be sent, stop the embedded discussion at this comment
+ */
+ public Notification(String key, NotificationType type, String userid,
+ String subjectid, Date time, String uri, String description,
+ boolean read, String senderid, String senderFullName,
+ String senderThumbnail, String commentKey) {
+ super();
+ this.key = key;
+ this.type = type;
+ this.userid = userid;
+ this.subjectid = subjectid;
+ this.time = time;
+ this.uri = uri;
+ this.description = description;
+ this.read = read;
+ this.senderid = senderid;
+ this.senderFullName = senderFullName;
+ this.senderThumbnail = senderThumbnail;
+ this.commentKey = commentKey;
+ }
+
+ /**
+ *
+ * @return .
+ */
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+ public NotificationType getType() {
+ return type;
+ }
+ public void setType(NotificationType type) {
+ this.type = type;
+ }
+ public String getUserid() {
+ return userid;
+ }
+ public void setUserid(String userid) {
+ this.userid = userid;
+ }
+ public Date getTime() {
+ return time;
+ }
+ public void setTime(Date time) {
+ this.time = time;
+ }
+ public String getUri() {
+ return uri;
+ }
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public boolean isRead() {
+ return read;
+ }
+ public void setRead(boolean read) {
+ this.read = read;
+ }
+ public String getSenderid() {
+ return senderid;
+ }
+ public void setSenderid(String senderid) {
+ this.senderid = senderid;
+ }
+ public String getSenderFullName() {
+ return senderFullName;
+ }
+ public void setSenderFullName(String senderFullName) {
+ this.senderFullName = senderFullName;
+ }
+ public String getSenderThumbnail() {
+ return senderThumbnail;
+ }
+ public void setSenderThumbnail(String senderThumbnail) {
+ this.senderThumbnail = senderThumbnail;
+ }
+ public String getSubjectid() {
+ return subjectid;
+ }
+ public void setSubjectid(String subjectid) {
+ this.subjectid = subjectid;
+ }
+
+ public String getCommentKey() {
+ return commentKey;
+ }
+
+
+
+ public void setCommentKey(String commentKey) {
+ this.commentKey = commentKey;
+ }
+
+ @Override
+ public String toString() {
+ return "Notification [key=" + key + ", type=" + type + ", userid="
+ + userid + ", subjectid=" + subjectid + ", time=" + time
+ + ", uri=" + uri + ", description=" + description + ", read="
+ + read + ", senderid=" + senderid + ", senderFullName="
+ + senderFullName + ", senderThumbnail=" + senderThumbnail
+ + ", commentKey=" + commentKey + "]";
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationChannelType.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationChannelType.java
new file mode 100644
index 0000000..2f12fb8
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationChannelType.java
@@ -0,0 +1,20 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+/**
+ * @author Massimiliano Assante ISTI-CNR
+ *
+ * @version 1.0 January 2012
+ */
+public enum NotificationChannelType {
+ /**
+ * PORTAL
+ */
+ PORTAL,
+ /**
+ * EMAIL
+ */
+ EMAIL,
+ /**
+ * TWITTER
+ */
+ TWITTER;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationType.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationType.java
new file mode 100644
index 0000000..03e4a9d
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationType.java
@@ -0,0 +1,181 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+
+
+/**
+ * @author Massimiliano Assante ISTI-CNR
+ *
+ * TODO: Buggy if NotificationType for WP_* are refactored see DBCassandraAstyanaxImpl#getUserNotificationPreferences(String userid)
+ * introduced due to urgent matters
+ */
+public enum NotificationType {
+ /**
+ * use to notify a user he got a Tabular Resource shared
+ */
+ TDM_TAB_RESOURCE_SHARE,
+ /**
+ * use to notify a user he got a TDM Rule shared
+ */
+ TDM_RULE_SHARE,
+ /**
+ * use to notify a user he got a TDM Templated shared
+ */
+ TDM_TEMPLATE_SHARE,
+ /**
+ * use to notify a user he got a workspace folder shared
+ */
+ WP_FOLDER_SHARE,
+ /**
+ * use to notify a user that a user in the share unshared
+ */
+ WP_FOLDER_UNSHARE,
+ /**
+ * use to notify a user that he got upgraded to administrator of a shared folder
+ */
+ WP_ADMIN_UPGRADE,
+ /**
+ * use to notify a user that he got downgraded from administrator of a shared folder
+ */
+ WP_ADMIN_DOWNGRADE,
+ /**
+ * use to notify a user that a new user was added in on of his workspace shared folder
+ */
+ WP_FOLDER_ADDEDUSER,
+ /**
+ * use to notify a user that an existing user was removed from one of his workspace shared folder
+ */
+ WP_FOLDER_REMOVEDUSER,
+ /**
+ * use to notify a user he got a workspace folder renamed
+ */
+ WP_FOLDER_RENAMED,
+ /**
+ * use to notify a user he got a workspace item deleted from one of his workspace shared folder
+ */
+ WP_ITEM_DELETE,
+ /**
+ * use to notify a user he got a workspace item updated from one of his workspace shared folder
+ */
+ WP_ITEM_UPDATED,
+ /**
+ * use to notify a user he got a workspace item renamed from one of his workspace shared folder
+ */
+ WP_ITEM_RENAMED,
+ /**
+ * use to notify a user he got a workspace item new in some of his workspace shared folder
+ */
+ WP_ITEM_NEW,
+ /**
+ * use to notify a user he got one of his post commented
+ */
+ OWN_COMMENT,
+ /**
+ * use to notify a user that commented on a post (Not his) that someone commented too
+ */
+ COMMENT,
+ /**
+ * use to notify a user that he got mentioned in one post
+ */
+ MENTION,
+ /**
+ * use to notify a user he got one of his post liked
+ */
+ LIKE,
+ /**
+ * use to notify a user he got a message
+ */
+ MESSAGE,
+ /**
+ * use to notify every user of a VRE/Group that the post was made
+ */
+ POST_ALERT,
+ /**
+ * use to notify a user that someone in his VRE created a new Event in the Calendar
+ */
+ CALENDAR_ADDED_EVENT,
+ /**
+ * use to notify a user that someone in his VRE updated an Event in the Calendar
+ */
+ CALENDAR_UPDATED_EVENT,
+ /**
+ * use to notify a user that someone in his VRE deleted an Event in the Calendar
+ */
+ CALENDAR_DELETED_EVENT,
+ /**
+ * use to notify a user he got a connections request
+ */
+ REQUEST_CONNECTION,
+ /**
+ * use to notify a user he got a job completed ok
+ */
+ JOB_COMPLETED_OK,
+ /**
+ * use to notify a user he got a job completed not ok
+ */
+ JOB_COMPLETED_NOK,
+ /**
+ * use to notify a document workflow owner that someone
+ * has edited a document involved in a worflow he created
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_EDIT,
+ /**
+ * use to notify a document workflow owner that someone
+ * has viewed a document involved in a worflow he created
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_VIEW,
+ /**
+ * use to notify a document workflow user (user that in the same document workflow)
+ * that forwarded to a step where he is requested to do a task
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_STEP_REQUEST_TASK,
+ /**
+ * use to notify a document workflow user that he was involved into a new Document Workflow
+ * and he is requested to do a task
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT,
+ /**
+ * use to notify a document workflow owner that a user performed a forward action to another step a document worflow he created
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER,
+ /**
+ * use to notify a document workflow owner that someone
+ * forwarded and the workflow moved to another step a document worflow he created
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER,
+ /**
+ * use to notify a document workflow peer (user that in the same step has your same role)
+ * that someone performed a forward action to another step in a document worflow he is involved into
+ */
+ @Deprecated
+ DOCUMENT_WORKFLOW_STEP_FORWARD_PEER,
+ /**
+ * catalogue, use to notify someone submits an item for consideration
+ */
+ CAT_ITEM_SUBMITTED,
+ /**
+ * catalogue, use to notify someone rejected a submitted item
+ */
+ CAT_ITEM_REJECTED,
+ /**
+ * catalogue, use to notify someone published an item
+ */
+ CAT_ITEM_PUBLISHED,
+ /**
+ * catalogue, use to notify someone updated an item
+ */
+ CAT_ITEM_UPDATED,
+ /**
+ * catalogue, use to notify someone removed an item
+ */
+ CAT_ITEM_DELETE,
+ /**
+ * generic notification
+ */
+ GENERIC;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Post.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Post.java
new file mode 100644
index 0000000..bc01274
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Post.java
@@ -0,0 +1,322 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ *
+ */
+@SuppressWarnings("serial")
+public class Post implements Serializable, Comparable {
+
+ private String key;
+ private PostType type;
+ private String entityId;
+ private Date time;
+ private String vreid;
+ private String uri;
+ private String uriThumbnail;
+ private String description;
+ private PrivacyLevel privacy;
+ private String fullName;
+ private String email;
+ private String thumbnailURL;
+ private String commentsNo;
+ private String likesNo;
+ private String linkTitle;
+ private String linkDescription;
+ private String linkHost;
+ boolean applicationPost;
+ /**
+ * this boolean indicates that the attachments to the post are > 1
+ */
+ boolean multiFileUpload;
+ /**
+ * default constructor
+ */
+ public Post() {
+ super();
+ }
+ /**
+ * To use ONLY for USER Posts
+ *
+ *
+ * @param key a UUID
+ * @param type an instance of PostType
+ * @param entityId the user or the app unique indentifier
+ * @param time when
+ * @param vreid a unique vre id
+ * @param uri optional uri
+ * @param uriThumbnail the thumbnail for the link posted
+ * @param description optional description
+ * @param privacy the privacy level of PrivacyLevel
+ * @param fullName
+ * @param email
+ * @param thumbnailURL this is the user thumbnail url
+ * @param linkTitle optional to be used when posting links
+ * @param linkDescription optional to be used when posting links
+ * @param linkHost option to be used when posting linkgs
+ */
+ public Post(String key, PostType type, String entityId, Date time,
+ String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy,
+ String fullName, String email, String thumbnailURL, String linkTitle, String linkDescription, String linkHost) {
+ this.key = key;
+ this.type = type;
+ this.entityId = entityId;
+ this.time = time;
+ this.vreid = vreid;
+ this.uri = uri;
+ this.uriThumbnail = uriThumbnail;
+ this.description = description;
+ this.privacy = privacy;
+ this.fullName = fullName;
+ this.email = email;
+ this.thumbnailURL = thumbnailURL;
+ this.commentsNo = "0";
+ this.likesNo = "0";
+ this.linkDescription = linkDescription;
+ this.linkTitle = linkTitle;
+ this.linkHost = linkHost;
+ this.applicationPost = false;
+ }
+ /**
+ * To use for USER and ApplicationProfile Posts
+ *
+ * @param key a UUID
+ * @param type an instance of PostType
+ * @param entityId the user or the app unique indentifier
+ * @param time when
+ * @param vreid a unique vre id
+ * @param uri optional uri
+ * @param uriThumbnail the thumbnail for the link posted
+ * @param description optional description
+ * @param privacy the privacy level of PrivacyLevel
+ * @param fullName
+ * @param email
+ * @param thumbnailURL this is the user thumbnail url
+ * @param linkTitle optional to be used when posting links
+ * @param linkDescription optional to be used when posting links
+ * @param applicationPost tell if this is an application post or a user post
+ */
+ public Post(String key, PostType type, String entityId, Date time,
+ String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy,
+ String fullName, String email, String thumbnailURL, String linkTitle, String linkDescription, String linkHost, boolean applicationPost) {
+ this(key, type, entityId, time, vreid, uri, uriThumbnail, description, privacy, fullName, email, thumbnailURL, linkTitle, linkDescription, linkHost);
+ this.applicationPost = applicationPost;
+ }
+
+
+ /**
+ * for serialization purposes
+ * @param key a UUID
+ * @param type an instance of PostType
+ * @param entityId the user or the app unique indentifier
+ * @param time when
+ * @param vreid a unique vre id
+ * @param uri optional uri
+ * @param uriThumbnail the thumbnail for the link posted
+ * @param description optional description
+ * @param privacy the privacy level of PrivacyLevel
+ * @param fullName
+ * @param email
+ * @param thumbnailURL this is the user thumbnail url
+ * @param linkTitle optional to be used when posting links
+ * @param linkDescription optional to be used when posting links
+ */
+ public Post(String key, PostType type, String entityId, Date time,
+ String vreid, String uri, String uriThumbnail, String description, PrivacyLevel privacy,
+ String fullName, String email, String thumbnailURL, String commentsNo,
+ String likesNo, String linkTitle, String linkDescription, String linkHost, boolean applicationPost, boolean multiFileUpload) {
+ super();
+ this.key = key;
+ this.type = type;
+ this.entityId = entityId;
+ this.time = time;
+ this.vreid = vreid;
+ this.uri = uri;
+ this.uriThumbnail = uriThumbnail;
+ this.description = description;
+ this.privacy = privacy;
+ this.fullName = fullName;
+ this.email = email;
+ this.thumbnailURL = thumbnailURL;
+ this.commentsNo = commentsNo;
+ this.likesNo = likesNo;
+ this.linkDescription = linkDescription;
+ this.linkTitle = linkTitle;
+ this.linkHost = linkHost;
+ this.applicationPost = applicationPost;
+ this.multiFileUpload = multiFileUpload;
+ }
+ /**
+ *
+ * @return post id
+ */
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public PostType getType() {
+ return type;
+ }
+
+ public void setType(PostType type) {
+ this.type = type;
+ }
+ /**
+ *
+ * @return the User or the App id
+ */
+ public String getEntityId() {
+ return entityId;
+ }
+ /**
+ * set the User or the App id
+ * @param entityId the UserId or the AppId id
+ */
+ public void setEntityId(String entityId) {
+ this.entityId = entityId;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public String getVreid() {
+ return vreid;
+ }
+
+ public void setVreid(String vreid) {
+ this.vreid = vreid;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public PrivacyLevel getPrivacy() {
+ return privacy;
+ }
+
+ public void setPrivacy(PrivacyLevel privacy) {
+ this.privacy = privacy;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getThumbnailURL() {
+ return thumbnailURL;
+ }
+
+ public void setThumbnailURL(String thumbnailURL) {
+ this.thumbnailURL = thumbnailURL;
+ }
+
+ public String getCommentsNo() {
+ return commentsNo;
+ }
+ public void setCommentsNo(String commentsNo) {
+ this.commentsNo = commentsNo;
+ }
+ public String getLikesNo() {
+ return likesNo;
+ }
+ public void setLikesNo(String likesNo) {
+ this.likesNo = likesNo;
+ }
+ public String getUriThumbnail() {
+ return uriThumbnail;
+ }
+ public void setUriThumbnail(String uriThumbnail) {
+ this.uriThumbnail = uriThumbnail;
+ }
+
+ public String getLinkTitle() {
+ return linkTitle;
+ }
+ public void setLinkTitle(String linkTitle) {
+ this.linkTitle = linkTitle;
+ }
+ public String getLinkDescription() {
+ return linkDescription;
+ }
+ public void setLinkDescription(String linkDescription) {
+ this.linkDescription = linkDescription;
+ }
+ public int compareTo(Post toCompare) {
+ if (this.time.after(toCompare.getTime()))
+ return 1;
+ if (this.time.before(toCompare.getTime()))
+ return -1;
+ return 0;
+ }
+ public String getLinkHost() {
+ return linkHost;
+ }
+ public void setLinkHost(String linkHost) {
+ this.linkHost = linkHost;
+ }
+
+ public boolean isApplicationPost() {
+ return applicationPost;
+ }
+ public void setApplicationPost(boolean applicationPost) {
+ this.applicationPost = applicationPost;
+ }
+ public boolean isMultiFileUpload() {
+ return multiFileUpload;
+ }
+ public void setMultiFileUpload(boolean multiFileUpload) {
+ this.multiFileUpload = multiFileUpload;
+ }
+ @Override
+ public String toString() {
+ return "Post [key=" + key + ", type=" + type + ", entityId=" + entityId
+ + ", time=" + time + ", vreid=" + vreid + ", uri=" + uri
+ + ", uriThumbnail=" + uriThumbnail + ", description="
+ + description + ", privacy=" + privacy + ", fullName="
+ + fullName + ", email=" + email + ", thumbnailURL="
+ + thumbnailURL + ", commentsNo=" + commentsNo + ", likesNo="
+ + likesNo + ", linkTitle=" + linkTitle + ", linkDescription="
+ + linkDescription + ", linkHost=" + linkHost
+ + ", applicationPost=" + applicationPost
+ + ", multiFileUpload=" + multiFileUpload + "]";
+ }
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostType.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostType.java
new file mode 100644
index 0000000..1ef857f
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostType.java
@@ -0,0 +1,18 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+/**
+ * @author Massimiliano Assante ISTI-CNR
+ *
+ */
+public enum PostType {
+ JOIN, SHARE, PUBLISH, TWEET, CONNECTED,
+ /**
+ * Special case used when accounting
+ */
+ ACCOUNTING,
+ /**
+ * Special case used when a Post is removed
+ */
+ DISABLED;
+}
+
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostWithAttachment.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostWithAttachment.java
new file mode 100644
index 0000000..242c8b0
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PostWithAttachment.java
@@ -0,0 +1,56 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.List;
+
+@SuppressWarnings("serial")
+public class PostWithAttachment implements Serializable {
+ private Post post;
+ private List attachments;
+
+ public PostWithAttachment(Post post, List attachments){
+ super();
+ this.post = post;
+ this.attachments = attachments;
+ }
+
+ public void setAttachments(List attachments) {
+ this.attachments = attachments;
+ }
+ public void setPost(Post post) {
+ this.post = post;
+ }
+
+
+ public List getAttachments() {
+ return attachments;
+ }
+
+ public Post getPost() {
+ return post;
+ }
+
+ public String toString() {
+ String postInfo = "Post [key=" + post.getKey() + ", type=" + post.getType() + ", entityId=" + post.getEntityId()
+ + ", time=" + post.getTime() + ", vreid=" + post.getVreid() + ", uri=" + post.getUri()
+ + ", uriThumbnail=" + post.getUriThumbnail() + ", description="
+ + post.getDescription() + ", privacy=" + post.getPrivacy() + ", fullName="
+ + post.getFullName() + ", email=" + post.getEmail() + ", thumbnailURL="
+ + post.getThumbnailURL() + ", commentsNo=" + post.getCommentsNo() + ", likesNo="
+ + post.getLikesNo() + ", linkTitle=" + post.getLinkTitle() + ", linkDescription="
+ + post.getLinkDescription() + ", linkHost=" + post.getLinkHost()
+ + ", applicationPost=" + post.isApplicationPost()
+ + ", multiFileUpload=" + post.isMultiFileUpload() + "]";
+ String attachmentInfo = "[Attachments: ";
+ for (Attachment attachment: attachments){
+ attachmentInfo += "[Attachment [key=" + attachment.getId() + ", uri=" + attachment.getUri() + ", name=" + attachment.getName() + ", description="
+ + attachment.getDescription() + ", thumbnailURL=" + attachment.getThumbnailURL()
+ + ", mimeType=" + attachment.getMimeType() + "]],";
+ }
+ attachmentInfo = attachmentInfo.substring(0, attachmentInfo.length()-1);
+ attachmentInfo += "]";
+ ;
+
+ return "[" + postInfo + ", " + attachmentInfo + "]" ;
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PrivacyLevel.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PrivacyLevel.java
new file mode 100644
index 0000000..1070e0a
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/PrivacyLevel.java
@@ -0,0 +1,9 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+/**
+ * @author Massimiliano Assante ISTI-CNR
+ *
+ * @version 1.0 July 6th 2012
+ */
+public enum PrivacyLevel {
+ PRIVATE, CONNECTION, VRES, SINGLE_VRE, PORTAL, PUBLIC;
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RangePosts.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RangePosts.java
new file mode 100644
index 0000000..368ee0f
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RangePosts.java
@@ -0,0 +1,40 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+/**
+ *
+ * @author Massimiliano Assante, ISTI-CNR
+ *
+ */
+@SuppressWarnings("serial")
+public class RangePosts implements Serializable {
+
+ private int lastReturnedPostTimelineIndex;
+ private ArrayList posts;
+
+ public RangePosts() {
+ super();
+ }
+
+ public RangePosts(int lastReturnedPostTimelineIndex, ArrayList posts) {
+ super();
+ this.lastReturnedPostTimelineIndex = lastReturnedPostTimelineIndex;
+ this.posts = posts;
+ }
+
+ public int getLastReturnedPostTimelineIndex() {
+ return lastReturnedPostTimelineIndex;
+ }
+ public void setLastReturnedPostTimelineIndex(int lastReturnedPostTimelineIndex) {
+ this.lastReturnedPostTimelineIndex = lastReturnedPostTimelineIndex;
+ }
+ public ArrayList getPosts() {
+ return posts;
+ }
+ public void setPosts(ArrayList posts) {
+ this.posts = posts;
+ }
+
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RunningJob.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RunningJob.java
new file mode 100644
index 0000000..71ef7f2
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/RunningJob.java
@@ -0,0 +1,83 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+
+/**
+ * The RunningJob class.
+ * @author Massimiliano Assante, ISTI-CNR (massimiliano.assante@isti.cnr.it)
+ * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
+ */
+@SuppressWarnings("serial")
+public class RunningJob implements Serializable {
+
+ private String jobId;
+ private String jobName;
+ private JobStatusType status;
+ private String message;
+ private String serviceName; // i.e., Dataminer, SmartExecutor..
+
+ public RunningJob() {
+ super();
+ }
+
+ /** Buind a RunningJob object.
+ * @param jobId
+ * @param jobName
+ * @param status
+ * @param message
+ * @param serviceName
+ */
+ public RunningJob(String jobId, String jobName, JobStatusType status,
+ String message, String serviceName) {
+ super();
+ this.jobId = jobId;
+ this.jobName = jobName;
+ this.status = status;
+ this.message = message;
+ this.serviceName = serviceName;
+ }
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getJobId() {
+ return jobId;
+ }
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+ public String getJobName() {
+ return jobName;
+ }
+ public void setJobName(String jobName) {
+ this.jobName = jobName;
+ }
+ public JobStatusType getStatus() {
+ return status;
+ }
+ public void setStatus(JobStatusType status) {
+ this.status = status;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ @Override
+ public String toString() {
+ return "RunningJob [" + (jobId != null ? "jobId=" + jobId + ", " : "")
+ + (jobName != null ? "jobName=" + jobName + ", " : "")
+ + (status != null ? "status=" + status + ", " : "")
+ + (message != null ? "message=" + message + ", " : "")
+ + (serviceName != null ? "serviceName=" + serviceName : "")
+ + "]";
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ShowUserStatisticAction.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ShowUserStatisticAction.java
new file mode 100644
index 0000000..d0fc011
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/ShowUserStatisticAction.java
@@ -0,0 +1,25 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+/**
+ * Enum class that specify the possible actions to take when the GCubeSocialNetworking.SHOW_STATISTICS_ACTION_OID parameter
+ * is found in the page url
+ * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
+ */
+public enum ShowUserStatisticAction {
+
+ POSTS_MADE_BY_USER("Your recent posts"),
+ LIKES_MADE_BY_USER("Posts you liked"),
+ COMMENTS_MADE_BY_USER("Posts you commented"),
+ LIKES_GOT_BY_USER("Likes to your posts"),
+ COMMENTS_GOT_BY_USER("Replies to your posts");
+
+ private final String actionHumanFriendly;
+
+ private ShowUserStatisticAction(String s) {
+ actionHumanFriendly = s;
+ }
+
+ public String getHumanFriendlyAction() {
+ return this.actionHumanFriendly;
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/UserInfo.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/UserInfo.java
new file mode 100644
index 0000000..44f46cb
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/UserInfo.java
@@ -0,0 +1,121 @@
+package org.gcube.social_networking.socialnetworking.model.shared;
+
+import java.io.Serializable;
+import java.util.HashMap;
+
+/**
+ * @author Massimiliano Assante ISTI-CNR
+ */
+@SuppressWarnings("serial")
+public class UserInfo implements Serializable {
+
+ public transient final static String USER_INFO_ATTR = "USER_INFO_ATTR";
+
+ private String username;
+
+ private String fullName;
+
+ private String avatarId;
+
+ private String emailaddress;
+
+ private String accountURL;
+
+ private boolean male;
+
+ private boolean admin;
+
+ private HashMap ownVREs;
+
+ public UserInfo() {
+ super();
+ }
+
+ public UserInfo(String username, String fullName, String avatarId,
+ String emailaddress, String accountURL, boolean male,
+ boolean admin, HashMap ownVREs) {
+ super();
+ this.username = username;
+ this.fullName = fullName;
+ this.avatarId = avatarId;
+ this.emailaddress = emailaddress;
+ this.accountURL = accountURL;
+ this.male = male;
+ this.admin = admin;
+ this.ownVREs = ownVREs;
+ }
+
+ public String getAccountURL() {
+ return accountURL;
+ }
+
+ public void setAccountURL(String accountURL) {
+ this.accountURL = accountURL;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getAvatarId() {
+ return avatarId;
+ }
+
+ public void setAvatarId(String avatarId) {
+ this.avatarId = avatarId;
+ }
+
+ public String getEmailaddress() {
+ return emailaddress;
+ }
+
+ public void setEmailaddress(String emailaddress) {
+ this.emailaddress = emailaddress;
+ }
+
+ public boolean isMale() {
+ return male;
+ }
+
+ public void setMale(boolean male) {
+ this.male = male;
+ }
+
+ public HashMap getOwnVREs() {
+ return ownVREs;
+ }
+
+ public void setOwnVREs(HashMap vreMap) {
+ this.ownVREs = vreMap;
+ }
+
+ public boolean isAdmin() {
+ return admin;
+ }
+
+ public void setAdmin(boolean admin) {
+ this.admin = admin;
+ }
+
+ @Override
+ public String toString() {
+ return "UserInfo [username=" + username + ", fullName=" + fullName
+ + ", avatarId=" + avatarId + ", emailaddress=" + emailaddress
+ + ", accountURL=" + accountURL + ", male=" + male + ", admin="
+ + admin + ", ownVREs=" + ownVREs + "]";
+ }
+
+
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/ColumnNameNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/ColumnNameNotFoundException.java
new file mode 100644
index 0000000..eee9f67
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/ColumnNameNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class ColumnNameNotFoundException extends Exception {
+ public ColumnNameNotFoundException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/CommentIDNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/CommentIDNotFoundException.java
new file mode 100644
index 0000000..00f29c2
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/CommentIDNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class CommentIDNotFoundException extends Exception {
+ public CommentIDNotFoundException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteIDNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteIDNotFoundException.java
new file mode 100644
index 0000000..36a4a78
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteIDNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class InviteIDNotFoundException extends Exception {
+ public InviteIDNotFoundException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteStatusNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteStatusNotFoundException.java
new file mode 100644
index 0000000..febaf07
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/InviteStatusNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class InviteStatusNotFoundException extends Exception {
+ public InviteStatusNotFoundException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/LikeIDNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/LikeIDNotFoundException.java
new file mode 100644
index 0000000..317d6f1
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/LikeIDNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class LikeIDNotFoundException extends Exception {
+ public LikeIDNotFoundException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationChannelTypeNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationChannelTypeNotFoundException.java
new file mode 100644
index 0000000..b01cc99
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationChannelTypeNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class NotificationChannelTypeNotFoundException extends Exception {
+ public NotificationChannelTypeNotFoundException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationIDNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationIDNotFoundException.java
new file mode 100644
index 0000000..003acc4
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationIDNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class NotificationIDNotFoundException extends Exception {
+ public NotificationIDNotFoundException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationTypeNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationTypeNotFoundException.java
new file mode 100644
index 0000000..2365816
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/NotificationTypeNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class NotificationTypeNotFoundException extends Exception {
+ public NotificationTypeNotFoundException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostIDNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostIDNotFoundException.java
new file mode 100644
index 0000000..ab5d2b1
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostIDNotFoundException.java
@@ -0,0 +1,9 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+
+@SuppressWarnings("serial")
+public class PostIDNotFoundException extends Exception {
+ public PostIDNotFoundException(String message, String postId) {
+ super("The Post having id: " + postId + " is not present in the database: " + message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostTypeNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostTypeNotFoundException.java
new file mode 100644
index 0000000..2f422f5
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PostTypeNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class PostTypeNotFoundException extends Exception {
+ public PostTypeNotFoundException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PrivacyLevelTypeNotFoundException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PrivacyLevelTypeNotFoundException.java
new file mode 100644
index 0000000..9b1880c
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/PrivacyLevelTypeNotFoundException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class PrivacyLevelTypeNotFoundException extends Exception {
+ public PrivacyLevelTypeNotFoundException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/TooManyRunningClustersException.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/TooManyRunningClustersException.java
new file mode 100644
index 0000000..3f36d21
--- /dev/null
+++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/exceptions/TooManyRunningClustersException.java
@@ -0,0 +1,8 @@
+package org.gcube.social_networking.socialnetworking.model.shared.exceptions;
+
+@SuppressWarnings("serial")
+public class TooManyRunningClustersException extends Exception {
+ public TooManyRunningClustersException(String message) {
+ super(message);
+ }
+}
\ No newline at end of file