Issue Details (XML | Word | Printable)

Key: XDT-884
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Matt Raible
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
XDoclet

Remove EJB dependency from <strutsform> task

Created: 26/Apr/04 03:41 AM   Updated: 02/Sep/04 12:24 AM
Component/s: Apache Module
Affects Version/s: 1.2.1
Fix Version/s: 1.2.2

Time Tracking:
Not Specified

File Attachments: 1. Java Source File StrutsDocletTask.java (0.4 kB)
2. Java Source File StrutsFormSubTask.java (6 kB)
3. Text File StrutsFormsWithoutEJB.patch (32 kB)

Environment: Windows XP, JDK 1.4.2, Ant 1.6.1


 Description  « Hide
It would be great if the <strutsform> task could be run on its own - outside of the ejbdoclet task. The main reason for this is b/c the ejbdoclet task depends on javax.ejb.* which requires the user to have j2ee.jar in their classpath.

By removing this dependency, it makes things quite a bit easier.

I modified this tonight to make this change. With the new StrutsDoclet task, you can generate forms from POJOs with something like the following:

        <taskdef name="strutsdoclet"
            classname="xdoclet.modules.apache.struts.StrutsDocletTask"
            classpathref="xdoclet.classpath"/>
        
        <!-- generate struts forms -->
        <strutsdoclet
            destdir="${build.dir}/web/gen"
            excludedtags="@version,@author"
            addedtags="@xdoclet-generated at ${TODAY}"
            force="${xdoclet.force}">
            <fileset dir="src/dao"/>

            <!-- generate struts forms -->
            <strutsform destdir="${build.dir}/web/gen"
                templateFile="metadata/templates/struts_form.xdt">
                <packageSubstitution packages="model"
                    substituteWith="webapp.form"/>
            </strutsform>

        </strutsdoclet>

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 26/Apr/04 03:41 AM
Attaching patch for classes currently in XDoclet

Matt Raible added a comment - 26/Apr/04 03:42 AM
New StrutsDoclet Task

Matt Raible added a comment - 26/Apr/04 03:42 AM
New StrutsFormSubTask without EJB Dependency

Matt Raible added a comment - 26/Apr/04 03:43 AM
This patch is probably not as clean as it should be. It breaks the ejbdoclet task when running "ant samples". However, it does everything I need, since I don't use EJBs.

Matt Raible added a comment - 27/Apr/04 12:15 PM
I've cleaned this up and now both the <strutsform> subtask of <ejbdoclet> will work, as well as I created a new <actionform> taghandler (and namespace) for this standalone stuff.

Rather than continuing to submit patches, please let me know when you're interested in committing this stuff - and I'll supply a patch then. I also cleaned up all the deprecation errors in the apache module.

Here's what the task looks like now in my build.xml.

        <taskdef name="strutsdoclet"
            classname="xdoclet.modules.apache.struts.StrutsDocletTask"
            classpathref="xdoclet.classpath"/>
        
        <!-- generate struts forms -->
        <strutsdoclet
            destdir="${build.dir}/web/gen"
            excludedtags="@version,@author"
            addedtags="@xdoclet-generated at ${TODAY}"
            force="${xdoclet.force}">
            <fileset dir="src/dao"/>

            <!-- generate struts forms -->
            <actionform destdir="${build.dir}/web/gen"
                templateFile="metadata/templates/struts_form.xdt">
                <packageSubstitution packages="model"
                    substituteWith="webapp.form"/>
            </actionform>

        </strutsdoclet>

Matt Raible added a comment - 01/Sep/04 09:18 AM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/samples/src/java/test/hibernate Name.java,1.1,1.2
Modifications for XDT-884 - to prove that actionforms can be generated from POJOs


Matt Raible added a comment - 01/Sep/04 09:18 AM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/modules/apache/src/xdoclet/modules/apache/struts/resources struts_form.xdt,NONE,1.1
Fix for XDT-884 - allow generation of ActionForms w/o having j2ee.jar in classpath


Matt Raible added a comment - 01/Sep/04 09:18 AM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/modules/apache/src/xdoclet/modules/apache/struts ActionFormSubTask.java,NONE,1.1 ActionFormTagsHandler.java,NONE,1.1
Fix for XDT-884 - allow generation of ActionForms w/o having j2ee.jar in classpath


Matt Raible added a comment - 01/Sep/04 09:18 AM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/samples build.xml,1.44,1.45
Modifications for XDT-884 - to prove that actionforms can be generated from POJOs


Matt Raible added a comment - 01/Sep/04 09:19 AM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/modules/apache/src/xdoclet/modules/apache/struts/ejb XDocletModulesApacheStrutsEjbMessages.java,1.4,1.5
Fix for XDT-884 - allow generation of ActionForms w/o having j2ee.jar in classpath


Matt Raible added a comment - 02/Sep/04 12:24 AM
Fixed in CVS.