Author: alexsmirnov
Date: 2007-10-18 20:54:42 -0400 (Thu, 18 Oct 2007)
New Revision: 3447
Added:
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
Removed:
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Library.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java
Log:
Fix taglibs assembly for JSF 2.0
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-19
00:33:03 UTC (rev 3446)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-19
00:54:42 UTC (rev 3447)
@@ -198,10 +198,7 @@
library.setRenderkits(renderkits);
}
Taglib taglib = library.getTaglib();
- if (null != taglib) {
- getLog().debug("Taglib uri is " + taglib.getUri());
- getLog().debug("Taglib shortname is " + taglib.getShortName());
- } else {
+ if (null == taglib) {
taglib = new Taglib();
library.setTaglib(taglib);
}
@@ -235,6 +232,8 @@
if(null == taglib.getTaglib()){
taglib.setTaglib(taglib.getShortName());
}
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
if (null != library.getTaglibs() && library.getTaglibs().length > 0) {
for (int i = 0; i < library.getTaglibs().length; i++) {
Taglib t = library.getTaglibs()[i];
@@ -308,6 +307,8 @@
if(null == taglib.getTaglib()){
taglib.setTaglib(taglib.getShortName());
}
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
}
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2007-10-19
00:33:03 UTC (rev 3446)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2007-10-19
00:54:42 UTC (rev 3447)
@@ -256,6 +256,7 @@
*/
private void generateTaglib(List models, Taglib taglib)
throws MojoExecutionException {
+ getLog().debug("Assembly taglib for uri " + taglib.getUri()+" with short
name "+taglib.getShortName());
VelocityContext taglibContext = new VelocityContext();
taglibContext.put("taglib", taglib);
// Build includes/excludes Xpath condition
@@ -263,6 +264,7 @@
createTagCondition(taglib, nameTag);
File tld = new File(outputDirectory, "META-INF/"
+ taglib.getTaglib() + ".tld");
+ getLog().debug("Write JSP taglib "+tld.getPath());
mergeXML(models, includeTld, TLD_TEMPLATE, "/taglib/tag"
+ createTagCondition(taglib, "name") + " | /taglib/listener",
null, new VelocityContext(taglibContext), tld);
@@ -272,6 +274,7 @@
+ createTagCondition(taglib, "tag-name")
+ " | /facelet-taglib/function", null, new VelocityContext(
taglibContext), faceletsTaglib);
+ getLog().debug("Write Facelets taglib "+faceletsTaglib.getPath());
}
/**
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Library.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Library.java 2007-10-19
00:33:03 UTC (rev 3446)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Library.java 2007-10-19
00:54:42 UTC (rev 3447)
@@ -144,4 +144,8 @@
this.taglibs = taglibs;
}
+ @Override
+ public String toString() {
+ return "JSF library "+getPrefix()+", desc:
"+getDescription()+(null!=getTaglibs()?", libs:
"+getTaglibs():"");
+ }
}
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java 2007-10-19
00:33:03 UTC (rev 3446)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java 2007-10-19
00:54:42 UTC (rev 3447)
@@ -220,4 +220,8 @@
_excludeTags = excludeTags;
}
+ @Override
+ public String toString() {
+ return "Lib: "+getShortName()+", URL: "+getUri();
+ }
}
Deleted: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm 2007-10-19
00:33:03 UTC (rev 3446)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
- version="1.2">
-
-${content}
-#foreach( $kit in ${renderkits})
- <render-kit>
- #if(${kit.name})
- <render-kit-id>${kit.name}</render-kit-id>
- #if(${kit.classname})
- <render-kit-class>${kit.classname}</render-kit-class>
- #end
- #end
- ${kit.facesConfig}
- </render-kit>
-#end
-
-
-</faces-config>
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
(rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+${content}
+
+#foreach( $kit in ${renderkits})
+ <render-kit>
+ #if(${kit.name})
+ <render-kit-id>${kit.name}</render-kit-id>
+ #if(${kit.classname})
+ <render-kit-class>${kit.classname}</render-kit-class>
+ #end
+ #end
+ ${kit.facesConfig}
+ </render-kit>
+#end
+
+
+</faces-config>
Deleted: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm 2007-10-19
00:33:03 UTC (rev 3446)
+++
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
-${content}
-</resource-config>
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm
(rev 0)
+++
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/resources-config.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource-config>
+${content}
+</resource-config>
Deleted: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm 2007-10-19
00:33:03 UTC (rev 3446)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE facelet-taglib PUBLIC
- "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
- "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
-<facelet-taglib
xmlns="http://java.sun.com/JSF/Facelet">
-<namespace>${library.taglib.uri}</namespace>
-
-${content}
-</facelet-taglib>
\ No newline at end of file
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm
(rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/taglib.vm 2007-10-19
00:54:42 UTC (rev 3447)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+<facelet-taglib
xmlns="http://java.sun.com/JSF/Facelet">
+<namespace>${taglib.uri}</namespace>
+
+${content}
+</facelet-taglib>
\ No newline at end of file
Deleted: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm 2007-10-19 00:33:03
UTC (rev 3446)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm 2007-10-19 00:54:42
UTC (rev 3447)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<taglib
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
-
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="${library.taglib.jspVersion}">
-
-<tlib-version>${library.taglib.tlibVersion}</tlib-version>
-#if(${library.taglib.shortName})
- <short-name>${library.taglib.shortName}</short-name>
-#end
- <uri>${library.taglib.uri}</uri>
-#if(${library.taglib.displayName})
- <display-name>${library.taglib.displayName}</display-name>
-#end
-#if(${library.description})
- <description>${library.description}</description>
-#end
-#if(${library.taglib.validatorClass})
- <validator>
- <validator-class>${library.taglib.validatorClass}</validator-class>
- </validator>
-#end
-
-${content}
-</taglib>
\ No newline at end of file
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
(rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm 2007-10-19 00:54:42
UTC (rev 3447)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!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>${taglib.tlibVersion}</tlib-version>
+ <jsp-version>${taglib.jspVersion}</jsp-version>
+#if(${taglib.shortName})
+ <short-name>${taglib.shortName}</short-name>
+#end
+ <uri>${taglib.uri}</uri>
+#if(${taglib.displayName})
+ <display-name>${taglib.displayName}</display-name>
+#end
+#if(${library.description})
+ <description>${library.description}</description>
+#end
+#if(${taglib.validatorClass})
+ <validator>
+ <validator-class>${taglib.validatorClass}</validator-class>
+ </validator>
+#end
+
+${content}
+</taglib>
\ No newline at end of file