Package org.apache.ecs

Examples of org.apache.ecs.Document


     */
    public Document getPage()
    {
        pageSet = true;
        if (this.page == null)
            this.page = new Document();
        return this.page;
    }
View Full Code Here


     
  public void test1()
  {
  System.out.println("\ntest1");

  Document doc = new Document();
  jsp_useBean bean = new jsp_useBean("bean1", "page", "Person");
  jsp_setProperty set = new jsp_setProperty("bean1", "last", "Jones");
  jsp_getProperty get = new jsp_getProperty("bean1", "first");
  bean.addElement(set);
  doc.appendBody(bean);
  doc.appendBody(new P());
  doc.appendBody(get);
  doc.appendBody(new jsp_scriptlet("out.println(\"hello\");"));
  IMG img = new IMG();
  jsp_expression expr = new jsp_expression("bean1.getPhoto()");
  img.setSrc(expr.toString());
  doc.appendBody(img);

  System.out.println(doc.toString());
  }
View Full Code Here

  public void test2()
  {
  System.out.println("\ntest2");

  Document doc = new Document();
  jsp_page page= new jsp_page("java", "true", "16k", "true",
                  "true", "false", "text/html", "iso");
  doc.appendBody(page);
 
  jsp_include inc = new jsp_include("anotherpage.jsp");
  jsp_forward fwd = new jsp_forward("anotherpage.jsp");
  doc.appendBody(inc);
  doc.appendBody(fwd);
  System.out.println(doc.toString());
  }
View Full Code Here

  public void test3()
  {
  System.out.println("\ntest3");

  Document doc = new Document();
  tsx_dbconnect conn = new tsx_dbconnect("conn1", "jdbc:db2:sample", "com.ibm.db2.db2driver", "wsdemo", "wsdemo1");
    tsx_dbquery query = new tsx_dbquery("query1", "conn1", "10");
  query.addElement("select * from staff");
    tsx_dbmodify modify = new tsx_dbmodify("modify", "conn1");
  tsx_repeat rep = new tsx_repeat("i", "1", "10");
  tsx_getProperty getProp = new tsx_getProperty("query1", "lastname");
  rep.addElement(getProp);
  doc.appendBody(conn);
  doc.appendBody(query);
  doc.appendBody(rep);
 
  tsx_setProperty setProp = new tsx_setProperty("modify1", "lastname", "Jones");
  modify.addElement("delete from staff where lastname='Jones'");
  doc.appendBody(setProp);
  doc.appendBody(modify);

 
  System.out.println(doc.toString());
  }
View Full Code Here

            body.addAttribute("leftmargin", "0");
            body.addAttribute("topmargin", "0");
            body.addAttribute("marginwidth", "0");
            body.addAttribute("marginheight", "0");

            Document document = new Document()
                .setDoctype(new Doctype.Html40Transitional())
                .setHtml(new Html().addElement(head).addElement(body));

            document.output(out);
        } catch(Exception e) {
            out.println("<html><body><h3>Fatal error generating navigation frame content</h3><pre>"
                    + Utils.getStackTrace(e) + "</pre></body></html>");
        } finally {
            if(out != null)
View Full Code Here

                .setText(HtmlColor.black)
                .addElement(new B().addElement("Smilehouse OpenSyncro"))
                .addElement(new P())
                .addElement("Your browser can't handle frames. Please update your browser!"));

            Document document = new Document().setDoctype(new Doctype.Html40Frameset()).setHtml(
                new Html().addElement(
                    new Head().addElement(new Title("Smilehouse OpenSyncro (Standalone)"))
                    .addElement(new Script(
                        "if (top.location != location) top.location.href = document.location.href;")
                        .setLanguage("JavaScript")
                        )).addElement(
                    frameset).addElement(noframes));
           
            document.output(out);
        } catch(Exception e) {
            out.println("<html><body><h3>FATAL ERROR</h3><pre>" + Utils.getStackTrace(e)
                    + "</pre></body></html>");
        } finally {
            if(out != null)
View Full Code Here

        if(message != null) {
            body.addElement(new Script().setLanguage("JavaScript").addElement(
                "alert('" + message + "')"));
        }

        Document document = new Document().setDoctype(new Doctype.Html40Transitional()).setHtml(
            new Html()
                .addElement(
                    new Head().addElement(new Title("Smilehouse OpenSyncro")).addElement(
                        new Link().setRel("stylesheet").setType("text/css").setHref(
                            "smilestyle.css")))
                .addElement(body));

        res.setContentType("text/html");
        PrintWriter out = res.getWriter();
        try {
            document.output(out);
        } catch(Exception e) {
            Environment.getInstance().log("Exception in login", e);
        } finally {
            if(out != null) {
                out.flush();
View Full Code Here

            tabGenerator.getStyle()).addElement(
            new Link().setRel("stylesheet").setType("text/css").setHref("smilestyle.css"));
        if(toHead != null)
            head.addElement(toHead);

        Document doc = new Document().setDoctype(new Doctype.Html40Transitional()).setHtml(
            new Html().addElement(head).addElement(
                body.addElement(tabGenerator.getTabSet(tabSetId, tabId, new ElementContainer()
                    .addElement(content), MENU_FILE, standaloneZones, lang))));
        doc.output(out);
    }
View Full Code Here

        Body body = getBody();
        body.addElement(new H1("ERROR!")).addElement(new PRE().addElement(Utils.getStackTrace(e))
//          .addElement(e.getCause().toString())
            );

        Document doc = new Document().setDoctype(new Doctype.Html40Transitional()).setHtml(
            new Html().addElement(new Head()).addElement(body));

        doc.output(out);
    }
View Full Code Here

     */
    public Document getPage()
    {
        pageSet = true;
        if (this.page == null)
            this.page = new Document();
        return this.page;
    }
View Full Code Here

TOP

Related Classes of org.apache.ecs.Document

Copyright © 2018 www.massapicom. 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.