Costantino Perciante 6 years ago
parent 9a74892f42
commit 1dbc072f16

@ -18,7 +18,7 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

@ -16,12 +16,12 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>

@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.8

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

@ -19,7 +19,7 @@
<properties>
<java-version>1.7</java-version>
<version.jersey>2.25.1</version.jersey>
<version.jersey>2.9</version.jersey>
<gCubeSubsystem>social-networking</gCubeSubsystem>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
@ -37,6 +37,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
@ -50,7 +57,11 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>[1.0.0-SNAPSHOT,)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@ -96,10 +107,6 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>

@ -16,6 +16,10 @@ public class ApplicationId {
@NotNull(message="app_id cannot be null")
@Size(message="app_id cannot be empty", min=1)
private String appId;
public ApplicationId() {
super();
}
public ApplicationId(String appId) {
super();

@ -6,6 +6,7 @@ import org.gcube.portal.databook.shared.JobStatusType;
import org.gcube.portal.databook.shared.RunningJob;
import org.gcube.portal.socialnetworking.model.providers.JobStatusTypeDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@ -29,19 +30,23 @@ public class JobNotificationBean {
@JsonProperty("job_name")
@NotNull(message="job_name cannot be missing")
private String jobName;
@JsonProperty("service_name")
@NotNull(message="service_name cannot be missing")
private String serviceName;
@JsonProperty("status")
@JsonDeserialize(using=JobStatusTypeDeserializer.class)
@JsonDeserialize(using=JobStatusTypeDeserializer.class)
@NotNull(message="status cannot be missing")
private JobStatusType status;
@JsonProperty("status_message")
private String statusMessage;
public JobNotificationBean() {
super();
}
/**
* @param recipient
* @param jobId
@ -108,11 +113,12 @@ public class JobNotificationBean {
public void setStatus(JobStatusType status) {
this.status = status;
}
@JsonIgnore
public RunningJob getRunningJob(){
return new RunningJob(jobId, jobName, status, statusMessage, serviceName);
}
@Override
@ -123,8 +129,8 @@ public class JobNotificationBean {
+ (jobName != null ? "jobName=" + jobName + ", " : "")
+ (serviceName != null ? "serviceName=" + serviceName + ", "
: "")
+ (status != null ? "status=" + status + ", " : "")
+ (statusMessage != null ? "statusMessage=" + statusMessage
: "") + "]";
+ (status != null ? "status=" + status + ", " : "")
+ (statusMessage != null ? "statusMessage=" + statusMessage
: "") + "]";
}
}

@ -19,14 +19,6 @@ public class MessageInputBean implements Serializable {
private static final long serialVersionUID = -1317811686036127456L;
/*@JsonProperty("sender")
@ApiModelProperty(
example="andrea.rossi",
required=false,
hidden=true, // do not show this information
value="The sender of the message. If not specified is the gcube-token's owner")
private String sender;*/
@JsonProperty("body")
@NotNull(message="body cannot be missing")
@Size(min=1, message="body cannot be empty")
@ -42,6 +34,10 @@ public class MessageInputBean implements Serializable {
@Size(min=1, message="at least a recipient is needed")
@Valid // validate recursively
private ArrayList<Recipient> recipients;
public MessageInputBean(){
super();
}
public MessageInputBean(String body, String subject,
ArrayList<Recipient> recipients) {

@ -41,6 +41,10 @@ public class PostInputBean implements Serializable{
@JsonProperty("params")
private String params;
public PostInputBean(){
super();
}
public PostInputBean(String text, String previewtitle,
String previewdescription, String previewhost, String previewurl,

@ -23,6 +23,10 @@ public class Recipient implements Serializable{
@NotNull(message="recipient id must not be null")
@Size(min=1, message="recipient id must not be empty")
private String id;
public Recipient(){
super();
}
public Recipient(String id) {
super();

@ -0,0 +1,62 @@
package org.gcube.portal.socialnetworking.model.output;
import java.util.Calendar;
import java.util.List;
import javax.jcr.ItemNotFoundException;
import org.gcube.common.homelibrary.home.User;
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.homelibrary.home.workspace.exceptions.WrongDestinationException;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Used for serialization/deserialization of {@link org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage}
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public interface MessageOutputBeanMixIn {
@JsonProperty("id")
String getId();
@JsonProperty("subject")
String getSubject();
@JsonProperty("body")
String getBody();
@JsonProperty("sender")
User getSender();
@JsonProperty("send_time")
Calendar getSendTime();
@JsonProperty("read")
boolean isRead();
@JsonIgnore
void setStatus(boolean status) throws InternalErrorException;
@JsonProperty("attachments_ids")
List<String> getAttachmentsIds();
@JsonIgnore
List<WorkspaceItem> getAttachments() throws InternalErrorException;
@JsonIgnore
WorkspaceItem saveAttachment(String attachmentId, String destinationFolderId)
throws InternalErrorException, WrongDestinationException,
ItemNotFoundException;
@JsonIgnore
void open() throws InternalErrorException;
@JsonProperty("recipients")
List<String> getAddresses();
@JsonIgnore
List<String> getCopyAttachmentsIds();
}

@ -3,19 +3,17 @@ package org.gcube.portal.socialnetworking.model.output;
import java.io.Serializable;
/**
* Response bean
* Response bean with real result of type T.
* @author Costantino Perciante at ISTI-CNR
* (costantino.perciante@isti.cnr.it)
*/
public class ResponseBean implements Serializable {
public class ResponseBean <T> implements Serializable {
private static final long serialVersionUID = -2725238162673879658L;
private boolean success;
private String message;
private Object result;
private T result;
public ResponseBean() {
super();
@ -27,7 +25,7 @@ public class ResponseBean implements Serializable {
* @param result
* @param help
*/
public ResponseBean(boolean success, String message, Object result) {
public ResponseBean(boolean success, String message, T result) {
super();
this.success = success;
this.message = message;
@ -55,12 +53,12 @@ public class ResponseBean implements Serializable {
}
public Object getResult() {
public T getResult() {
return result;
}
public void setResult(Object result) {
public void setResult(T result) {
this.result = result;
}

Loading…
Cancel
Save