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

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


   * 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("_");
        PreviewFileAsset p = new PreviewFileAsset();
        p.setInode(values[0]);
View Full Code Here


      singleH1.remove();
    }
  }

  private static void removeFileIconDiv(Document templateBody){
    Element divFilesIcons = templateBody.getElementById(FILE_CONTAINER_DIV_ID);
    if(null!=divFilesIcons)
      divFilesIcons.remove();
  }
View Full Code Here

  private static void getParseContainer(Document templateBody){
    Elements divHiddenParseContainer = templateBody.getElementsByAttributeValue(STYLE_ATTRIBUTE, STYLE_DISPLAY_NONE);
    for(Element singleDiv : divHiddenParseContainer){
      if(!singleDiv.attr(ID_ATTRIBUTE).equals("metatagToAdd")){
        Element parent = singleDiv.parent();
        if(!parent.attr(ID_ATTRIBUTE).equals("metatagToAdd")){
          String html = singleDiv.html();
          singleDiv.remove();
          parent.append(html);
        }
      }
    }
  }
View Full Code Here

      }
    }
  }

  private static void addJsCssFiles(Document templateBody){
    Element head = templateBody.head();
    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){
        head.append(replaceHTMLComments(singleFile.html()));
        singleFile.remove();
      }
      divFilesToAdd.remove();
    }
  }
View Full Code Here

      divFilesToAdd.remove();
    }
  }

  private static void addHeadCode(Document templateBody, String headCode){
    Element head = templateBody.head();
    head.append(headCode);
  }
View Full Code Here

    Element head = templateBody.head();
    head.append(headCode);
  }

  private static void addHeaderCode(Document templateBody, String headCode){
    Element header = templateBody.getElementById(HEADER_ID);
    header.append(headCode);
  }
View Full Code Here

    Element header = templateBody.getElementById(HEADER_ID);
    header.append(headCode);
  }

  private static void addFooterCode(Document templateBody, String headCode){
    Element header = templateBody.getElementById(FOOTER_ID);
    header.append(headCode);
  }
View Full Code Here

    Element header = templateBody.getElementById(FOOTER_ID);
    header.append(headCode);
  }

  private static String getPageWithValue(Document templateDrawedBody){
    Element globalContainer = templateDrawedBody.getElementsByAttributeValue(NAME_ATTRIBUTE, MAIN_DIV_NAME_VALUE).get(0);
    return globalContainer.attr(ID_ATTRIBUTE);
  }
View Full Code Here

  }

  private static String getLayout(Document templateDrawedBody){
    Elements layouts = templateDrawedBody.getElementsByAttributeValue(ID_ATTRIBUTE, SIDEBAR_ID);
    if(null!=layouts && layouts.size()>0){
      Element layout = layouts.get(0);
      if(null!=layout)
        return templateDrawedBody.getElementsByAttributeValue(NAME_ATTRIBUTE, MAIN_DIV_NAME_VALUE).get(0).attr(CLASS_ATTRIBUTE);
      else
        return NO_SIDEBAR_VALUE;
    }else
View Full Code Here

    }else
      return NO_SIDEBAR_VALUE;
  }

  private static boolean hasHeader(Document templateDrawedBody){
    Element header = templateDrawedBody.getElementById(HEADER_ID);
    return header!=null;
  }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.jsoup.nodes.Element

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.