public String getSiteNodePath(SiteNodeVO siteNodeVO, boolean includeRootSiteNode, boolean includeRepositoryName, Database db) throws Exception
{
StringBuffer sb = new StringBuffer();
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(siteNodeVO.getRepositoryId(), db);
while(siteNodeVO != null)
{
if (includeRootSiteNode || siteNodeVO.getParentSiteNodeId() != null)
{
sb.insert(0, "/" + siteNodeVO.getName());
}
if(siteNodeVO.getParentSiteNodeId() != null)
siteNodeVO = getSiteNodeVOWithId(siteNodeVO.getParentSiteNodeId(), db);
else
siteNodeVO = null;
}
if (includeRepositoryName)
{
if(repositoryVO != null)
sb.insert(0, repositoryVO.getName() + "/");
}
return sb.toString().replaceAll("//", "/");
}