* @param htmlHeadElement
* @throws ViewParserException
*/
private void generateCruxMetaDataElement(Element htmlHeadElement) throws ViewParserException
{
ScreenFactory factory = ScreenFactory.getInstance();
String screenModule = null;
try
{
screenModule = factory.getScreenModule(cruxPageDocument);
}
catch (Exception e)
{
throw new ViewParserException(e.getMessage(), e);
}
if (screenModule == null)
{
throw new ViewParserException("No module declared on view ["+viewId+"].");
}
try
{
String screenId = factory.getRelativeScreenId(this.viewId, screenModule);
Element cruxMetaData = htmlDocument.createElement("script");
cruxMetaData.setAttribute("id", "__CruxMetaDataTag_");
htmlHeadElement.appendChild(cruxMetaData);
Text textNode = htmlDocument.createTextNode("var __CruxScreen_ = \""+screenModule+"/"+HTMLUtils.escapeJavascriptString(screenId, escapeXML)+"\"");