Discussion:
[Middlegen-user] Using Ant for Local and Remove views
M-Leander Reimer
2002-06-25 12:24:03 UTC
Permalink
Hi there,

In reference to my last mail: It seems that JBoss (at least 2.4.5 so I
think 3.0.0) as well, makes the <ejb-link> tag for <ejb-local-ref>s
mandatory, which is not what it says in the DTD. I added the link
attribute to the @web:ejb-local-ref definitions in all the struts
classes under /middlegen/samples/src/java/airline/web/struts. Then the
samples deploys OK.

Now my question. In order to do some test, I would need the remote
interfaces of all the generated EJBs. But I don't want to use the GUI
all the time to switch this feature on.

Is there an Ant target level tag where I can specify the views (so local
and remote) Middlegen should include?

Or can I modify the code somewhere to support this?

Thanks for your help!

Leander
a***@netcom.no
2002-06-25 12:48:08 UTC
Permalink
Thanks for this valuable info Leander. I'll make sure to add link in
the ejb-local-refs from the web tier in the samples.

In order to remote-enable EJBs by default you'll have to update the
code in a few places. I'll explain, and if you do it, please upload a
patch for your changes to SF.

1) We want an extra attribute <cmp20 viewtype="local|remote|both"/>.
Add a setter/getter for this in CMP20Plugin.java.
2) We want to set appropriate view type on the table/column level based
on the value of this viewtype property. This should be done in the init
() method of Entity20Column.java class. You can access the value with

String viewtype = ((CMP20Plugin)getPlugin()).getViewtype();

and add logic for the three different cases here.
Make sure you add "preference" support just like for local
setters/getters so that a setting is "remembered" (requires JDK1.4)

That should be it. These changes will make it possible to "preset" the
view type at the Ant level. If you run in gui mode, you should see the
remote checkboxes being checked too.

Hope this is enough info to get you started.

Aslak

----- Original Message -----
From: M-Leander Reimer <***@gmx.net>
Date: Tuesday, June 25, 2002 4:24 pm
Subject: [Middlegen-user] Using Ant for Local and Remove views
Post by M-Leander Reimer
Hi there,
In reference to my last mail: It seems that JBoss (at least 2.4.5
so I
think 3.0.0) as well, makes the <ejb-link> tag for <ejb-local-ref>s
mandatory, which is not what it says in the DTD. I added the link
classes under /middlegen/samples/src/javsamples deploys OK.
Now my question. In order to do some test, I would need the remote
interfaces of all the generated EJBs. But I don't want to use the GUI
all the time to switch this feature on.
Is there an Ant target level tag where I can specify the views (so
localand remote) Middlegen should include?
Or can I modify the code somewhere to support this?
Thanks for your help!
Leander
-------------------------------------------------------
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
M-Leander Reimer
2002-06-29 14:24:05 UTC
Permalink
Hi Aslak, hi Middlegen users,

I submitted a patch on SF:
[ 575403 ] Ant for Local and Remove views patch

I did the modification like you advised. The only thing that didn't work
as described was to put the setter/and getter in CMP20Plugin.java (it
worked on my old version at home, but didn't using my latest CVS
snapshot from friday 28.06.). It produced ClassCastExcpetions when doing
Post by a***@netcom.no
String viewtype = ((CMP20Plugin)getPlugin()).getViewtype();
in Entity20Column.java. For some reason it was getting BMP20Plugin
instead of CMP20Plugin from tge getPlugin() method. So I moved the code
into Entity20Plugin.java and use the following cast now:

String viewtype = ((Entity20Plugin)getPlugin()).getViewtype();

Hope that's OK, but it works. Couldn't test the preferences support
because I am using JDK 1.3.1, but it should also work.

Leander

Loading...