2  * This file is part of "SnipSnap Radeox Rendering Engine".
 
   4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
 
   7  * Please visit http://radeox.org/ for updates and contact.
 
  10  * This library is free software; you can redistribute it and/or
 
  11  * modify it under the terms of the GNU Lesser General Public
 
  12  * License as published by the Free Software Foundation; either
 
  13  * version 2.1 of the License, or (at your option) any later version.
 
  15  * This library is distributed in the hope that it will be useful,
 
  16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
  18  * Lesser General Public License for more details.
 
  20  * You should have received a copy of the GNU Lesser General Public
 
  21  * License along with this library; if not, write to the Free Software
 
  22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
  26 package org.plog4u.wiki.macro;
 
  28 import java.io.IOException;
 
  29 import java.io.Writer;
 
  32 //import org.apache.commons.logging.Log;
 
  33 //import org.apache.commons.logging.LogFactory;
 
  34 import org.plog4u.wiki.filter.ICachableMacro;
 
  35 import org.plog4u.wiki.filter.INoParserBodyFilterMacro;
 
  36 import org.radeox.macro.LocalePreserved;
 
  37 import org.radeox.macro.parameter.MacroParameter;
 
  40  * Macro to display quotations from other sources. The
 
  41  * output is wrapped usually in <blockquote> to look like
 
  48 public class QuoteMacro extends LocalePreserved implements INoParserBodyFilterMacro, ICachableMacro {
 
  49 //  private static Log log = LogFactory.getLog(QuoteMacro.class);
 
  51   private String[] paramDescription =
 
  53        "?2: displayed description, default is Source"};
 
  55   public String[] getParamDescription() {
 
  56     return paramDescription;
 
  62   public String getLocaleKey() {
 
  65   public void execute(Writer writer, MacroParameter params)
 
  66       throws IllegalArgumentException, IOException {
 
  68     writer.write("<blockquote>");
 
  69     writer.write(params.getContent());
 
  70     String source = "Source"; // i18n
 
  71     if (params.getLength() == 2) {
 
  72       source = params.get(1);
 
  74     // if more than one was present, we
 
  75     // should show a description for the link
 
  76     if (params.getLength() > 0) {
 
  77       writer.write("<a href=\""+params.get(0)+"\">");
 
  81     writer.write("</blockquote>");