Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Component/s: None
    • Labels:
      None

      Description

      Dev Notes:

      Currently the following methods are available to the user:

      • getAttachments() – Returns all attachments for the current message
      • addAttachment(data, type) – Adds a new attachment to the current message
      • AttachmentUtil.getMessageAttachments – Returns all attachments for the current message
      • AttachmentUtil.getMessageAttachment – Returns a specific attachment for a specific channel/message
      • AttachmentUtil.reAttachMessage – Replaces all attachment tokens and returns the full message
      • AttachmentUtil.getMessageAttachmentsFromSourceChannel – Returns all attachments for the source message of an upstream channel

      The following methods should be added:

      • getAttachmentIds() – Returns all attachment IDs (not replacement tokens) for the current message
      • getAttachmentIds(channelId, messageId) – Returns all attachment IDs for a specific channel / message
      • getAttachment(attachmentId, base64Decode) – Returns a single attachment for the current message
        • Optional parameter base64Decode indicates that the attachment content should be Base64 decoded first
        • Default if not specified is false
      • getAttachment(channelId, messageId, attachmentId, base64Decode) – Returns a single attachment from a specific channel / message
      • updateAttachment(attachmentId, data, type, base64Encode) – Updates a specific attachment for the current message
        • Optional parameter base64Encode indicates that the content should be Base64 encoded first
        • Default if not specified is false
      • updateAttachment(channelId, messageId, attachmentId, data, type, base64Encode) – Updates a specific attachment for a specific channel / message
      • updateAttachment(attachment, base64Encode) – Similar to above
      • updateAttachment(channelId, messageId, attachment, base64Encode) – Similar to above
      • Attachment.getContentString() – Returns the UTF-8 string representation of the content bytes
      • Attachment.getContentString(charset) – Returns the string representation of the content bytes using a specific charset
      • Attachment.setContentString(content) – Sets the content of the attachment to the UTF-8 byte representation of the string
      • Attachment.setContentString(content, charset) – Sets the content of the attachment to the byte representation of the string using a specific charset
      • new Attachment(String id, String content, String type) – Creates a new attachment, using the UTF-8 byte representation of the string
      • new Attachment(String id, String content, String charset, String type) – Creates a new attachment, using the byte representation of the string with the given charset

      The following methods should be modified:

      • getAttachments(base64Decode) – Adding optional parameter base64Decode
      • addAttachment(data, type, base64Encode) – Adding optional parameter base64Encode

      The above added / modified methods should also have equivalent counterparts in AttachmentUtil.


      The user should be able to modify an incoming CCD attachment like so:

      var ccd = new XML(getAttachment(attachmentId, true).getContentString());
      
      ccd.id.@root = 'testing';
      
      updateAttachment(attachmentId, ccd.toString(), 'text/xml', true);
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Nick Rupley
            Reporter:
            Nick Rupley
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development