Discussion:
[Middlegen-user] alter tags generated by Middlegen
Richard Aillet
2002-03-26 15:40:09 UTC
Permalink
Hi,

Is there anyway to modify the XDoclet tags in the Java file generated
by
Middlegen ?

I would like to choice some tags in the AcountBean.java generated, for
example:

* @ejb:bean
* type="CMP"
* cmp-version="2.x"
* name=" AccountEJB-OneToMany"
* jndi-name="one2many.AccountHome"
* view-type="remote"

Thanks.

Richard.
Aslak Hellesøy
2002-03-26 22:09:14 UTC
Permalink
Richard,

There are four ways to do this:
1) Hand edit the generated sources before you run XDoclet on them. That's
the bad/boring solution.
2) Modify middlegen/src/java/entity-cmp.j and rebuild the middlegen jar.
(You can get the sources via CVS)
3) Modify the code in MiddlegenTagsHandler or EntityCMPTagsHandler. The
XML-like tags in entity-cmp.j correspond to methods in these classes.
4) Use the latest CVS version in GUI mode. You have checkboxes to toggle
between local/remote (if you check both, you'll get view-type="both".

I would recommend 4. If you want to modify e.g. the @ejb:bean
name="somethingelse", you'll have to modify the java sources. If this is
what you need to do (although I can't see why), what way would you prefer to
control the output? -Via the gui? -Via the Ant task? -Via some property
file? -Some other way?

HTH,
Aslak

-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of Richard
Aillet
Sent: 26. mars 2002 18:46
To: middlegen-***@lists.sourceforge.net.
Subject: [Middlegen-user] alter tags generated by Middlegen


Hi,

Is there anyway to modify the XDoclet tags in the Java file generated by
Middlegen ?

I would like to choice some tags in the AcountBean.java generated, for
example:

* @ejb:bean
* type="CMP"
* cmp-version="2.x"
* name=" AccountEJB-OneToMany"
* jndi-name="one2many.AccountHome"
* view-type="remote"

Thanks.

Richard.
Richard Aillet
2002-03-27 13:07:30 UTC
Permalink
I try the solution 2) and rebuild middlegen.jar

Even if I modify view-type="remote", in the java source bean generated
by Middlegen, I have still some 'local' name when a bean is in relation
with another bean (for example in Bean1.java, I have a relation:
public abstract com.package.Bean2Local getBean2();)

I would prefer:
public abstract com.package.Bean2 getBean2();)

In the entity-cmp.j, I see there is a reference to
<XDtMgEjb:targetType/>. Do you know if this reference can be modified ?
If yes, how can I do ?

Thanks to help me.

Richard.


-----Message d'origine-----
De : Aslak Hellesøy [mailto:***@netcom.no]
Envoyé : mercredi 27 mars 2002 01:08
À : Richard Aillet; middlegen-***@lists.sourceforge.net
Objet : RE: [Middlegen-user] alter tags generated by Middlegen

Richard,

There are four ways to do this:
1) Hand edit the generated sources before you run XDoclet on them.
That's
the bad/boring solution.
2) Modify middlegen/src/java/entity-cmp.j and rebuild the middlegen jar.
(You can get the sources via CVS)
3) Modify the code in MiddlegenTagsHandler or EntityCMPTagsHandler. The
XML-like tags in entity-cmp.j correspond to methods in these classes.
4) Use the latest CVS version in GUI mode. You have checkboxes to toggle
between local/remote (if you check both, you'll get view-type="both".

I would recommend 4. If you want to modify e.g. the @ejb:bean
name="somethingelse", you'll have to modify the java sources. If this is
what you need to do (although I can't see why), what way would you
prefer to
control the output? -Via the gui? -Via the Ant task? -Via some property
file? -Some other way?

HTH,
Aslak

-----Original Message-----
From: middlegen-user-***@lists.sourceforge.net
[mailto:middlegen-user-***@lists.sourceforge.net]On Behalf Of Richard
Aillet
Sent: 26. mars 2002 18:46
To: middlegen-***@lists.sourceforge.net.
Subject: [Middlegen-user] alter tags generated by Middlegen


Hi,

Is there anyway to modify the XDoclet tags in the Java file generated
by
Middlegen ?

I would like to choice some tags in the AcountBean.java generated, for
example:

* @ejb:bean
* type="CMP"
* cmp-version="2.x"
* name=" AccountEJB-OneToMany"
* jndi-name="one2many.AccountHome"
* view-type="remote"

Thanks.

Richard.

Loading...