// Panel ID has been passed
idPanel = getPanel();
setPanel(null);
} else {
// Try to get panel ID from request
Panel panel = RequestContext.lookup().getActivePanel();
if(panel != null){
idPanel = panel.getPanelId().toString();
}
}
Panel panel = null;
if (idPanel != null) {
Section currSection = NavigationManager.lookup().getCurrentSection();
if (currSection != null) {
panel = currSection.getPanel(idPanel);
}
}
if (key != null && panel != null) {
Locale locale = getLocale();
try {
// Retrieve and render resource
// Resources may be a single text, or a jsp to include
// They're located in the panel descriptor
String res = panel.getResource(key, locale); // getProvider().getResource(key);
if (res == null) {
// Resource not found => Print key to make it noticiable
pageContext.getOut().print(key);
log.error("Resource " + key + " for panel " + panel.getId() + " not found!");
} else if (res.toLowerCase().indexOf(".jsp") != -1) {
// It's a JSP to include
jspInclude(res);
} else {
// Just output resource value