Examples of HtmlGenerator


Examples of org.w3c.jigsaw.html.HtmlGenerator

  if ( debug )
      printNegotiationState ("After Q selection:", states) ;
  if ( qmax == REQUIRED_QUALITY ) {

      Reply reply = request.makeReply(HTTP.NOT_ACCEPTABLE) ;
       HtmlGenerator g = new HtmlGenerator("No acceptable");
       g.append("<P>The resource cannot be served according to the "
          + "headers sent</P>");
       reply.setStream (g) ;
      throw new HTTPException (reply) ;
  } else if ( states.size() == 1 ) {
      return ((VariantState) states.elementAt(0)).getResource() ;
  } else {
      // Respond with multiple choice (for the time being, there should
      // be a parameter to decide what to do.
      Reply reply = request.makeReply(HTTP.MULTIPLE_CHOICE) ;
      HtmlGenerator g = new HtmlGenerator ("Multiple choice for "+
             resource.getIdentifier()) ;
      g.append ("<ul>") ;
      for (int i = 0 ; i < states.size() ; i++) {
    VariantState state = (VariantState) states.elementAt(i) ;
    String name = null;
    ResourceReference rr = state.getResource();
    try {
        name = rr.unsafeLock().getIdentifier();
        g.append ("<li>"
            + "<a href=\"" + name + "\">" + name + "</a>"
            + " Q= " + state.getQ()) ;
    } catch (InvalidResourceException ex) {
        //FIXME
    } finally {
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

      }
  }
  // now we have multiple choice :(
  String name;
  Reply reply = request.makeReply(HTTP.MULTIPLE_CHOICE) ;
  HtmlGenerator g = new HtmlGenerator ("Multiple choice for "+
               resource.getIdentifier()) ;
  g.append ("<ul>") ;
  for (int i = 0 ; i < variants.length ; i++) {
      if (variants[i] != null) {
    try {
        name = variants[i].unsafeLock().getIdentifier();
        g.append ("<li>"
            + "<a href=\"" + name + "\">" +name+ "</a>");
    } catch (InvalidResourceException ex) {
        //FIXME (this should NOT happen :) )
    } finally {
        variants[i].unlock();
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  if ( debug )
      printNegotiationState ("After Q selection:", states) ;
  if ( qmax == REQUIRED_QUALITY ) {

      Reply reply = request.makeReply(HTTP.NOT_ACCEPTABLE) ;
       HtmlGenerator g = new HtmlGenerator("No acceptable");
       g.append("<P>The resource cannot be served according to the "
          + "headers sent</P>");
       reply.setStream (g) ;
      throw new HTTPException (reply) ;
  } else if ( states.size() == 1 ) {
      return ((VariantState) states.elementAt(0)).getResource() ;
  } else {
      // Respond with multiple choice (for the time being, there should
      // be a parameter to decide what to do.
      Reply reply = request.makeReply(HTTP.MULTIPLE_CHOICE) ;
      HtmlGenerator g = new HtmlGenerator ("Multiple choice for "+
             resource.getIdentifier()) ;
      g.append ("<ul>") ;
      for (int i = 0 ; i < states.size() ; i++) {
    VariantState state = (VariantState) states.elementAt(i) ;
    String name = null;
    ResourceReference rr = state.getResource();
    try {
        name = rr.unsafeLock().getIdentifier();
        g.append ("<li>"
            + "<a href=\"" + name + "\">" + name + "</a>"
            + " Q= " + state.getQ()) ;
    } catch (InvalidResourceException ex) {
        //FIXME
    } finally {
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

      }
  }
  // now we have multiple choice :(
  String name;
  Reply reply = request.makeReply(HTTP.MULTIPLE_CHOICE) ;
  HtmlGenerator g = new HtmlGenerator ("Multiple choice for "+
               resource.getIdentifier()) ;
  g.append ("<ul>") ;
  for (int i = 0 ; i < variants.length ; i++) {
      if (variants[i] != null) {
    try {
        name = variants[i].unsafeLock().getIdentifier();
        g.append ("<li>"
            + "<a href=\"" + name + "\">" +name+ "</a>");
    } catch (InvalidResourceException ex) {
        //FIXME (this should NOT happen :) )
    } finally {
        variants[i].unlock();
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

     * </ul>
     * @param title The document title.
     * @return a HtmlGenerator instance.
     */
    public static HtmlGenerator getHtmlGenerator(String title) {
  HtmlGenerator g = new HtmlGenerator(title);
  g.addStyle("BODY {color: black; background: white; "+
       "font-family: serif; margin-top: 35px }\n");
  addStyle(g);
  return g;
    }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

     * @return a HtmlGenerator instance.
     */
    public static HtmlGenerator getHtmlGenerator(CvsFrame cvsframe,
             String title)
    {
  HtmlGenerator g = new HtmlGenerator(title);
  cvsframe.addStyleSheet(g);
  addStyle(g);
  return g;
    }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

    protected static Reply error(Request request,
         String msg,
         String details)
    {
  Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
  HtmlGenerator g = getHtmlGenerator(msg);
  g.append ("<center>");
  g.append ("[ <A HREF=\"./CVS\">Back</A> ]<hr noshade width=\"80%\">");
  g.append ("</center>");
  g.append ("<div class=\"error\"> <center><p class=\"error\">", msg,
      "</center><p>\n");
  g.append ("Details : <p><em>",details,"</em><p></div>\n");
  g.append ("<hr noshade width=\"80%\">");
  error.setStream(g);
  return error;
    }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

      } catch (MalformedURLException ex) {
    return null;
      }
      Reply reply = req.makeReply(HTTP.FOUND);
      reply.setLocation(loc);
      HtmlGenerator g = new HtmlGenerator("Moved");
      g.append("<P>This resource has moved, click  if your browser"
         + " doesn't support automatic redirection<BR>"+
         "<A HREF=\""+loc.toExternalForm()+"\">"+
         loc.toExternalForm()+"</A>");
      reply.setStream(g);
      return reply ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

    e.setProxyAuthenticate(challenge);
      } else {
    e = request.makeReply(HTTP.UNAUTHORIZED);
    e.setWWWAuthenticate(challenge);
      }
      HtmlGenerator g = new HtmlGenerator("Unauthorized");
      g.append ("<h1>Unauthorized access</h1>"+
          "<p>You are denied access to this resource.");
      e.setStream(g);
      request.skipBody();
      throw new HTTPException (e);
  } else {
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  return false;
    }

    protected HtmlGenerator generateForm(String msg) {
  // Create the HTML and set title:
  HtmlGenerator g = new HtmlGenerator("Password editor for "+getRealm());
  // Add style link
  addStyleSheet(g);
  g.append("<h1>Password editor for "
     , getRealm()
     , "</h1>");
  // If some message is available, dump it:
  if ( msg != null )
      g.append("<hr>", msg, "</hr>");
  // And then display the form:
  g.append("<form method=\"POST\" action=\"",
     getURLPath(),
     "\">");
  g.append("<table width=\"100%\">");
  g.append("<tr><th align=right>username");
  g.append("<th align=left><input type=\"text\" name=\"username\">");
  g.append("<tr><th align=right>old password");
  g.append("<th align=left><input type=\"password\" name=\"opasswd\">");
  g.append("<tr><th align=right>new password");
  g.append("<th align=left><input type=\"password\" name=\"npasswd\">");
  g.append("<tr><th align=right>confirm");
  g.append("<th align=left><input type=\"password\" name=\"cpasswd\">");
  g.append("</table>");
  g.append("<input type=\"submit\" value=\"Change\">");
  g.append("</form>");
  return g;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.