Added JsInterop DTOs (ClientPost, ClientAttachment and JSON) for supporting new IPC Client side in NewsFeed

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@164772 82a268e6-3cf1-43bd-a215-b396298e98cf
feature/23194
Massimiliano Assante 6 years ago
parent c9308c45ba
commit 3e328e71e5

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.portal.social-networking-library.1-16-1"
date="2018-03-07">
<Change>Added JsInterop DTOs (ClientPost, ClientAttachment and JSON) for supporting new IPC Client side in NewsFeed</Change>
</Changeset>
<Changeset component="org.gcube.portal.social-networking-library.1-16-0"
date="2017-05-25">
<Change>Added support for hashtags in comments</Change>

@ -10,7 +10,7 @@
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>1.16.0-SNAPSHOT</version>
<version>1.16.1-SNAPSHOT</version>
<name>gCube Social Networking Library</name>
<description>
The gCube Social Networking Library is the 'bridge' between your gCube Applications and the social networking facilities.
@ -22,10 +22,10 @@
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portal/${project.artifactId}</url>
</scm>
<properties>
<gwtVersion>2.7.0</gwtVersion>
<gwtVersion>2.8.1</gwtVersion>
<distroDirectory>distro</distroDirectory>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@ -42,6 +42,10 @@
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google</groupId>
<artifactId>gwt-jsonmaker</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax-core</artifactId>
@ -72,10 +76,6 @@
<artifactId>portal-manager</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google</groupId>
<artifactId>gwt-jsonmaker</artifactId>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>

@ -0,0 +1,34 @@
package org.gcube.portal.databook.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;
}
}

@ -0,0 +1,51 @@
package org.gcube.portal.databook.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;
}
}

@ -0,0 +1,10 @@
package org.gcube.portal.databook.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> O parse(String json);
}
Loading…
Cancel
Save