Changes for page Custom Project Templates

Last modified by Bastian Triller on 2009/04/11 21:03

From version 47.1
edited by David Avendasora
on 2009/04/11 20:37
Change comment: There is no comment for this version
To version 48.1
edited by David Avendasora
on 2009/04/11 20:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -105,9 +105,9 @@
105 105  
106 106  = Using Template Inputs =
107 107  
108 -So now that you have template input defined, you will want to be able to use them. The name use used in the "name" attribute of your input declaration will be the name of the variable in your Velocity context. For instance, in the example above, the Velocity variable "linkToWonderProjects" will be bound to the boolean value corresponding to the user's selection, and can be used just like any other velocity variable. The Apache project provides a [[Velocity reference guide>>http://velocity.apache.org/engine/devel/vtl-reference-guide.html]].
108 +So now that you have template inputs defined, you need to be able to use them. The name used in the "name" attribute of your input node will be the name of the variable you can use in your template's files. For instance, in the example above, the Velocity variable "servletDeployment" will be bound to the boolean value corresponding to the user's selection, and can be used just like any other velocity variable. The Apache project provides a [[Velocity reference guide>>http://velocity.apache.org/engine/devel/vtl-reference-guide.html]].
109 109  
110 -As an example, the .classpath file can be modified to automatically add a link to the JavaWOJSPServlet.framework if the user is prompted and selects "Deploy to Servlet Container" in the the new project wizard.
110 +As an example, the .classpath file can be modified to automatically add a link to the JavaWOJSPServlet.framework if the user selects "Deploy to Servlet Container" in the the wizard.
111 111  
112 112  {{code value="xml"}}
113 113  
... ... @@ -129,6 +129,12 @@
129 129  
130 130  {{/code}}
131 131  
132 -In addition to variables inside of Velocity templates, you can also use template variables in folder and file names. However, because $ is not allowed on some filesystems, we instead surround the variable names with "" (for instance $someVariable would be someVariable in the filename or path). As an example, the Wonder Application template has an input named "basePackage" (of type Package), which creates a magic variable named "basePackage//folder" (where the dots are turned into slashes), and the Source folder on the filesystem is named "Wonder Application/Sources///basePackage//folder//".
132 +In addition to variables inside of Velocity templates, you can also use template variables in folder and file names. However, because $ is not allowed on some filesystems, we instead surround the variable names with "" (for instance $someVariable would be "someVariable" in the filename or path). As an example, the template above has an input named "basePackage" (of type Package) which, as we learned above, creates two variables: "basePackage" and "basePackage//folder". Since we are going to be using this variable to name (and define the path) of a folder in the Sources directory, we need to use the alternate version of the variable. Create a new folder in the Sources directory of the project templaet and instead of using "${{basePackage_folder}}{{/basePackage_folder}}" as the file name, we must use "basePackage//folder".
133 133  
134 +=== Special Circumstances ===
135 +
136 +===== Flagging files to be skipped by Velocity =====
137 +
138 +===== Using keypaths =====
139 +
134 134  Happy templating