public void renderSubContentBody( Appendable writer, Map<String, Object> context, ModelScreenWidget.SubContent content) throws IOException { Locale locale = UtilMisc.ensureLocale(context.get("locale")); String mimeTypeId = "text/html"; String expandedContentId = content.getContentId(context); String expandedMapKey = content.getMapKey(context); String renderedContent = ""; LocalDispatcher dispatcher = (LocalDispatcher) context.get("dispatcher"); Delegator delegator = (Delegator) context.get("delegator"); // create a new map for the content rendering; so our current context does not get overwritten! Map<String, Object> contentContext = FastMap.newInstance(); contentContext.putAll(context); try { if (WidgetContentWorker.contentWorker != null) { renderedContent = WidgetContentWorker.contentWorker.renderSubContentAsTextExt( dispatcher, delegator, expandedContentId, expandedMapKey, contentContext, locale, mimeTypeId, true); // Debug.logInfo("renderedContent=" + renderedContent, module); } else { Debug.logError( "Not rendering content, WidgetContentWorker.contentWorker not found.", module); } if (UtilValidate.isEmpty(renderedContent)) { String editRequest = content.getEditRequest(context); if (UtilValidate.isNotEmpty(editRequest)) { if (WidgetContentWorker.contentWorker != null) { WidgetContentWorker.contentWorker.renderContentAsTextExt( dispatcher, delegator, "NOCONTENTFOUND", writer, contentContext, locale, mimeTypeId, true); } else { Debug.logError( "Not rendering content, WidgetContentWorker.contentWorker not found.", module); } } } else { if (content.xmlEscape()) { renderedContent = UtilFormatOut.encodeXmlValue(renderedContent); } writer.append(renderedContent); } } catch (GeneralException e) { String errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e.toString(); Debug.logError(e, errMsg, module); // throw new RuntimeException(errMsg); } catch (IOException e2) { String errMsg = "Error rendering included content with id [" + expandedContentId + "] : " + e2.toString(); Debug.logError(e2, errMsg, module); // throw new RuntimeException(errMsg); } }