Package com.dotcms.repackage.org.jsoup.nodes

Examples of com.dotcms.repackage.org.jsoup.nodes.Document


   *
   * @param _body - the body became by jsp TemplateForm
   * @return endBody with all HTML tags
   */
  public static StringBuffer getPreviewBody(String _body, List<PreviewFileAsset> savedFiles, String themePath, boolean header, boolean footer){
    Document templateBody = Jsoup.parse(_body);

    // adding default css for YUI Grid
    if(UtilMethods.isSet(themePath)) {
      addHeadCode(templateBody, "#dotParse('"+themePath+Template.THEME_HTML_HEAD+"')");
    }
    addHeadCode(templateBody, "<link rel=\"stylesheet\" type=\"text/css\" href=\""+PATH_CSS_YUI+"\">");

    if(UtilMethods.isSet(themePath) && header) {
      addHeaderCode(templateBody, "#dotParse('"+themePath+Template.THEME_HEADER+"')");
    }

    if(UtilMethods.isSet(themePath) && footer) {
      addFooterCode(templateBody, "#dotParse('"+themePath+Template.THEME_FOOTER+"')");
    }

    // remove the div for file
    removeFileIconDiv(templateBody);

    // remove the "add container" links
    removeAddContainer(templateBody);

    // remove the mock containers
    removeMockContainers(templateBody);

    // remove the <h1> contents
    removeYuiGridContent(templateBody);

    // add all the js and css files
//    addPreviewJsCssFiles(templateBody,savedFiles);
    addJsCssFiles(templateBody);

    // gets the parseContainer
    getParseContainer(templateBody);


    return new StringBuffer(templateBody.toString());

  }
View Full Code Here


   *
   * @param _body - the body became by jsp TemplateForm
   * @return endBody with all HTML tags
   */
  public static StringBuffer getBody(String _body, String headCode, String themePath, boolean header, boolean footer){
    Document templateBody = Jsoup.parse(_body);

    // adding default css for YUI Grid

    if(UtilMethods.isSet(themePath)) {
      addHeadCode(templateBody, "#dotParse('"+themePath+Template.THEME_HTML_HEAD+"')");
    }
    addHeadCode(templateBody, "<link rel=\"stylesheet\" type=\"text/css\" href=\""+PATH_CSS_YUI+"\">");

    if(UtilMethods.isSet(themePath) && header) {
      addHeaderCode(templateBody, "#dotParse('"+themePath+Template.THEME_HEADER+"')");
    }

    if(UtilMethods.isSet(themePath) && footer) {
      addFooterCode(templateBody, "#dotParse('"+themePath+Template.THEME_FOOTER+"')");
    }

    // remove the div for file
    removeFileIconDiv(templateBody);

    // remove the "add container" links
    removeAddContainer(templateBody);

    // remove the mock containers
    removeMockContainers(templateBody);

    // remove the <h1> contents
    removeYuiGridContent(templateBody);

    // add all the js and css files
    addJsCssFiles(templateBody);

    // gets the parseContainer
    getParseContainer(templateBody);

    // gets the metatag containers
    getMetatagContainers(templateBody);

    // add head code to body
    if(null!=headCode && !"".equals(headCode.trim()))
      addHeadCode(templateBody, headCode);

    return new StringBuffer(templateBody.toString());
  }
View Full Code Here

     * @param isPreview
     * @return
     */
    public static TemplateLayout getDesignParameters ( String drawedBody, Boolean isPreview ) {

        Document templateDrawedBody = Jsoup.parse( drawedBody );
        TemplateLayout parameters = new TemplateLayout();
        parameters.setPageWidth( getPageWithValue( templateDrawedBody ) );
        parameters.setHeader( hasHeader( templateDrawedBody ) );
        parameters.setFooter( hasFooter( templateDrawedBody ) );
        parameters.setLayout( getLayout( templateDrawedBody ) );
View Full Code Here

   * Get the imported files inodes
   *
   * May 7, 2012 - 5:31:05 PM
   */
  public static List<PreviewFileAsset> getFilesInodes(String _body){
    Document templateBody = Jsoup.parse(_body);
    List<PreviewFileAsset> result = new ArrayList<PreviewFileAsset>();
    Element divFilesToAdd = templateBody.getElementById(FILES_TO_ADD_DIV_ID);
    if(null!=divFilesToAdd){
      Elements filesToAdd = divFilesToAdd.getElementsByAttributeValueStarting(ID_ATTRIBUTE, FILE_TO_ADD_START_ID);
      for(Element singleFile : filesToAdd){
        String id = singleFile.attr("id");
        String[] values = id.substring(id.indexOf(FILE_TO_ADD_START_ID)+4).split("_");
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.jsoup.nodes.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.