Welcome to Planet Eclipse

September 08, 2008

Annamalai Chockalingam
Annamalai Chockalingam

Database Development in Eclipse with the Data Tools Platform (DTP)

What is DTP
The Eclipse Data Tools Platform (DTP) is a standard Eclipse plugin that you can use to perform most database development and query functions. The DTP plugin supports several database platforms via JDBC, including Derby, Oracle, MS SQL, Postgres, Sybase ASA, Flat Files, XML Data, Web Services, and more. This post covers connecting to MySQL and basic DTP features.

Requirements
Eclipse Europa(3.3) with inbuilt DTP 1.5
Mysql JDBC connector preferably Connector java 5.1
Mysql version 5.0, it allows both local and remote access of the database.


How to Create Connection Profile




1.Select File > New > Other
2.Expand Connection Profiles and select Connection Profile, Next >
3.Select JDBC Generic connection, Next>>
4.Name the connection profile For ex..Sample
5.Click on the Browse icon and select the required driver,
(Here Im using the MySQL JDBC Driver5.0)




6.Give DB password, save it if you prefer. Finish>>
7.Now its all set ready to ping the database.


Creating a table using DTP

1.Select database > right click > connect – Now the database is connected
2.Expand the left pane >right click on table you have created



3.Select new table>next >name the table>Add column and rows as you wish>Finish to create a table.
4.Now the table is created, to alter table or insert values.
Select the table name on the left pane>Click on the “Generate DDL” and use SQL query to do alter, delete, drop,.
Some useful links/References

http://www.eclipse.org/datatools/downloads.php
http://2tbsp.com/node/86

Regards

Imran

Ian Skerrett
Ian Skerrett

September 07, 2008

Tonny Madsen
Tonny Madsen

Shaping up for the Autumn :-)

Autumn is comming and with that many of us will be busy with training, mentoring and whatever we do for a living.

In order to get in shape for the Autumn, we participated in the largest fun run the DHL Relay in Copenhagen. 21000 teams with 5 runners each running 5 km in the middle of Copenhagen! The relay takes place over 5 days and just about every company in the Copenhagen area participates. Some with just one team and some with several hundred teams.

Most of the teams, ours included, combine the running with a good dinner afterwards.

The next runs are in 2 weeks (10 km) and in four weeks (13 km)...

And then we hope to be in shape for whatever the Autumns brings...

Abel Muino
Abel Muino

Wassim Melhem
Wassim Melhem

Eclipse Over Spain

Lost in Spain

During my recent Lost in Spain™ vacation, I visited Mallorca, Spain's largest Balearic island. Mallorca is home to tennis royalty (Rafael Nadal), Hollywood royalty (Michael Douglas and his young wife) and the summer home to Spain's royal family.

Mallorca is also the home to an old friend Emil, a mechatronic engineer living in the beautiful city of Palma. When I walked into his office, I expected to see a desk covered with electronic equipment, but I was certainly surprised to see an Eclipse application running on his monitor.



Eclipse and Mechatronics


So how is Eclipse used in Mechatronics on a Spanish island? Let's break it down.

Emil is developing a rich client application that communicates via CAN-bus with a range of electronic sensor/actuator control devices using a USB-CAN adapter.

With this application, he can monitor the states/errors, remote-control actuators and change the setting of each installed device. He can also send, read and verify the firmwares of all devices. The number of the control devices can reach 8000 in one installation.


Living La Vida Loca

It was very cool to see Eclipse being used on a daily basis in mechatronics. However, as soon as I realized that I was discussing Eclipse on my vacation, I stormed out of his office and enjoyed a street dance :)

September 06, 2008

Ed Merks
Ed Merks

Meandering Down the Garden Path

I was just telling Amber and Ruby about the spaghetti incident. Amber couldn't believe letting perfectly good leftovers go to waste while Ruby misunderstood thinking there might still be some available. Sorry girls waste not want not isn't everybody's style.


As a little diversion, I thought I'd lead you down the my garden path. Things are late this year but it's prettier than ever.


Ruby likes to jump right in!


Isn't the garden path inviting? See what you're missing Ralph?


