RenderRequest renderRequest = getRenderRequest();
PortletSession session = renderRequest.getPortletSession();
ContentRenderer renderer = (ContentRenderer) renderRequest.getAttribute(RENDERER_PARAM);
PLinkReplacer pLinkReplacer = (PLinkReplacer) renderRequest.getAttribute(PLINK_PARAM);
CRConfigUtil crConf = (CRConfigUtil) renderRequest.getAttribute(CRCONF_PARAM);
try {
if (object != null) {
try {
String content = renderer.renderContent(object, contentAttribute, true, pLinkReplacer, false, null);
/* Get the ContentPostProcessor-Config from the PortletSession or instance it from the Config */
@SuppressWarnings("unchecked")
ConcurrentHashMap<String, ContentPostProcesser> confs = (ConcurrentHashMap<String, ContentPostProcesser>) session
.getAttribute(SESSION_KEY_CONTENTPOSTPROCESSOR_CONF, PortletSession.APPLICATION_SCOPE);
if (confs == null) {
confs = ContentPostProcesser.getProcessorTable(crConf);
if (confs != null) {
session.setAttribute(
SESSION_KEY_CONTENTPOSTPROCESSOR_CONF,
confs,
PortletSession.APPLICATION_SCOPE);
logger.debug("Put ContentPostProcessor config into session of " + crConf.getName() + "!");
}
}
if (confs != null) {
for (ContentPostProcesser p : confs.values()) {
content = p.processString(content, renderRequest);