try {
ds = this.config.getDatasource();
plinkObject = PortalConnectorFactory.getContentObject(contentid, ds);
ITemplateManager myTemplateEngine = this.config.getTemplateManager();
// Put objects in the plink template
myTemplateEngine.put("plink", plinkObject);
//Deploy predefined Objects to the context
Iterator<String> it = this.contextObjects.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
myTemplateEngine.put(key, this.contextObjects.get(key));
}
// as url is a special object put it also in the templates
if (this.config.getPathResolver() != null) {
String url = this.config.getPathResolver().getPath(plinkObject);
if (url != null) {
myTemplateEngine.put("url", url);
}
}
link = myTemplateEngine.render("link", this.config.getPlinkTemplate());
} catch (DatasourceNotAvailableException e) {
CRException ex = new CRException(e);
log.error(ex.getMessage() + ex.getStringStackTrace());
} catch (CRException ex) {