Calling a LotusScript agent
SearchDomino.com expert Cregg Hardwick provides code that will call a LotusScript agent.
I know how to call a Java agent from LotusScript, but I do not know how to call a LotusScript agent from a Java program. Can you please help?
VIEW MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A.
I do not believe this is possible as of Lotus Domino R6, but you can call a LotusScript agent using something like this:
URL url = new URL(protoHost + "/sample.nsf/MyAgent"+ "?OpenAgent&Value=" +Parms);
MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:
If you have an active CORBA-DIIOP connection in your Domino server you can use this connector.
For example, with "pure" JAVA (compiled with Sun JDK):
import lotus.domino.*; import java.util.*; public class agente { public static void main (String args[[]) { try{ Session s; String server; String usuario="yourhttpuser"; String pwd="httppwd"; String bdnombre; String agent; server="IP or DSN NAME"; s=NotesFactory.createSession (server, usuario, pwd); bdnombre="TestAgentes.nsf"; Database db= s.getDatabase(server, bdnombre); if(!db.isOpen()) { System.out.println ("No se puedo abrir el aplicativo"); System.exit(0); } agent="ServerInfo"; Agent Agente = db.getAgent(agent); Agente.runOnServer(); System.out.println ("Mire en el log si ha ido bien"); } catch (NotesException e){ System.out.println ("-----------------------------"); System.out.println ("Notes Error #" + e.id + " " + e.text); System.out.println ("-----------------------------"); // e.printStackTrace(); } catch(Exception e){ e.printStackTrace(); } } }
—Pedro F.
Do you have comments on this Ask the Expert Q&A? Let us know.
Related information from SearchDomino.com: