cancel
Showing results for 
Search instead for 
Did you mean: 

File adapter module

Former Member
0 Kudos

Hello experts,

1.

I want to retrieve the value of <b>Target directory</b> for a file <b>reciever</b> communication channel inside module. Is it possible? Any code samples?

2. My audit logs are not getting printed inspite of having a log-configuration.xml in place and proper audit log statements in the code? anybody face similar situations before? These statements are inside a <b>reciever file</b> adapter module.

--

Amol

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Amol,

For question 1, a blog was published recently to access adapter speciifc identifiers or dynamic configuration details from inside a module . take a look at it, should solve your problem,

/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules

Regards,

Bhavesh

Former Member
0 Kudos

No luck,

This API is available after SP16 only. I am on SP15.....any other way?

bhavesh_kantilal
Active Contributor
0 Kudos

Amol,

The author of the blog had actually explained / given a different code snippet until it was pointed by Stefan that the earlier API should not be used.

Maybe a mail to the author of the blog can give you some pointers and hopefully it is not SP specific.

Regards,

Bhavesh

Former Member
0 Kudos

Hi Amol,

Try the following code if u r using File Adapter

String channelId = mc.getChannelID(); //mc is module context object

Channel channel = new Channel(channelId);

String tgtDir = channel.getValueAsString("file.targetDir");

Regards,

Sudharshan

Former Member
0 Kudos

Hello Sudharshan

I followed ur code snippet and was successful in retrieving the directory's name but i want to retrieve the file's name too...I dont know what should be passed instead of "file.targetDir" in order to get the file's name.

awaiting your reply

Regards

Kapil

Former Member
0 Kudos

Hi Kapil,

file.targetFileName

In General put the following piece of code in sender or receiver adapter and u can get all the parameters specific to that Adapter Type in channel(Configuration) for outbound and inbound channel depending on direction of channel in which module is configured.

String[] chattr=ch.getAttributeNames();// ch is channel object

If u put this in receiver module of file adapter, the string array will hold the names of all the parameters pertaining to Receiver File Adapter(file.targetFileName,file.targetDir,etc). Same procedure holds good for sender channel.

Once u get the parameter name, u can get the value as given by my earlier post in this thread.

Hope this helps.

Regards,

Sudharshan

Former Member
0 Kudos

Sudharshan

Thank you very much for your quick reply.

Actually, I m trying to append system date and time to the file name and send it back. With your help, I was successful in retrieving the file's name but now I want to send it back. I checked the api 's for channel but it does nt allow to set the new value for the file name. How can I achieve this ? any pointers will be very helpful

awaiting your reply

Regards

Kapil

Former Member
0 Kudos

Hi Kapil,

U can search the forum. Ur issue has been discussed.

Also u can post a separate thread for ur requirement,so that people can see the new topic and respond to it.

Regards,

Sudharshan

Former Member
0 Kudos

Hello Sudharshan

I searched the forum but found no success...

I ve started a , please have a look n give me some inputs. I ve also put my code for reference.

Regards

Kapil

Answers (0)