BrowserBean browserBean = new BrowserBean();
//this.browserBean.setRequest(getRequest());
NodeDeliveryController nodeDeliveryController = NodeDeliveryController.getNodeDeliveryController(siteNodeId, languageId, contentId);
IntegrationDeliveryController integrationDeliveryController = IntegrationDeliveryController.getIntegrationDeliveryController(siteNodeId, languageId, contentId);
TemplateController templateController = getTemplateController(dbWrapper, siteNodeId, languageId, contentId, new FakeHttpServletRequest(), (InfoGluePrincipal)principal, false, browserBean, nodeDeliveryController, integrationDeliveryController);
DeliveryContext deliveryContext = DeliveryContext.getDeliveryContext(/*(InfoGluePrincipal)this.principal*/);
//deliveryContext.setRepositoryName(repositoryName);
deliveryContext.setSiteNodeId(siteNodeId);
deliveryContext.setContentId(contentId);
deliveryContext.setLanguageId(languageId);
deliveryContext.setPageKey("" + System.currentTimeMillis());
//deliveryContext.setSession(new Session(fakeHttpServletSession));
//deliveryContext.setInfoGlueAbstractAction(null);
deliveryContext.setHttpServletRequest(fakeHttpServletRequest);
deliveryContext.setHttpServletResponse(fakeHttpServletResponse);
templateController.setDeliveryContext(deliveryContext);
//We don't want a page cache entry to be created
deliveryContext.setDisablePageCache(true);
Integer rootMetaInfoContentId = templateController.getMetaInformationContentId(siteNodeId);
logger.info("rootMetaInfoContentId:" + rootMetaInfoContentId);
recurseSiteNodeTree(siteNodeId, languageId, templateController);
Integer topContentId = null;
ContentVO contentVO = templateController.getContent(rootMetaInfoContentId);
logger.info("contentVO:" + contentVO.getName());
ContentVO parentContentVO = templateController.getContent(contentVO.getParentContentId());
logger.info("parentContentVO:" + parentContentVO.getName());
while(parentContentVO != null)
{
topContentId = parentContentVO.getContentId();
if(parentContentVO.getParentContentId() != null)
parentContentVO = templateController.getContent(parentContentVO.getParentContentId());
else
parentContentVO = null;
}
logger.info("topContentId:" + topContentId);