/* * GetNoteIDList.java * * Created on 02 May 2002, 20:57 */ import javax.servlet.*; import javax.servlet.http.*; import java.net.*; import java.io.*; import lotus.domino.*; /** * * @author jake howlett, codestore.net * @version */ public class GetNoteIDList extends HttpServlet { private static final int startHexDesignID = 278; private static final int startHexDocumentID = 2294; private static final int attemptsAtViews = 200; private static final int attemptsAtDocs = 2000; java.io.PrintWriter out = null; String[] NoteIDs = new String[attemptsAtViews]; String[] DocIDs = new String[attemptsAtDocs]; int idsFound = 0; int docsFound = 0; /** Initializes the servlet. */ public void init(ServletConfig config) throws ServletException { super.init(config); } /** Destroys the servlet. */ public void destroy() { } private void openDocumentURL( String tryViewURL, String NoteID ) throws Exception { try{ URL vURL = new URL ( tryViewURL + "/" + NoteID + "?OpenDocument"); vURL.openStream(); out.println(""); DocIDs[docsFound] = NoteID; docsFound++; } catch ( FileNotFoundException e) { out.println( ""); } } private void openViewURL( String tryURL, String NoteID ) throws Exception { try{ URL vURL = new URL ( tryURL + "/" + NoteID + "?OpenView"); vURL.openStream(); out.println(""); NoteIDs[idsFound] = NoteID; idsFound++; } catch ( FileNotFoundException e) { out.println( ""); } } private void openURL( String tryURL ) throws Exception { try{ URL vURL = new URL ( tryURL ); BufferedReader in = new BufferedReader( new InputStreamReader( vURL.openStream( ) ) ); out.println("
GET
and POST
methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
response.setContentType("text/html");
out = response.getWriter();
// output your page here
out.println("");
out.println("");
out.println("GET
method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
processRequest(request, response);
}
/** Handles the HTTP POST
method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
processRequest(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Hacks a Domino database for \"open\" views using their NoteIDs.";
}
}