*
* @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());
}