String intro = ""; //$NON-NLS-1$
String footer = ""; //$NON-NLS-1$
final String dashboardTemplate = "template-dashboard" + template + ".html"; //$NON-NLS-1$
final IUITemplater templater = PentahoSystem.get(IUITemplater.class, userSession);
ArrayList<String> i18nTagsList = new ArrayList<String>();
if (templater != null) {
String solutionPath = "system/" + PLUGIN_NAME + "/" + dashboardTemplate;
if(!repository.resourceExists(solutionPath))
{//then try in solution
solutionPath = SOLUTION_DIR + "/templates/" + dashboardTemplate;
}
final ActionResource templateResource = new ActionResource("", IActionSequenceResource.SOLUTION_FILE_RESOURCE, "text/xml", solutionPath); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String templateContent = repository.getResourceAsString(templateResource, ISolutionRepository.ACTION_EXECUTE);
// Process i18n on dashboard outer template
templateContent = updateUserLanguageKey(templateContent);
templateContent = processi18nTags(templateContent, i18nTagsList);
// Process i18n on dashboard outer template - end
final String[] sections = templater.breakTemplateString(templateContent, "", userSession); //$NON-NLS-1$
if (sections != null && sections.length > 0) {
intro = sections[0];
}
if (sections != null && sections.length > 1) {
footer = sections[1];