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

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


    Element header = templateDrawedBody.getElementById(HEADER_ID);
    return header!=null;
  }

  private static boolean hasFooter(Document templateDrawedBody){
    Element footer = templateDrawedBody.getElementById(FOOTER_ID);
    return footer!=null;
  }
View Full Code Here


        //***************************************************************
        //Verify if we have a sidebar
        Elements splitSideBar = templateDrawedBody.select( DIV_TAG + "[" + ID_ATTRIBUTE + "=" + SIDEBAR_ID );
        if ( splitSideBar != null && !splitSideBar.isEmpty() ) {//We found our sidebar

            Element sidebar = splitSideBar.get( 0 );

            //Getting the containers for this html fragment
            List<String> containers = getColumnContainers( sidebar );
            //Adding the sidebar to the layout
            layout.setSidebar( containers, isPreview );
        }

        //***************************************************************
        //Split the drawed body in rows
        List<TemplateLayoutRow> splitBodiesList = new ArrayList<TemplateLayoutRow>();
        Elements splitBodies = templateDrawedBody.select( DIV_TAG + "[" + ID_ATTRIBUTE + "~=" + getRegexForSelectBody() );
        for ( int i = 0; i < splitBodies.size(); i++ ) {

            Element splitBody = splitBodies.get( i );
            // gets the identifier of the body div
            String idHtml = splitBody.attr( ID_ATTRIBUTE );
            String id = idHtml.substring( idHtml.indexOf( SPLIT_BODY_ID_PREFIX ) + SPLIT_BODY_ID_PREFIX.length() );
            String layoutType = splitBody.child( 0 ).attr( ID_ATTRIBUTE );

            //Create a template row
            TemplateLayoutRow rowLayout = new TemplateLayoutRow();
            rowLayout.setIdentifier( Integer.parseInt( id ) );
            rowLayout.setId( "select_splitBody" );
            rowLayout.setValue( layoutType );

            //We may have  multiple columns in here
            Elements columns = splitBody.select( DIV_TAG + "." + COLUMN_CONTAINER_CLASS );
            if ( columns != null && !columns.isEmpty() ) {

                //We found multiple columns...
                for ( Element columnElement : columns ) {
                    //Find the containers for this column
View Full Code Here

        return containers;
    }

  private static void getMetatagContainers(Document templateBody){
    Element head = templateBody.head();
    Element metatagToAdd = templateBody.getElementById("metatagToAdd");
    if(null!=metatagToAdd){
      Elements metatags = metatagToAdd.getElementsByAttributeValueStarting(ID_ATTRIBUTE, FILE_TO_ADD_START_ID);
      for(Element meta:metatags)
        head.append(meta.html());
      metatagToAdd.remove();
    }
  }
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.