The DTP News and Views blog is Brian Fitzpatrick's (aka "Fitz") window on the world. Here you'll find information about what DTP is up to, articles on using DTP better, and how folks in the community are using DTP around the Eclipse-a-verse.
I saw Dave Carver's post about using MarkMail's indices of the Eclipse mailing lists and was inspired to take a look at the DTP mailing list to see if there were any trends. We seem to follow the same trend as WTP...
We seem to peak around the time of each year's release train, which makes sense, and then drop off a bit after that.
This helps to understand a bit of the adoption curve as was noted in the EclipseCon 2009 keynote "The Social Mind: Designing Like Groups Matter" (you can see the abstract here).
They showed a picture of Wikipedia contributions that looks somewhat similar to the graphs for WTP in Dave's post and this one for the DTP list. Initially there's a lot of contributions and conversation and it starts to drop off over time with only a few people doing the majority of the posting. In our case, the top 5 are all either Sybase or IBM folks, but it's heartening to see that at #6, we have Oracle represented and some of our friends at Actuate as well.
What does this tell us? Honestly not much more than we already knew, but it's good to have another metric. Thanks Dave for pointing out that Markmail is there!
If anyone's interested in the DTP-DEV stats, feel free to check them out here as well.
Now that we know generally what we want to do, we'll start by focusing on making the YouTubeAPIs usable in Eclipse and perform a simple test. Easy enough, right?
So the first thing I had to do was grab the YouTube jars from Google. I found those here. I grabbed the latest version of gdata-samples.java. The YouTube/Google APIs also have some dependencies, so I had to go out and grab imap.jar, mailapi.jar, pop3,jar, and smtp.jar. I was able to re-use a plug-in wrapper for javax.activation.jar from Orbit, which I'll talk about in a sec.
With all of the jars downloaded, I just had to create an Eclipse plug-in wrapper so they were available to other plug-ins. To do this is cake... Right-click in the Package Explorer, select New->Project, and in the list of Wizards select "Plug-in from existing JAR archives". Select your external jars (it will copy them into the plug-in wrapper). I named mine "com.google.gdata.youtube" and unchecked the "Unzip the JAR archives into the project" so it kept the jars as jars, not source code. Click Finish and watch the magic happen.
When it's done, I had to do one last thing to add a dependency. The Google APIs still depend on the javax.activation.jar...
Do you remember I mentioned the Orbit project? Well, you can read more about it here, but the idea is that it provides a repository for a number of third-party projects/resources that are shared across Eclipse. These have already gone through the IP process and are approved for our use. (Note however that even if a library is approved by the Foundation for use by all projects, project teams must still fill out a Contribution Questionnaire and notify the Foundation of their intentions to use a library). And there are quite a few of them. If you look at the latest build (from back in August 2008), you'll see 83 different packages available.
In this case, I just want javax.activation, so I locate it in the list, download it, and drop it in my Eclipse environment. Once the workbench picks it up, I can add it as a dependency in the MANIFEST.MF file for my wrapper plug-in.
Cool. So that pretty much wraps up my jar wrapper plug-in. Not too tough there.
So now what? Now that we have this plug-in, we can write a quick little application to do something with it.
I've gone ahead and created a simple class that does a very basic YouTube search...
public static String TR_FEED_URL = "http://gdata.youtube.com/feeds/api/standardfeeds/top_rated";//$NON-NLS-1$
/** * Return a list of video entries back to the calling method */ public static VideoFeed getResults(String author, String title) throws IOException, ServiceException { YouTubeService myService = new YouTubeService( "", //$NON-NLS-1$ ""); //$NON-NLS-1$
String VIDEO_FEED = TR_FEED_URL; YouTubeQuery query = new YouTubeQuery(new URL(VIDEO_FEED));
//set the author if( (author != null) && author.length() > 0) { query.setAuthor(author); } //set the actual query string if((title != null) && title.length() > 0) { query.setFullTextQuery(title); }
//choose most viewed as the ordering query.setOrderBy(YouTubeQuery.OrderBy.VIEW_COUNT);
//get the video feed VideoFeed feed = myService.query(query,VideoFeed.class); return feed; } }
So all that this really does is get a list of the top rated videos currently at YouTube. Pretty straightforward.
You'll notice a couple of things about the code. You have to have a developer key (your own ID as a developer or one for a particular company) and a client ID (seems you can have many of these). This basically lets the Google & YouTube APIs know that you're legitimately asking for data and aren't some rogue hacker trying to cause trouble. You can get these two items here. Once you have them, you can just create new constants for them and just use the constants.
So if you swap your developer key and client ID into the above code, it should do a quick search. But how should we test it?
I like creating new plug-in projects with example menu actions. To do this is pretty easy... Right-click in the Package Explorer, select New->Project, and in the list of Wizards select "Plug-in Project". Name it and set the plug-in ID and other info, and on the "Templates" page in the wizard, select "Plug-in with a popup menu." By default it keys off an IFile, so you can get to it from the Navigator or Project Navigator in the workbench.
It goes off and creates the basic code and you can then use your new utility class pretty easily by changing the run() method in the action class to look something like this:
public void run(IAction action) { try { VideoFeed feed = UTubeUtils.getResults(null, null); if (feed != null) { if (feed.getEntries() != null && feed.getEntries().size() > 0) { System.out.println("Found some videos..."); Iterator<VideoEntry> iter = feed.getEntries().listIterator(); while (iter.hasNext()) { VideoEntry entry = iter.next(); System.out.println("Video Entry: " + entry.getTitle().getPlainText()); } } // clean up feed = null; } } catch (ServiceException se) { se.printStackTrace(); } catch (IOException ie) { ie.printStackTrace(); } }
When you run the workbench and right-click on your action in the Navigator, you should see something like this in your development workbench console view...
Success! We have a plug-in wrapper for our YouTube jars and their dependencies. And we've verified that we can use those APIs in an Eclipse environment.
Next we have to figure out how to hook up YouTube to DTP and show a video in the workbench. And after that we can fine tune our look and feel to make it easier for our users.
Maybe this was a bit longer to write up than I'd thought originally, but this part of the process only took me about half a day when I was creating this code the first time.
Questions? Comments? Drop me a note here and I'll be happy to get back to you.
Next time I'll write about hooking up YouTube and DTP and how I used the built-in Eclipse web browser UI component to show videos.
On the DTP newsgroup we had a question about using DTP APIs to create a new transient connection profile and then use that to execute some DDL...
It's pretty easy actually... The trick for the transient profile is knowing all the bits and pieces you have to have ahead of time, like the:
provider ID, which is the connection profile type ID
vendor and version, which relate to the vendor/version of the database you're connecting to
and then the driver path. Note that you can also use a pre-defined driver and get the DriverInstance from the DriverManager, then retrieve various properties like the vendor, version, class name, and driver path from there
So one of my presentations at EclipseCon 2009 was "DTPtv and Other Wacky Ideas."
Was this truly a wacky idea? Probably. Who would have thought to merge Eclipse, YouTube, and DTP in one go?
My goal was two-fold... First, I wanted to show that DTP can be used for something more than just databases. Far too often we're pidgeonholed as a provider of database tools. And though we do that, we do much more as well. Second, I wanted to do something out of the usual box, and YouTube is pretty dang far out of the box...
Create a YouTube Search connection profile in DTP so you could create and manage multiple searches in a variety of ways.
Create a viewer that would allow a user to take advantage of YouTube searches on the fly and see the results within the Eclipse IDE or in an RCP application.
Now why would you want to do this you might ask? Good question.
Let's say you write Eclipse RCP applications for a company with a healthy education department. They want to help out beginning users by recording tutorials and putting them up on YouTube. Not only will it help your users, but it works as a bit of helpful marketing for your sales staff. And now that they're doing this, they want a way to be able to take advantage of these YouTube videos right inside the application.
Maybe this isn't so far fetched after all?
In the next series of blog posts, I'll focus on the three steps I took to get this all working. I demoed working code at the conference and will clean it up a little, zip it up, and have it available on a file sharing site soon. I hope to also contribute it back to the Examples project at Eclipse, as it crosses project boundaries.
As always, please feel free to ask questions or make comments as I go through the process. Many of you will find this old hat, but I'm hoping someone can take advantage of the information. :)
I'm still in the process of getting my act back together after EclipseCon 2009 last week in Santa Clara, California. Was a great conference as per usual, and a bit of an eye-opener for me at least as far as the excitement (or lack thereof) for DTP in the conference community.
First, let me say that I am very excited about Amazon's announcement about the AWS Toolkit for Eclipse. Eclipse in the Cloud is a very cool concept and one that I think will prove to be fertile ground for all sorts of interesting applications. The exciting part for me was hearing that the AWS Toolkit team is still looking at using DTP to help them integrate with their SimpleDB database in the Cloud in a future release of the toolkit.
Anything we at DTP can do to help with that effort would be very educational and cool for us. And as always, we'll help wherever we can. :)
Second... There were a TON of great talks at EclipseCon this year. Though E4 seemed to get most of the buzz, I think that runtime talks were running a close second. After attending a number of talks in all parts of the spectrum (business, coding, new tools, and so on), I came away with a ton of cool ideas I'd love to explore if time allowed. Things from exposing DTP as OSGi services, to using the Data Binding APIs, to using Zest to possibly help to visualize a database schema and other things. I have a loooong list of things to explore.
And third, I was bummed about the lack of interest in our DTP talks this year. We had a few people show up at the DTP tutorial on Monday, and I had a few people at my DTPtv talk, but we ended up with an empty room for our set of short talks at the end of Thursday.
Now, I know that DTP is really more of a "plumbing" project and I get that plumbing isn't sexy. But when people put time and effort into creating presentations (and in one case fly from Germany to present), it's disappointing that nobody wanted to listen.
Yes, there were probably extenuating circumstances. I know that many people left the conference early to catch flights and there were other talks that were probably much more exciting (I missed John & Max's talk in the same slot and would have liked to attended). But still...
Even with that bummer deal, I still think it was an excellent conference. Scott Rosenbaum and the program committee (of which I was a very very minor part) did a great job recruiting amazing keynotes and cool folks to come talk about their technologies. And as I said, I came away brimming with ideas for DTP.
So maybe next year will be a better year for DTP... Who knows?
I'll be writing up one or two more posts about my EclipseCon experience this year, including a post about my DTPtv talk, which (though it went short), I had a great time doing.
Thanks to everybody involved in the conference this year. Let's do it again next year!
We would love to know how you are using DTP -- either as an end user, an adopter, or an extender. Tell your story via the DTP mailing list or newsgroup!