1 25 package org.snipsnap.snip; 26 27 28 import org.picocontainer.PicoContainer; 29 import org.radeox.api.engine.RenderEngine; 30 import org.radeox.api.engine.context.RenderContext; 31 import org.snipsnap.app.Application; 32 import org.snipsnap.container.Components; 33 import org.snipsnap.render.context.SnipRenderContext; 34 35 import java.util.Collection ; 36 37 43 public class SnipFormatter 44 { 45 public static String toXML(Snip snip, String content) 46 { 47 PicoContainer container = Components.getContainer(); 49 RenderEngine engine = (RenderEngine) container.getComponentInstance(Components.DEFAULT_ENGINE); 50 RenderContext context = new SnipRenderContext(snip, (SnipSpace) container.getComponentInstance(SnipSpace.class)); 51 context.setParameters(Application.get().getParameters()); 52 return engine.render(content, context); 53 } 54 } 55 | Popular Tags |