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
List<String> containers = getColumnContainers( columnElement );
//Adding the containers for this column
rowLayout.addColumnContainers( containers, isPreview );
}
//Add the created row
splitBodiesList.add( rowLayout );
} else { //It means we just have one column
//Find the containers for this column
List<String> containers = getColumnContainers( splitBody );
rowLayout.addColumnContainers( containers, isPreview );
//Add the created row
splitBodiesList.add( rowLayout );
}
}