You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by ap...@apache.org on 2010/12/16 16:01:17 UTC
svn commit: r1049996 [1/2] - in /velocity/tools/trunk: ./
maven-velocity-tools-plugin/ maven-velocity-tools-plugin/src/
maven-velocity-tools-plugin/src/main/
maven-velocity-tools-plugin/src/main/java/
maven-velocity-tools-plugin/src/main/java/org/ mave...
Author: apetrelli
Date: Thu Dec 16 15:01:15 2010
New Revision: 1049996
URL: http://svn.apache.org/viewvc?rev=1049996&view=rev
Log:
VELTOOLS-133
First version of the taglib2directive mojo and example in showcase using DisplayTag.
Added:
velocity/tools/trunk/maven-velocity-tools-plugin/ (with props)
velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml
velocity/tools/trunk/maven-velocity-tools-plugin/src/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/Taglib2Directive.java
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Attribute.java
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Tag.java
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Taglib.java
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/jspDirective.vm
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/velocity.properties
velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/web-jsptaglibrary_1_2.dtd
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/DigesterTest.java
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/
velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/displaytag.tld
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/ (with props)
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/main/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/main/java/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/main/resources/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/test/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/test/java/
velocity/tools/trunk/velocity-tools-examples/displaytag-directive/src/test/resources/
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/Person.java
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/java/org/apache/velocity/tools/examples/showcase/sample/SampleListInitializer.java
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/resources/DISPLAYTAG-LICENSE.txt
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/resources/NOTICE
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/css/
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/css/displaytag.css
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/img/
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/img/arrow_down.png (with props)
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/img/arrow_off.png (with props)
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/displaytag/img/arrow_up.png (with props)
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/jsp.vm
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/TaglibDirective.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/ExternalWriterHttpServletResponse.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/JspUtils.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/JspWriterImpl.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/VelocityBodyContent.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/VelocityJspFragment.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/VelocityPageContext.java
velocity/tools/trunk/velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/taglib/jspimpl/VelocityToolsJspException.java
Modified:
velocity/tools/trunk/pom.xml
velocity/tools/trunk/velocity-tools-examples/pom.xml
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/pom.xml
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/resources/resources.properties
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/velocity.properties
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/header.vm
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/layout/Default.vm
velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/toolmenu.vm
Propchange: velocity/tools/trunk/maven-velocity-tools-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Dec 16 15:01:15 2010
@@ -0,0 +1,2 @@
+target
+.*
Added: velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml Thu Dec 16 15:01:15 2010
@@ -0,0 +1,50 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>velocity-tools-parent</artifactId>
+ <groupId>org.apache.velocity</groupId>
+ <version>2.1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>maven-velocity-tools-plugin</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-tools-view-jsp</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/Taglib2Directive.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/Taglib2Directive.java?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/Taglib2Directive.java (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/Taglib2Directive.java Thu Dec 16 15:01:15 2010
@@ -0,0 +1,192 @@
+package org.apache.velocity.tools.plugin.taglib;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.annotations.DigesterLoader;
+import org.apache.commons.digester.annotations.DigesterLoaderBuilder;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.tools.plugin.taglib.model.Tag;
+import org.apache.velocity.tools.plugin.taglib.model.Taglib;
+import org.xml.sax.SAXException;
+
+/**
+ * Creates directives from a tag library.
+ *
+ * @goal taglib2directive
+ *
+ * @phase generate-resources
+ * @requiresDependencyResolution compile
+ */
+public class Taglib2Directive extends AbstractMojo
+{
+
+ /**
+ * The project
+ *
+ * @parameter expression="${project.compileClasspathElements}"
+ * @required
+ * @readonly
+ */
+ List<String> classpathElements;
+
+ /**
+ * Location of the file.
+ *
+ * @parameter
+ * expression="${project.build.directory}/veltools-generated-classes"
+ * @required
+ */
+ File classesOutputDirectory;
+
+ /**
+ * Location of the file.
+ *
+ * @parameter
+ * expression="${project.build.directory}/veltools-generated-resources"
+ * @required
+ */
+ File resourcesOutputDirectory;
+
+ /**
+ * Name of the package.
+ *
+ * @parameter expression="sample"
+ * @required
+ */
+ String packageName;
+
+ /**
+ * Name of the TLD prefix.
+ *
+ * @parameter expression="sample"
+ * @required
+ */
+ String prefix;
+
+ /**
+ * Location of the TLD to parse.
+ *
+ * @parameter expression="sample"
+ * @required
+ */
+ String tld;
+
+ /**
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ MavenProject project;
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ InputStream tldStream = null;
+ try
+ {
+ tldStream = findTLD();
+ DigesterLoader loader = new DigesterLoaderBuilder()
+ .useDefaultAnnotationRuleProviderFactory()
+ .useDefaultDigesterLoaderHandlerFactory();
+ Digester digester = loader.createDigester(Taglib.class);
+ digester.register(
+ "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN",
+ getClass().getResource("/web-jsptaglibrary_1_2.dtd"));
+ Taglib taglib = (Taglib) digester.parse(tldStream);
+ Properties props = new Properties();
+ InputStream propsStream = getClass().getResourceAsStream(
+ "/velocity.properties");
+ props.load(propsStream);
+ propsStream.close();
+ VelocityEngine engine = new VelocityEngine(props);
+ String packageDirName = packageName.replaceAll("\\.", "/");
+ File packageDir = new File(classesOutputDirectory, packageDirName);
+ packageDir.mkdirs();
+ for (Tag tag : taglib.getTags())
+ {
+ File sourceFile = new File(packageDir, tag
+ .getReflectedTagClass().getSimpleName()
+ + "Directive.java");
+ VelocityContext context = new VelocityContext();
+ context.put("packageName", packageName);
+ context.put("prefix", prefix);
+ context.put("tag", tag);
+ Template template = engine.getTemplate("/jspDirective.vm");
+ FileWriter writer = new FileWriter(sourceFile);
+ template.merge(context, writer);
+ writer.close();
+ }
+ project.addCompileSourceRoot(classesOutputDirectory.getAbsolutePath());
+ } catch (IOException e)
+ {
+ throw new MojoExecutionException(
+ "I/O exception while executing taglib2directive", e);
+ } catch (SAXException e)
+ {
+ throw new MojoExecutionException(
+ "Parsing exception while executing taglib2directive", e);
+ } catch (RuntimeException e)
+ {
+ throw e;
+ } catch (Exception e)
+ {
+ throw new MojoExecutionException(
+ "Generic exception while executing taglib2directive", e);
+ } finally
+ {
+ if (tldStream != null)
+ {
+ try
+ {
+ tldStream.close();
+ } catch (IOException e)
+ {
+ throw new MojoExecutionException(
+ "I/O exception while executing taglib2directive", e);
+ }
+ }
+ }
+
+ }
+
+ private InputStream findTLD() throws IOException
+ {
+ for (String path : classpathElements)
+ {
+ File file = new File(path);
+ if (file.isDirectory())
+ {
+ File candidate = new File(file, tld);
+ if (candidate.exists())
+ {
+ return new FileInputStream(candidate);
+ }
+ } else if (file.getPath().endsWith(".jar"))
+ {
+ JarFile jar = new JarFile(file);
+ ZipEntry entry = jar.getEntry(tld);
+ if (entry != null)
+ {
+ return jar.getInputStream(entry);
+ }
+ }
+ }
+
+ throw new IOException("Cannot find tld resource: " + tld);
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Attribute.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Attribute.java?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Attribute.java (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Attribute.java Thu Dec 16 15:01:15 2010
@@ -0,0 +1,129 @@
+package org.apache.velocity.tools.plugin.taglib.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.digester.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester.annotations.rules.ObjectCreate;
+import org.apache.commons.digester.annotations.rules.SetTop;
+
+@ObjectCreate(pattern = "taglib/tag/attribute")
+public class Attribute
+{
+
+ private static Map<String, String> primitive2wrapped;
+
+ static {
+ primitive2wrapped = new HashMap<String, String>();
+ primitive2wrapped.put("byte", Byte.class.getName());
+ primitive2wrapped.put("short", Short.class.getName());
+ primitive2wrapped.put("int", Integer.class.getName());
+ primitive2wrapped.put("long", Long.class.getName());
+ primitive2wrapped.put("float", Float.class.getName());
+ primitive2wrapped.put("double", Double.class.getName());
+ primitive2wrapped.put("char", Character.class.getName());
+ primitive2wrapped.put("boolean", Boolean.class.getName());
+ }
+
+ @BeanPropertySetter(pattern = "taglib/tag/attribute/name")
+ private String name;
+
+ @BeanPropertySetter(pattern = "taglib/tag/attribute/description")
+ private String description;
+
+ @BeanPropertySetter(pattern = "taglib/tag/attribute/required")
+ private boolean required = false;
+
+ @BeanPropertySetter(pattern = "taglib/tag/attribute/rtexprvalue")
+ private boolean rtexprvalue = false;
+
+ @BeanPropertySetter(pattern = "taglib/tag/attribute/type")
+ private String type;
+
+ private Tag tag;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+
+ public boolean isRtexprvalue()
+ {
+ return rtexprvalue;
+ }
+
+ public void setRtexprvalue(boolean rtexprvalue)
+ {
+ this.rtexprvalue = rtexprvalue;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ @SetTop(pattern="taglib/tag/attribute")
+ public void setTag(Tag tag)
+ {
+ this.tag = tag;
+ }
+
+ public Tag getTag()
+ {
+ return tag;
+ }
+
+ public String getWrappedType() {
+ if (type == null) {
+ return String.class.getName();
+ }
+ String retValue = primitive2wrapped.get(type);
+ if (retValue == null) {
+ retValue = type;
+ }
+ return retValue;
+ }
+
+ public String getSetterName() {
+ return "set" + name.substring(0, 1).toUpperCase() + name.substring(1);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Attribute [name=" + name + ", description=" + description
+ + ", required=" + required + ", rtexprvalue=" + rtexprvalue
+ + ", type=" + type + "]";
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Tag.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Tag.java?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Tag.java (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Tag.java Thu Dec 16 15:01:15 2010
@@ -0,0 +1,111 @@
+package org.apache.velocity.tools.plugin.taglib.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.jsp.tagext.SimpleTag;
+
+import org.apache.commons.digester.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester.annotations.rules.ObjectCreate;
+import org.apache.commons.digester.annotations.rules.SetNext;
+import org.apache.velocity.tools.view.jsp.taglib.jspimpl.VelocityToolsJspException;
+
+@ObjectCreate(pattern = "taglib/tag")
+public class Tag
+{
+
+ @BeanPropertySetter(pattern = "taglib/tag/name")
+ private String name;
+
+ @BeanPropertySetter(pattern = "taglib/tag/description")
+ private String description;
+
+ @BeanPropertySetter(pattern = "taglib/tag/tag-class")
+ private String tagClass;
+
+ @BeanPropertySetter(pattern = "taglib/tag/body-content")
+ private String bodyContent;
+
+ private List<Attribute> attributes = new ArrayList<Attribute>();
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String getTagClass()
+ {
+ return tagClass;
+ }
+
+ public void setTagClass(String tagClass)
+ {
+ this.tagClass = tagClass;
+ }
+
+ public String getBodyContent()
+ {
+ return bodyContent;
+ }
+
+ public void setBodyContent(String bodyContent)
+ {
+ this.bodyContent = bodyContent;
+ }
+
+ public List<Attribute> getAttributes()
+ {
+ return attributes;
+ }
+
+ @SetNext
+ public void addAttribute(Attribute attribute)
+ {
+ attributes.add(attribute);
+ }
+
+ public boolean isSimpleTag() {
+ return SimpleTag.class.isAssignableFrom(getReflectedTagClass());
+ }
+
+ public boolean hasBody() {
+ return !"empty".equals(bodyContent);
+ }
+
+ public Class<?> getReflectedTagClass()
+ {
+ Class<?> clazz;
+ try
+ {
+ clazz = Class.forName(tagClass);
+ } catch (ClassNotFoundException e)
+ {
+ throw new VelocityToolsJspException("Problems obtaining class: " + tagClass, e);
+ }
+ return clazz;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Tag [name=" + name + ", description=" + description
+ + ", tagClass=" + tagClass + ", bodyContent=" + bodyContent
+ + ", attributes=" + attributes + "]";
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Taglib.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Taglib.java?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Taglib.java (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/java/org/apache/velocity/tools/plugin/taglib/model/Taglib.java Thu Dec 16 15:01:15 2010
@@ -0,0 +1,86 @@
+package org.apache.velocity.tools.plugin.taglib.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.digester.annotations.rules.BeanPropertySetter;
+import org.apache.commons.digester.annotations.rules.ObjectCreate;
+import org.apache.commons.digester.annotations.rules.SetNext;
+
+@ObjectCreate(pattern = "taglib")
+public class Taglib
+{
+ @BeanPropertySetter(pattern = "taglib/description")
+ private String description;
+
+ @BeanPropertySetter(pattern = "taglib/tlib-version")
+ private String tlibVersion;
+
+ @BeanPropertySetter(pattern = "taglib/short-name")
+ private String shortName;
+
+ @BeanPropertySetter(pattern = "taglib/uri")
+ private String uri;
+
+ private List<Tag> tags = new ArrayList<Tag>();
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String getTlibVersion()
+ {
+ return tlibVersion;
+ }
+
+ public void setTlibVersion(String tlibVersion)
+ {
+ this.tlibVersion = tlibVersion;
+ }
+
+ public String getShortName()
+ {
+ return shortName;
+ }
+
+ public void setShortName(String shortName)
+ {
+ this.shortName = shortName;
+ }
+
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ public List<Tag> getTags()
+ {
+ return tags;
+ }
+
+ @SetNext
+ public void addTag(Tag tag)
+ {
+ tags.add(tag);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Taglib [description=" + description + ", tlibVersion="
+ + tlibVersion + ", shortName=" + shortName + ", uri=" + uri
+ + ", tags=" + tags + "]";
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/jspDirective.vm
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/jspDirective.vm?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/jspDirective.vm (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/jspDirective.vm Thu Dec 16 15:01:15 2010
@@ -0,0 +1,74 @@
+package ${packageName};
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.JspTag;
+
+import org.apache.velocity.context.InternalContextAdapter;
+import org.apache.velocity.exception.MethodInvocationException;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.runtime.directive.Directive;
+import org.apache.velocity.runtime.parser.node.ASTMap;
+import org.apache.velocity.runtime.parser.node.Node;
+import org.apache.velocity.tools.view.ViewContext;
+import org.apache.velocity.tools.view.jsp.taglib.jspimpl.JspUtils;
+import org.apache.velocity.tools.view.jsp.taglib.jspimpl.VelocityPageContext;
+
+public class ${tag.reflectedTagClass.simpleName}Directive extends Directive
+{
+
+ @Override
+ public String getName()
+ {
+ return "${prefix}_${tag.name}";
+ }
+
+ @Override
+ public int getType()
+ {
+ return #if(${tag.hasBody()})BLOCK#{else}LINE#end;
+ }
+
+ @Override
+ public boolean render(InternalContextAdapter context, Writer writer, Node node)
+ throws IOException, ResourceNotFoundException, ParseErrorException,
+ MethodInvocationException
+ {
+ ViewContext viewContext = (ViewContext) context
+ .getInternalUserContext();
+ ASTMap astMap = (ASTMap) node.jjtGetChild(0);
+ Map<String, Object> params = (Map<String, Object>) astMap
+ .value(context);
+ PageContext pageContext = new VelocityPageContext(context, writer,
+ viewContext);
+ ${tag.reflectedTagClass.name} tag = new ${tag.reflectedTagClass.name}();
+ JspTag oldParentTag = JspUtils.getLatestJspTag(context);
+ JspUtils.setLatestTag(context, tag);
+ try
+ {
+ tag.setPageContext(pageContext);
+ tag.setParent(JspUtils.wrapTag(oldParentTag));
+ Object obj;
+#foreach($attribute in $tag.attributes)
+ obj = params.get("${attribute.name}");
+ if (obj != null) {
+ tag.${attribute.setterName}((${attribute.wrappedType}) obj);
+ }
+#end
+ JspUtils.executeTag(context, node, pageContext, tag);
+ } catch (JspException e)
+ {
+ throw new IOException("Cannot execute ${tag.name} tag", e);
+ } finally
+ {
+ JspUtils.setLatestTag(context, oldParentTag);
+ }
+ return true;
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/velocity.properties
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/velocity.properties?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/velocity.properties (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/velocity.properties Thu Dec 16 15:01:15 2010
@@ -0,0 +1,115 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# ----------------------------------------------------------------------------
+# These are the default properties for the
+# Velocity Runtime. These values are used when
+# Runtime.init() is called, and when Runtime.init(properties)
+# fails to find the specificed properties file.
+# ----------------------------------------------------------------------------
+
+
+# ----------------------------------------------------------------------------
+# R U N T I M E L O G
+# ----------------------------------------------------------------------------
+# Velocity uses the Servlet APIs logging facilites.
+
+# ----------------------------------------------------------------------------
+# This controls if Runtime.error(), info() and warn() messages include the
+# whole stack trace. The last property controls whether invalid references
+# are logged.
+# ----------------------------------------------------------------------------
+
+runtime.log.invalid.reference = true
+
+
+# ----------------------------------------------------------------------------
+# T E M P L A T E E N C O D I N G
+# ----------------------------------------------------------------------------
+
+input.encoding=ISO-8859-1
+output.encoding=ISO-8859-1
+
+
+# ----------------------------------------------------------------------------
+# F O R E A C H P R O P E R T I E S
+# ----------------------------------------------------------------------------
+# These properties control how the counter is accessed in the #foreach
+# directive. By default the reference $velocityCount will be available
+# in the body of the #foreach directive. The default starting value
+# for this reference is 1.
+# ----------------------------------------------------------------------------
+
+directive.foreach.counter.name = velocityCount
+directive.foreach.counter.initial.value = 1
+
+
+# ----------------------------------------------------------------------------
+# I N C L U D E P R O P E R T I E S
+# ----------------------------------------------------------------------------
+# These are the properties that governed the way #include'd content
+# is governed.
+# ----------------------------------------------------------------------------
+
+directive.include.output.errormsg.start = <!-- include error :
+directive.include.output.errormsg.end = see error log -->
+
+
+# ----------------------------------------------------------------------------
+# P A R S E P R O P E R T I E S
+# ----------------------------------------------------------------------------
+
+directive.parse.max.depth = 10
+
+
+# ----------------------------------------------------------------------------
+# VELOCIMACRO PROPERTIES
+# ----------------------------------------------------------------------------
+# global : name of default global library. It is expected to be in the regular
+# template path. You may remove it (either the file or this property) if
+# you wish with no harm.
+# ----------------------------------------------------------------------------
+# dev-changes by Marino
+resource.loader=class, string
+
+class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+
+velocimacro.library.autoreload = false
+
+velocimacro.permissions.allow.inline = true
+velocimacro.permissions.allow.inline.to.replace.global = false
+velocimacro.permissions.allow.inline.local.scope = false
+
+velocimacro.context.localscope = false
+
+# ----------------------------------------------------------------------------
+# INTERPOLATION
+# ----------------------------------------------------------------------------
+# turn off and on interpolation of references and directives in string
+# literals. ON by default :)
+# ----------------------------------------------------------------------------
+runtime.interpolate.string.literals = true
+
+
+# ----------------------------------------------------------------------------
+# RESOURCE MANAGEMENT
+# ----------------------------------------------------------------------------
+# Allows alternative ResourceManager and ResourceCache implementations
+# to be plugged in.
+# ----------------------------------------------------------------------------
+resource.manager.class = org.apache.velocity.runtime.resource.ResourceManagerImpl
+resource.manager.cache.class = org.apache.velocity.runtime.resource.ResourceCacheImpl
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/web-jsptaglibrary_1_2.dtd
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/web-jsptaglibrary_1_2.dtd?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/web-jsptaglibrary_1_2.dtd (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/main/resources/web-jsptaglibrary_1_2.dtd Thu Dec 16 15:01:15 2010
@@ -0,0 +1,499 @@
+<!--
+
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 2000-2007 Sun Microsystems, Inc. All rights reserved.
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common Development
+and Distribution License("CDDL") (collectively, the "License"). You
+may not use this file except in compliance with the License. You can obtain
+a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+language governing permissions and limitations under the License.
+
+When distributing the software, include this License Header Notice in each
+file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+Sun designates this particular file as subject to the "Classpath" exception
+as provided by Sun in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the License
+Header, with the fields enclosed by brackets [] replaced by your own
+identifying information: "Portions Copyrighted [year]
+[name of copyright owner]"
+
+Contributor(s):
+
+If you wish your version of this file to be governed by only the CDDL or
+only the GPL Version 2, indicate your decision by adding "[Contributor]
+elects to include this software in this distribution under the [CDDL or GPL
+Version 2] license." If you don't indicate a single choice of license, a
+recipient has the option to distribute your version of this file under
+either the CDDL, the GPL Version 2 or to extend the choice of license to
+its licensees as provided above. However, if you add GPL Version 2 code
+and therefore, elected the GPL Version 2 license, then the option applies
+only if the new code is made subject to such option by the copyright
+holder.
+
+-->
+
+<!--
+
+ This is the DTD defining the JavaServer Pages 1.2 Tag Library
+ descriptor (.tld) (XML) file format/syntax.
+
+ A Tag Library is a JAR file containing a valid instance of a Tag Library
+ Descriptor (taglib.tld) file in the META-INF subdirectory, along with the
+ appropriate implementing classes, and other resources required to
+ implement the tags defined therein.
+
+ -->
+
+<!NOTATION WEB-JSPTAGLIB.1_2 PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN">
+
+<!--
+This is the XML DTD for the JSP 1.2 Tag Library Descriptor.
+All JSP 1.2 tag library descriptors must include a DOCTYPE
+of the following form:
+
+ <!DOCTYPE taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+-->
+
+<!--
+The taglib tag is the document root, it defines:
+
+tlib-version the version of the tag library implementation
+
+jsp-version the version of JSP the tag library depends upon
+
+short-name a simple default short name that could be used by
+ a JSP authoring tool to create names with a mnemonic
+ value; for example, the it may be used as the prefered
+ prefix value in taglib directives
+
+uri a uri uniquely identifying this taglib
+
+display-name the display-name element contains a short name that
+ is intended to be displayed by tools
+small-icon optional small-icon that can be used by tools
+
+large-icon optional large-icon that can be used by tools
+
+description a simple string describing the "use" of this taglib,
+ should be user discernable
+
+validator optional TagLibraryValidator information
+
+listener optional event listener specification
+
+
+-->
+
+<!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?,
+ display-name?, small-icon?, large-icon?, description?,
+ validator?, listener*, tag+) >
+
+<!ATTLIST taglib id ID #IMPLIED
+ xmlns CDATA #FIXED
+ "http://java.sun.com/JSP/TagLibraryDescriptor"
+>
+
+<!--
+Describes this version (number) of the taglibrary (dewey decimal)
+
+#PCDATA ::= [0-9]*{ "."[0-9] }0..3
+-->
+
+<!ELEMENT tlib-version (#PCDATA) >
+
+<!--
+Describes the JSP version (number) this taglibrary requires in
+order to function (dewey decimal)
+
+The default is 1.2
+
+#PCDATA ::= [0-9]*{ "."[0-9] }0..3
+-->
+
+<!ELEMENT jsp-version (#PCDATA) >
+
+<!--
+Defines a short (default) short-name to be used for tags and
+variable names used/created by this tag library. Do not use
+white space, and do not start with digits or underscore.
+
+#PCDATA ::= NMTOKEN
+-->
+
+<!ELEMENT short-name (#PCDATA) >
+
+<!--
+Defines a public URI that uniquely identifies this version of
+the taglibrary. Leave it empty if it does not apply.
+-->
+
+<!ELEMENT uri (#PCDATA) >
+
+<!--
+Defines an arbitrary text string descirbing the tag library
+-->
+
+<!ELEMENT description (#PCDATA) >
+
+<!--
+
+Defines an optional validator that can be used to
+validate the conformance of a JSP page to using this tag library.
+-->
+
+<!ELEMENT validator (validator-class, init-param*, description?) >
+
+
+<!--
+
+Defines the TagLibraryValidator class that can be used to
+validate the conformance of a JSP page to using this tag library.
+-->
+
+<!ELEMENT validator-class (#PCDATA) >
+
+
+<!--
+
+The init-param element contains a name/value pair as an
+initialization param
+-->
+
+<!ELEMENT init-param (param-name, param-value, description?)>
+
+<!--
+
+The param-name element contains the name of a parameter.
+-->
+
+<!ELEMENT param-name (#PCDATA)>
+
+<!--
+
+The param-value element contains the value of a parameter.
+-->
+
+<!ELEMENT param-value (#PCDATA)>
+
+
+<!--
+
+Defines an optional event listener object to be instantiated and
+registered automatically.
+-->
+
+<!ELEMENT listener (listener-class) >
+
+<!--
+
+The listener-class element declares a class in the application that
+must be registered as a web application listener bean. See the
+Servlet 2.3 specification for details.
+-->
+
+<!ELEMENT listener-class (#PCDATA) >
+
+
+<!--
+The tag defines a unique tag in this tag library. It has one
+attribute, id.
+
+The tag element may have several subelements defining:
+
+name The unique action name
+
+tag-class The tag handler class implementing
+ javax.servlet.jsp.tagext.Tag
+
+tei-class An optional subclass of
+ javax.servlet.jsp.tagext.TagExtraInfo
+
+body-content The body content type
+
+display-name A short name that is intended to be displayed
+ by tools
+
+small-icon Optional small-icon that can be used by tools
+
+large-icon Optional large-icon that can be used by tools
+
+description Optional tag-specific information
+
+variable Optional scripting variable information
+
+attribute All attributes of this action
+
+example Optional informal description of an example of a
+ use of this tag
+
+-->
+
+<!ELEMENT tag (name, tag-class, tei-class?, body-content?, display-name?,
+ small-icon?, large-icon?, description?, variable*, attribute*,
+ example?) >
+
+<!--
+Defines the subclass of javax.serlvet.jsp.tagext.Tag that implements
+the request time semantics for this tag. (required)
+
+#PCDATA ::= fully qualified Java class name
+-->
+
+<!ELEMENT tag-class (#PCDATA) >
+
+<!--
+Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for
+this tag. (optional)
+
+If this is not given, the class is not consulted at translation time.
+
+#PCDATA ::= fully qualified Java class name
+-->
+
+<!ELEMENT tei-class (#PCDATA) >
+
+<!--
+Provides a hint as to the content of the body of this tag. Primarily
+intended for use by page composition tools.
+
+There are currently three values specified:
+
+tagdependent The body of the tag is interpreted by the tag
+ implementation itself, and is most likely in a
+ different "langage", e.g embedded SQL statements.
+
+JSP The body of the tag contains nested JSP syntax
+
+empty The body must be empty
+
+The default (if not defined) is JSP
+
+#PCDATA ::= tagdependent | JSP | empty
+
+-->
+
+<!ELEMENT body-content (#PCDATA) >
+
+<!--
+
+The display-name element contains a short name that is intended
+to be displayed by tools.
+-->
+
+<!ELEMENT display-name (#PCDATA) >
+
+
+<!--
+
+The large-icon element contains the name of a file containing a large
+(32 x 32) icon image. The file name is a relative path within the
+tag library. The image must be either in the JPEG or GIF format, and
+the file name must end with the suffix ".jpg" or ".gif" respectively.
+The icon can be used by tools.
+-->
+
+<!ELEMENT large-icon (#PCDATA) >
+
+<!--
+
+The small-icon element contains the name of a file containing a large
+(32 x 32) icon image. The file name is a relative path within the
+tag library. The image must be either in the JPEG or GIF format, and
+the file name must end with the suffix ".jpg" or ".gif" respectively.
+The icon can be used by tools.
+-->
+
+<!ELEMENT small-icon (#PCDATA) >
+
+<!--
+
+The example element contains an informal description of an example
+of the use of a tag.
+-->
+
+<!ELEMENT example (#PCDATA) >
+
+<!--
+
+The variable tag provides information on the scripting variables
+defined by this tag. It is a (translation time) error for a tag
+that has one or more variable subelements to have a TagExtraInfo
+class that returns a non-null object.
+
+The subelements of variable are of the form:
+
+name-given The variable name as a constant
+
+name-from-attribute The name of an attribute whose (translation
+ time) value will give the name of the
+ variable. One of name-given or
+ name-from-attribute is required.
+
+variable-class Name of the class of the variable.
+ java.lang.String is default.
+
+declare Whether the variable is declared or not.
+ True is the default.
+
+scope The scope of the scripting varaible
+ defined. NESTED is default.
+
+description Optional description of this variable
+
+-->
+
+<!ELEMENT variable ( (name-given | name-from-attribute), variable-class?,
+ declare?, scope?, description?) >
+
+<!--
+
+The name for the scripting variable. One of name-given or
+name-from-attribute is required.
+-->
+
+<!ELEMENT name-given (#PCDATA) >
+
+<!--
+
+The name of an attribute whose (translation-time) value will give
+the name of the variable. One of name-given or name-from-attribute
+is required.
+-->
+
+<!ELEMENT name-from-attribute (#PCDATA) >
+
+<!--
+
+The optional name of the class for the scripting variable. The
+default is java.lang.String.
+-->
+
+<!ELEMENT variable-class (#PCDATA) >
+
+<!--
+
+Whether the scripting variable is to be defined or not. See
+TagExtraInfo for details. This element is optional and "true"
+is the default.
+-->
+
+<!ELEMENT declare (#PCDATA) >
+
+<!--
+
+The scope of the scripting variable. See TagExtraInfo for details.
+The element is optional and "NESTED" is the default. Other legal
+values are "AT_BEGIN" and "AT_END".
+-->
+
+<!ELEMENT scope (#PCDATA) >
+
+<!--
+
+The attribute tag defines an attribute for the nesting tag
+
+An attribute definition is composed of:
+
+- the attributes name (required)
+- if the attribute is required or optional (optional)
+- if the attributes value may be dynamically calculated at runtime
+ by a scriptlet expression (optional)
+- the type of the attributes value (optional)
+- an informal description of the meaning of the attribute (optional)
+
+-->
+
+
+<!--
+The attribute tag defines an attribute for the nesting tag
+
+An attribute definition is composed of:
+
+- the attributes name (required)
+
+- if the attribute is required or optional (optional)
+
+- if the attributes value may be dynamically calculated at runtime
+ by a scriptlet expression (optional)
+
+- the type of the attributes value (optional)
+
+- an informal description of the meaning of the attribute (optional)
+-->
+
+<!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) >
+
+<!--
+Defines the canonical name of a tag or attribute being defined
+
+#PCDATA ::= NMTOKEN
+-->
+
+<!ELEMENT name (#PCDATA) >
+
+<!--
+Defines if the nesting attribute is required or optional.
+
+#PCDATA ::= true | false | yes | no
+
+If not present then the default is "false", i.e the attribute
+is optional.
+-->
+
+<!ELEMENT required (#PCDATA) >
+
+<!--
+Defines if the nesting attribute can have scriptlet expressions as
+a value, i.e the value of the attribute may be dynamically calculated
+at request time, as opposed to a static value determined at translation
+time.
+
+#PCDATA ::= true | false | yes | no
+
+If not present then the default is "false", i.e the attribute
+has a static value
+-->
+
+<!ELEMENT rtexprvalue (#PCDATA) >
+
+
+<!--
+
+Defines the Java type of the attributes value. For static values
+(those determined at translation time) the type is always
+java.lang.String.
+-->
+
+<!ELEMENT type (#PCDATA) >
+
+
+<!-- ID attributes -->
+
+<!ATTLIST tlib-version id ID #IMPLIED>
+<!ATTLIST jsp-version id ID #IMPLIED>
+<!ATTLIST short-name id ID #IMPLIED>
+<!ATTLIST uri id ID #IMPLIED>
+<!ATTLIST description id ID #IMPLIED>
+<!ATTLIST example id ID #IMPLIED>
+<!ATTLIST tag id ID #IMPLIED>
+<!ATTLIST tag-class id ID #IMPLIED>
+<!ATTLIST tei-class id ID #IMPLIED>
+<!ATTLIST body-content id ID #IMPLIED>
+<!ATTLIST attribute id ID #IMPLIED>
+<!ATTLIST name id ID #IMPLIED>
+<!ATTLIST required id ID #IMPLIED>
+<!ATTLIST rtexprvalue id ID #IMPLIED>
+
+
+<!ATTLIST param-name id ID #IMPLIED>
+<!ATTLIST param-value id ID #IMPLIED>
+<!ATTLIST listener id ID #IMPLIED>
+<!ATTLIST listener-class id ID #IMPLIED>
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/DigesterTest.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/DigesterTest.java?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/DigesterTest.java (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/test/java/org/apache/velocity/tools/plugin/taglib/model/DigesterTest.java Thu Dec 16 15:01:15 2010
@@ -0,0 +1,26 @@
+package org.apache.velocity.tools.plugin.taglib.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.annotations.DigesterLoader;
+import org.apache.commons.digester.annotations.DigesterLoaderBuilder;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+public class DigesterTest
+{
+
+ @Test
+ public void testDigester() throws IOException, SAXException {
+ DigesterLoader loader = new DigesterLoaderBuilder().useDefaultAnnotationRuleProviderFactory().useDefaultDigesterLoaderHandlerFactory();
+ Digester digester = loader.createDigester(Taglib.class);
+ digester.register("-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN", getClass().getResource("/web-jsptaglibrary_1_2.dtd"));
+ InputStream is = getClass().getResourceAsStream("/displaytag.tld");
+ Taglib taglib = (Taglib) digester.parse(is);
+ is.close();
+ System.out.println(taglib);
+ }
+
+}
Added: velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/displaytag.tld
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/displaytag.tld?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/displaytag.tld (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/src/test/resources/displaytag.tld Thu Dec 16 15:01:15 2010
@@ -0,0 +1,743 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+ <tlib-version>1.1</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>display</short-name>
+ <uri>http://displaytag.sf.net</uri>
+ <display-name>Display *: Tag Library</display-name>
+ <description>http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
+ The display tag library is an open source suite of custom tags that provide high level web presentation patterns
+ which will work in a MVC model, and provide a significant amount of functionality while still being simple and
+ straight-forward to use. The primary tag in the library is the Table tag.
+ </description>
+ <tag>
+ <name>table</name>
+ <tag-class>org.displaytag.tags.TableTag</tag-class>
+ <tei-class>org.displaytag.tags.TableTagExtraInfo</tei-class>
+ <body-content>JSP</body-content>
+ <display-name>table</display-name>
+ <description>
+ Displays a list in an html table, formatting each item in the list according to the Column tags nested inside of
+ this tag. Use the list attribute to indicate the Collection of data, in some scope, that the tag should operate
+ on. Supports the export of the list data to alternative formats such as CSV, Excel, and XML. The contents of the
+ list can be sorted, and the list can be broken into individual pages for display. If you use this tag in Struts,
+ or in some other framework where the page is included via a jsp:include, you should use the requestURI attribute
+ to indicate where tag generated links should point.
+ </description>
+ <attribute>
+ <name>list</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Reference to the object used as source for the table. Can be an expression like requestScope.object.property .
+ You must define either the name attribute or the list attribute. Using "Name" is suggested.
+ </description>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ reference to the object used as source for the table. Can be an expression like requestScope.object.property. In
+ the EL version of the taglibrary this must be an EL expression which points to the source object.
+ </description>
+ </attribute>
+ <attribute>
+ <name>length</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>number of records to be shown</description>
+ </attribute>
+ <attribute>
+ <name>offset</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>index of the first record to be shown</description>
+ </attribute>
+ <attribute>
+ <name>pagesize</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>number of records in a page</description>
+ </attribute>
+ <attribute>
+ <name>decorator</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Fully qualified class name for a TableDecorator. Use a TableDecorator to provide custom operations against the
+ whole list, such as computing totals. Must extend org.displaytag.decorator.TableDecorator.
+ </description>
+ </attribute>
+ <attribute>
+ <name>requestURI</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ When the present, links for sorting, exports, and paging are formed by adding any tag generated parameters to
+ the value of requestURI attribute.
+ </description>
+ </attribute>
+ <attribute>
+ <name>requestURIcontext</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ Enable/disable prepending of application context to generated links. Default is true, you can set it to false in
+ order to generate cross-context links.
+ </description>
+ </attribute>
+ <attribute>
+ <name>excludedParams</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Whitespace separated list containg the name of parameters which should NOT be forwarded during paging or
+ sorting. You can use excludedParams="*" to match (exclude) any parameter.
+ </description>
+ </attribute>
+ <attribute>
+ <name>varTotals</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Store a java.util.Map of the column totals in a pageContext variable by this name. The keys of the map are
+ "column" and the column number (first column is "column1", etc); values are the corresponding total for the
+ column; columns that are not marked as to total="true" will be omitted from the map. The variable will ONLY be
+ available within the footer tag and after the end of the table, it is not available with the body of the table
+ or columns.
+ </description>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute</description>
+ </attribute>
+ <attribute>
+ <name>class</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute</description>
+ </attribute>
+ <attribute>
+ <name>cellspacing</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute</description>
+ </attribute>
+ <attribute>
+ <name>cellpadding</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute. Better using "padding" css attribute in style or class</description>
+ </attribute>
+ <attribute>
+ <name>frame</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>rules</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>summary</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute</description>
+ </attribute>
+ <attribute>
+ <name>htmlId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html "id" pass through attribute</description>
+ </attribute>
+ <attribute>
+ <name>export</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>enable/disable export. Valid values are true or false</description>
+ </attribute>
+ <attribute>
+ <name>id</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ See "uid". The id attribute can't be a runtime expression in jsp 1.0 compliant containers, while uid will allow
+ it.
+ </description>
+ </attribute>
+ <attribute>
+ <name>uid</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Unique id used to identify this table. The object representing the current row is also added to the pageContext
+ under this name and the current row number is added using the key uid_rowNum. Two tables in the same page can't
+ have the same uid (paging and sorting will affect both). If no "htmlId" is specified the same value will be used
+ for the html id of the generated table.
+ </description>
+ </attribute>
+ <attribute>
+ <name>sort</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Use 'page' if you want to sort only visible records, or 'list' if you want to sort the full list, or 'external'
+ if the data is sorted outside displaytag.
+ </description>
+ </attribute>
+ <attribute>
+ <name>defaultsort</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>The index of the column that will be used by default for sorting (starting from 1)</description>
+ </attribute>
+ <attribute>
+ <name>defaultorder</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The default order for the sorted column. Valid values are "ascending" (default) or "descending"
+ </description>
+ </attribute>
+ <attribute>
+ <name>partialList</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>enable/disable partialLists. Valid values are true or false</description>
+ </attribute>
+ <attribute>
+ <name>size</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Used only when partialList=true. Reference to the Integer object containing the size of the total dataset. Can
+ be an expression like requestScope.object.property. In the EL version of the taglibrary this must be an EL
+ expression which points to the source object.
+ </description>
+ </attribute>
+ <attribute>
+ <name>keepStatus</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ Preserve the current paging/sort status across session. The default is false (do not use sessions). Note that
+ for this to work properly you need to assign to each table in your application a different id.
+ </description>
+ </attribute>
+ <attribute>
+ <name>clearStatus</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>Clears the current paging/sort status saved in session.</description>
+ </attribute>
+ <attribute>
+ <name>form</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Uses post for paging/sorting links, by submitting the for with the given name. Note that this form will not be
+ created by displaytag, and it must exist in page.
+ </description>
+ </attribute>
+ <example>
+ <![CDATA[
+<display:table name="someList" export="true" id="row" requestURI="MyAction.do">
+ <display:column sortable="true" title="ID"> <c:out value="${row.id}"/> </display:column>
+ <display:column property="email" autolink="true"/>
+ <display:column property="description" title="Comments"/>
+</display:table>
+]]>
+ </example>
+ </tag>
+ <tag>
+ <name>column</name>
+ <tag-class>org.displaytag.tags.ColumnTag</tag-class>
+ <body-content>JSP</body-content>
+ <display-name>column</display-name>
+ <description>
+ Displays a property of a row object inside a table. MUST be nested inside of a Table tag. The value displayed will
+ be the results of a decorator (if any); else the property named by the 'property' attribute; or if the 'property'
+ attribute is null, then the results of evaluating the JSP body of the tag.
+ </description>
+ <attribute>
+ <name>property</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ name of the property in the bean specified in the parent table tag (via the "name" attribute) mapped to this
+ column
+ </description>
+ </attribute>
+ <attribute>
+ <name>sortProperty</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ name of the property in the bean specified in the parent table tag (via the "name" attribute) which will be used
+ to sort values in the column. This can be used when the column body is filled or a decorator is used and column
+ should sort on undecorated values.
+ </description>
+ </attribute>
+ <attribute>
+ <name>title</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>title of the column (text for the th cell)</description>
+ </attribute>
+ <attribute>
+ <name>comparator</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ The classname of comparator to use when sorting this column, or the comparator itself. Defaults to the
+ DefaultComparator.
+ </description>
+ </attribute>
+ <attribute>
+ <name>titleKey</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Resource key used to lookup the title value. Only works if "title" is not defined. Works together with a
+ configured I18nResourceProvider, specified via the displaytag.properties file. By default, if JSTL is available,
+ the JSTL provider is used, which makes this attribute work the same as fmt:message's key property.
+ </description>
+ </attribute>
+ <attribute>
+ <name>nulls</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ By default, null values don't appear in the list. By setting 'nulls' to 'true', then null values will appear as
+ "null" in the list (mostly useful for debugging). Defaults to 'false'.
+ </description>
+ </attribute>
+ <attribute>
+ <name>total</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ If true, will total the contents of this column. This value is available via the Map named in varTotals for the
+ table. Column values need to Numbers.
+ </description>
+ </attribute>
+ <attribute>
+ <name>sortable</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>Set to 'true' to make the column sortable. Defaults to 'false'.</description>
+ </attribute>
+ <attribute>
+ <name>defaultorder</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The default sort order for this column. Valid values are "ascending" (default) or "descending"
+ </description>
+ </attribute>
+ <attribute>
+ <name>autolink</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ Automatically hyperlink URLs and email addresses that appear in the column. Defaults to 'false'.
+ </description>
+ </attribute>
+ <attribute>
+ <name>format</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ A MessageFormat patter that will be used to decorate objects in the column. Can be used as a "shortcut" for
+ simple column decorations. @since 1.1
+ </description>
+ </attribute>
+ <attribute>
+ <name>escapeXml</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>boolean</type>
+ <description>
+ Set it to true to escape special characters in html and xml output. Defaults to 'false'. @since 1.1
+ </description>
+ </attribute>
+ <attribute>
+ <name>media</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Use this attribute to keep a column from being output during an export. The column will only render for the
+ named media type(s) - it won't be added to the table if the current request media is not supported. Can be any
+ space separated combination of 'html', 'csv', 'xml', 'all', or 'excel'. Defaults to 'all'. See the export page
+ in the example webapp for more details.
+ </description>
+ </attribute>
+ <attribute>
+ <name>href</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ <![CDATA[
+ The base URL used to construct the dynamic link. If this attribute is provided, then the data that is shown for
+ this column is wrapped inside a <a href=""> tag with the url provided through this attribute. Typically you
+ would use this attribute along with one of the struts-like param attributes (param*) to create a dynamic link so
+ that each row creates a different URL based on the data that is being viewed. An empty href value will generate
+ a link to the current page, preserving parameters just like for paging links.]]>
+ </description>
+ </attribute>
+ <attribute>
+ <name>url</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The base URL used to construct the dynamic link. This attribute has the same functionality as the href
+ attribute, but it pre-pends the contextPath.
+ </description>
+ </attribute>
+ <attribute>
+ <name>paramId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The name of the request parameter that will be dynamically added to the generated href URL. The corresponding
+ value is defined by the paramProperty and (optional) paramName attributes, optionally scoped by the paramScope
+ attribute.
+ </description>
+ </attribute>
+ <attribute>
+ <name>paramName</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The name of a JSP bean that is a String containing the value for the request parameter named by paramId (if
+ paramProperty is not specified), or a JSP bean whose property getter is called to return a String (if
+ paramProperty is specified). The JSP bean is constrained to the bean scope specified by the paramScope property,
+ if it is specified. If paramName is omitted, then it is assumed that the current object being iterated on is the
+ target bean.
+ </description>
+ </attribute>
+ <attribute>
+ <name>paramProperty</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The name of a property of the current object being iterated on, whose return value will be used as the value of
+ the parameter (named by the paramId attribute) that will be dynamically added to this href URL. If paramName is
+ also specified the property will not be fetched from the object being iterated on, but from the bean specified
+ by paramName. The support of paramProperty in conjunction with paramName will be probably removed in future: use
+ paramProperty only if you need a property in the iterated object, elsewhere use only paramName (you can select a
+ property using an expression name.property).
+ </description>
+ </attribute>
+ <attribute>
+ <name>paramScope</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ @deprecated - use Expressions in paramName. The scope within which to search for the bean specified by the
+ paramName attribute. If not specified, all scopes are searched. If paramName is not provided, then the current
+ object being iterated on is assumed to be the target bean.
+ </description>
+ </attribute>
+ <attribute>
+ <name>maxLength</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>
+ If this attribute is provided, then the column's displayed is limited to this number of characters. An elipse
+ (...) is appended to the end if this column is linked, and the user can mouseover the elipse to get the full
+ text. Be careful on using this attribute for String which can contain html tags or entities, or together with
+ the autolink attribute turned on: displaytag will do its best trying to avoid leaving unclosed tags or broken
+ entities in the output, but a complex or bad input could lead to unattended results.
+ </description>
+ </attribute>
+ <attribute>
+ <name>maxWords</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>
+ If this attribute is provided, then the column's displayed is limited to this number of words. An elipse (...)
+ is appended to the end if this column is linked, and the user can mouseover the elipse to get the full text. Be
+ careful on using this attribute for String which can contain html tags or entities, or together with the
+ autolink attribute turned on: displaytag will do its best trying to avoid leaving unclosed tags or broken
+ entities in the output, but a complex or bad input could lead to unattended results.
+ </description>
+ </attribute>
+ <attribute>
+ <name>class</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ html pass through attribute; use this instead of directly coding presentational atttributes.
+ </description>
+ </attribute>
+ <attribute>
+ <name>headerClass</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>"class" html attribute added only for header cells.</description>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>group</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ <description>
+ The grouping level (starting at 1 and incrementing) of this column (indicates if successive contain the same
+ values, then they should not be displayed). The level indicates that if a lower level no longer matches, then
+ the matching for this higher level should start over as well. If this attribute is not included, then no
+ grouping is performed.
+ </description>
+ </attribute>
+ <attribute>
+ <name>decorator</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Whitespace separated list of column decorators to apply to the current column. A table decorator name can be the
+ name of an object in page, request, session or application scope or a fully qualified class name of a class
+ implementing the org.displaytag.decorator.DisplaytagColumnDecorator interface. If a decorator is specified for
+ the entire table, then this decorator will decorate that decorator.
+ </description>
+ </attribute>
+ <attribute>
+ <name>sortName</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Used with sort="external", the name that should be given to the server to sort this column. IE if
+ sortName="buzz", then the href for this column to sort will have a parameter d-(encodedId)-s=buzz. If sortName
+ is ommitted the value for the sort param will default to the column number.
+ </description>
+ </attribute>
+ <attribute>
+ <name>headerScope</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>"scope" html attribute added only for header cells.</description>
+ </attribute>
+ <attribute>
+ <name>scope</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>"scope" html attribute.</description>
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.Object</type>
+ <description>
+ Static value to be used for the column. It has the same meaning of setting a value in the tag body, but values
+ set using this attribute will not be coerced to Strings. You may need to use the value attribute instead of a
+ scriptlet in the tag body if you need to calculate totals on numeric values.
+ </description>
+ </attribute>
+ </tag>
+ <tag>
+ <name>setProperty</name>
+ <tag-class>org.displaytag.tags.SetPropertyTag</tag-class>
+ <body-content>JSP</body-content>
+ <display-name>setProperty</display-name>
+ <description>
+ Sets the indicated property on the enclosing Table tag. MUST be nested within a Table tag. As an alternative, you
+ may create a property file that holds sitewide defaults; see the configuration documentation or the
+ DisplayPropertiesLoaderServlet javadoc for information.
+ </description>
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>The name of the property to set on the enclosing Table tag.</description>
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ The value to which the property is set. You can also set the property value in the tag body.
+ </description>
+ </attribute>
+ <example>
+ <![CDATA[
+<display:setProperty name="paging.banner.placement" value="bottom" />
+or
+<display:setProperty name="paging.banner.placement">bottom</display:setProperty>
+]]>
+ </example>
+ </tag>
+ <tag>
+ <name>footer</name>
+ <tag-class>org.displaytag.tags.TableFooterTag</tag-class>
+ <body-content>JSP</body-content>
+ <display-name>footer</display-name>
+ <description>
+ Tag wich should be nested into a table tag to provide a custom table footer. The body of the tag is into the tfoot
+ section of the table. The totals variable, if designated, will be in pageContext in this tag.
+ </description>
+ <attribute>
+ <name>media</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Use this attribute to keep a footer from being output during an export. The caption will only render for the
+ named media type(s) - it won't be added to the table if the current request media is not supported. Can be any
+ space separated combination of 'html', 'csv', 'xml', 'all', or 'excel'. Defaults to 'all'. See the export page
+ in the example webapp for more details.
+ </description>
+ </attribute>
+ <example>
+ <![CDATA[
+<display:table name="someList" varTotals="totals">
+ <display:column property="itemName"/>
+ <display:column property="price" total="true"/>
+ <display:footer>
+ <tr>
+ <td>Total Bill:</td>
+ <td><c:out value="${totals.column2}" /></td>
+ <tr>
+ </display:footer>
+</display:table>
+]]>
+ </example>
+ </tag>
+ <tag>
+ <name>caption</name>
+ <tag-class>org.displaytag.tags.CaptionTag</tag-class>
+ <body-content>JSP</body-content>
+ <display-name>caption</display-name>
+ <description>
+ Simple tag which mimics the html caption tag. Use it inside a table tag to display a caption.
+ </description>
+ <attribute>
+ <name>style</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>class</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>id</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>title</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>lang</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>dir</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>html pass through attribute.</description>
+ </attribute>
+ <attribute>
+ <name>media</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ <description>
+ Use this attribute to keep a caption from being output during an export. The caption will only render for the
+ named media type(s) - it won't be added to the table if the current request media is not supported. Can be any
+ space separated combination of 'html', 'csv', 'xml', 'all', or 'excel'. Defaults to 'all'. See the export page
+ in the example webapp for more details.
+ </description>
+ </attribute>
+ <example>
+ <![CDATA[
+<display:table name="someList">
+ <display:column property="mail"/>
+ <display:column property="total"/>
+ <display:caption>This is the table caption</display:caption>
+</display:table>
+]]>
+ </example>
+ </tag>
+</taglib>
\ No newline at end of file
Modified: velocity/tools/trunk/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/pom.xml?rev=1049996&r1=1049995&r2=1049996&view=diff
==============================================================================
--- velocity/tools/trunk/pom.xml (original)
+++ velocity/tools/trunk/pom.xml Thu Dec 16 15:01:15 2010
@@ -189,6 +189,7 @@
<module>velocity-tools-uberjar</module>
<module>velocity-tools-examples</module>
<module>velocity-tools-assembly</module>
+ <module>maven-velocity-tools-plugin</module>
</modules>
</project>
Propchange: velocity/tools/trunk/velocity-tools-examples/displaytag-directive/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Dec 16 15:01:15 2010
@@ -0,0 +1,2 @@
+.*
+target
Added: velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml?rev=1049996&view=auto
==============================================================================
--- velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml (added)
+++ velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml Thu Dec 16 15:01:15 2010
@@ -0,0 +1,65 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>velocity-tools-examples</artifactId>
+ <groupId>org.apache.velocity</groupId>
+ <version>2.1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>displaytag-directive</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <name>Displaytag directives</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>maven-velocity-tools-plugin</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <configuration>
+ <packageName>org.apache.velocity.tools.examples.displaytag</packageName>
+ <prefix>display</prefix>
+ <tld>META-INF/displaytag.tld</tld>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>displaytag</groupId>
+ <artifactId>displaytag</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>directive-generation</id>
+ <goals>
+ <goal>taglib2directive</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>displaytag</groupId>
+ <artifactId>displaytag</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-tools-view-jsp</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Modified: velocity/tools/trunk/velocity-tools-examples/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/pom.xml?rev=1049996&r1=1049995&r2=1049996&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-examples/pom.xml (original)
+++ velocity/tools/trunk/velocity-tools-examples/pom.xml Thu Dec 16 15:01:15 2010
@@ -15,5 +15,6 @@
<module>velocity-tools-examples-showcase</module>
<module>velocity-tools-examples-simple</module>
<module>velocity-tools-examples-struts</module>
+ <module>displaytag-directive</module>
</modules>
</project>
\ No newline at end of file