I still remember when we first moved here in 1999 and had a scale model of the back yard drawn out on grid paper; the yard was devoid of a single living thing at the time. The neighbor looked at it and asked "don't you have the grass and the beds backwards?" Um, no, I don't think so. "Oh well, it will never actually look that way," he follows up. Well, you know something? It doesn't usually pay off to underestimate me. What does pay off is to model it first. Ruby fancies herself a model.


She's been told she's pretty, smart, and sweet a few too many times I think. But telling her she's as pretty as a pink sunflower is just over the top.


Her little ego is getting swollen, so I'd better tone it done. Just keep in mind that the things you imagine can be realized if you set your mind to them. You just need to follow the right path...

Ketan Padegaonkar
Ketan Padegaonkar

SWTBot Proposal at Eclipse.org

SWTBot has been proposed as an eclipse project.

Everyone is invited to comment on and/or join the project. Please send all feedback to the SWTBot newsgroup (web link).

See you all there.

September 05, 2008

Ian Bull
Ian Bull

GWT and OSGi

A number of people have asked me how I configured GWT and OSGi. Some detailed steps are available here, however, following wiki pages is not always the easiest thing. I have created a small "hello, world" example. You can get the projects here.

To use this, simply import the zip file into eclipse: (File->Import, select Existing Projects into Workspace).



Once it is imported, you should have 3 projects in your eclipse workspace:
The GWT project is simply the GWT jars wrapped in a bundle.

The client project is the client side code, and the server project is the servlet we use (it simply returns the word "World" to complete Hello, World.)



I have included an external tool to compile the client side code. Make sure you select com.example.gwtclient ant_build.xml in the external tools list.



After this runs, you should refresh your workspace (press F5). Under the com.example.gwtclient you should have www directory.

Finally, you can use the provided launch configuration to actually launch OSGi, the Jetty engine and the servlets. To do this, go to Run Configurations..., and select GWT Example Launch.



This will launch the Jetty server on port 80. If you want to change this, go to the Arguments tab and set -Dorg.osgi.service.http.port=8080 in the VM arguments.

Once running, simply hit: http://localhost/index.html



If anyone is interested, we could extend this and make it part of the Eclipse Examples project. However, there may be some licensing issues as it currently includes the GWT jars.

Dave Carver
Dave Carver

Spaghetti vs The Garbage Disposal

Well, here is something I learned. Don't take left over spaghetti and try to use the garbage disposal to get rid of it. You end up with a bunch of chopped up spaghetti sitting in your pipes, and it loves to absorb water. Thus causing a nice big backup, that takes about 3 full bottles of Drain-O to eat it away. Oh and yes, I did try the plunger and plumber's snake, it fought back and reclogged a day later.

Boris Bokowski
Boris Bokowski

Simply models

I have been working on a small demo application that (when finished) is meant to be an exemplary RCP-style desktop application based on e4. This is how it looks so far:



There is a very simple navigator on the left, a thumbnails view, and a preview area.

As I wrote the application based on Eric's and Tom's work, I started by implementing a couple of views that I contributed to the new e4 Workbench through an extension point.

Then I realized that all I need is an EMF model representing the parts that make up the UI: the views, the menu, and the toolbar. I don't actually need any extension points, because my application is not an extensible IDE - it is a rich client application for which I know how the UI should be structured. I am pretty happy about the end result - my application is fully described by one XMI file that I can edit using an editor for EMF models, and I can just go and modify that file if I want to rearrange views, add new ones, delete unnecessary ones, build my menu structure and so on.



Compare this to how it works with the current 3.x Workbench: I would have to write a perspective extension, a couple of views extensions, a command extension, a menu and a toolbar extension. Then I would have to assign unique IDs to all these pieces, and to ensure that IDs match up properly. How many hours we've wasted in the past when IDs did not match up!

Of course, this only works for closed applications, not for open and extensible ones like e.g. the Eclipse IDE. However, it is still pretty useful to be able to reason about a concrete EMF model representing the UI application structure. For example, when you have lots of little pieces contributed by many plug-ins, we can now talk about what it means to produce that concrete model from the many little pieces. One interesting question based on this is: Can we maybe generalize the many ad-hoc mechanisms we have grown over the last years (most of which involve matching up IDs) to something that is less ad-hoc and more general?

It's been fun to work on this little application so far. If you would like to participate, let us know on the e4 mailing list, and/or attend the bi-weekly e4 conference calls. You can always email me directly, of course.

P.S. The code is available in CVS - check out the ui/demos project under /cvsroot/eclipse/e4-incubator to get the launch configuration and project set file (emf-workbench.psf).

Mike Milinkovich
Mike Milinkovich

Atta Boys (and Girls)

Bjorn and guests have been blogging about the results of the recent committer satisfaction survey at Eclipse. I think that the survey itself embodied genius in its simplicity: one question on “…how happy are you with the Foundation’s support of you and your project?”

As the Executive Director, I am pretty thrilled with the response, as 82.5% are on the “happy” side of the equation. That’s a darn good result.

Of course, there is always work to do and improvements to be made. You can see those thoughts well reflected in the comments that Bjorn gradually worked his way through in his blog series. The good news is committers are generally pretty happy with the IT infrastructure and the support they get. Unsurprisingly, they are a little less happy with the processes that we impose on them. There’s a shock! :-)

To all of the staff at the Eclipse Foundation, I want to extend a hearty congratulations. I know that as the pointy haired boss I rarely say “thank you” enough for the great work that you do. So here are a few thank you’s, along with my personal favourite quotes from the survey.

To Denis Roy, Matt Ward and Karl Matthias: You are obviously taking customer service seriously and it is being noticed by our community. Thanks

Very happy, especially with the fast response time of the webmasters

To Bjorn Freeman-Benson, Anne Jacko and Gabe O’Brien: The development process and portal have come a very long way over the past year and your work is helping to improve our committers day-to-day interactions with the Foundation. Thanks!

The development process is well thought out. I also _really_ like the portal.

To Janet Campbell, Sharon Corbett and Barb Cochrane: You bear the brunt of running our IP due diligence process. A process which clearly puts a burden on our committers, but one which has been an enormous part of our community’s success. And you do it with grace and humour. Thanks!

Their’s is a tough job and, in my opinion, they do it very well

Ed Merks
Ed Merks

Open Collaboration on E4

Nearly as exciting as the schools of 200 cardinal tetras and 100 rummy nose tetras I added to my tank the other day was the meeting I just had!


At yesterday's e4 call, Boris offered to review the modeled workbench prototype he, Tom, and Eric have been working on. Getting early feedback is always valuable. We hooked up on skype, for free, and figured out how to screen share using Yugma, for free, so we could freely collaborate on software that we're going to give away for free; I wonder if that makes us freetards? I like to think of it as thrifty and generous, though I've been accused of having a distorted view of reality; but I digress.

Once we got over the technology hurdles, we called up Tom and Michael and started the show. What you're seeing here is a simple "Photo IDE" application in the navigator, where the structure of the workbench is modeled using Ecore, an instance of that model is open in the editor, which is then used to initialize the running application shown on the right.


Boris demonstrated how changes to the model are reflected in the structure of the application when it is launched. He also showed how cool it could look with some styling applied to it. The styling stuff isn't available yet, but is in the works:


He even showed how he easily integrated a view that displays the map location for the GPS coordinates of the selected photo:


Too cool hey? We had lots of interesting discussions and ideas for what to do next. It's very exciting to see this all unfold live and in person! I'm surprised more people didn't take up Boris' offer.

What's being done with e4 relates closely to some of the model-based work Michael is doing, so he took the opportunity to demo a few of the things he's working on. He's got this funky model that lets him rapidly configure how a table displays data in various fancy ways.


He complained a little bit about EMF's viral nature but I remained silent while my nanite servants actively reshape his thinking. When all his models have been integrated with the collective, he'll be convinced that it was a good viral infection.

It's cool that four people, from four different oranizations, in four different cities, on two different continents can get together to collaborate freely for free. Isn't life grand!

Konstantin Komissarchik
Konstantin Komissarchik

Designing API for fragile content

Just as with any other profession, programming involves quite a bit of monotonous and repetitive work. Interesting problems do come up, of course, but not so frequently that encountering one always brings a smile to my face. One of my deep interests in the programming profession is API design, so it would be fair to say that when I recently encountered a tricky API design puzzle I got pretty excited.

