Index

Customizing Eclipse by NetBeans?

I am a NetBeanser but also interested in Eclipse. When I try using Eclipse, sometimes I meet a problem. Then NetBeans does a great help to solve it...my dear Eclipse users, how about using NetBeans for improving Eclipse operation????

Notice:The newer topic comes first.

/Trouble shot completely!/Customizing Lomboz plugin!/


Trouble shot completely!

I was so exited I could customized Lomboz plugin. Then I thought I should notice this matter to Lomboz community. So I went to the Lomboz forum,

http://forge.objectweb.org/forum/forum.php?forum_id=360

got the account and announced on this matter.

About 4 hours later, I got a reply to my announce. The Lomboz friend Siarhei kindly showed me the way:

If I had made Java files under /src directory, I would not have met such a mess.

I followed the advice soon. First, I re-installed the original Lomboz plugin . And it's like this: in the new Lomboz project wizard, set the source folder "src" by clicking "Add Folder" button.

Say yes for this message:

So you will get the structure as below. Create your favorite package and Java file under the "src" node.

Then right-click web module node("deployagainweb" in the above project") and deploy this module!

Now let's browse again the deployed web module in NETBEANS' FAVORITE WINDOW.

Yeeeahaa! Thanks a lot, my friend Siarhei!

Then, the article below is for those who would not want to make /src folders ?!?.pppp.


Customizing Lomboz plugin!

One day I was enjyoing Lomboz for Tomcat Web application in Eclipse. You might have an impression that Lomboz is for EJB with JBoss. But even if you need only Tomcat, you will need it for code assistance, support for Tag libraries, or auto deployment on Tomcat server.

There is one point to be noticed, You cannot create JavaBeans or helper classes directly under WEB-INF/classes folder. These file should come to a position like below:

please take a look at DummyBean node.

It may be because java files under WEB-INF/classes should be treated as under package WEB-INF.classes.*. The required structure for Web module is accomplished on deployment. You can select many Lomboz J2EE operation from context menu at the root of the module(package):

Sorry the project name differes from the first screenshot...
Anyway, if you select "Deploy Module", a folder would be created and required files are copied in the required structure, then it would be copied to Tomcat's webapp folder.

But when I opened the module deployed into Tomcat, I was surprised....

Oh? why F drive?

Not this time. I know my self-built Athlon64 machine shows F drive as the system partition. It's weird , so weird that my brogroll Rick gave me "Ouch!"for comment on it, but the machine still works. What I said Oh? for is a DummyBean.class file there. It wasn't sent to WEB-INF/classes folder?...

Ooh? why dist folder? files with dot-headded name? The deploytestmod folder should be package. When I open it...

Ooooh?

A infinite-looped or fractal-like strucure...but does have WEB-INF/classes/deploytestmod/DummyBean.class file. So it works. Though "It works, go for it!" is my motto, but it's too complicated...

Build file! The secret must be in the build file! It's because when I select Deploy Module there comes an ant in the IDE console.Below is the screenshot again, you will see build.xml under WEB-INF folder.

C

Opening an Ant nest, I could see the secret in the Target "init"...

Here is described the task fo copy files into dist directory as an Web module. Maybe I have to edit this part.

I know there is an Ant editor in Eclipse, but recently I have struggled with Ant in NetBeans4.0 for a long time, so I started up NetBeans.

I used its

powerful(but sometimes dangerous)"Favorite" window.

From here I will show operation in NetBeans. Right-click the root node and select "Add to Favorites"...

Then a file chooser appears.So select this Lomboz project under eclipse/workspace directory.

Then you could see ALL files contained in the Lomboz project. Open WEB-INF node to dispose the build.xml node.

Further you could see the targets written in this build file. Right-click the "init" node and select "Run Target".

Then the task is done, you could see "dist" node.

Oh, sorry, I have selected a wrong node. please take a look at dist node underward.

Opening it...oh, la la.

Many META-INFs, WEB-INFs, DummyBean.classes...Ah, it's sure the problem is hidden in the "init" target. I examine the descripsion and editted like below. For copying files just under dist folder...

I added an exclude against class files.

Then coping files under WEB-INF/classes folder. It's only to add excludes against one by one.

WEB-INF and META-INF folders.
Files with dot-headed name.
dist folder.
jsp files.

The reason not for selecting only class file is, you might need property files or other .This requirement would make the description a little complecated.

This is the editing as far as I could think out. I expect a simple Web application would work with it.The simplest one at present, running "init" target...

a dist folder was created in clearer structure. Yeah!

In this way it was find you should edit the build.xml . This build file is auto-created each time you create a Lomboz project. It is a very reusablly relative file so once you have the editted vertion then you only have to copy it to other projects...Mmm, but still not so efficient to copy and paste every time...

It must be the template in a plugin folder

was the next idea came to me.

Lomboz plugin consists of many plugin folders. Which to select?...the best way is,

Hi-yah!

Put eclipse/plugins folder on "Favorites" window and

Open every node

named "com.objectlearn...". At last,

Gotcha!

It is still read-only in an archive, So from here...Oh I long for older version of NB with more utilities...Now I have to use command propt window,

First of all, close Eclipse.

Then go down to eclipse/plugins/com.objectlearn.jdt.j2ee_3.0.1directory, where you could find lomboz.jar file.

jar -xf lomboz.jar

Wait! extracted directories will be scattered just there. After making lomboz directory, and copying the lomboz.jar to it. The original lomboz.jar is to be reserved , changing its name to e.g. bak-lomboz.jar.

Enter lomboz folder and command "jar -xf lomboz.jar".Then you will a real template file to be edited. Edit the content in two blocks, each between <fileset dir=...></fileset> tags.

Now compress this again. Move MANIFEST.MF file from META-INF folder to just under current directory, lomboz. Then command

jar cvfm ../lomboz.jar MANIFEST.MF *.*

Because lomboz.jar must be created outside the current directory, or this time we will really fall into an infinit loop. Option v, meaning report on processing, might not needed. Anyway, you could not chase a rapid stream of many reports. It's just for feeling the proceeding.

Then a new lomboz.jar would be created. The original jar or edited source folder are to be resereved somewhere. Restart Eclipse...

Now I get a customized build file in every Lomboz project. I have made it sure many simple Web apps, made of jsps and Beans, would work well.

So don't ignore NetBeans, friends, though you now use Eclipse. It's not only for Java programming, but also many bothering works around !