EXPERT RESPONSE
It depends on what you mean by "dynamic" menu. There are numerous ways to do this, you could use a view with one column to create a menu, you could write a LotusScript or Java Agent to generate a page of links or two dynamically create a JavaScript menu. You could just use JavaScript to create a menu, or you could do it with DHTML, if really just rdepends on what style of "dynamic" menu you want.
The following simple Java agent could be used to generate page of links based on content read from a database. It assumes that you have a view named vwMenu, which contains documents with at least two fields, tLink and tDescription. The tLink field contains the actual link and tDescription, which contains description text to display to the user. You would probably want to add some more error handling to this agent before using it in production.
// Last mods 020506.105101 - dhatter@libertastechnologies.com - www.libertastechnologies.com
import lotus.domino.*;
import java.util.*;
import java.io.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session nsCurrent = getSession();
AgentContext nactxCurrent = nsCurrent.getAgentContext();
Database ndbCurrent = nactxCurrent.getCurrentDatabase();
PrintWriter pwHTML=getAgentOutput();
pwHTML.println("Content-Type: text/html");
pwHTML.println("Pragma: No-cache");
pwHTML.println("Expires: 0");
View nvwMenu;
Document ndocMenu;
String strHTML;
nvwMenu=ndbCurrent.getView("vwMenu");
strHTML="Dynamic Menu";
strHTML=strHTML + "";
strHTML=strHTML +"";
pwHTML.println(strHTML);
} catch(Exception e) {
e.printStackTrace();
}
}
} // end of agent
|