So I was tasked with building a forms-based editor in Eclipse for an XML file with a certain schema. I started out by extending the XML source editor that's part of WTP. That gave the source view tab for my editor and I could access XML DOM that the source editor exposed. Any changes I made to the DOM would propagate to the source buffer. That's a pretty good start, but I did not want my forms UI working directly with DOM. I don't know if DOM API has any fans, but I am certainly not one of them. I didn't want my UI code getting cluttered with it. Ok, easy enough. Just take DOM and wrap it in API custom-created for the schema.

Many of the elements in this particular document schema are tightly-typed. There are integers, class names, file paths, etc. My first cut at the API used these types in the getters and setters...

Integer getMinDuration();
void setMinDuration( Integer minDuration );

That works well enough when content is well-formed, but this is an XML file that's edited directly by users. Handling of malformed content is very important. Let's say that the min-duration element is found, but it's content cannot be parsed as an integer. The only option that the above API left me was to return null. That might be acceptable in some cases, but it's produces a rather poor user experience in the context of an editor. The text field that would be bound to this property would be blank, forcing the user to either type in a new value or revert to the source view in order to fix the existing value. What I wanted to do is show the malformed value in the text field together with a problem decoration so that the user can see and fix it easily. Ok, so let's augment the API a bit...
Integer getMinDuration();
String getMinDurationUnparsed();
void setMinDuration( Integer minDuration );
void setMinDuration( String minDuration );

That's better, but min duration has a default value and only positive integers are valid. A bit more API augmentation was in order...
Integer getMinDuration();
String getMinDurationUnparsed();
Integer getMinDurationDefault();
void setMinDuration( Integer minDuration );
void setMinDuration( String minDuration );
IStatus validateMinDuration();

Now I had enough information in the API to build the UI that I needed, but the API was starting to smell a bit. That's six methods for one element in the schema that has dozens of elements. There has to be a better way to structure this API. After some head-scratching, I decided to try returning a surrogate object from the getter method instead of the actual value. The surrogate would handle parsing, default values and validation...
IntegerValue getMinDuration();
void setMinDuration( Integer minDuration );
void setMinDuration( String minDuration );

class IntegerValue
{
    String getString();
    String getString( boolean useDefault );
    Integer getParsedValue();
    Integer getParsedValue( boolean useDefault );
    IStatus validate();
}

The getMinDuration() method would always return a non-null surrogate object. The caller then decides what aspect of value they are interested in querying. The IntegerValue class supplies default validation logic for handling unparsable content, but additional validation can be added. For instance, in this case only integers greater than zero are valid. Since range is a pretty common constraint, I made the IntegerValue constructor take the min and max values (in addition to the raw string value of the property and the default value). More complicated validation scenarios can be handled by subclassing the IntegerValue class.

Note that only the getter deals with surrogate object. I wanted to keep the surrogate objects immutable so that they can be handled in a manner similar to basic value types without worrying about synchronization. When setting a value, you either have a raw value (either it can't be parsed or the code in question doesn't want to deal with parsing it) or you have a tightly-typed value. An overloaded setter method takes care of both of these scenarios.

As you can imagine, it was simple at this point to extend this pattern to other types. I created a base class for all value types, which made it possible for some code to handle variety of types without knowing what they actually are. A good example of this is text field data binding code. Since any value can be retrieved and set as a string, any value can be bound to a text field.
abstract class Value<T>
{
    String getString();
    String getString( boolean useDefault );
    T getParsedValue();
    T getParsedValue( boolean useDefault );
    IStatus validate();
}

class IntegerValue extends Value<Integer>

{
    ...
}

I actually ended up using the same pattern even for properties that were strings by creating a StringValue class. Even though there is no parsing involved, the benefit of having consistent access to default value handling and validation made it worth it.

So what do you think?

Eugene Kuleshov
Eugene Kuleshov

On Maven support in MyEclipse

I was very excited when I discovered that Genuitec used Maven Integration for Eclipse (m2eclipse) code in their Maven4MyEclipse product. Unfortunately my excitement quickly faded away after following MyEclipse support forums. Jason wrote more detailed blog about it:

