Subject: RE: Extract the user’s address book info
this is the code that i found from the webimport lotus.domino.*;
import java.io.PrintWriter;
public class ReadAddress extends AgentBase
{
//NotesMain method is the entry point for Domino Java Agent
public void NotesMain()
{
try
{
//Create a Session object
Session s = this.getSession();
// PrintWriter object is used for output
PrintWriter pw = this.getAgentOutput();
//Create a Database object; we will use the name and address book
Database db = s.getDatabase("","names.nsf");
//Continue only if the database was properly instantiated
if (db != null)
{
//create a View object using the list of people in the NAB
View vw = db.getView("People");
//Continue only if the View object has been properly instantiated
if (vw != null)
{
//Retrieve the first document in the view
Document doc = vw.getFirstDocument();
//Declare String objects to be used for field values
String fname = null;
String lname = null;
int c = 0;
//Loop through all documents in the view;
while (doc != null)
{
c += 1;
//Retrieve the contents of the FirstName and lastname field as a String
fname = doc.getItemValueString("FirstName");
lname = doc.getItemValueString("LastName");
//display name and counter variable
pw.println("Person #" + c + " : " + fname + " " + lname);
//Get next document from the view
doc = vw.getNextDocument(doc);
}
//return memory used by the View object to the system
vw.recycle();
}
//Return memory used by the Database object to the system
db.recycle();
}
//Return memory used by the Session object to the system
s.recycle();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
but, it gives me these 3 errors
terence@kiriya:~$ javac -cp NCSO.jar ReadAddress.java
ReadAddress.java:3: cannot find symbol
symbol: class AgentBase
public class ReadAddress extends AgentBase
^
ReadAddress.java:11: cannot find symbol
symbol : method getSession()
location: class ReadAddress
Session s = this.getSession();
^
ReadAddress.java:14: cannot find symbol
symbol : method getAgentOutput()
location: class ReadAddress
PrintWriter pw = this.getAgentOutput();
^
3 errors
i think it is because my NCSO.jar file don’t have the AgentBase class,
may i know why can i get a NCSO file that is come with the AgentBase class?