public RadeoxWikiRenderEngine(InitialRenderContext context, Blog blog) { super(context); context.setRenderEngine(this); this.blog = blog; }
@Override protected void setUp(FilterContext context) { context.getRenderContext().setCacheable(true); }
private void initRadeoxEngine() { // This is needed so that our local config is used InitialRenderContext ircontext = new BaseInitialRenderContext(); Locale locale = new Locale("xwiki", "xwiki"); ircontext.set(RenderContext.INPUT_LOCALE, locale); ircontext.set(RenderContext.OUTPUT_LOCALE, locale); ircontext.set(RenderContext.LANGUAGE_LOCALE, locale); ircontext.setParameters(new HashMap()); this.initialRenderContext = ircontext; this.filterPipe = initFilterPipe(ircontext); }
private String insertValue(String s) { int idx = s.indexOf('$'); if (idx != -1) { StringBuffer tmp = new StringBuffer(); Map globals = context.getParameters(); String var = s.substring(idx + 1); if (idx > 0) tmp.append(s.substring(0, idx)); if (globals.containsKey(var)) { tmp.append(globals.get(var)); } return tmp.toString(); } return s; }
/** * @see CodeRemoveFilter#handleMatch(StringBuffer, MatchResult, FilterContext) */ public void handleMatch(StringBuffer buffer, MatchResult result, FilterContext context) { LinkedList contentList = (LinkedList) context.getRenderContext().get(CodeRemoveFilter.CODE_MACRO_CONTENT); buffer.append(result.group(1)); buffer.append((String) contentList.removeFirst()); buffer.append("{code}"); } }
private String insertValue(String s) { int idx = s.indexOf('$'); if (idx != -1) { StringBuffer tmp = new StringBuffer(); Map globals = context.getParameters(); String var = s.substring(idx + 1); if (idx > 0) tmp.append(s.substring(0, idx)); if (globals.containsKey(var)) { tmp.append(globals.get(var)); } return tmp.toString(); } return s; }
public void setInitialContext(InitialRenderContext context) { super.setInitialContext(context); Locale outputLocale = (Locale) context.get(RenderContext.OUTPUT_LOCALE); String outputName = (String) context .get(RenderContext.OUTPUT_BUNDLE_NAME); ResourceBundle outputMessages = ResourceBundle.getBundle(outputName, outputLocale); start = outputMessages.getString(getLocaleKey() + ".start"); //$NON-NLS-1$ end = outputMessages.getString(getLocaleKey() + ".end"); //$NON-NLS-1$ }
public void setInitialContext(InitialRenderContext context) { super.setInitialContext(context); Locale outputLocale = (Locale) context.get(RenderContext.OUTPUT_LOCALE); String outputName = (String) context .get(RenderContext.OUTPUT_BUNDLE_NAME); ResourceBundle outputMessages = ResourceBundle.getBundle(outputName, outputLocale); start = outputMessages.getString(getLocaleKey() + ".start"); //$NON-NLS-1$ end = outputMessages.getString(getLocaleKey() + ".end"); //$NON-NLS-1$ }