support attachments for write message
This commit is contained in:
parent
1455a59ac8
commit
3b367774cc
|
@ -1,10 +1,11 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [v2.7.1-SNAPSHOT] - 2022-10-20
|
## [v2.8.0-SNAPSHOT] - 2022-10-20
|
||||||
|
|
||||||
- Feature #23891 Refactored following updates social lib
|
- Feature #23891 Refactored following updates social lib
|
||||||
- Feature #23847 Social service: temporarily block of notifications for given username(s)
|
- Feature #23847 Social service: temporarily block of notifications for given username(s)
|
||||||
- Feature #23439: Please allow an IAM client to send notifications OPEN
|
- Feature #23439: Please allow an IAM client to send notifications OPEN
|
||||||
|
- Feature #23991 Support attachments through notification / message API
|
||||||
|
|
||||||
## [v2.7.0] - 2022-09-12
|
## [v2.7.0] - 2022-09-12
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>social-networking-library-ws</artifactId>
|
<artifactId>social-networking-library-ws</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>2.7.1-SNAPSHOT</version>
|
<version>2.8.0-SNAPSHOT</version>
|
||||||
<name>social-networking-library-ws</name>
|
<name>social-networking-library-ws</name>
|
||||||
<description>Rest interface for the social networking library.</description>
|
<description>Rest interface for the social networking library.</description>
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -39,6 +39,13 @@ public class MessageInputBean implements Serializable {
|
||||||
@Valid // validate recursively
|
@Valid // validate recursively
|
||||||
private ArrayList<Recipient> recipients;
|
private ArrayList<Recipient> recipients;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a list of workspace item id valid in the workspace of the sender
|
||||||
|
*/
|
||||||
|
@JsonProperty("attachmentIds")
|
||||||
|
@Valid // validate recursively
|
||||||
|
private ArrayList<String> attachmentIds;
|
||||||
|
|
||||||
public MessageInputBean() {
|
public MessageInputBean() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -50,6 +57,17 @@ public class MessageInputBean implements Serializable {
|
||||||
this.body = body;
|
this.body = body;
|
||||||
this.subject = subject;
|
this.subject = subject;
|
||||||
this.recipients = recipients;
|
this.recipients = recipients;
|
||||||
|
this.attachmentIds = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageInputBean(String sender, String body, String subject,
|
||||||
|
ArrayList<Recipient> recipients, ArrayList<String> attachmentIds) {
|
||||||
|
super();
|
||||||
|
//this.sender = sender;
|
||||||
|
this.body = body;
|
||||||
|
this.subject = subject;
|
||||||
|
this.recipients = recipients;
|
||||||
|
this.attachmentIds = attachmentIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBody() {
|
public String getBody() {
|
||||||
|
@ -71,14 +89,17 @@ public class MessageInputBean implements Serializable {
|
||||||
this.recipients = recipients;
|
this.recipients = recipients;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public ArrayList<String> getAttachmentIds() {
|
||||||
public String toString() {
|
return attachmentIds;
|
||||||
return "MessageInputBean ["
|
|
||||||
+ (body != null ? "body=" + body + ", " : "")
|
|
||||||
+ (subject != null ? "subject=" + subject + ", " : "")
|
|
||||||
+ (recipients != null ? "recipients=" + recipients : "") + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAttachmentIds(ArrayList<String> attachmentIds) {
|
||||||
|
this.attachmentIds = attachmentIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MessageInputBean [body=" + body + ", subject=" + subject + ", recipients=" + recipients
|
||||||
|
+ ", attachmentIds=" + attachmentIds + "]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class Messages {
|
||||||
// send message
|
// send message
|
||||||
MessageManagerClient client = AbstractPlugin.messages().build();
|
MessageManagerClient client = AbstractPlugin.messages().build();
|
||||||
logger.debug("Sending message to " + recipientsListFiltered);
|
logger.debug("Sending message to " + recipientsListFiltered);
|
||||||
String messageId = client.sendMessage(recipientsListFiltered, subject, body, null);
|
String messageId = client.sendMessage(recipientsListFiltered, subject, body, input.getAttachmentIds());
|
||||||
|
|
||||||
// send notification
|
// send notification
|
||||||
logger.debug("Message sent to " + recipientsIds + ". Sending message notification to: " + recipientsIds);
|
logger.debug("Message sent to " + recipientsIds + ". Sending message notification to: " + recipientsIds);
|
||||||
|
|
Loading…
Reference in New Issue