Home > Ask the Domino Experts > LotusScript Questions & Answers > Calling a LotusScript agent
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Calling a LotusScript agent

Cregg Hardwick EXPERT RESPONSE FROM: Cregg Hardwick

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 14 August 2006

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?


>
EXPERT RESPONSE

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:

  • Learning Guide: LotusScript development
  • FAQ: LotusScript advice
  • FAQ: Java for Lotus Notes and Domino
  • Reference Center: LotusScript tips and resources


  • Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


    RELATED CONTENT
    LotusScript
    Debug Lotus Notes documents using extracted data
    Extracting attachments from a Lotus Notes rich-text field
    Programmatically replace the design of Lotus Notes databases
    Reading a binary field in an Oracle database with LotusScript
    LotusScript equivalent of @Picklist for Lotus Notes
    Launch large attachments within an email from a Notes database
    How to find files on a hard drive or mapped network with LotusScript
    Update the ACL from the Roles view with LotusScript
    LotusScript agent moves tagged spam email to junk mail folder
    Set a value in a field existing in another Lotus Notes database

    Lotus Notes Domino Agents
    Verify scheduled agent status with Domino Extensible Language (DXL)
    Top 10 Lotus Notes Domino programming and development tips of 2007
    How to export data from a Lotus Notes database to a CSV file
    Must-know Lotus Notes Domino agents -- 10 tips in 10 minutes
    Enable or disable scheduled agents without opening the Lotus Notes database design
    Creating custom views in Lotus Notes databases
    Editing fields in a Lotus Notes view with Ajax
    Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
    Can I stop Lotus Domino Server from transforming embedded images into attachments?
    How to automatically create a backup copy of your Domino Directory

    LotusScript
    Modifying LotusScript code for date and time handling
    Use DXL utilities for advanced replication settings in Notes
    Use LotusScript to create encrypted replicas
    Write a LotusScript agent to automate file attachments
    Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
    Setting up local replication of a Lotus Notes database for offline employees
    Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database
    LotusScript to extract and move attachments to a Lotus Notes mailbox or file folder
    Copying a rich-text field with attachments to a Lotus Notes document
    How to convert Lotus Notes documents to .PDF files

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



    Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice

    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts