* implements {@link com.gentics.cr.template.ITemplateManager#render(String, String)}
*/
public String render(final String templatename, final String templatesource) throws CRException {
String renderedTemplate = null;
TemplateProcessor processor = PortalNodeInteractor.getPortletTemplateProcessor(this.portlet);
try {
Iterator<String> it = this.contextObjects.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
processor.put(key, this.contextObjects.get(key));
}
renderedTemplate = processor.getOutputForSource(templatesource, this.portlet);
} catch (TemplateNotFoundException e) {
throw new CRException(e);
} catch (PrivateKeyException e) {
throw new CRException(e);
} finally {