Lotus Notes / Domino Sonstiges > Java und .NET mit Notes/Domino

gegenwärtiges Notes-Programmverzeichnis

<< < (3/5) > >>

eknori:

--- Code: ---Const W_API_MODULE = "nnotes"

Declare Sub subwOSGetExecutableDirectory Lib W_API_MODULE Alias "OSGetExecutableDirectory" _
(Byval v_strRetPathName As String)


Sub Click(Source As Button)
Dim strFullDir As String

strFullDir = String$(127,0)
Call subwOSGetExecutableDirectory(strFullDir)

For i = 1 To Len(strfulldir)
If Mid(strfulldir , i , 1 ) = "\" Then ptr = i
Next
Msgbox (Left(strfulldir, ptr - 1 ))
End Sub


--- Ende Code ---

Quelle

Sanjou:
Hallo... erstmal danke für die ganzen Antworten  :)

also ich brauch die Angaben um ein Notes Dokument mit bestimmter ID zu öffnen... das ganze mache ich in einem Java - Programm, und die benötigte Information will ich in einem Java - Agenten als Parameter mitgeben....

Das öffnen versuche ich folgendermaßen:
------------------------------------------------------------
// Lotus Notes Dokument öffnen
            Runtime.getRuntime().exec(urlString);
------------------------------------------------------------

und in URL String steht dann der Pfad zur Notes.exe

Hab leider keine andere Idee wie ich sonst ein Dokument öffnen könnte....

Glombi:
Hast Du die Notes Desginer Hilfe? Falls ja, solltest Du mal unter Jaca/CORBA Classes nachschauen.

Hier mal ein Beispiel wie man auf Notes zugreift:

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here)
      Database db = session.getDatabase("snapper", "names2", false);
      if (db == null)
        System.out.println("names2.nsf does not exist on snapper");
      else
        System.out.println("Title of names2.nsf: \"" + db.getTitle()+ "\"") ;

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}



und wichtige Hinweise:

Designer requirements
Compilation of a Java program using the lotus.domino package requires installation of Domino Designer Release 5 or greater.
For stand-alone applications, include Notes.jar from the Notes program directory and domino\java\NCSO.jar or domino\java\NCSO.cab from the Notes data directory in the classpath. For example:
set CLASSPATH=.;c:\notes\data\domino\java\NCSO.jar;c:\notes\Notes.jar
Notes.jar contains the high-level lotus.domino package, the lotus.domino.local package for local calls, and the old lotus.notes package. The NCSO archive contains the high-level lotus.domino package and the lotus.domino.cso package for remote calls. Strictly, you do not need the NCSO archive if you are not compiling remote calls and you do not need Notes.jar if you are not compiling local calls or old calls.
The two NCSO archives have identical content but differ in the archiving technique:
NCSO.jar uses the JDK JAR utility with compression.
NCSO.cab uses the Microsoft CABARC utility.
Hinweis  Earlier releases used NCSO.jar (uncompressed) and NCSOC.jar (compressed).
Your class code must import the high-level lotus.domino package:
import lotus.domino.*;
Run-time requirements
A computer running a Java application that makes local Domino calls must contain Domino Server, Domino Designer, or Notes Client, and must include Notes.jar in the classpath.
A computer running a Java application that makes remote Domino calls need not contain Domino or Notes, but must contain one of the NCSO archives and must include it in the classpath.
A computer running a Domino agent that makes Domino calls must include Notes.jar in the classpath.
A computer running an applet that makes Domino calls needs no Domino software or classpath assignments. The applet must be loaded from a computer containing a Domino server.
Hinweis  Do not use NCSOW.jar in the classpath for executing remote (IIOP) calls in a WebSphere® environment. NCSOW.jar is no longer kitted as it was starting with Release 5.0.4. You can continue to run programs that use NCSOW.jar on R5 servers, but not on Release 6 servers. The NCSO archives work with both R5 and Release 6 servers.


Andreas

Sanjou:
der Zugriff auf die Datenbank ist kein Problem
(dank dem super Forum und der Notes Designer Hilfe....   :))
... aber ich hab es noch nicht hinbekommen, das ich dann in einer Session das Dokument in Lotus Notes öffnen kann... ich kann halt nur auf die Daten  selber zugreifen....

und nach meinem bisherigen Wissensstand geht das Öffnen nur über die notes.exe...

LG
Sandra

Glombi:
Ok, dann brauchst Du die URL eines Dokuments. Die bekommst Du mit HttpURL der Klasse Document.

Beispiel:This agent gets the Notes and HTTP URLs for a document in the current database. The agent varies the display depending on whether access is through Notes (the HTTP URL is blank) or HTTP protocols.
import lotus.domino.*;
import java.io.PrintWriter;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here)
      Database db = agentContext.getCurrentDatabase();
      DocumentCollection dc = db.getAllDocuments();
      Document doc = dc.getFirstDocument();
     
      // Get URLs
      String notesURL = doc.getNotesURL();
      String httpURL = doc.getHttpURL();
     
      // Assume local if http is blank and print info for notes
      if (httpURL.length() == 0) {
        System.out.println("NotesURL = " + notesURL);
        System.out.println("Http URL = None");
      }
     
      // If http exists print info for both assuming output to browser
      else {
        PrintWriter pw = getAgentOutput();
        pw.println("NotesURL = " + notesURL);
        pw.println("<BR>HttpURL = " + httpURL);
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}


Andreas

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln