private void handleHtmlNewNotebookForm(RequestAndResponse requestAndResponse) throws IOException, ServletException {
  final String title=servletText.pageTitleNewNotebook();
  if (addTitle(requestAndResponse,title)) {
    return;
  }
  final PageWrapper pageWrapper=new PageWrapper(requestAndResponse,title,false);
  pageWrapper.addHeader();
  final boolean userIsSignedIn=isUserSignedIn(requestAndResponse);
  if (!userIsSignedIn && !allowSaveIfNotSignedIn) {
    requestAndResponse.print(servletText.errorRequiresSignIn(allowSaveIfNotSignedIn));
  }
 else   if (userIsSignedIn && isUsersAccountClosed(requestAndResponse)) {
    requestAndResponse.print(servletText.errorAccountIsClosed());
  }
 else {
    if (!userIsSignedIn) {
      requestAndResponse.print(servletText.sentenceAllowSaveIfNotSignedIn());
    }
    requestAndResponse.print("<script type=\"text/javascript\">\n" + "function saveNote() {\n" + "  if(document.getElementById(\"note\").value.trim() == \"\") {\n"+ "    setResponseErrorMessage(errorBlankNote(), \"createResponse\");\n"+ "  } else {\n"+ "    document.getElementById(\"putNote\").submit();\n"+ "  }\n"+ "}\n"+ "</script>");
    requestAndResponse.print("<form action=\"/makeNotebook\" id=\"putNote\" method=\"POST\">" + "<table class=\"nopadding\"><tr><td colspan=\"2\">" + "<input type=\"text\" id=\"note\" name=\"note\" placeholder=\"" + servletText.labelYourNotebookTitle() + "\" autofocus>"+ "</td></tr>"+ "<tr><td>"+ "<input type=\"checkbox\" name=\"isPublic\" id=\"isPublic\"><label for=\"isPublic\">"+ servletText.labelAnyoneCanReadThis()+ "</label>"+ "<input type=\"hidden\" name=\"csrft\" value=\""+ getCsrft(requestAndResponse)+ "\">"+ "</td></tr>"+ "<tr><td><div id=\"createResponse\"></div></td>"+ "<td><button id=\"save\" class=\"specialbutton\" onclick=\"saveNote(); return false;\">"+ servletText.buttonSave()+ "</button></td></tr></table></form>");
  }
  pageWrapper.addFooter();
}

private void handleHtmlNewNotebookForm ( RequestAndResponse requestAndResponse ) throws IOException , ServletException { final String title = servletText . pageTitleNewNotebook ( ) ; if ( addTitle ( requestAndResponse , title ) ) { return ; } final PageWrapper pageWrapper = new PageWrapper ( requestAndResponse , title , false ) ; pageWrapper . addHeader ( ) ; final boolean userIsSignedIn = isUserSignedIn ( requestAndResponse ) ; if ( ! userIsSignedIn && ! allowSaveIfNotSignedIn ) { requestAndResponse . print ( servletText . errorRequiresSignIn ( allowSaveIfNotSignedIn ) ) ; } else if ( userIsSignedIn && isUsersAccountClosed ( requestAndResponse ) ) { requestAndResponse . print ( servletText . errorAccountIsClosed ( ) ) ; } else { if ( ! userIsSignedIn ) { requestAndResponse . print ( servletText . sentenceAllowSaveIfNotSignedIn ( ) ) ; } requestAndResponse . print ( "<script type=\"text/javascript\">\n" + "function saveNote() {\n" + "  if(document.getElementById(\"note\").value.trim() == \"\") {\n" + "    setResponseErrorMessage(errorBlankNote(), \"createResponse\");\n" + "  } else {\n" + "    document.getElementById(\"putNote\").submit();\n" + "  }\n" + "}\n" + "</script>" ) ; requestAndResponse . print ( "<form action=\"/makeNotebook\" id=\"putNote\" method=\"POST\">" + "<table class=\"nopadding\"><tr><td colspan=\"2\">" + "<input type=\"text\" id=\"note\" name=\"note\" placeholder=\"" + servletText . labelYourNotebookTitle ( ) + "\" autofocus>" + "</td></tr>" + "<tr><td>" + "<input type=\"checkbox\" name=\"isPublic\" id=\"isPublic\"><label for=\"isPublic\">" + servletText . labelAnyoneCanReadThis ( ) + "</label>" + "<input type=\"hidden\" name=\"csrft\" value=\"" + getCsrft ( requestAndResponse ) + "\">" + "</td></tr>" + "<tr><td><div id=\"createResponse\"></div></td>" + "<td><button id=\"save\" class=\"specialbutton\" onclick=\"saveNote(); return false;\">" + servletText . buttonSave ( ) + "</button></td></tr></table></form>" ) ; } pageWrapper . addFooter ( ) ; }
part of the html api . displays a form that enables a user to create a note .
