on 2007 Jul 11 3:20 PM
Hi,
how can I set the filename of a mail attachment dynamically in a receiver mail adapter (also dynamically configured)?
I had to uncheck the "keep attachment" because of our scenario.
If I check this box I get a .xml file which I can rename with the MessageTransformBean (but not dynamically?) but I get to much files in the mail.
Now I get a .dat file and want to rename it dynamically in e.g. dynamicName.txt.
Can you give me some input how to do that?
Thanks in advance
Dominic
Hi Dominic !
Have you checked this document:
You can also develop your one transformation class for use with the MessageTransformBean and specify it by using the Transform.Class property in the modules tab. That custom transformation class maybe could read a value from the payload (the dynamic attachment filename) and replace the current one (current value of the Transport.ContentDescription).
Regards,
Matias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matias,
I've chekced the document. The MessageTransformBean seems to work only proper, when the checkbox "Keep Attachment" is enabled. But due to my scenario I can not enable it. I'm getting to much files (all XI-payload files shown in SXMB_MONI). Or is there an opportunity to select the right payload file and discard the others?
regards
Dominic
Hi Dominic !
I think you have to develop your own java transformation class and solve the issues right there (discard the attachment you don't want using the keep attachment option, and assign filename) maybe using some resources of the Michal's weblog.
To use dynamicconfiguration to change the name via UDF, I guess you need to know the dynamic configuration tag name for the receiver, and overwrite this one.
Regards,
Matias.
It is not possible to create dynamic attachment names besides writing an adapter module, escpecially when you want to choose the right attachments from many.
Maybe this blog might give you an idea how the adapter module can work (even it describes a Java mapping):
/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dominic,
This might help you...
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
regards,
vasanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dominic,
have a look at my blog:
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
it shows how you can do it with adapter module
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
good blog, but I don't think it matches my needs.
I want to set the filename of the attachment (.dat-file) dynamically (!!), e.g [sender]_[receiver]_[messageid].txt
As my mail adapter is also dynamically configured, isn't it possible to set the filename of the attachment in the message-mapping?
regards
Dominic
Hi
<i>isn't it possible to set the filename of the attachment in the message-mapping?</i>
--->
Try writing this UDF so to get the name in mapping
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a); // a - parameter given to UDF that specifies filename
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
Hope this helps
yes of course.
And I can see the entries in the Dynamic Configuration trace of SXMB_MONI:
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">Testfile.txt</SAP:Record>
But the file I get is a .dat file. I can't find this .dat filename in any trace of sxmb_moni. Do you know where it's generated?
Regards
Dominic
Hi all,
I solved the first part of the problem. Now I don't get a something.dat file but a file I named in the modulconfiguration. Thats what I did:
I took the MessageTransformBean with
Transform.ContentDescription - Testfile.edi
Transform.ContentDisposition - attachment;filename="Testfile.edi"
Transform.ContentType - application/edifact;name="Testfile.edi"
Box "Keep Attachment" is unchecked.
But my second problem is, how can I configure this filename dynamically? does it somehow work with the Variable Substitution?
Unfortunately I don know the stepts to develop and use my own adapter module or transformation class. Could anybody provide me some tutorials or similar?
Thanks in advance
Dominic
Hi Dominic !
Great !
You can use this tutorial:
How To Create Modules for the J2EE Adapter Engine
And you can use Michal's weblog that implements the pseudo variable substitution via adaptar module. Conventional Variable substitution is not available in the module tab.
Regards,
Matias.
User | Count |
---|---|
73 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.