JSP CUSTOM TAG LIBRARIES


Examples: runagent tag
The JSP code below runs the following agent, which is named "MakeFolder" and is stored in the Domino database:

import lotus.domino.*;

public class JavaAgent extends AgentBase {
 public void NotesMain() {
   try {
     Session session = getSession();
       AgentContext agentContext = session.getAgentContext();
       Database db = agentContext.getCurrentDatabase();
       Agent ag =agentContext.getCurrentAgent();
       String noteid=ag.getParameterDocID();


       Document doc = db.getDocumentByID(noteid);
       if (doc != null) {
         String docNumber = doc.getUniversalID();
         System.out.println("Document UNID is " +           docNumber);
         db.enableFolder(docNumber);
       }
       else
         System.out.println("document not found");
     } catch(Exception e) {
         e.printStackTrace();
     }
 }
}

The following JSP code executes the MakeFolder agent when the folder name supplied in the makefolder parameter is supplied:

<domutil:if isblank="makefolder" trueaction="exclude">
<%-- if the makefolder parameter exists, we need to create the folder to store the subsequent survey results documents
--%>
 <domino:document unid="<%=unid%>">
   <domino:runagent name="MakeFolder"/>
 </domino:document>
</domutil:if>

See Also