Skip to Main Content

Security Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to load freemarker/velocity template in OIM scheduler

user13135542Aug 21 2016 — edited Aug 28 2016

Hi,

I am using OIM PS3.

We have a requirement to send email notification to users. Since OOTB OIM notification template allows only 4000 chars in email body ,I have developed freemarker tempate 'template.ftl' and put that in resources folder and deployed the scheduler.

I could load properties file in resources folder using

this.getClass().getClassLoader().getResourceAsStream.

How can i load free marker template, I have tried many options

            Configuration cfg = new Configuration();

            cfg.setClassForTemplateLoading(this.getClass(), "resources/");

            Template template = cfg.getTemplate("template.ftl");

            Configuration cfg = new Configuration();

            cfg.setClassForTemplateLoading(this.getClass(), "/resources/");

            Template template = cfg.getTemplate("template.ftl");

           cfg.setDirectoryForTemplateLoading(new File("resources"));

But couldnt make it work.

can anyone Please help on this

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2016
Added on Aug 21 2016
1 comment
202 views