Eric,

I've seen this work in Matt Raible's struts-resume example app - but when I
used the exact same config in my app it does not work.

In case you give up getting this to work, like I did, here is my Ant
workaround:
        </ejbdoclet>
        <!-- Since the strutsForm "packageSubstitution" is not working,
simulate it -->
        <mkdir
dir="${build.dir}/${module.webapp}/src-gen/com/acme/webapp/form"/>
        <move
todir="${build.dir}/${module.webapp}/src-gen/com/acme/webapp/form"
includeEmptyDirs="no">
            <fileset
dir="${build.dir}/${module.webapp}/src-gen/com/acme/persistence/base">
              <patternset>
                <include name="*.java"/>
              </patternset>
            </fileset>
        </move>
        <delete
dir="${build.dir}/${module.webapp}/src-gen/com/acme/persistence"/>
        <replace
dir="${build.dir}/${module.webapp}/src-gen/com/acme/webapp/form">
            <include name="**/*.java"/>
            <replacefilter token="com.acme.persistence.base"
value="com.acme.webapp.form"/>
            <!-- boolean "is" getters are not converting to "get" getters
when strings -->
            <replacefilter token="public String is" value="public String
get"/>
        </replace>

It is definitely a hack, but I could waste no more time getting it to work.

FWIW - Richard






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Eric Chow
Sent: Friday, April 11, 2003 12:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [Xdoclet-user] Package problem in Struts ActionForm !!!


Hi Mick,

The destDir=" ???? " is the directory that places the generated source.

I want the "package test.form" ?????


Eric


----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 11, 2003 3:05 PM
Subject: RE: [Xdoclet-user] Package problem in Struts ActionForm !!!


destDir="locationOfActionForms"
-----Original Message-----
From: Eric Chow [mailto:[EMAIL PROTECTED]
Sent: Friday, April 11, 2003 4:41 AM
To: [EMAIL PROTECTED]
Subject: [Xdoclet-user] Package problem in Struts ActionForm !!!


I tried to generate Struts ActionFrom from EJB, it works.
But the package(location) of the generated ActionForm is same as the EJB
itself.
How can I specify the generated ActionForm's package(directory location) in
XDoclet?

The following is my build.xml and EJB source:

in build.xml
==================================================================

I just want all the ActionForm will be generated to package "test.form" !!!!

<strutsform destdir="${project.gen.java}">
   <!-- Is that true for specify the package for generated ActionForm
????? --->
   <!-- It seems not work ???????? -->
   <packageSubstitution packages="test" substituteWith="form"/>
</strutsform>
=================================================================


EJB source:
===============================================
package test.ejb;


import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;


/**
 * The DBMessageBean
 *
 * @ejb.bean
 *    type="CMP"
 *    name="DBMessage"
 *    view-type="local"
 *    local-jndi-name="test.local.DBMessage"
 *
 * @ejb.transaction
 *    type="Required"
 *
 *
 * @ejb.persistence
 *    table-name="chk_dbmessage"
 *
 * @ejb.home
 *    local-class="test.interfaces.DBMessageHome"
 *
 * @ejb.interface
 *    local-class="test.interfaces.DBMessage"
 *
 * @ejb.pk
 *    class="test.pk.DBMessagePK"
 *
 *
 * @struts.form
 *    include-all="true"
 *
 *
 */
public abstract class DBMessageBean implements EntityBean {
   protected EntityContext ctx;


   /**
    * @ejb.create-method
    */
   public Object ejbCreate(String application, String key, String charset,
Object message) throws CreateException {
     setApplication(application);
     setKey(key);
     setCharset(charset);
     setMessage(message);

      return null;
   }


   /**
    * Called when the object has been instantiated; does nothing in this
example
    */
   public void ejbPostCreate(String application, String key, String charset,
Object message) { }


   /**
    * @ejb.interface-method
    *
    */
   public abstract void setApplication(String application);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="application"
    *
    */
   public abstract String getApplication();


   /**
    * @ejb.interface-method
    *
    */
 public abstract void setKey(String key);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="name"
    *
    */
   public abstract String getKey();


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="charset"
    *
    */
   public abstract String getCharset();


   /**
    * @ejb.interface-method
    *
    */
   public abstract void setCharset(String charset);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.persistence
    *    column-name="message"
    *
    *
    */
   public abstract Object getMessage();

   /**
    * @ejb.interface-method
    *
    */
   public abstract void setMessage(Object message);
}


















==========================
If you know what you are doing,
it is not called RESEARCH!
==========================




Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.




destDir="locationOfActionForms"

-----Original Message-----
From: Eric Chow [mailto:[EMAIL PROTECTED]
Sent: Friday, April 11, 2003 4:41 AM
To: [EMAIL PROTECTED]
Subject: [Xdoclet-user] Package problem in Struts ActionForm !!!


I tried to generate Struts ActionFrom from EJB, it works.
But the package(location) of the generated ActionForm is same as the EJB
itself.
How can I specify the generated ActionForm's package(directory location) in
XDoclet?

The following is my build.xml and EJB source:

in build.xml
==================================================================

I just want all the ActionForm will be generated to package "test.form" !!!!

<strutsform destdir="${project.gen.java}">
   <!-- Is that true for specify the package for generated ActionForm
????? --->
   <!-- It seems not work ???????? -->
   <packageSubstitution packages="test" substituteWith="form"/>
</strutsform>
=================================================================


EJB source:
===============================================
package test.ejb;



import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;


/**
 * The DBMessageBean
 *
 * @ejb.bean
 *    type="CMP"
 *    name="DBMessage"
 *    view-type="local"
 *    local-jndi-name="test.local.DBMessage"
 *
 * @ejb.transaction
 *    type="Required"
 *
 *
 * @ejb.persistence
 *    table-name="chk_dbmessage"
 *
 * @ejb.home
 *    local-class="test.interfaces.DBMessageHome"
 *
 * @ejb.interface
 *    local-class="test.interfaces.DBMessage"
 *
 * @ejb.pk
 *    class="test.pk.DBMessagePK"
 *
 *
 * @struts.form
 *    include-all="true"
 *
 *
 */
public abstract class DBMessageBean implements EntityBean {
   protected EntityContext ctx;


   /**
    * @ejb.create-method
    */
   public Object ejbCreate(String application, String key, String charset,
Object message) throws CreateException {
     setApplication(application);
     setKey(key);
     setCharset(charset);
     setMessage(message);

      return null;
   }


   /**
    * Called when the object has been instantiated; does nothing in this
example
    */
   public void ejbPostCreate(String application, String key, String charset,
Object message) { }


   /**
    * @ejb.interface-method
    *
    */
   public abstract void setApplication(String application);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="application"
    *
    */
   public abstract String getApplication();


   /**
    * @ejb.interface-method
    *
    */
 public abstract void setKey(String key);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="name"
    *
    */
   public abstract String getKey();


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.pk-field
    *
    * @ejb.persistence
    *    column-name="charset"
    *
    */
   public abstract String getCharset();


   /**
    * @ejb.interface-method
    *
    */
   public abstract void setCharset(String charset);


   /**
    * @ejb.interface-method
    *
    * @ejb.transaction
    *      type="Supports"
    *
    * @ejb.persistence
    *    column-name="message"
    *
    *
    */
   public abstract Object getMessage();

   /**
    * @ejb.interface-method
    *
    */
   public abstract void setMessage(Object message);
}


















==========================
If you know what you are doing,
it is not called RESEARCH!
==========================



Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.




-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to