Examples of HtmlPage


Examples of com.opensymphony.module.sitemesh.HTMLPage

            StringWriter buffer = new StringWriter();
            page.writeBody(OutputConverter.getWriter(buffer));
            context.put("body", buffer.toString());

            if (page instanceof HTMLPage) {
                HTMLPage htmlPage = (HTMLPage) page;
                buffer = new StringWriter();
                htmlPage.writeHead(OutputConverter.getWriter(buffer));
                context.put("head", buffer.toString());
            }

            //Rendering the content
            VelocityEngine velocityEngine = VelocityManager.getInstance().getVelocityEngine();
View Full Code Here

Examples of com.opensymphony.module.sitemesh.HTMLPage

            Factory factory = PortletContext.getContext().getSiteMeshFactory();
            Decorator decorator = factory.getDecoratorMapper().getNamedDecorator(request, decoratorName);
            if (decorator != null) {
                com.opensymphony.module.sitemesh.PageParser parser = factory.getPageParser("text/html");
                HTMLPage page = (HTMLPage) ((FastPageParser) parser).parse(new StringReader(bodyContent.toString()));
                Context context = VelocityManager.getInstance()
                        .createContext(ActionContext.getContext().getValueStack(), request, response);
                context.put("page", page);
                if (node.jjtGetNumChildren() == 3)
                    context.put("title", (String) node.jjtGetChild(1).value(adapter));
                else
                    context.put("title", page.getTitle());
                StringWriter buffer = new StringWriter();
                page.writeBody(OutputConverter.getWriter(buffer));
                context.put("body", buffer.toString());
                buffer = new StringWriter();
                page.writeHead(OutputConverter.getWriter(buffer));
                context.put("head", buffer.toString());
                context.put("params", params);
                writer.write(VelocityUtils.getRenderedTemplate(decorator.getPage(), context));
            } else {
                throw new IOException("could not find decorator with name: " + decoratorName);
View Full Code Here

Examples of fitnesse.html.template.HtmlPage

  public Response makeResponse(FitNesseContext context, Request request) throws Exception {
    this.context = context;
    loadPage(request.getResource(), context);

    SimpleResponse response = new SimpleResponse();
    HtmlPage html = context.pageFactory.newPage();
    html.setMainTemplate("render.vm");
    html.put("content", new SlimRenderer());
    response.setContent(html.html());
    return response;
  }
View Full Code Here

Examples of org.ajax4jsf.component.html.HtmlPage

     */
    protected void setProperties(UIComponent component)
    {
        // TODO Auto-generated method stub
        super.setProperties(component);
    HtmlPage comp = (HtmlPage) component;
            if(null != this._ajaxListener){
        ((HtmlPage)component).setAjaxListener(this._ajaxListener);
      }   
                    
            if (this._contentType != null) {
        if (this._contentType.isLiteralText()) {
          try {
                       
            java.lang.String __contentType = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._contentType.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setContentType(__contentType);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("contentType", this._contentType);
        }
      }
                          
            if (this._format != null) {
        if (this._format.isLiteralText()) {
          try {
                       
            java.lang.String __format = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._format.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setFormat(__format);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("format", this._format);
        }
      }
                         
            if (this._immediate != null) {
        if (this._immediate.isLiteralText()) {
          try {
                       
            Boolean __immediate = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._immediate.getExpressionString(),
                      Boolean.class);
         
                        comp.setImmediate(__immediate.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("immediate", this._immediate);
        }
      }
                         
            if (this._namespace != null) {
        if (this._namespace.isLiteralText()) {
          try {
                       
            java.lang.String __namespace = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._namespace.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setNamespace(__namespace);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("namespace", this._namespace);
        }
      }
                        
            if (this._onload != null) {
        if (this._onload.isLiteralText()) {
          try {
                       
            java.lang.String __onload = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._onload.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setOnload(__onload);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("onload", this._onload);
        }
      }
                        
            if (this._onunload != null) {
        if (this._onunload.isLiteralText()) {
          try {
                       
            java.lang.String __onunload = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._onunload.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setOnunload(__onunload);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("onunload", this._onunload);
        }
      }
                        
            if (this._pageTitle != null) {
        if (this._pageTitle.isLiteralText()) {
          try {
                       
            java.lang.String __pageTitle = (java.lang.String) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._pageTitle.getExpressionString(),
                      java.lang.String.class);
         
                        comp.setPageTitle(__pageTitle);
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("pageTitle", this._pageTitle);
        }
      }
                          
            if (this._selfRendered != null) {
        if (this._selfRendered.isLiteralText()) {
          try {
                       
            Boolean __selfRendered = (Boolean) getFacesContext().
              getApplication().
                getExpressionFactory().
                  coerceToType(this._selfRendered.getExpressionString(),
                      Boolean.class);
         
                        comp.setSelfRendered(__selfRendered.booleanValue());
                      } catch (ELException e) {
            throw new FacesException(e);
          }
        } else {
          component.setValueExpression("selfRendered", this._selfRendered);
View Full Code Here

Examples of org.archive.wayback.replay.HTMLPage

    HttpHeaderOperation.copyHTTPMessageHeader(resource, httpResponse);

    Map<String,String> headers = HttpHeaderOperation.processHeaders(resource, result, uriConverter, this);

    // Load content into an HTML page, and resolve load-time URLs:
    HTMLPage page = new HTMLPage(resource,result,uriConverter);
    page.readFully();
   
    if(serverSideRendering) {
      page.resolveAllPageUrls();
    } else {
      page.resolvePageUrls();
    }
    if(jsInserts != null) {
      Iterator<String> itr = jsInserts.iterator();
      while(itr.hasNext()) {
        toInsert.append(page.getJSIncludeString(itr.next()));
      }
    }
    if(jspInserts != null) {
      Iterator<String> itr = jspInserts.iterator();
      while(itr.hasNext()) {
        toInsert.append(page.includeJspString(itr.next(), httpRequest,
            httpResponse, wbRequest, results, result));
      }
    }

    // insert the new content:
    if(serverSideRendering) {
      page.insertAtStartOfBody(toInsert.toString());
    } else {
      page.insertAtEndOfBody(toInsert.toString());
    }
   
    // set the corrected length:
    int bytes = page.getBytes().length;
    headers.put(HTTP_LENGTH_HEADER, String.valueOf(bytes));
    // Tomcat will always send a charset... It's trying to be smarter than
    // we are. If the original page didn't include a "charset" as part of
    // the "Content-Type" HTTP header, then Tomcat will use the default..
    // who knows what that is, or what that will do to the page..
    // let's try explicitly setting it to what we used:
    httpResponse.setCharacterEncoding(page.getCharSet());

    // send back the headers:
    HttpHeaderOperation.sendHeaders(headers, httpResponse);

    page.writeToOutputStream(httpResponse.getOutputStream());
   
    // log this replay request
    logReplayRequest(httpRequest, httpRequest.getParameter("sid"));
  }
View Full Code Here

Examples of org.dbwiki.web.html.HtmlPage

        content.openTABLE(layout.getCSS(CSS.CSSContentFrame));
               
        // Display the children
        SchemaNodeListIndex children = new SchemaNodeListIndex(group, _layouter);
        for (int i = 0; i < children.size(); i++) {
          HtmlPage lines = getLinesForNodeList(children.get(i), versionParameter);
          if (lines.size() > 0) {
            content.openTR();
            content.openTD(layout.getCSS(CSS.CSSContentListing));
            content.add(lines);
            content.closeTD();
            content.closeTR();
View Full Code Here

Examples of org.htmlparser.visitors.HtmlPage

    }

    public void testCreateSimplePage() throws Exception
    {
        createParser(SIMPLE_PAGE);
        HtmlPage page = new HtmlPage(parser);
        parser.visitAllNodesWith(page);
        assertStringEquals(
            "title",
            "Welcome to the HTMLParser website",
            page.getTitle());
        NodeList bodyNodes = page.getBody();
        assertEquals("number of nodes in body", 1, bodyNodes.size());
        Node node = bodyNodes.elementAt(0);
        assertTrue(
            "expected stringNode but was " + node.getClass().getName(),
            node instanceof StringNode);
        assertStringEquals(
            "body contents",
            "Welcome to HTMLParser",
            page.getBody().asString());
    }
View Full Code Here

Examples of org.mojavemvc.tests.views.HTMLPage

    }

    @Action
    public View doSomething() {

        return new HTMLPage();
    }
View Full Code Here

Examples of org.mojavemvc.tests.views.HTMLPage

    }

    @Action("param-annotation-dates")
    public View paramAnnotationTest11(@Param("p1") Date[] p1) {

        return new HTMLPage()
            .withH2Content("index/param-annotation-dates " +
                    p1[0].toString() + ", " + p1[1].toString() +
                    ", " + p1[2].toString() + ", " + p1[3].toString());
    }
View Full Code Here

Examples of org.mojavemvc.tests.views.HTMLPage

    }

    @Action("param-annotation-bools")
    public View paramAnnotationTest12(@Param("p1") boolean[] p1) {

        return new HTMLPage()
            .withH2Content("index/param-annotation-bools " +
                    p1[0] + ", " + p1[1] + ", " + p1[2] + ", " + p1[3]);
    }
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.