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-b396298e98cffeature/23194
parent
c9308c45ba
commit
3e328e71e5
@ -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…
Reference in New Issue