Examples of HtmlGenerator


Examples of org.w3c.jigsaw.html.HtmlGenerator

    return null;
  }
  // failed, restrict access
  Reply r = request.makeReply(HTTP.USE_PROXY);
  if (r != null) {
      HtmlGenerator g = new HtmlGenerator("Use Proxy");
      g.append("You should use the following proxy to access" +
         " this resource: " + getString(ATTR_PROXY, "localhost"));
      r.setStream(g);
  }
  r.setLocation(proxy_url);
  return r;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

    {
  String username = data.getValue("username");
  String opasswd  = data.getValue("opasswd");
  String npasswd  = data.getValue("npasswd");
  String cpasswd  = data.getValue("cpasswd");
  HtmlGenerator g = null;
  if ((username == null)
      || (opasswd == null)
      || (npasswd == null)
      || (cpasswd == null)) {
      // Check that all values are available:
      if (username == null)
    g = generateForm("Fill in <em>all</em> the fields.");
      else
    g = generateForm("Hey, "+username+", could you feel in "
         + "<em>all</em> the fields please.");
  } else   if ( ! npasswd.equals(cpasswd) ) {
      // Check that new and confirmed password are the same:
      g = generateForm("New and confirmed password don't "
           + " match, try again "
           + ((username == null) ? "." : (username+".")));
  } else if ( changePassword(username, opasswd, npasswd) ) {
      // Run the change:
      g = new HtmlGenerator("Password now changed.");
      // Add style link
      addStyleSheet(g);
      g.append("<h1>Your password has been changed</h1>");
      g.append("<p>Operation succeeded, have fun !");
  } else {
      // Changing the password failed, don't provide explanations:
      g = new HtmlGenerator("Password change failed");
      // Add style link
      addStyleSheet(g);
      g.append("<h1>Changing the password failed</h1>");
      g.append("You were not allowed to change the password for user \""
         , username
         , "\".");
  }
  // We always succeed, that's cool:
  Reply reply = createDefaultReply(request, HTTP.OK);
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  throws ProtocolException, ResourceException
    {
  // get our associated FileResource
  FileResource fres = getFileResource();
  // Create the HTML generator, and set titles:
  HtmlGenerator g = new HtmlGenerator("FancyFrame");
  g.append("<h1>FancyFrame output</h1>");
  // emit the message
  g.append("<p>",getMessage(),"</p>");
  // display information about our FileResource
  g.append("<h2> FileResource associated : </h2>");
  g.append("<ul><li>Identifier : ",fres.getIdentifier());
  g.append("<li>File : "+fres.getFile());
  g.append("<li>Last Modified Time : ",
     new Date(fres.getLastModified()).toString(),
     "</ul>");
  // now emit the reply
  Reply reply = createDefaultReply(request, HTTP.OK) ;
  reply.setStream(g) ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  throws ProtocolException, ResourceException
    {
  // get our associated DirectoryResource
  DirectoryResource dres = getDirectoryResource();
  // Create the HTML generator, and set titles:
  HtmlGenerator g = new HtmlGenerator("FancyFrame");
  g.append("<h1>FancyFrame output</h1>");
  // emit the message
  g.append("<p>",getMessage(),"</p>");
  // display information about our DirectoryResource
  g.append("<h2> DirectoryResource associated : </h2>");
  g.append("<ul><li>Identifier : ",dres.getIdentifier());
  g.append("<li>Directory : "+dres.getDirectory());
  g.append("<li>Last Modified Time : ",
     new Date(dres.getLastModified()).toString(),
     "</ul>");
  // now emit the reply
  Reply reply = createDefaultReply(request, HTTP.OK) ;
  reply.setStream(g) ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

      String log = null;
      try {
    log = getCvsManager().log(name);
      } catch (CvsException cvs_ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g = getHtmlGenerator("CVS log command failed") ;
    g.append ("<p>The CVS <strong>log</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + cvs_ex.getMessage() + "</em>"
        + "<hr> from class: " + this.getClass().getName()) ;
    error.setStream (g) ;
    throw new HTTPException (error) ;
      } catch (InvalidResourceException ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g = getHtmlGenerator("CVS log command failed") ;
    g.append ("<p>The CVS <strong>log</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + ex.getMessage() + "</em>"
        + "<hr> from class: " + this.getClass().getName()) ;
    error.setStream (g) ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

      String diff = null ;
      try {
    diff = getCvsManager().diff(name);
      } catch (CvsException cvs_ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g = getHtmlGenerator("CVS diff command failed") ;
    g.append ("<p>The CVS <strong>diff</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + cvs_ex.getMessage() + "</em>"
        + "<hr> from class: " + this.getClass().getName()) ;
    error.setStream (g) ;
    throw new HTTPException (error) ;
      } catch (InvalidResourceException ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g = getHtmlGenerator("CVS diff command failed") ;
    g.append ("<p>The CVS <strong>diff</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + ex.getMessage() + "</em>"
        + "<hr> from class: " + this.getClass().getName()) ;
    error.setStream (g) ;
    throw new HTTPException (error) ;
      } finally {
    rr_cvsframe.unlock();
      }
      // if there are no differences, generate a dummy report
      Reply         reply = request.makeReply(HTTP.OK) ;
      if((diff == null) || (diff.length() == 0)) {
    HtmlGenerator g = getHtmlGenerator("CVS diff command results");
    g.append("<P>No differences between " + name
       + " and the repository</P>");
    reply.setStream(g);
      } else {
    HtmlGenerator g = getHtmlGenerator("Diff result");
    g.append ("<center>");
    g.append (" [ <a href=\"../\">Up to directory</A> ] &middot;");
    g.append (" [ <a href=\""+getCvsURL(),
        "\">Back to CVS</A> ] \n");
    g.append ("</center>");
    g.append ("<hr noshade width=\"80%\"><p>");
    g.append ("<span class=\"title\"> CVS diff of ",
        name,"</span>\n");
    g.append ("<pre>",parseDiff(diff),"</pre>\n");
    g.append ("<p><hr noshade width=\"80%\">");
    g.append ("<center>");
    g.append (" [ <a href=\"../\">Up to directory</A> ] &middot;");
    g.append (" [ <a href=\""+getCvsURL(),
        "\">Back to CVS</A> ] \n");
    g.append ("</center>");
    reply.setStream(g);
      }
      return reply ;
  }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

    protected Reply getOtherResource(Request request)
  throws ProtocolException, ResourceException
    // get our associated Resource
  FramedResource res = getResource();
  // Create the HTML generator, and set titles:
  HtmlGenerator g = new HtmlGenerator("FancyFrame");
  g.append("<h1>FancyFrame output</h1>");
  // emit the message
  g.append("<p>",getMessage(),"</p>");
  // display information about our Resource
  g.append("<h2> Resource associated : </h2>");
  g.append("<ul><li>Identifier : ",res.getIdentifier());
  g.append("<li>Last Modified Time : ",
     new Date(res.getLastModified()).toString(),
     "</ul>");
  // now emit the reply
  Reply reply = createDefaultReply(request, HTTP.OK) ;
  reply.setStream(g) ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  }

  protected Reply doEditRev (Request request, String revision)
      throws HTTPException
  {
      HtmlGenerator g = getHtmlGenerator("Edit log");
      g.append ("<center>");
      g.append (" [ <a href=\"../\">Up to directory</A> ] &middot; ");
      g.append (" [ <a href=\""+getCvsURL()+
          "\">Back to CVS</A> ] &middot; ");
      g.append (" [ <a href=\"./",name+"?log\">Back to log</A> ] ");
      g.append ("<hr noshade width=\"80%\"><p>");
      g.append ("<span class=\"title\"> Edit log comment of ",
          name,
          " (revision "+revision+")</span>\n");
      g.append ("<form  method=\"post\">\n");
      g.append ("<input type=\"hidden\" name=\"revision\" value=\"",
          revision,"\">\n");
      g.append ("<table border=\"0\">\n");
      g.append ("<tr><td align=\"left\">");
      g.append ("<textarea name=\"comment\" rows=\"3\" cols=\"50\">\n") ;
      g.append ("</textarea></td></tr>\n") ;
      g.append ("</td></tr><tr><td align=\"center\">");
      g.append ("<input type=\"submit\" name=\"submit\" " +
          "value=\" Save Comment \">" );
      g.append ("</td></tr>");
      g.append ("</table></center></form>\n");
      g.append ("<hr noshade width=\"80%\">");
      Reply reply = request.makeReply(HTTP.OK) ;
      reply.setStream(g);
      return reply;
  }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

    command[0] = "-m"+revision+":\""+comment+"\"";
    command[1] = name;
    getCvsManager().admin(command);
      } catch (CvsException ex) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
    HtmlGenerator g =
        getHtmlGenerator("CVS admin command failed") ;
    g.append ("<p>The CVS <strong>admin</strong> command failed "
        + " on " + name
        + " with the following error message: "
        + "<em>" + ex.getMessage() + "</em>");
    error.setStream (g) ;
    throw new HTTPException (error) ;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

         int status,
         String title,
         String msg)
    {
  Reply error = request.makeReply(status);
  HtmlGenerator g = CvsFrame.getHtmlGenerator(title);
  g.append("<span class=\"title\">",title,"</span>\n");
  g.append("<p>",msg);
  error.setStream(g);
  return error;
    }
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.