Update of /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv11958/src/java/xdoclet/plugins
Modified Files:
JellyPlugin.java ScriptPlugin.java VelocityPlugin.java
Log Message:
Added a little demo project to get people started
Index: JellyPlugin.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/plugins/JellyPlugin.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** JellyPlugin.java 16 Mar 2003 20:38:54 -0000 1.4
--- JellyPlugin.java 17 Mar 2003 13:38:57 -0000 1.5
***************
*** 23,27 ****
* Plugin backed by <a
href="http://jakarta.apache.org/commons/sandbox/jelly/">Jelly</a>.
*
! * @bean.class locale="en"
* displayName="Jelly Plugin"
* shortDescription="A plugin that uses Jelly Scripts"
--- 23,27 ----
* Plugin backed by <a
href="http://jakarta.apache.org/commons/sandbox/jelly/">Jelly</a>.
*
! * @bean.class name="jelly"
* displayName="Jelly Plugin"
* shortDescription="A plugin that uses Jelly Scripts"
***************
*** 43,50 ****
try {
// Find the template
! URL templateURL =
getXDoclet().getClasspathManager().getResource(getTemplateName());
if (templateURL == null) {
! throw new XDocletException("Couldn't find " + getTemplateName() + "
on the classpath: "
+ getXDoclet().getClasspathManager().getClasspath());
}
--- 43,50 ----
try {
// Find the template
! URL templateURL =
getXDoclet().getClasspathManager().getResource(getTemplatePath());
if (templateURL == null) {
! throw new XDocletException("Couldn't find " + getTemplatePath() + "
on the classpath: "
+ getXDoclet().getClasspathManager().getClasspath());
}
Index: ScriptPlugin.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/plugins/ScriptPlugin.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** ScriptPlugin.java 9 Mar 2003 15:48:00 -0000 1.4
--- ScriptPlugin.java 17 Mar 2003 13:38:57 -0000 1.5
***************
*** 21,25 ****
* @return the template name
*/
! public final String getTemplateName() {
return _templatePath;
}
--- 21,25 ----
* @return the template name
*/
! public final String getTemplatePath() {
return _templatePath;
}
***************
*** 30,34 ****
* jar files or directories.
*
! * @param templateName name of the template to use during generation.
* @bean.attribute default="true"
*/
--- 30,34 ----
* jar files or directories.
*
! * @param templateName relative path to the template to use.
* @bean.attribute default="true"
*/
***************
*** 37,47 ****
}
! protected void generateOneFileForAll(File file)
throws XDocletException {
generate(file);
}
! protected void generateOneFileForEach(File file, Object object)
throws XDocletException {
generate(file);
}
--- 37,53 ----
}
! protected final void generateOneFileForAll(File file)
throws XDocletException {
+ if( getTemplatePath() == null ) {
+ throw new XDocletException( "templatePath was not specified." );
+ }
generate(file);
}
! protected final void generateOneFileForEach(File file, Object object)
throws XDocletException {
+ if( getTemplatePath() == null ) {
+ throw new XDocletException( "templatePath was not specified." );
+ }
generate(file);
}
Index: VelocityPlugin.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/plugins/VelocityPlugin.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** VelocityPlugin.java 16 Mar 2003 20:38:54 -0000 1.4
--- VelocityPlugin.java 17 Mar 2003 13:38:57 -0000 1.5
***************
*** 23,27 ****
* Plugin backed by <a href="http://jakarta.apache.org/velocity/">Velocity</a>.
*
! * @bean.class locale="en"
* displayName="Velocity Plugin"
* shortDescription="A plugin that uses Velocity Scripts"
--- 23,27 ----
* Plugin backed by <a href="http://jakarta.apache.org/velocity/">Velocity</a>.
*
! * @bean.class name="velocity"
* displayName="Velocity Plugin"
* shortDescription="A plugin that uses Velocity Scripts"
***************
*** 75,79 ****
FileWriter writer = new FileWriter(file);
VelocityContext context = new VelocityContext(getContextObjects());
! String templateName = getTemplateName();
if (templateName == null) {
--- 75,79 ----
FileWriter writer = new FileWriter(file);
VelocityContext context = new VelocityContext(getContextObjects());
! String templateName = getTemplatePath();
if (templateName == null) {
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel