From a8a2ff739ec3e112edcfaf39f59ce87d5005aa6d Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Wed, 7 Nov 2018 13:47:28 -0500 Subject: [PATCH 01/24] misc changes --- build.gradle | 4 ++-- userpass.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 27d989a..2f89247 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.9' compile group: 'commons-io', name: 'commons-io', version:'2.6' - compile group: 'org.apache.tika', name: 'tika-core', version:'1.18' + compile group: 'org.apache.tika', name: 'tika-core', version:'1.19.1' testCompile group: 'junit', name: 'junit', version:'4.12' } @@ -94,7 +94,7 @@ publishing { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { username project.mavenUser - password project.mavenPass + git password project.mavenPass } } } diff --git a/userpass.txt b/userpass.txt index e69de29..e991996 100644 --- a/userpass.txt +++ b/userpass.txt @@ -0,0 +1,2 @@ +username +password \ No newline at end of file From ea93a5f289ee627d94e24b3f1ce1570f1d6d3e20 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Wed, 7 Nov 2018 13:47:28 -0500 Subject: [PATCH 02/24] misc changes --- build.gradle | 4 ++-- userpass.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 27d989a..2f89247 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.9' compile group: 'commons-io', name: 'commons-io', version:'2.6' - compile group: 'org.apache.tika', name: 'tika-core', version:'1.18' + compile group: 'org.apache.tika', name: 'tika-core', version:'1.19.1' testCompile group: 'junit', name: 'junit', version:'4.12' } @@ -94,7 +94,7 @@ publishing { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { username project.mavenUser - password project.mavenPass + git password project.mavenPass } } } diff --git a/userpass.txt b/userpass.txt index e69de29..e991996 100644 --- a/userpass.txt +++ b/userpass.txt @@ -0,0 +1,2 @@ +username +password \ No newline at end of file From d9b79b71046f91d7f880dd827ecaef0f91625c31 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Wed, 5 Dec 2018 16:05:06 -0500 Subject: [PATCH 03/24] SDK-49 --- .../datamotion/Models/AttachmentMetadata.java | 73 ++++++++ .../Models/GetAttachmentResponse.java | 73 ++++++++ .../GetMessageSummariesWithMetadata.java | 36 ++++ ...tMessageSummariesWithMetadataResponse.java | 26 +++ .../MessageSummariesWithMetadaSummary.java | 173 ++++++++++++++++++ .../Models/MessageWithAttachmentMetadata.java | 125 +++++++++++++ .../Models/MessageWithMetadataAttachment.java | 86 +++++++++ 7 files changed, 592 insertions(+) create mode 100644 src/main/java/com/datamotion/Models/AttachmentMetadata.java create mode 100644 src/main/java/com/datamotion/Models/GetAttachmentResponse.java create mode 100644 src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java create mode 100644 src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java create mode 100644 src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java create mode 100644 src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java create mode 100644 src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java diff --git a/src/main/java/com/datamotion/Models/AttachmentMetadata.java b/src/main/java/com/datamotion/Models/AttachmentMetadata.java new file mode 100644 index 0000000..bf5a852 --- /dev/null +++ b/src/main/java/com/datamotion/Models/AttachmentMetadata.java @@ -0,0 +1,73 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AttachmentMetadata { + @JsonProperty("AttachmentID") + private String AttachmentID; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("ContentType") + private String ContentType; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private int Size; + + public AttachmentMetadata() { + // TODO Auto-generated constructor stub + } + + public AttachmentMetadata(String attachmentID, String contentID, String contentType, String fileName, int size) { + AttachmentID = attachmentID; + ContentID = contentID; + ContentType = contentType; + FileName = fileName; + Size = size; + } + + public String getAttachmentID() { + return AttachmentID; + } + + public void setAttachmentID(String attachmentID) { + AttachmentID = attachmentID; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getContentType() { + return ContentType; + } + + public void setContentType(String contentType) { + ContentType = contentType; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public int getSize() { + return Size; + } + + public void setSize(int size) { + Size = size; + } +} diff --git a/src/main/java/com/datamotion/Models/GetAttachmentResponse.java b/src/main/java/com/datamotion/Models/GetAttachmentResponse.java new file mode 100644 index 0000000..50742be --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetAttachmentResponse.java @@ -0,0 +1,73 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetAttachmentResponse { + @JsonProperty("AttachmentBase64") + private String AttachmentBase64; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("ContentType") + private String ContentType; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private int Size; + + public GetAttachmentResponse() { + // TODO Auto-generated constructor stub + } + + public GetAttachmentResponse(String attachmentBase64, String contentID, String contentType, String fileName, + int size) { + AttachmentBase64 = attachmentBase64; + ContentID = contentID; + ContentType = contentType; + FileName = fileName; + Size = size; + } + + public String getAttachmentBase64() { + return AttachmentBase64; + } + + public void setAttachmentBase64(String attachmentBase64) { + AttachmentBase64 = attachmentBase64; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getContentType() { + return ContentType; + } + + public void setContentType(String contentType) { + ContentType = contentType; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public int getSize() { + return Size; + } + + public void setSize(int size) { + Size = size; + } +} diff --git a/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java new file mode 100644 index 0000000..967b34e --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java @@ -0,0 +1,36 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetMessageSummariesWithMetadata { + @JsonProperty("FolderId") + private int FolderId; + + @JsonProperty("LastMessageIdReceived") + private int LastMessageIdReceived; + + public GetMessageSummariesWithMetadata() { + // TODO Auto-generated constructor stub + } + + public GetMessageSummariesWithMetadata(int folderId, int lastMessageIdReceived) { + FolderId = folderId; + LastMessageIdReceived = lastMessageIdReceived; + } + + public int getFolderId() { + return FolderId; + } + + public void setFolderId(int folderId) { + FolderId = folderId; + } + + public int getLastMessageIdReceived() { + return LastMessageIdReceived; + } + + public void setLastMessageIdReceived(int lastMessageIdReceived) { + LastMessageIdReceived = lastMessageIdReceived; + } +} diff --git a/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java new file mode 100644 index 0000000..de71a08 --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java @@ -0,0 +1,26 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetMessageSummariesWithMetadataResponse { + @JsonProperty("Summaries") + private ArrayList Summaries; + + public GetMessageSummariesWithMetadataResponse() { + // TODO Auto-generated constructor stub + } + + public GetMessageSummariesWithMetadataResponse(ArrayList summaries) { + Summaries = summaries; + } + + public ArrayList getSummaries() { + return Summaries; + } + + public void setSummaries(ArrayList summaries) { + Summaries = summaries; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java b/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java new file mode 100644 index 0000000..45ef583 --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java @@ -0,0 +1,173 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageSummariesWithMetadaSummary { + @JsonProperty("AttachmentCount") + private int AttachmentCount; + + @JsonProperty("createTimeString") + private String createTimeString; + + @JsonProperty("FolderId") + private int FolderId; + + @JsonProperty("MessageId") + private int MessageId; + + @JsonProperty("MessageSize") + private int MessageSize; + + @JsonProperty("Read") + private boolean Read; + + @JsonProperty("MessageStatus") + private int MessageStatus; + + @JsonProperty("SenderAddress") + private String SenderAddress; + + @JsonProperty("Subject") + private String Subject; + + @JsonProperty("Attachments") + private ArrayList Attachments; + + @JsonProperty("ExpirationDate") + private String ExpirationDate; + + @JsonProperty("SecurityEnvelope") + private SecurityEnvelope SecurityEnvelope; + + @JsonProperty("Tracking") + private Tracking Tracking; + + public MessageSummariesWithMetadaSummary() { + // TODO Auto-generated constructor stub + } + + public MessageSummariesWithMetadaSummary(int attachmentCount, String createTimeString, int folderId, int messageId, + int messageSize, boolean read, int messageStatus, String senderAddress, String subject, + ArrayList attachments, String expirationDate, + com.datamotion.Models.SecurityEnvelope securityEnvelope, com.datamotion.Models.Tracking tracking) { + AttachmentCount = attachmentCount; + this.createTimeString = createTimeString; + FolderId = folderId; + MessageId = messageId; + MessageSize = messageSize; + Read = read; + MessageStatus = messageStatus; + SenderAddress = senderAddress; + Subject = subject; + Attachments = attachments; + ExpirationDate = expirationDate; + SecurityEnvelope = securityEnvelope; + Tracking = tracking; + } + + public int getAttachmentCount() { + return AttachmentCount; + } + + public void setAttachmentCount(int attachmentCount) { + AttachmentCount = attachmentCount; + } + + public String getCreateTimeString() { + return createTimeString; + } + + public void setCreateTimeString(String createTimeString) { + this.createTimeString = createTimeString; + } + + public int getFolderId() { + return FolderId; + } + + public void setFolderId(int folderId) { + FolderId = folderId; + } + + public int getMessageId() { + return MessageId; + } + + public void setMessageId(int messageId) { + MessageId = messageId; + } + + public int getMessageSize() { + return MessageSize; + } + + public void setMessageSize(int messageSize) { + MessageSize = messageSize; + } + + public boolean isRead() { + return Read; + } + + public void setRead(boolean read) { + Read = read; + } + + public int getMessageStatus() { + return MessageStatus; + } + + public void setMessageStatus(int messageStatus) { + MessageStatus = messageStatus; + } + + public String getSenderAddress() { + return SenderAddress; + } + + public void setSenderAddress(String senderAddress) { + SenderAddress = senderAddress; + } + + public String getSubject() { + return Subject; + } + + public void setSubject(String subject) { + Subject = subject; + } + + public ArrayList getAttachments() { + return Attachments; + } + + public void setAttachments(ArrayList attachments) { + Attachments = attachments; + } + + public String getExpirationDate() { + return ExpirationDate; + } + + public void setExpirationDate(String expirationDate) { + ExpirationDate = expirationDate; + } + + public SecurityEnvelope getSecurityEnvelope() { + return SecurityEnvelope; + } + + public void setSecurityEnvelope(SecurityEnvelope securityEnvelope) { + SecurityEnvelope = securityEnvelope; + } + + public Tracking getTracking() { + return Tracking; + } + + public void setTracking(Tracking tracking) { + Tracking = tracking; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java b/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java new file mode 100644 index 0000000..6b9099c --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java @@ -0,0 +1,125 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageWithAttachmentMetadata { + @JsonProperty("To") + private ArrayList To; + + @JsonProperty("From") + private String From; + + @JsonProperty("Cc") + private ArrayList Cc; + + @JsonProperty("Bcc") + private ArrayList Bcc; + + @JsonProperty("Subject") + private String Subject; + + @JsonProperty("CreateTime") + private String CreateTime; + + @JsonProperty("HtmlBody") + private String HtmlBody; + + @JsonProperty("TextBody") + private String TextBody; + + @JsonProperty("Attachments") + private ArrayList Attachments; + + public MessageWithAttachmentMetadata() { + // TODO Auto-generated constructor stub + } + + public MessageWithAttachmentMetadata(ArrayList to, String from, ArrayList cc, ArrayList bcc, + String subject, String createTime, String htmlBody, String textBody, + ArrayList attachments) { + To = to; + From = from; + Cc = cc; + Bcc = bcc; + Subject = subject; + CreateTime = createTime; + HtmlBody = htmlBody; + TextBody = textBody; + Attachments = attachments; + } + + public ArrayList getTo() { + return To; + } + + public void setTo(ArrayList to) { + To = to; + } + + public String getFrom() { + return From; + } + + public void setFrom(String from) { + From = from; + } + + public ArrayList getCc() { + return Cc; + } + + public void setCc(ArrayList cc) { + Cc = cc; + } + + public ArrayList getBcc() { + return Bcc; + } + + public void setBcc(ArrayList bcc) { + Bcc = bcc; + } + + public String getSubject() { + return Subject; + } + + public void setSubject(String subject) { + Subject = subject; + } + + public String getCreateTime() { + return CreateTime; + } + + public void setCreateTime(String createTime) { + CreateTime = createTime; + } + + public String getHtmlBody() { + return HtmlBody; + } + + public void setHtmlBody(String htmlBody) { + HtmlBody = htmlBody; + } + + public String getTextBody() { + return TextBody; + } + + public void setTextBody(String textBody) { + TextBody = textBody; + } + + public ArrayList getAttachments() { + return Attachments; + } + + public void setAttachments(ArrayList attachments) { + Attachments = attachments; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java b/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java new file mode 100644 index 0000000..7b8616c --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java @@ -0,0 +1,86 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageWithMetadataAttachment { + @JsonProperty("AttachmentId") + private int AttachmentId; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private Size Size; + + @JsonProperty("SecurityEnvelope") + private SecurityEnvelope SecurityEnvelope; + + @JsonProperty("Tracking") + private MetaTracking Tracking; + + public MessageWithMetadataAttachment() { + // TODO Auto-generated constructor stub + } + + public MessageWithMetadataAttachment(int attachmentId, String contentID, String fileName, + com.datamotion.Models.Size size, com.datamotion.Models.SecurityEnvelope securityEnvelope, + MetaTracking tracking) { + AttachmentId = attachmentId; + ContentID = contentID; + FileName = fileName; + Size = size; + SecurityEnvelope = securityEnvelope; + Tracking = tracking; + } + + public int getAttachmentId() { + return AttachmentId; + } + + public void setAttachmentId(int attachmentId) { + AttachmentId = attachmentId; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public Size getSize() { + return Size; + } + + public void setSize(Size size) { + Size = size; + } + + public SecurityEnvelope getSecurityEnvelope() { + return SecurityEnvelope; + } + + public void setSecurityEnvelope(SecurityEnvelope securityEnvelope) { + SecurityEnvelope = securityEnvelope; + } + + public MetaTracking getTracking() { + return Tracking; + } + + public void setTracking(MetaTracking tracking) { + Tracking = tracking; + } +} From 33962891768f5711ef49ec50a514f0f567b2afa3 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Fri, 7 Dec 2018 13:45:06 -0500 Subject: [PATCH 04/24] SDK-50 --- src/main/java/com/datamotion/DMWeb.java | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/main/java/com/datamotion/DMWeb.java b/src/main/java/com/datamotion/DMWeb.java index f2e8f39..0140942 100644 --- a/src/main/java/com/datamotion/DMWeb.java +++ b/src/main/java/com/datamotion/DMWeb.java @@ -21,6 +21,9 @@ import com.datamotion.Models.DeleteMessageResponse; import com.datamotion.Models.Details; import com.datamotion.Models.Folders; +import com.datamotion.Models.GetAttachmentResponse; +import com.datamotion.Models.GetMessageSummariesWithMetadata; +import com.datamotion.Models.GetMessageSummariesWithMetadataResponse; import com.datamotion.Models.HttpHeader; import com.datamotion.Models.Message; import com.datamotion.Models.MessageIdGet; @@ -28,6 +31,7 @@ import com.datamotion.Models.MessageIds; import com.datamotion.Models.MessageSummariesGet; import com.datamotion.Models.MessageSummariesResponse; +import com.datamotion.Models.MessageWithAttachmentMetadata; import com.datamotion.Models.MetaData; import com.datamotion.Models.MimeMessage; import com.datamotion.Models.MoveMessage; @@ -518,6 +522,88 @@ public void retractMessage(int messageId) throws Exception { throw new Exception(response); } } + + public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { + MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); + String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return message; + } + + public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { + GetAttachmentResponse attachment = new GetAttachmentResponse(); + String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + attachment = objectMapper.readValue(response, GetAttachmentResponse.class); + } catch(Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return attachment; + } + + public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { + GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); + String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; + String JSONreq = buildJSONStringFromObject(req); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return summaries; + } + + public MessageId saveDraft(Message draft) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/SaveDraft"; + String JSONDraft = buildJSONStringFromObject(draft); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } + + public MessageId sendDraft(String draftId) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } } //Auxiliary Functions: From a4d2104fcc9f1c2a337040f60f2856b12d987554 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 15:51:09 -0500 Subject: [PATCH 05/24] SDK-64, SDK-65 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 2f89247..3111d49 100644 --- a/build.gradle +++ b/build.gradle @@ -32,13 +32,13 @@ repositories { } dependencies { - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.6' + compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.8' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.9.6' compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.9.6' compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.9' compile group: 'commons-io', name: 'commons-io', version:'2.6' - compile group: 'org.apache.tika', name: 'tika-core', version:'1.19.1' + compile group: 'org.apache.tika', name: 'tika-core', version:'1.20' testCompile group: 'junit', name: 'junit', version:'4.12' } From 0001da7b3678d1593f05c9ea04cb1211efe78d8b Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 16:26:04 -0500 Subject: [PATCH 06/24] Commented out 5.43 --- src/main/java/com/datamotion/DMWeb.java | 162 ++++++++++++------------ 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/src/main/java/com/datamotion/DMWeb.java b/src/main/java/com/datamotion/DMWeb.java index 0140942..19c6cf0 100644 --- a/src/main/java/com/datamotion/DMWeb.java +++ b/src/main/java/com/datamotion/DMWeb.java @@ -523,87 +523,87 @@ public void retractMessage(int messageId) throws Exception { } } - public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { - MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); - String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; - String response = ""; - try { - HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return message; - } - - public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { - GetAttachmentResponse attachment = new GetAttachmentResponse(); - String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; - String response = ""; - try { - HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - attachment = objectMapper.readValue(response, GetAttachmentResponse.class); - } catch(Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return attachment; - } - - public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { - GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); - String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; - String JSONreq = buildJSONStringFromObject(req); - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return summaries; - } - - public MessageId saveDraft(Message draft) throws Exception { - MessageId messageId = new MessageId(); - String URL = BaseUrl + "/Message/SaveDraft"; - String JSONDraft = buildJSONStringFromObject(draft); - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - messageId = objectMapper.readValue(response, MessageId.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return messageId; - } - - public MessageId sendDraft(String draftId) throws Exception { - MessageId messageId = new MessageId(); - String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - messageId = objectMapper.readValue(response, MessageId.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return messageId; - } +// public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { +// MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); +// String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return message; +// } +// +// public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { +// GetAttachmentResponse attachment = new GetAttachmentResponse(); +// String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// attachment = objectMapper.readValue(response, GetAttachmentResponse.class); +// } catch(Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return attachment; +// } +// +// public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { +// GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); +// String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; +// String JSONreq = buildJSONStringFromObject(req); +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return summaries; +// } +// +// public MessageId saveDraft(Message draft) throws Exception { +// MessageId messageId = new MessageId(); +// String URL = BaseUrl + "/Message/SaveDraft"; +// String JSONDraft = buildJSONStringFromObject(draft); +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// messageId = objectMapper.readValue(response, MessageId.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return messageId; +// } +// +// public MessageId sendDraft(String draftId) throws Exception { +// MessageId messageId = new MessageId(); +// String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// messageId = objectMapper.readValue(response, MessageId.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return messageId; +// } } //Auxiliary Functions: From fd7c84f5056ef627abaeef22ff07bf6f45e27046 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 17:24:16 -0500 Subject: [PATCH 07/24] replaced userpass.txt contents with generics --- userpass.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/userpass.txt b/userpass.txt index e991996..8b13789 100644 --- a/userpass.txt +++ b/userpass.txt @@ -1,2 +1 @@ -username -password \ No newline at end of file + From 99566d503c8f27262a4e1582df880d476138b25e Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Wed, 7 Nov 2018 13:47:28 -0500 Subject: [PATCH 08/24] misc changes --- build.gradle | 4 ++-- userpass.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 27d989a..2f89247 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.9' compile group: 'commons-io', name: 'commons-io', version:'2.6' - compile group: 'org.apache.tika', name: 'tika-core', version:'1.18' + compile group: 'org.apache.tika', name: 'tika-core', version:'1.19.1' testCompile group: 'junit', name: 'junit', version:'4.12' } @@ -94,7 +94,7 @@ publishing { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { username project.mavenUser - password project.mavenPass + git password project.mavenPass } } } diff --git a/userpass.txt b/userpass.txt index e69de29..e991996 100644 --- a/userpass.txt +++ b/userpass.txt @@ -0,0 +1,2 @@ +username +password \ No newline at end of file From 3285a1fd0462eaef7e87b21035892ac0add31c37 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Wed, 5 Dec 2018 16:05:06 -0500 Subject: [PATCH 09/24] SDK-49 --- .../datamotion/Models/AttachmentMetadata.java | 73 ++++++++ .../Models/GetAttachmentResponse.java | 73 ++++++++ .../GetMessageSummariesWithMetadata.java | 36 ++++ ...tMessageSummariesWithMetadataResponse.java | 26 +++ .../MessageSummariesWithMetadaSummary.java | 173 ++++++++++++++++++ .../Models/MessageWithAttachmentMetadata.java | 125 +++++++++++++ .../Models/MessageWithMetadataAttachment.java | 86 +++++++++ 7 files changed, 592 insertions(+) create mode 100644 src/main/java/com/datamotion/Models/AttachmentMetadata.java create mode 100644 src/main/java/com/datamotion/Models/GetAttachmentResponse.java create mode 100644 src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java create mode 100644 src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java create mode 100644 src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java create mode 100644 src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java create mode 100644 src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java diff --git a/src/main/java/com/datamotion/Models/AttachmentMetadata.java b/src/main/java/com/datamotion/Models/AttachmentMetadata.java new file mode 100644 index 0000000..bf5a852 --- /dev/null +++ b/src/main/java/com/datamotion/Models/AttachmentMetadata.java @@ -0,0 +1,73 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AttachmentMetadata { + @JsonProperty("AttachmentID") + private String AttachmentID; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("ContentType") + private String ContentType; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private int Size; + + public AttachmentMetadata() { + // TODO Auto-generated constructor stub + } + + public AttachmentMetadata(String attachmentID, String contentID, String contentType, String fileName, int size) { + AttachmentID = attachmentID; + ContentID = contentID; + ContentType = contentType; + FileName = fileName; + Size = size; + } + + public String getAttachmentID() { + return AttachmentID; + } + + public void setAttachmentID(String attachmentID) { + AttachmentID = attachmentID; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getContentType() { + return ContentType; + } + + public void setContentType(String contentType) { + ContentType = contentType; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public int getSize() { + return Size; + } + + public void setSize(int size) { + Size = size; + } +} diff --git a/src/main/java/com/datamotion/Models/GetAttachmentResponse.java b/src/main/java/com/datamotion/Models/GetAttachmentResponse.java new file mode 100644 index 0000000..50742be --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetAttachmentResponse.java @@ -0,0 +1,73 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetAttachmentResponse { + @JsonProperty("AttachmentBase64") + private String AttachmentBase64; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("ContentType") + private String ContentType; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private int Size; + + public GetAttachmentResponse() { + // TODO Auto-generated constructor stub + } + + public GetAttachmentResponse(String attachmentBase64, String contentID, String contentType, String fileName, + int size) { + AttachmentBase64 = attachmentBase64; + ContentID = contentID; + ContentType = contentType; + FileName = fileName; + Size = size; + } + + public String getAttachmentBase64() { + return AttachmentBase64; + } + + public void setAttachmentBase64(String attachmentBase64) { + AttachmentBase64 = attachmentBase64; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getContentType() { + return ContentType; + } + + public void setContentType(String contentType) { + ContentType = contentType; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public int getSize() { + return Size; + } + + public void setSize(int size) { + Size = size; + } +} diff --git a/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java new file mode 100644 index 0000000..967b34e --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadata.java @@ -0,0 +1,36 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetMessageSummariesWithMetadata { + @JsonProperty("FolderId") + private int FolderId; + + @JsonProperty("LastMessageIdReceived") + private int LastMessageIdReceived; + + public GetMessageSummariesWithMetadata() { + // TODO Auto-generated constructor stub + } + + public GetMessageSummariesWithMetadata(int folderId, int lastMessageIdReceived) { + FolderId = folderId; + LastMessageIdReceived = lastMessageIdReceived; + } + + public int getFolderId() { + return FolderId; + } + + public void setFolderId(int folderId) { + FolderId = folderId; + } + + public int getLastMessageIdReceived() { + return LastMessageIdReceived; + } + + public void setLastMessageIdReceived(int lastMessageIdReceived) { + LastMessageIdReceived = lastMessageIdReceived; + } +} diff --git a/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java new file mode 100644 index 0000000..de71a08 --- /dev/null +++ b/src/main/java/com/datamotion/Models/GetMessageSummariesWithMetadataResponse.java @@ -0,0 +1,26 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GetMessageSummariesWithMetadataResponse { + @JsonProperty("Summaries") + private ArrayList Summaries; + + public GetMessageSummariesWithMetadataResponse() { + // TODO Auto-generated constructor stub + } + + public GetMessageSummariesWithMetadataResponse(ArrayList summaries) { + Summaries = summaries; + } + + public ArrayList getSummaries() { + return Summaries; + } + + public void setSummaries(ArrayList summaries) { + Summaries = summaries; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java b/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java new file mode 100644 index 0000000..45ef583 --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageSummariesWithMetadaSummary.java @@ -0,0 +1,173 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageSummariesWithMetadaSummary { + @JsonProperty("AttachmentCount") + private int AttachmentCount; + + @JsonProperty("createTimeString") + private String createTimeString; + + @JsonProperty("FolderId") + private int FolderId; + + @JsonProperty("MessageId") + private int MessageId; + + @JsonProperty("MessageSize") + private int MessageSize; + + @JsonProperty("Read") + private boolean Read; + + @JsonProperty("MessageStatus") + private int MessageStatus; + + @JsonProperty("SenderAddress") + private String SenderAddress; + + @JsonProperty("Subject") + private String Subject; + + @JsonProperty("Attachments") + private ArrayList Attachments; + + @JsonProperty("ExpirationDate") + private String ExpirationDate; + + @JsonProperty("SecurityEnvelope") + private SecurityEnvelope SecurityEnvelope; + + @JsonProperty("Tracking") + private Tracking Tracking; + + public MessageSummariesWithMetadaSummary() { + // TODO Auto-generated constructor stub + } + + public MessageSummariesWithMetadaSummary(int attachmentCount, String createTimeString, int folderId, int messageId, + int messageSize, boolean read, int messageStatus, String senderAddress, String subject, + ArrayList attachments, String expirationDate, + com.datamotion.Models.SecurityEnvelope securityEnvelope, com.datamotion.Models.Tracking tracking) { + AttachmentCount = attachmentCount; + this.createTimeString = createTimeString; + FolderId = folderId; + MessageId = messageId; + MessageSize = messageSize; + Read = read; + MessageStatus = messageStatus; + SenderAddress = senderAddress; + Subject = subject; + Attachments = attachments; + ExpirationDate = expirationDate; + SecurityEnvelope = securityEnvelope; + Tracking = tracking; + } + + public int getAttachmentCount() { + return AttachmentCount; + } + + public void setAttachmentCount(int attachmentCount) { + AttachmentCount = attachmentCount; + } + + public String getCreateTimeString() { + return createTimeString; + } + + public void setCreateTimeString(String createTimeString) { + this.createTimeString = createTimeString; + } + + public int getFolderId() { + return FolderId; + } + + public void setFolderId(int folderId) { + FolderId = folderId; + } + + public int getMessageId() { + return MessageId; + } + + public void setMessageId(int messageId) { + MessageId = messageId; + } + + public int getMessageSize() { + return MessageSize; + } + + public void setMessageSize(int messageSize) { + MessageSize = messageSize; + } + + public boolean isRead() { + return Read; + } + + public void setRead(boolean read) { + Read = read; + } + + public int getMessageStatus() { + return MessageStatus; + } + + public void setMessageStatus(int messageStatus) { + MessageStatus = messageStatus; + } + + public String getSenderAddress() { + return SenderAddress; + } + + public void setSenderAddress(String senderAddress) { + SenderAddress = senderAddress; + } + + public String getSubject() { + return Subject; + } + + public void setSubject(String subject) { + Subject = subject; + } + + public ArrayList getAttachments() { + return Attachments; + } + + public void setAttachments(ArrayList attachments) { + Attachments = attachments; + } + + public String getExpirationDate() { + return ExpirationDate; + } + + public void setExpirationDate(String expirationDate) { + ExpirationDate = expirationDate; + } + + public SecurityEnvelope getSecurityEnvelope() { + return SecurityEnvelope; + } + + public void setSecurityEnvelope(SecurityEnvelope securityEnvelope) { + SecurityEnvelope = securityEnvelope; + } + + public Tracking getTracking() { + return Tracking; + } + + public void setTracking(Tracking tracking) { + Tracking = tracking; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java b/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java new file mode 100644 index 0000000..6b9099c --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageWithAttachmentMetadata.java @@ -0,0 +1,125 @@ +package com.datamotion.Models; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageWithAttachmentMetadata { + @JsonProperty("To") + private ArrayList To; + + @JsonProperty("From") + private String From; + + @JsonProperty("Cc") + private ArrayList Cc; + + @JsonProperty("Bcc") + private ArrayList Bcc; + + @JsonProperty("Subject") + private String Subject; + + @JsonProperty("CreateTime") + private String CreateTime; + + @JsonProperty("HtmlBody") + private String HtmlBody; + + @JsonProperty("TextBody") + private String TextBody; + + @JsonProperty("Attachments") + private ArrayList Attachments; + + public MessageWithAttachmentMetadata() { + // TODO Auto-generated constructor stub + } + + public MessageWithAttachmentMetadata(ArrayList to, String from, ArrayList cc, ArrayList bcc, + String subject, String createTime, String htmlBody, String textBody, + ArrayList attachments) { + To = to; + From = from; + Cc = cc; + Bcc = bcc; + Subject = subject; + CreateTime = createTime; + HtmlBody = htmlBody; + TextBody = textBody; + Attachments = attachments; + } + + public ArrayList getTo() { + return To; + } + + public void setTo(ArrayList to) { + To = to; + } + + public String getFrom() { + return From; + } + + public void setFrom(String from) { + From = from; + } + + public ArrayList getCc() { + return Cc; + } + + public void setCc(ArrayList cc) { + Cc = cc; + } + + public ArrayList getBcc() { + return Bcc; + } + + public void setBcc(ArrayList bcc) { + Bcc = bcc; + } + + public String getSubject() { + return Subject; + } + + public void setSubject(String subject) { + Subject = subject; + } + + public String getCreateTime() { + return CreateTime; + } + + public void setCreateTime(String createTime) { + CreateTime = createTime; + } + + public String getHtmlBody() { + return HtmlBody; + } + + public void setHtmlBody(String htmlBody) { + HtmlBody = htmlBody; + } + + public String getTextBody() { + return TextBody; + } + + public void setTextBody(String textBody) { + TextBody = textBody; + } + + public ArrayList getAttachments() { + return Attachments; + } + + public void setAttachments(ArrayList attachments) { + Attachments = attachments; + } +} diff --git a/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java b/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java new file mode 100644 index 0000000..7b8616c --- /dev/null +++ b/src/main/java/com/datamotion/Models/MessageWithMetadataAttachment.java @@ -0,0 +1,86 @@ +package com.datamotion.Models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageWithMetadataAttachment { + @JsonProperty("AttachmentId") + private int AttachmentId; + + @JsonProperty("ContentID") + private String ContentID; + + @JsonProperty("FileName") + private String FileName; + + @JsonProperty("Size") + private Size Size; + + @JsonProperty("SecurityEnvelope") + private SecurityEnvelope SecurityEnvelope; + + @JsonProperty("Tracking") + private MetaTracking Tracking; + + public MessageWithMetadataAttachment() { + // TODO Auto-generated constructor stub + } + + public MessageWithMetadataAttachment(int attachmentId, String contentID, String fileName, + com.datamotion.Models.Size size, com.datamotion.Models.SecurityEnvelope securityEnvelope, + MetaTracking tracking) { + AttachmentId = attachmentId; + ContentID = contentID; + FileName = fileName; + Size = size; + SecurityEnvelope = securityEnvelope; + Tracking = tracking; + } + + public int getAttachmentId() { + return AttachmentId; + } + + public void setAttachmentId(int attachmentId) { + AttachmentId = attachmentId; + } + + public String getContentID() { + return ContentID; + } + + public void setContentID(String contentID) { + ContentID = contentID; + } + + public String getFileName() { + return FileName; + } + + public void setFileName(String fileName) { + FileName = fileName; + } + + public Size getSize() { + return Size; + } + + public void setSize(Size size) { + Size = size; + } + + public SecurityEnvelope getSecurityEnvelope() { + return SecurityEnvelope; + } + + public void setSecurityEnvelope(SecurityEnvelope securityEnvelope) { + SecurityEnvelope = securityEnvelope; + } + + public MetaTracking getTracking() { + return Tracking; + } + + public void setTracking(MetaTracking tracking) { + Tracking = tracking; + } +} From 4879e4be2f9e6bfc7f556950667da72b63843844 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Fri, 7 Dec 2018 13:45:06 -0500 Subject: [PATCH 10/24] SDK-50 --- src/main/java/com/datamotion/DMWeb.java | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/main/java/com/datamotion/DMWeb.java b/src/main/java/com/datamotion/DMWeb.java index f2e8f39..0140942 100644 --- a/src/main/java/com/datamotion/DMWeb.java +++ b/src/main/java/com/datamotion/DMWeb.java @@ -21,6 +21,9 @@ import com.datamotion.Models.DeleteMessageResponse; import com.datamotion.Models.Details; import com.datamotion.Models.Folders; +import com.datamotion.Models.GetAttachmentResponse; +import com.datamotion.Models.GetMessageSummariesWithMetadata; +import com.datamotion.Models.GetMessageSummariesWithMetadataResponse; import com.datamotion.Models.HttpHeader; import com.datamotion.Models.Message; import com.datamotion.Models.MessageIdGet; @@ -28,6 +31,7 @@ import com.datamotion.Models.MessageIds; import com.datamotion.Models.MessageSummariesGet; import com.datamotion.Models.MessageSummariesResponse; +import com.datamotion.Models.MessageWithAttachmentMetadata; import com.datamotion.Models.MetaData; import com.datamotion.Models.MimeMessage; import com.datamotion.Models.MoveMessage; @@ -518,6 +522,88 @@ public void retractMessage(int messageId) throws Exception { throw new Exception(response); } } + + public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { + MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); + String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return message; + } + + public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { + GetAttachmentResponse attachment = new GetAttachmentResponse(); + String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + attachment = objectMapper.readValue(response, GetAttachmentResponse.class); + } catch(Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return attachment; + } + + public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { + GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); + String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; + String JSONreq = buildJSONStringFromObject(req); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return summaries; + } + + public MessageId saveDraft(Message draft) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/SaveDraft"; + String JSONDraft = buildJSONStringFromObject(draft); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } + + public MessageId sendDraft(String draftId) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } } //Auxiliary Functions: From 3b7e318296b933004a584007a69e9baf81045432 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 15:51:09 -0500 Subject: [PATCH 11/24] SDK-64, SDK-65 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 2f89247..3111d49 100644 --- a/build.gradle +++ b/build.gradle @@ -32,13 +32,13 @@ repositories { } dependencies { - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.6' + compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.8' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.9.6' compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.9.6' compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.9' compile group: 'commons-io', name: 'commons-io', version:'2.6' - compile group: 'org.apache.tika', name: 'tika-core', version:'1.19.1' + compile group: 'org.apache.tika', name: 'tika-core', version:'1.20' testCompile group: 'junit', name: 'junit', version:'4.12' } From 25d74bcccc07050e4c27898d1529701a36112bc5 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 16:26:04 -0500 Subject: [PATCH 12/24] Commented out 5.43 --- src/main/java/com/datamotion/DMWeb.java | 162 ++++++++++++------------ 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/src/main/java/com/datamotion/DMWeb.java b/src/main/java/com/datamotion/DMWeb.java index 0140942..19c6cf0 100644 --- a/src/main/java/com/datamotion/DMWeb.java +++ b/src/main/java/com/datamotion/DMWeb.java @@ -523,87 +523,87 @@ public void retractMessage(int messageId) throws Exception { } } - public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { - MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); - String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; - String response = ""; - try { - HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return message; - } - - public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { - GetAttachmentResponse attachment = new GetAttachmentResponse(); - String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; - String response = ""; - try { - HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - attachment = objectMapper.readValue(response, GetAttachmentResponse.class); - } catch(Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return attachment; - } - - public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { - GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); - String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; - String JSONreq = buildJSONStringFromObject(req); - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return summaries; - } - - public MessageId saveDraft(Message draft) throws Exception { - MessageId messageId = new MessageId(); - String URL = BaseUrl + "/Message/SaveDraft"; - String JSONDraft = buildJSONStringFromObject(draft); - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - messageId = objectMapper.readValue(response, MessageId.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return messageId; - } - - public MessageId sendDraft(String draftId) throws Exception { - MessageId messageId = new MessageId(); - String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; - String response = ""; - try { - HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); - response = IOUtils.toString(entity.getContent(), "UTF-8"); - ObjectMapper objectMapper = new ObjectMapper(); - messageId = objectMapper.readValue(response, MessageId.class); - } catch (Exception ex) { - ErrorMessage = response; - throw new Exception(response); - } - return messageId; - } +// public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { +// MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); +// String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return message; +// } +// +// public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { +// GetAttachmentResponse attachment = new GetAttachmentResponse(); +// String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// attachment = objectMapper.readValue(response, GetAttachmentResponse.class); +// } catch(Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return attachment; +// } +// +// public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { +// GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); +// String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; +// String JSONreq = buildJSONStringFromObject(req); +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return summaries; +// } +// +// public MessageId saveDraft(Message draft) throws Exception { +// MessageId messageId = new MessageId(); +// String URL = BaseUrl + "/Message/SaveDraft"; +// String JSONDraft = buildJSONStringFromObject(draft); +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// messageId = objectMapper.readValue(response, MessageId.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return messageId; +// } +// +// public MessageId sendDraft(String draftId) throws Exception { +// MessageId messageId = new MessageId(); +// String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; +// String response = ""; +// try { +// HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); +// response = IOUtils.toString(entity.getContent(), "UTF-8"); +// ObjectMapper objectMapper = new ObjectMapper(); +// messageId = objectMapper.readValue(response, MessageId.class); +// } catch (Exception ex) { +// ErrorMessage = response; +// throw new Exception(response); +// } +// return messageId; +// } } //Auxiliary Functions: From a8ae7cc875dff92257628dd9ada6072928d1541f Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 7 Jan 2019 17:24:16 -0500 Subject: [PATCH 13/24] replaced userpass.txt contents with generics --- userpass.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/userpass.txt b/userpass.txt index e991996..8b13789 100644 --- a/userpass.txt +++ b/userpass.txt @@ -1,2 +1 @@ -username -password \ No newline at end of file + From 20933a44d0983fb8d53164936dd1609da88df2db Mon Sep 17 00:00:00 2001 From: DataMotion PLM Date: Tue, 8 Jan 2019 20:15:27 +0000 Subject: [PATCH 14/24] Update BUILDNUM to 1.0.2 --- BUILDNUM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDNUM b/BUILDNUM index 7f20734..e6d5cb8 100644 --- a/BUILDNUM +++ b/BUILDNUM @@ -1 +1 @@ -1.0.1 \ No newline at end of file +1.0.2 \ No newline at end of file From f805ae483a15dbbc1a39678997718471bf1f6e9f Mon Sep 17 00:00:00 2001 From: DataMotion PLM Date: Tue, 8 Jan 2019 20:19:32 +0000 Subject: [PATCH 15/24] Update build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 45f5f24..e791d0e 100644 --- a/build.gradle +++ b/build.gradle @@ -105,7 +105,7 @@ publishing { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { username project.mavenUser - git password project.mavenPass + password project.mavenPass } } } From b7a8b65755d70a3933b72c236422ba45003fa1fa Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Thu, 23 May 2019 11:08:22 -0400 Subject: [PATCH 16/24] SDK-74 --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e791d0e..c03d09a 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ repositories { } dependencies { - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.8' + compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.9' compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.9.6' compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.9.6' compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.5' @@ -104,8 +104,8 @@ publishing { maven { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { - username project.mavenUser - password project.mavenPass + //username project.mavenUser + //password project.mavenPass } } } From ec0951142cb25146d6bc199d9382b21723151304 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Thu, 23 May 2019 11:16:39 -0400 Subject: [PATCH 17/24] uncommented maven credentials --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index c03d09a..3ec7f24 100644 --- a/build.gradle +++ b/build.gradle @@ -104,8 +104,8 @@ publishing { maven { url "${project.version.endsWith('-SNAPSHOT') ? 'https://oss.sonatype.org/content/repositories/snapshots' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' }" credentials { - //username project.mavenUser - //password project.mavenPass + username project.mavenUser + password project.mavenPass } } } From 121bdd509e472a85ad6bca8bd4d820902cb2f4e1 Mon Sep 17 00:00:00 2001 From: Tyler Bissell Date: Mon, 8 Jul 2019 11:33:29 -0400 Subject: [PATCH 18/24] uncommented 5.43 methods --- src/main/java/com/datamotion/DMWeb.java | 164 ++++++++++++------------ 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/src/main/java/com/datamotion/DMWeb.java b/src/main/java/com/datamotion/DMWeb.java index 19c6cf0..8e2f574 100644 --- a/src/main/java/com/datamotion/DMWeb.java +++ b/src/main/java/com/datamotion/DMWeb.java @@ -523,87 +523,87 @@ public void retractMessage(int messageId) throws Exception { } } -// public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { -// MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); -// String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; -// String response = ""; -// try { -// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); -// response = IOUtils.toString(entity.getContent(), "UTF-8"); -// ObjectMapper objectMapper = new ObjectMapper(); -// message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); -// } catch (Exception ex) { -// ErrorMessage = response; -// throw new Exception(response); -// } -// return message; -// } -// -// public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { -// GetAttachmentResponse attachment = new GetAttachmentResponse(); -// String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; -// String response = ""; -// try { -// HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); -// response = IOUtils.toString(entity.getContent(), "UTF-8"); -// ObjectMapper objectMapper = new ObjectMapper(); -// attachment = objectMapper.readValue(response, GetAttachmentResponse.class); -// } catch(Exception ex) { -// ErrorMessage = response; -// throw new Exception(response); -// } -// return attachment; -// } -// -// public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { -// GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); -// String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; -// String JSONreq = buildJSONStringFromObject(req); -// String response = ""; -// try { -// HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); -// response = IOUtils.toString(entity.getContent(), "UTF-8"); -// ObjectMapper objectMapper = new ObjectMapper(); -// summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); -// } catch (Exception ex) { -// ErrorMessage = response; -// throw new Exception(response); -// } -// return summaries; -// } -// -// public MessageId saveDraft(Message draft) throws Exception { -// MessageId messageId = new MessageId(); -// String URL = BaseUrl + "/Message/SaveDraft"; -// String JSONDraft = buildJSONStringFromObject(draft); -// String response = ""; -// try { -// HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); -// response = IOUtils.toString(entity.getContent(), "UTF-8"); -// ObjectMapper objectMapper = new ObjectMapper(); -// messageId = objectMapper.readValue(response, MessageId.class); -// } catch (Exception ex) { -// ErrorMessage = response; -// throw new Exception(response); -// } -// return messageId; -// } -// -// public MessageId sendDraft(String draftId) throws Exception { -// MessageId messageId = new MessageId(); -// String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; -// String response = ""; -// try { -// HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); -// response = IOUtils.toString(entity.getContent(), "UTF-8"); -// ObjectMapper objectMapper = new ObjectMapper(); -// messageId = objectMapper.readValue(response, MessageId.class); -// } catch (Exception ex) { -// ErrorMessage = response; -// throw new Exception(response); -// } -// return messageId; -// } + public MessageWithAttachmentMetadata getMessageWithoutAttachmentData(int messageId) throws Exception { + MessageWithAttachmentMetadata message = new MessageWithAttachmentMetadata(); + String URL = BaseUrl + "/Message/" + messageId + "/NoAttachmentData"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + message = objectMapper.readValue(response, MessageWithAttachmentMetadata.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return message; + } + + public GetAttachmentResponse getAttachment(int attachmentId) throws Exception { + GetAttachmentResponse attachment = new GetAttachmentResponse(); + String URL = BaseUrl + "/Message/" + attachmentId + "/Attachment"; + String response = ""; + try { + HttpEntity entity = buildHttpGetEntity(URL, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + attachment = objectMapper.readValue(response, GetAttachmentResponse.class); + } catch(Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return attachment; + } + + public GetMessageSummariesWithMetadataResponse getMessageSummariesWithMetadata(GetMessageSummariesWithMetadata req) throws Exception { + GetMessageSummariesWithMetadataResponse summaries = new GetMessageSummariesWithMetadataResponse(); + String URL = BaseUrl + "/Message/GetMessageSummariesWithMetadata"; + String JSONreq = buildJSONStringFromObject(req); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONreq, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + summaries = objectMapper.readValue(response, GetMessageSummariesWithMetadataResponse.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return summaries; + } + + public MessageId saveDraft(Message draft) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/SaveDraft"; + String JSONDraft = buildJSONStringFromObject(draft); + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, JSONDraft, assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } + + public MessageId sendDraft(String draftId) throws Exception { + MessageId messageId = new MessageId(); + String URL = BaseUrl + "/Message/" + draftId + "/SendDraft"; + String response = ""; + try { + HttpEntity entity = buildHttpPostEntity(URL, "", assembleCommonHeaders()); + response = IOUtils.toString(entity.getContent(), "UTF-8"); + ObjectMapper objectMapper = new ObjectMapper(); + messageId = objectMapper.readValue(response, MessageId.class); + } catch (Exception ex) { + ErrorMessage = response; + throw new Exception(response); + } + return messageId; + } } //Auxiliary Functions: @@ -638,7 +638,7 @@ public static String buildJSONStringFromObject(Object object) { public static HttpEntity buildHttpPostEntity(String URL, String body, ArrayList headerList) throws ClientProtocolException, IOException { HttpClient client = HttpClientBuilder.create().build(); HttpPost httpPost = new HttpPost(URL); - StringEntity input = new StringEntity(body); + StringEntity input = new StringEntity(body, "UTF-8"); for (int i = 0; i < headerList.size(); i++) { httpPost.addHeader(headerList.get(i).getKey(), headerList.get(i).getValue()); } From 003b539975118ba3795dac6f0b3d6777d25c3a44 Mon Sep 17 00:00:00 2001 From: DataMotion PLM Date: Wed, 10 Jul 2019 18:09:16 +0000 Subject: [PATCH 19/24] Update BUILDNUM --- BUILDNUM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDNUM b/BUILDNUM index e6d5cb8..e4c0d46 100644 --- a/BUILDNUM +++ b/BUILDNUM @@ -1 +1 @@ -1.0.2 \ No newline at end of file +1.0.3 \ No newline at end of file From 8d45382d03db53f382482b053b88fa298b71a98a Mon Sep 17 00:00:00 2001 From: DataMotion PLM Date: Thu, 11 Jul 2019 17:53:53 +0000 Subject: [PATCH 20/24] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 915d2b7..e512966 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.0.{build} +version: 1.0.3.{build} image: Visual Studio 2017 From 0afc020282be3de5a7bad11664e22829bc5d5bf5 Mon Sep 17 00:00:00 2001 From: Christopher Ly Date: Mon, 29 Jul 2019 11:10:52 -0400 Subject: [PATCH 21/24] Fixed the Details and Attachment objects --- .../com/datamotion/Models/Attachment.java | 18 ++++++++- .../java/com/datamotion/Models/Details.java | 39 ++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/datamotion/Models/Attachment.java b/src/main/java/com/datamotion/Models/Attachment.java index 0733f89..ef40824 100644 --- a/src/main/java/com/datamotion/Models/Attachment.java +++ b/src/main/java/com/datamotion/Models/Attachment.java @@ -31,18 +31,25 @@ public class Attachment { @JsonProperty("FileName") private String FileName; + /** + * Attachment ContentId + */ + @JsonProperty("ContentId") + private String ContentId; public Attachment() { AttachmentBase64 = null; ContentType = null; FileName = null; + ContentId = null; } - public Attachment(String attachmentBase64, String contentType, String fileName) { + public Attachment(String attachmentBase64, String contentType, String fileName, String contentId) { AttachmentBase64 = attachmentBase64; ContentType = contentType; FileName = fileName; + ContentId = contentId; } @JsonIgnore @@ -90,6 +97,15 @@ public String getFileName() { @JsonIgnore public void setFileName(String fileName) { FileName = fileName; + + @JsonIgnore + public String getContentId() { + return ContentId; + } + + @JsonIgnore + public void setContentId(String contentId) { + ContentId = contentId; } } diff --git a/src/main/java/com/datamotion/Models/Details.java b/src/main/java/com/datamotion/Models/Details.java index 8ff6aea..499aed9 100644 --- a/src/main/java/com/datamotion/Models/Details.java +++ b/src/main/java/com/datamotion/Models/Details.java @@ -33,20 +33,36 @@ public class Details { @JsonProperty("Statistics") private Statistics Statistics; + /** + * Account Uid + */ + @JsonProperty("Uid") + private Integer Uid; + + /** + * Account UserId + */ + @JsonProperty("UserId") + private String UserId; + public Details() { EmailAddress = null; FirstName = null; LastName = null; Statistics = null; + Uid = null; + UserId = null; } public Details(String emailAddress, String firstName, String lastName, - com.datamotion.Models.Statistics statistics) { + com.datamotion.Models.Statistics statistics, Integer uid, String userId) { EmailAddress = emailAddress; FirstName = firstName; LastName = lastName; Statistics = statistics; + Uid = uid; + UserId = userId; } @JsonIgnore @@ -89,4 +105,25 @@ public void setStatistics(Statistics statistics) { Statistics = statistics; } + @JsonIgnore + public Integer getUid(){ + return Uid; + } + + @JsonIgnore + public Integer setUid(Integer uid){ + Uid = uid; + } + + @JsonIgnore + public String getUserId(){ + return UserId; + } + + @JsonIgnore + public String setUserId(String userId){ + UserId = userId; + } + + } \ No newline at end of file From 211458e8de2ec9b45b336c2c8cc094dc4d1c1064 Mon Sep 17 00:00:00 2001 From: Christopher Ly Date: Mon, 29 Jul 2019 11:29:49 -0400 Subject: [PATCH 22/24] Added missing curly bracket --- src/main/java/com/datamotion/Models/Attachment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/datamotion/Models/Attachment.java b/src/main/java/com/datamotion/Models/Attachment.java index ef40824..67057cc 100644 --- a/src/main/java/com/datamotion/Models/Attachment.java +++ b/src/main/java/com/datamotion/Models/Attachment.java @@ -97,7 +97,8 @@ public String getFileName() { @JsonIgnore public void setFileName(String fileName) { FileName = fileName; - + } + @JsonIgnore public String getContentId() { return ContentId; From e105d4bda988763125545d4ad0e9599f51725de1 Mon Sep 17 00:00:00 2001 From: Christopher Ly Date: Mon, 29 Jul 2019 11:40:26 -0400 Subject: [PATCH 23/24] Fixed setter return type in Details --- src/main/java/com/datamotion/Models/Details.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/datamotion/Models/Details.java b/src/main/java/com/datamotion/Models/Details.java index 499aed9..141bc46 100644 --- a/src/main/java/com/datamotion/Models/Details.java +++ b/src/main/java/com/datamotion/Models/Details.java @@ -111,7 +111,7 @@ public Integer getUid(){ } @JsonIgnore - public Integer setUid(Integer uid){ + public void setUid(Integer uid){ Uid = uid; } @@ -121,7 +121,7 @@ public String getUserId(){ } @JsonIgnore - public String setUserId(String userId){ + public void setUserId(String userId){ UserId = userId; } From 3cee7cd4f610ae05cbe37944e6a444996d8a7028 Mon Sep 17 00:00:00 2001 From: Christopher Ly Date: Mon, 29 Jul 2019 11:51:30 -0400 Subject: [PATCH 24/24] Set ContentId to null for unit tests --- .../java/com/datamotionTest/Tests/GetMessageMetadataTest.java | 2 +- src/test/java/com/datamotionTest/Tests/GetMessageTest.java | 2 +- src/test/java/com/datamotionTest/Tests/GetMimeMessageTest.java | 2 +- src/test/java/com/datamotionTest/Tests/MoveMessageTest.java | 2 +- .../java/com/datamotionTest/Tests/SendDeleteMessageTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/datamotionTest/Tests/GetMessageMetadataTest.java b/src/test/java/com/datamotionTest/Tests/GetMessageMetadataTest.java index 1bacbf2..75c95f3 100644 --- a/src/test/java/com/datamotionTest/Tests/GetMessageMetadataTest.java +++ b/src/test/java/com/datamotionTest/Tests/GetMessageMetadataTest.java @@ -24,7 +24,7 @@ public void test() throws Exception { ArrayList cc = new ArrayList(); ArrayList bcc = new ArrayList(); ArrayList attachments = new ArrayList(); - Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt"); + Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt", null); attachments.add(attachment); Message message = new Message(to, "UnitTest1@dmfaketest.com", cc, bcc, "TestSubject", "CreateTime", attachments, "content", "content"); int messageId = tester.Message.sendMessage(message).getMessageId(); diff --git a/src/test/java/com/datamotionTest/Tests/GetMessageTest.java b/src/test/java/com/datamotionTest/Tests/GetMessageTest.java index 2332cd4..6c5cee3 100644 --- a/src/test/java/com/datamotionTest/Tests/GetMessageTest.java +++ b/src/test/java/com/datamotionTest/Tests/GetMessageTest.java @@ -23,7 +23,7 @@ public void test() throws Exception { ArrayList cc = new ArrayList(); ArrayList bcc = new ArrayList(); ArrayList attachments = new ArrayList(); - Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt"); + Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt", null); attachments.add(attachment); Message message = new Message(to, "UnitTest1@dmfaketest.com", cc, bcc, "TestSubject", "CreateTime", attachments, "content", "content"); int messageId = tester.Message.sendMessage(message).getMessageId(); diff --git a/src/test/java/com/datamotionTest/Tests/GetMimeMessageTest.java b/src/test/java/com/datamotionTest/Tests/GetMimeMessageTest.java index 22b14ab..f76aef5 100644 --- a/src/test/java/com/datamotionTest/Tests/GetMimeMessageTest.java +++ b/src/test/java/com/datamotionTest/Tests/GetMimeMessageTest.java @@ -24,7 +24,7 @@ public void test() throws Exception { ArrayList cc = new ArrayList(); ArrayList bcc = new ArrayList(); ArrayList attachments = new ArrayList(); - Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt"); + Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt", null); attachments.add(attachment); Message message = new Message(to, "UnitTest1@dmfaketest.com", cc, bcc, "TestSubject", "CreateTime", attachments, "content", "content"); int messageId = tester.Message.sendMessage(message).getMessageId(); diff --git a/src/test/java/com/datamotionTest/Tests/MoveMessageTest.java b/src/test/java/com/datamotionTest/Tests/MoveMessageTest.java index 07cba13..c419d34 100644 --- a/src/test/java/com/datamotionTest/Tests/MoveMessageTest.java +++ b/src/test/java/com/datamotionTest/Tests/MoveMessageTest.java @@ -34,7 +34,7 @@ public void test() throws Exception { ArrayList cc = new ArrayList(); ArrayList bcc = new ArrayList(); ArrayList attachments = new ArrayList(); - Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt"); + Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt", null); attachments.add(attachment); Message message = new Message(to, context.getUsername(), cc, bcc, "TestSubject", "CreateTime", attachments, "content", "content"); int messageId = tester.Message.sendMessage(message).getMessageId(); diff --git a/src/test/java/com/datamotionTest/Tests/SendDeleteMessageTest.java b/src/test/java/com/datamotionTest/Tests/SendDeleteMessageTest.java index b057eca..9812104 100644 --- a/src/test/java/com/datamotionTest/Tests/SendDeleteMessageTest.java +++ b/src/test/java/com/datamotionTest/Tests/SendDeleteMessageTest.java @@ -23,7 +23,7 @@ public void test() throws Exception { ArrayList cc = new ArrayList(); ArrayList bcc = new ArrayList(); ArrayList attachments = new ArrayList(); - Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt"); + Attachment attachment = new Attachment("dGhpcyBpcyBhIHRlc3QgZmlsZQ==", "text/plain", "test.txt", null); attachments.add(attachment); Message message = new Message(to, "UnitTest1@dmfaketest.com", cc, bcc, "TestSubject", "CreateTime", attachments, "content", "content"); int messageId = tester.Message.sendMessage(message).getMessageId();