cancel
Showing results for 
Search instead for 
Did you mean: 

Can I make user function jar (To get File Name user function) ??

Former Member
0 Kudos

To XI experts

I intend to make user funtion jar.

My function is "To get File Name function".

So I have to use "Container", "DynamicConfiguration", "DynamicConfigurationKey"and so on.

But I noticed that I have to import such a Objects when I make my jar file.

(when I compaile, I see error occuered, so such objects are not avilale)

Can I import such objects? Or I have to select other way?

(If I cant use there objects, I ll make user functtion without jar file).

Please give me a help!

(our XI is version7.0 SP12)

Thanks, naoki

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Have a look

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i --> Dynamic File Name using XI 3.0 SP12 Part – I

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii --> Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II

Thanks

Former Member
0 Kudos

To Sridhar

Thanks a lot to reply to my message.

I read two blogs you recomennded, but these blogs do'nt show me a resolve way.

I had confirmed and tested the function which get FileName, by java user mapping.

And now I want to use this function by jar file.

(I want to use this function everywhere need to "Filename" in mapping.

If I can use jar file, I need not to write same cord.)

Thanks! naoki

justin_santhanam
Active Contributor
0 Kudos

Naoki,

I'm not sure, check it out with aii_map_api.jar . I hope it will solve ur issue.

Best regards,

raj.

Former Member
0 Kudos

To Raj

Thanks a lot for reply to my quetion.

I had tested it with aii_map_api.jar.

but some errors are remained.

this is my code

-


package testJavaMapping;

import com.sap.aii.*;

public class CommonMethod {

public static String GetFileName(Container container) ← Here!!

{

String de = "";

try{

//From Runtime to get DYNAMIC_CONFIGURATION

DynamicConfiguration conf

= (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

↑ Here!!

//("http://sap.com/xi/XI/System/File","FileName")

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

↑ Here!!

//containerのDynamicConfigurationKey

de = (String)conf.get(key);

}

catch(Exception e){}

//return fileName

return de;

}

}

-


maybe, aii_map_api.jar dont contain "Container ", " DynamicConfiguration" and "DynamicConfigurationKey" TYPE.

Error is "cannot be resilved or is not a type".

but your poit out is very helpfull.

maybe, I have to serch some jars...

Thanks!! Naoki

Former Member
0 Kudos

To Raj

your point is very helpful!

Now I solve my problem, I need 2 jar files.

1 is aii_map_api.jar

2 is aii_mt_rt.jar

Now Im testing my new "Common User Method" jar file.

Till my result is OK!

Thanks to your helps!! Naoki

Answers (1)

Answers (1)

Former Member
0 Kudos

if you want to make "Common User Function" jar file.

you need 2 jar files.

1 is aii_map_api.jar

2 is aii_mt_rt.jar

you must search your XI server. So you ll find 2 files.

Thank you! Naoki