Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Java classes from the WEB-INF directory in Java agents

Tags:

xpages

Currently I am busy with a brand new XPages project. I use Java and Managed Beans to access the data. Till now I don't have to use Lotusscript ;-)

One of the last things is to create a scheduled agent to perform some backend stuff. There is already some logic in Java classes, who are in a directory in the WEB-INF directory. I son't want rewrite these Java logic to Lotusscript, but reuse.

Is is possible to access these Java classes, from a (scheduled) Java agent??

like image 622
Frank van der Linden Avatar asked Jul 05 '26 13:07

Frank van der Linden


2 Answers

Assuming that the WEB-INF directory that you are talking about is inside the NSF the answer is going to be NO.

Java Agents in Lotus Domino are self contained and can't see that part of the NSF. You could package those particular classes into a jar file and then attach the jar to the java agent or just copy the classes directly to the java agent. Either way you will have to maintain two sets of code.

like image 58
Declan Lynch Avatar answered Jul 11 '26 02:07

Declan Lynch


Maybe another option for you. I'll post on Monday sample code how to use Eclipse jobs on Domino triggered from XPages. These jobs can run on behalf of the current user. The Eclipse jobs framework also allows scheduling them.

Both XPages and your Eclipse jobs run in the http process and you can access the jobs from your XPages. In other words jobs can use the same code in the WEB-INF directory.

Teaser: http://www.youtube.com/watch?v=uYgCfp1Bw8Q

Update: Posted the sample here http://www.openntf.org/Internal/home.nsf/blogEntry.xsp?permaLink=NHEF-8SJB2R

like image 33
Niklas Heidloff Avatar answered Jul 11 '26 00:07

Niklas Heidloff