How did Genuitec get their Maven integration so wrong? I really think it is a lack of foresight in cooperating with a project that has a very strong community and doing pretty poor product planning. They obviously didn't talk to many of their customers about Maven integration as you can see from litany I've collected below. I think the integration of Maven in MyEclipse can be considered a complete flop by MyEclipse users. Hopefully the next time around Genuitec will make an attempt to communicate more with the Open Source community which they are trying to leverage and do a better job of listening to their customers...
In m2eclipse we provide a number of extension points to support 3rd party integrations. In particular, the project configuration framework allows integrators to stitch Maven configuration used in the command line build with vendor-specific tools configuration in Eclipse. This framework has been used to implement integrations for JDT, AJDT and WTP tools and it should have been used by MyEclipse as well. It is disappointing to see the lack of communication or any feedback from the MyEclipse team, which in result hurts their own users.

Given the recent event of Genuitec joining Eclipse Strategic Membership, I really hope that this situation will improve in the future and we will see some communication from them and maybe even see them contributing features back to the open source technology they are using.

In a mean time, to allow MyEclipse users to continue using full power of m2eclipse, we created special update site that will disable Maven4MyEclipse and replace it with stock m2eclipse. http://m2eclipse.sonatype.org/update-maven4youreclipse/.

Kevin McGuire
Kevin McGuire

CTabFolder, grow a skin buddy

On our E4 quest for a skinnable UI, tops on my hit list is CTabFolder. Presently that curve is carefully represented by an array of integer pairs, which are interpreted as a polyline draw.  Fast, but extremely fragile.

The problem is that that curve is a really strong branding element of Eclipse. This was done on purpose to great effect. But now in the world of RCP applications, its too restricted.  Its somewhat comical that you can spot an Eclipse application at 2o’ just by looking at the layout (skinny tall left, wide middle, skinny talk right) and those darn tabs.

We should consider a new ETabFolder that takes bitmaps, presumably 8 in total: 4 for each corner, and tile’able sides top\bottom\left\right so the tab length\height can grow.

And of course, the bitmaps would be supplied via CSS :)

Bjorn Freeman-Benson
Bjorn Freeman-Benson

Your opinions re the webmasters (8 of 8)

Today's "your written opinions" topic is your love of the webmasters. I'm very happy to end this series on such a high note: Denis, Matt, and Karl are clearly doing all the right things. I will let your comments speak for themselves - remembering that "4" is the highest score possible and "3" is the second highest, here are all the written comments about the webmasters:

  • 4: Very happy, especially with the fast response time of the webmasters (Denis in particular).
  • 4: The infrastructure is excellent, and the IT staff is helpful. The development process is well thought out. I also _really_ like the portal.
  • 4: Continuous improvements are being noticed. Foundation is not resting on laurels.
  • 4: Happy is simply not a high enough acjective to express my satisfaction with the Foundation and everyone I have met and worked with to date. Whatever you are doing, keep it up.
  • 4: Denis and his team are just awsome! I also admire Janet, Sharon, Lynn, Mike, Bjorn, and all the others for how well they do their job with incredibly good response times.
  • 4: currently i was moving my bugzilla accounts an committer rights from email addy to another... the help from the webmaster was quick and insightful.
  • 4: help desk (denis and team) is great!
  • 4: There have been considerable and steady improvements in committer support over the past year.
  • 4: Availability of infrastructure is quite good. Any infrastructure issues/downtime are normally communicated beforehand, so that I know what is going on. Staff response time in case of special requests is very quick.
  • 4: I never have to think about the server infrastructure; I can take it for granted. Foundation staff are very responsive and always consistent in their dealings with the community.
  • 4: Thanks for everything!
  • 4: Favorable response times when dealing with IP issues and the IT staff has always communicated well (AND THEY HAVE A GOOD SENSE OF HUMOR!)
  • 4: Very happy with the support and timeliness of responses to questions.
  • 4: The webmasters have been very supportive. The project summary / metadata has made it easier to manage project status.
  • 4: Eclipse support is great!
  • 4: Very good and fast support. :)
  • 4: The eclipse team is awesome. In my 2+ years of working with the foundation I have found the support outstanding and the infrastructure very reliable.
  • 3: Overall, I am happy but there are times that responses from the webmaster or legal are slow (e.g. several days).


17 "happy"s and 1 "mostly happy" - nobody else even came close. Wow! First prize for sure!

SOA Tools Team
SOA Tools Team

BPMN modeler sub-project proposal first draft is available