Not sure I understand the scenario completely, but to get a handle to a contextual document in a Java agent, you have a couple of standard options:Session oSession = getSession();
To my knowledge, extended syntax doesn’t work in Java. so you need to use the method GetItemValue instead once you get a handle on the Document object.
My problem is I’ve searched the java/Corba classes extensively. Since java has no “front-end” methods, I don’t know how to get the handle to the “Current Document” like you do in LS.
I can get a document - for instance - by searching by UNID:
oAgentContext = oSession.getAgentContext();
Database oDatabase = oAgentContext.getCurrentDatabase();
DocumentCollection dc = oDatabase.getAllDocuments();
Document oDatabase.getDocumentByUNID(doc.getParentDocumentUNID());
BUT - how do I pass the UNID? use an environment variable?
Perhaps it will help us if you try to explain what you are trying to accomplish, and how. How is this code being called?
The Notes Java API cannot, and wont interact with the UI Workspace. You can run a java agent, but even that agent will not interact directly with the Notes GUI interface.
Anyhow, you can pass 1 paramater to a java agent, by calling the agent like:
agent.run(noteId)
And then, in the java agent, you retrieve that Note ID by using a session object:
session.getParameterDocID();
I’m not sure what else you’re doing here- you mentioned something about a separate server. Using this method won’t even help you if you’re using a different database on the same server, because it’s a Note ID, not UID.
Steve, thanks for the detailed response. And, yes you are correct, I’m probably going to have to use a trigger agent - as you suggest
<bold attempt at sounding like I know what I’m doing>
Ultimately what I’m trying is as follows:
On some event - ie, trigger - I’d like to connect to a remote server and pass some notes field data, using the java agent. The java agent is already set up to connect and post:
but I needed the initial code to get the domino data. Using Dallas’ suggestions, I believe I’m now getting that.
Now that I have the domino data, I had tried using then QueryClose event (as the trigger) - because I assumed that at that point the document was already saved - but the data seems to be still in the scope of the UI.
So now your suggestion is very timely because the next step is to get to the document via another (Lotus) agent.