Timer timer = new Timer();
timer.setActive(false);
String decoratePageTemplate = "";
NodeDeliveryController nodeDeliveryController = NodeDeliveryController.getNodeDeliveryController(this.getDeliveryContext());
timer.printElapsedTime("Initialized controllers");
Integer repositoryId = nodeDeliveryController.getSiteNodeVO(getDatabase(), this.getDeliveryContext().getSiteNodeId()).getRepositoryId();
String componentXML = getPageComponentsString(getDatabase(), this.getTemplateController(), this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), this.getDeliveryContext().getContentId());
//logger.info("componentXML:" + componentXML);
componentXML = appendPagePartTemplates(componentXML, this.getDeliveryContext().getSiteNodeId());
timer.printElapsedTime("After getPageComponentsString");
Timer decoratorTimer = new Timer();
decoratorTimer.setActive(false);
InfoGlueComponent baseComponent = null;
if(componentXML == null || componentXML.length() == 0)
{
decoratePageTemplate = showInitialBindingDialog(this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), this.getDeliveryContext().getContentId());
}
else
{
List unsortedPageComponents = new ArrayList();
try
{
//DOM4J
/*
Document document = domBuilder.getDocument(componentXML);
List pageComponents = getPageComponentsWithDOM4j(getDatabase(), componentXML, document.getRootElement(), "base", this.getTemplateController(), null, unsortedPageComponents);
*/
//XPP3
XmlInfosetBuilder builder = XmlInfosetBuilder.newInstance();
XmlDocument doc = builder.parseReader(new StringReader( componentXML ) );
List pageComponents = getPageComponentsWithXPP3(getDatabase(), componentXML, doc.getDocumentElement(), "base", this.getTemplateController(), null, unsortedPageComponents);
preProcessComponents(nodeDeliveryController, repositoryId, unsortedPageComponents, pageComponents);
if(pageComponents.size() > 0)
{
baseComponent = (InfoGlueComponent)pageComponents.get(0);
}
}
catch(Exception e)
{
throw new SystemException("There was a problem parsing the component structure on the page. Could be invalid XML in the ComponentStructure attribute. Message:" + e.getMessage(), e);
}
decoratorTimer.printElapsedTime("After getting basecomponent");
if(baseComponent == null)
{
decoratePageTemplate = showInitialBindingDialog(this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), this.getDeliveryContext().getContentId());
}
else
{
//if(this.getDeliveryContext().getShowSimple() == true)
//{
// decoratePageTemplate = showSimplePageStructure(this.getTemplateController(), repositoryId, this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), baseComponent);
//}
//else
//{
ContentVO metaInfoContentVO = nodeDeliveryController.getBoundContent(getDatabase(), this.getTemplateController().getPrincipal(), this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), true, "Meta information", this.getDeliveryContext());
decoratePageTemplate = decorateComponent(baseComponent, this.getTemplateController(), repositoryId, this.getDeliveryContext().getSiteNodeId(), this.getDeliveryContext().getLanguageId(), this.getDeliveryContext().getContentId()/*, metaInfoContentVO.getId()*/, 15, 0);
decoratePageTemplate = decorateTemplate(this.getTemplateController(), decoratePageTemplate, this.getDeliveryContext(), baseComponent);
//}
if(logger.isInfoEnabled())