public BaseRenderEngine() { this(new BaseInitialRenderContext()); }
public BaseInitialRenderContext() { Locale languageLocale = Locale.getDefault(); Locale locale = new Locale("Basic", "basic"); set(RenderContext.INPUT_LOCALE, locale); set(RenderContext.OUTPUT_LOCALE, locale); set(RenderContext.LANGUAGE_LOCALE, languageLocale); set(RenderContext.INPUT_BUNDLE_NAME, "radeox_markup"); set(RenderContext.OUTPUT_BUNDLE_NAME, "radeox_markup"); set(RenderContext.LANGUAGE_BUNDLE_NAME, "radeox_messages"); set(RenderContext.DEFAULT_FORMATTER, "java"); } }
public static String render(String arg) { // for maximum robustness don't put any text in that isn't there if (arg == null) { arg = ""; } RenderContext context = new BaseRenderContext(); return (EngineManager.getInstance().render(arg, context)); } }
public static void main(String[] args) { String test = "__SnipSnap__ {link:Radeox|http://radeox.org} ==Other Bold=="; RenderContext context = new BaseRenderContext(); RenderEngine engine = new BaseRenderEngine(); log.info("Rendering with default:"); log.info(engine.render(test, context)); log.info("Rendering with alternative Wiki:"); InitialRenderContext initialContext = new BaseInitialRenderContext(); initialContext.set(RenderContext.INPUT_LOCALE, new Locale("otherwiki", "")); RenderEngine engineWithContext = new BaseRenderEngine(initialContext); log.info(engineWithContext.render(test, context)); } }
public FilterPipe() { this(new BaseInitialRenderContext()); }
public static void main(String[] args) { String test = "__SnipSnap__ {link:Radeox|http://radeox.org} ==Other Bold=="; RenderContext context = new BaseRenderContext(); RenderEngine engine = new BaseRenderEngine(); log.info("Rendering with default:"); log.info(engine.render(test, context)); log.info("Rendering with alternative Wiki:"); InitialRenderContext initialContext = new BaseInitialRenderContext(); initialContext.set(RenderContext.INPUT_LOCALE, new Locale("otherwiki", "")); RenderEngine engineWithContext = new BaseRenderEngine(initialContext); log.info(engineWithContext.render(test, context)); } }
public static String render(String arg) { // for maximum robustness don't put any text in that isn't there if (arg == null) { arg = ""; } RenderContext context = new BaseRenderContext(); return (EngineManager.getInstance().render(arg, context)); } }
public BaseInitialRenderContext() { Locale languageLocale = Locale.getDefault(); Locale locale = new Locale("Basic", "basic"); set(RenderContext.INPUT_LOCALE, locale); set(RenderContext.OUTPUT_LOCALE, locale); set(RenderContext.LANGUAGE_LOCALE, languageLocale); set(RenderContext.INPUT_BUNDLE_NAME, "radeox_markup"); set(RenderContext.OUTPUT_BUNDLE_NAME, "radeox_markup"); set(RenderContext.LANGUAGE_BUNDLE_NAME, "radeox_messages"); set(RenderContext.DEFAULT_FORMATTER, "java"); } }
public RWikiBaseRenderEngine() { this(new BaseInitialRenderContext()); }
public static void main(String[] args) { log.info("Radeox 0.8"); log.info("Copyright (c) 2003 Stephan J. Schmidt, Matthias L. Jugel. " + "\nAll Rights Reserved."); log.info("See License Agreement for terms and conditions of use."); RenderEngine engine = new BaseRenderEngine(); BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); RenderContext context = new BaseRenderContext(); String line; try { log.info("> "); while ((line = reader.readLine()) != null) { log.info(engine.render(line, context)); log.info("> "); } } catch (IOException e) { log.error(e.getMessage(), e); } } }
public FilterPipe() { this(new BaseInitialRenderContext()); }
public static void main(String[] args) { log.info("Radeox 0.8"); log.info("Copyright (c) 2003 Stephan J. Schmidt, Matthias L. Jugel. " + "\nAll Rights Reserved."); log.info("See License Agreement for terms and conditions of use."); RenderEngine engine = new BaseRenderEngine(); BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); RenderContext context = new BaseRenderContext(); String line; try { log.info("> "); while ((line = reader.readLine()) != null) { log.info(engine.render(line, context)); log.info("> "); } } catch (IOException e) { log.error(e.getMessage(), e); } } }
public BaseRenderEngine() { this(new BaseInitialRenderContext()); }
public String render(String content, XWikiDocument contentdoc, XWikiDocument contextdoc, XWikiContext context) { Util util = context.getUtil(); // Remove the content that is inside "{pre}" PreTagSubstitution preTagSubst = new PreTagSubstitution(util, isRemovePre()); content = preTagSubst.substitute(content); RenderContext rcontext = (RenderContext) context.get("rcontext"); if (rcontext == null) { rcontext = new BaseRenderContext(); // This is needed as otherwise some macros throw exceptions rcontext.setParameters(new HashMap()); rcontext.set("xcontext", context); } if (rcontext.getRenderEngine() == null) { XWikiRadeoxRenderEngine radeoxengine = new XWikiRadeoxRenderEngine(this.initialRenderContext, this.filterPipe, context); rcontext.setRenderEngine(radeoxengine); } // If global placeholders are not enabled, then use local placeholders. boolean useLocalPlaceholders = !Utils.arePlaceholdersEnabled(context); if (useLocalPlaceholders) { Utils.enablePlaceholders(context); } String result = rcontext.getRenderEngine().render(content, rcontext); if (useLocalPlaceholders) { result = Utils.replacePlaceholders(result, context); Utils.disablePlaceholders(context); } return preTagSubst.insertNonWikiText(result); }
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); }
/** * Decorates the specified static page. * * @param context the context in which the decoration is running * @param staticPage the static page to be decorated */ public void decorate(ContentDecoratorContext context, StaticPage staticPage) { InitialRenderContext initialContext = new BaseInitialRenderContext(); initialContext.set(RenderContext.INPUT_LOCALE, getBlog().getLocale()); RenderEngine engineWithContext = new RadeoxWikiRenderEngine(initialContext, getBlog()); staticPage.setBody(wikify(staticPage.getBody(), engineWithContext, initialContext)); }
/** * Decorates the specified blog entry. * * @param context the context in which the decoration is running * @param blogEntry the blog entry to be decorated */ public void decorate(ContentDecoratorContext context, BlogEntry blogEntry) { InitialRenderContext initialContext = new BaseInitialRenderContext(); initialContext.set(RenderContext.INPUT_LOCALE, getBlog().getLocale()); RenderEngine engineWithContext = new RadeoxWikiRenderEngine(initialContext, getBlog()); blogEntry.setExcerpt(wikify(blogEntry.getExcerpt(), engineWithContext, initialContext)); blogEntry.setBody(wikify(blogEntry.getBody(), engineWithContext, initialContext)); }