Hello,
I try to automate code generation for web application. I have already designed clssses for DTO objects. Now I’m tring to generete struts ActionForm and related JSP page base on that. I found good examples of using XDoclet perform this task. Here are the url’s:
ActionForm generation base on template :http://www.jroller.com/page/happy/Home/20050228
JSP page: http://www.ehatchersolutions.com/JavaDevWithAnt/struts.html#strutsgen
Addtionaly here is complete project download: http://www.ehatchersolutions.com/downloads/JavaDevWithAnt-1.0.zip
the most intresting part is in tools\strutsgen folder.
Question: How to configure MyExclipse to run code generation when using XDoclet template files ? I want to be able run XDoclet JSP generator using popup menu Myeclipse\Run Xdoclet.
You can assume that I follow MyEclipse Enterprise application (WEB+EJB) folder struture.
Addtionaly normal java project with DTO classes were added to workspace. All 3 projects builds EAR archive. Java sources are in src.
Detail questions:
– What shoud I put insted of ant variables like ${build.dir}. Absolute path, path reltive to …
– Where to put *.xtd files. Inside project folder, in separte project ?
– The solution with tools\strutsgen uses class thet extends Xdoclet capabilities. Where I should put or install this class.
Here is e.g. ant task that i want to transform to My Exclipse settings
<xdoclet destdir="${build.dir}"
excludedtags="@version,@author"
force="${xdoclet.force}">
<fileset dir="${project.src.dir}"
includes="**/${form.name}.java" />
<template templateFile="src/FormKeys.xdt"
ofType="org.apache.struts.validator.ValidatorForm"
acceptAbstractClasses="false"
prefixWithPackageStructure="false"
destinationFile="{0}.properties" />
</xdoclet>
Regards
Andrzej