1 25 package org.snipsnap.render.macro; 26 27 import org.radeox.util.i18n.ResourceManager; 28 import org.snipsnap.render.filter.links.BackLinks; 29 import org.snipsnap.render.macro.parameter.SnipMacroParameter; 30 31 import java.io.IOException ; 32 import java.io.Writer ; 33 34 40 41 public class BackLinkMacro extends ListOutputMacro { 42 public String getName() { 43 return "backlinks"; 44 } 45 46 public String [] getParamDescription() { 47 return ResourceManager.getString("i18n.messages", "macro.backlinks.description").split(";"); 48 } 49 50 public String getDescription() { 51 return ResourceManager.getString("i18n.messages", "macro.backlinks.description"); 52 } 53 54 public void execute(Writer writer, SnipMacroParameter params) 55 throws IllegalArgumentException , IOException { 56 int count = 10; 57 if (params.getLength() == 1) { 58 count = Integer.parseInt(params.get("0")); 59 } 60 BackLinks.appendTo(writer, params.getSnipRenderContext().getSnip().getAccess().getBackLinks(), count); 62 } 63 } 64 | Popular Tags |