Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve usability of expanded attachment tokens in the User API #4199

Open
rbeckman-nextgen opened this issue May 11, 2020 · 1 comment
Open

Comments

@rbeckman-nextgen
Copy link
Collaborator

There is little information on how to use expanded attachment tokens with the User API. It is not intuitive when creating an attachment via AttachmentUtil to be manually routed to another channel.

Suggestions:

  • Add method getExpandedAttachmentId() to com.mirth.connect.server.userutil.Attachment to retrieve it directly from the attachment. This is probably the most intuitive, but I realize that the Attachments do not currently carry channelId and messageId information.
  • Add method to com.mirth.connect.server.userutil.AttachmentUtil public static String expandLocalTokens(String raw, ImmutableConnectorMessage connectorMessage) { return getAttachmentHandlerProvider(connectorMessage.getChannelId()).reAttachMessage(raw, connectorMessage, false); } It's not immediately apparent that one of the four versions of AttachmentUtil.reAttachMessage can actually expand tokens instead of reattaching the attachment. It's not in the method description, but only detailed in the parameter description. That method returns a byte[] instead of a String.
  • Add a few examples in the javadoc for the AttachmentUtil class showing proper usage for creating and reattaching messages, including expanding tokens.

Imported Issue. Original Details:
Jira Issue Key: MIRTH-4323
Reporter: agermano
Created: 2018-09-06T16:55:12.000-0700

@cturczynskyj cturczynskyj added the closed-due-to-inactivity This is being closed due to age. If this is still an issue, comment and we can reopen. label Mar 1, 2021
@pladesma pladesma closed this as completed Mar 1, 2021
@cturczynskyj cturczynskyj reopened this Mar 1, 2021
@cturczynskyj cturczynskyj removed the closed-due-to-inactivity This is being closed due to age. If this is still an issue, comment and we can reopen. label Mar 1, 2021
@atupaitso
Copy link

I completely agree with the last comment. I am trying to handle attachments in javascript. We would like to generate the expanded token, which is {ATTACH:channelId:MessageId:attachmentId} and I cannot find any method in the java documentation to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants