Class Definition der base class
public class SimpleServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private NamesDirectory namesDir;
private DominoConnection domConnection;
private String dbUNID;
public SimpleServlet() {
....
Calling Function ...
/* Execute and action, based on the Parameters passed to the servlet from the URL; */
private void executeParams(HttpServletRequest req, PrintWriter pw) {
try
{
....
Code
pw.println("List the usernames for this session.<BR>") ;
pw.println(" Value for database parameter was: " + parameterNames.get("databaseunid") + "<BR>");
this.dbUNID = parameterNames.get("databaseunid");
this.domConnection = new DominoConnection(this.dbUNID, pw);
--> hier knallt es this.domConnection.DominoGetUserName(pw);
die Domino Connection ist in einer eigenen Klasse definiert. Und zwar bei zwei von drei Methoden die ich in dieser Klasse aufrufe.
Bei dieser Funktion hier auch
pw.println("List the data for a single project.<BR>") ;
pw.println(" Value for database parameter was: " + parameterNames.get("databaseunid") + "<BR>");
this.dbUNID = parameterNames.get("databaseunid");
this.domConnection = new DominoConnection(this.dbUNID, pw);
this.domConnection.DominoGetView("(ProjectsByCode)", pw); // -->> der Call hier der in dieselbe Klasse reinschaut funktioniert komischerweise
pw.println("check if the view is still available.<BR>") ;
pw.println(this.domConnection.notesViewHashMap.get("(ProjectsByCode)").getName());
pw.println("... rows in view = " + Integer.toString(this.domConnection.notesViewHashMap.get("(ProjectsByCode)").getEntryCount() ));
--> hier auch this.domConnection.DominoGetDocumentByKey("(ProjectsByCode)",parameterNames.get("projectid"), pw);
Das hier ist die Klasse.
public class DominoConnection {
private Session notesS;
private DbDirectory notesDbDirectory;
private Database notesDatabase;
private View notesView;
public HashMap<String, View> notesViewHashMap = new HashMap();
private Document notesDocument;
public HashMap<String, Document> notesDocumentHashMap = new HashMap();
....
und das hier die aufgerufenen Funktion
/public void DominoGetDocumentByKey(String viewName, String keyID, PrintWriter pw) {
try {
pw.println("Debug001");
if (notesViewHashMap.containsKey(viewName)) {
pw.println("View found viewName = " + this.notesViewHashMap.get(viewName).getName() + "<BR>");
notesDocument = this.notesViewHashMap.get(viewName).getDocumentByKey(keyID);
if (!notesDocumentHashMap.containsKey(notesDocument.getUniversalID())) {
notesDocumentHashMap.put(notesDocument.getUniversalID(), notesDocument);
pw.println("document Size = " + notesDocument.getSize() + "<BR>");
}
}
}
catch (NotesException n) {
pw.println("NotesException DominoGetdocumentByKey<BR>");
pw.println(n.toString()+ "<BR>");
} //catch block
}
//Check the user
public void DominoGetUserName(PrintWriter pw) {
try {
pw.println("Common UserName = " + notesS.getCommonUserName() + "<BR>");
pw.println("Effective UserName = " + notesS.getEffectiveUserName() + "<BR>");
}
catch (NotesException n) {
pw.println("NotesException DominoGetView<BR>");
pw.println(n.toString()+ "<BR>");
} //catch block
}
Und das hier ist das Teil das funktioniert wenn ich es aufrufe
//connect and open the specified view in that database add the view to a hash map for further use
public void DominoGetView(String viewName, PrintWriter pw) {
try {
if (!notesViewHashMap.containsKey(viewName)) {
notesView = this.notesDatabase.getView(viewName);
if (notesView != null) {
notesViewHashMap.put(viewName, notesView);
pw.println("viewName = " + notesView.getName() + "<BR>");
}
}
}
catch (NotesException n) {
pw.println("NotesException DominoGetView<BR>");
pw.println(n.toString()+ "<BR>");
} //catch block
}
Ich weis das ich etwas übersehe. Ich weis nur nicht was.