Opening a window via Java agent

I’ve got three pieces of code here, one of which should open a pdf into a new window. But none works. (Yes, the basics were covered – the url is valid.)

The agent has been tested both as WebQuerySave or [ToolsRunMacro] directly. Same results.

#1 Connecting via URL

=============================

URL url = new URL(urlbuffer.toString());

URLConnection c = url.openConnection();

c.setDoOutput (true);

c.connect();

#2 Connecting by Redirection (a)

=============================

System.out.println( urlbuffer.toString() );

#2 Connecting by Redirection (b)

=============================

System.out.println( “<META HTTP-EQUIV="Refresh" CONTENT="0; URL=” + urlbuffer.toString() + “">Click on Enter if you are not automatically forwarded to the image” )

Subject: Try: System.out.println(“[” + urlbuffer.toString() + “]”);

Subject: RE: Try: System.out.println(“[” + urlbuffer.toString() + “]”);

no go.

Subject: RE: Try: System.out.println(“[” + urlbuffer.toString() + “]”);

This should work:

import lotus.domino.*;

import java.io.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {



	try {

		Session session = getSession();

		

		AgentContext agentContext = session.getAgentContext();

		

		Database nd =  agentContext.currentDatabase();

		

           PrintWriter pw = getAgentOutput();



           pw.println( "<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=http://www.google.fi\"></head><body>Click on <a href=\"http://www.google.fi\">Enter</a> if you are not automatically forwarded to the image</body></html>" );





	} catch(Exception e) {

		e.printStackTrace();

	}

}

}