Timer t = new Timer();
List<InfoglueTool> tools = new ArrayList<InfoglueTool>();
if(hasAccessTo(principal, "StructureTool.Read", true))
tools.add(new InfoglueTool("StructureTool", "ViewStructureTool!V3.action", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.structureTool.name"), "A place to manage your sites", "structure", ""));
if(hasAccessTo(principal, "ContentTool.Read", true))
tools.add(new InfoglueTool("ContentTool", "ViewContentTool!V3.action", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.contentTool.name"), "A place to manage your sites", "content", ""));
if(hasAccessTo(principal, "ManagementTool.Read", true))
tools.add(new InfoglueTool("ManagementTool", "ViewManagementTool!V3.action", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.managementTool.name"), "A place to manage your sites", "management", ""));
if(hasAccessTo(principal, "MyDesktopTool.Read", true))
tools.add(new InfoglueTool("MyDesktopTool", "ViewMyDesktopTool!V3.action", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.myDesktopTool.name"), "A place to manage your sites", "mydesktop", ""));
if(hasAccessTo(principal, "PublishingTool.Read", true))
tools.add(new InfoglueTool("PublishingTool", "ViewPublishingTool!V3.action", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.publishingTool.name"), "A place to manage your sites", "publishing", ""));
if(hasAccessTo(principal, "FormsTool.Read", true))
{
try
{
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName("Infoglue form system");
if(repositoryVO != null)
{
SiteNodeVO siteNodeVO = SiteNodeController.getController().getRootSiteNodeVO(repositoryVO.getId());
if(siteNodeVO != null)
{
tools.add(new InfoglueTool("FormsTool", "ViewSiteNode.action?siteNodeId=" + siteNodeVO.getId(), "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.formEditorTool.name"), "A place to manage your forms", "formeditor", ""));
}
}
}
catch (Exception e)
{
logger.error("Problem loading form system:" + e.getMessage(), e);
}
}
if(hasAccessTo(principal, "CalendarTool.Read", true))
{
try
{
RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName("Infoglue calendar system");
if(repositoryVO != null)
{
SiteNodeVO siteNodeVO = SiteNodeController.getController().getRootSiteNodeVO(repositoryVO.getId());
if(siteNodeVO != null)
{
tools.add(new InfoglueTool("CalendarTool", "ViewSiteNode.action?siteNodeId=" + siteNodeVO.getId(), "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.calendarTool.name"), "A place to manage your calendars", "calendareditor", ""));
}
}
}
catch (Exception e)
{
logger.error("Problem loading calendar system:" + e.getMessage(), e);
}
}
if(hasAccessTo(principal, "SearchTool.Read", true))
tools.add(new InfoglueTool("SearchTool", "Search.action?initSearch=true", "", LabelController.getController(locale).getLocalizedString(locale, "tool.common.searchTool.name"), "Global search", "search", ""));
return tools;
}