I've recently began helping with large project at work. The project contains a very large codebase, and in working through all the pieces, I thought, "I wish I could just bookmark some of these locations, so that I could return to particular areas later on". This thought hit me after I spent about 10 minutes trying to find a piece of code that I knew I visited earlier in the week.
It appears that I didn't have to look far for a bookmarking feature. I use Eclipse, and the great folks on that project have already thought about this. To bookmark a section of code, simply right click in the left hand margin of the code editor, and you'll see an "Add Bookmark..." link. Click it, and you will create a bookmark in the code that you can then use to quickly jump back to that location.
You'll also want to add the "Bookmarks" view to your perspective as well. Simply click Window -> Show View and enter Bookmark. Then add that view.
Bookmarks isn't something that you'll need/want when you are browsing your own projects, but it can certainly save time when you are browsing code in a larger project that you are not yet familiar with.
Bookmarking... It's a good thing. (Sometimes)
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Wednesday, February 4, 2009
Sunday, December 14, 2008
Batch Metadata Tools gets Custom Content Proivder
As of version 1.12, the Batch Metadata Tools now has a "build your own content provider". This new feature, called a CompositeMetadataProvider, is basically a way to compose or build a new content provider from 2 other content providers, using only configuration.
For example, you can create a new content provider that uses the IMDB provider to search, but then uses themovidedb.com provider to fetch the details and thumbnail information. You can also configure which fields from the search provider that you want to use instead of those in the detail provider.
This new composite provider model may be a little tricky to understand at first, but it opens up some great potential to pull content from multiple sources when fetching metadata information.
For example, you can create a new content provider that uses the IMDB provider to search, but then uses themovidedb.com provider to fetch the details and thumbnail information. You can also configure which fields from the search provider that you want to use instead of those in the detail provider.
This new composite provider model may be a little tricky to understand at first, but it opens up some great potential to pull content from multiple sources when fetching metadata information.
Saturday, December 13, 2008
Batch Metadata Tools gets new Metadata Provider
Last week I applied for an api_key for themoviedb.com for the Batch Metadata Tools project, and it was granted. Then within a couple of hours, I had the full integration with themoviedb.com complete.
Their api is really simple. It mainly consists of two commands; Search and GetInfo. The search takes a single search argument and returns a list of matches, and the get info command will return back the complete movie information for a given match. Simple and easy.
Batch Metadata Tools is now at version 1.11, and you can red more about how to use this new provider in the project wiki.
About Batch Metadata Tools
The Batch Metadata Tools project is a small java project that provide movie information and cover art for movie files. Currently it's used within the SageTV community for fetching movie information when you import a large collection of movies. Although it is currently used for SageTV, it supports a pluggable output provider, so that it could be used to read/write other formats.
Currently the Batch Metadata Tools has search providers for IMDB, DVDProfiler, and themoviedb.com.
Their api is really simple. It mainly consists of two commands; Search and GetInfo. The search takes a single search argument and returns a list of matches, and the get info command will return back the complete movie information for a given match. Simple and easy.
Batch Metadata Tools is now at version 1.11, and you can red more about how to use this new provider in the project wiki.
About Batch Metadata Tools
The Batch Metadata Tools project is a small java project that provide movie information and cover art for movie files. Currently it's used within the SageTV community for fetching movie information when you import a large collection of movies. Although it is currently used for SageTV, it supports a pluggable output provider, so that it could be used to read/write other formats.
Currently the Batch Metadata Tools has search providers for IMDB, DVDProfiler, and themoviedb.com.
Monday, October 6, 2008
Java 5 Features - Part 1 - Formatting
I've been using Java for a long time, and one of the first comments I made about Java, when I switched from C, was "Where's printf?". Most people will never need to use printf, and in the few cases that you need to format something, you can use Java's MessageFormat class, at least that's what Java enthusiasts would have you believe.
As you may know, Java 5 introduced the printf() function. Even though I knew it was there, I still resisted using it until recently. And now, I can't imagine not having it. I don't know why I resisted using it? I used Generics as soon as it was availble, but printf() just eluded me, even though I found it to a great function in C.
I may be one of the last people that still write command line applications. I like command line applications, and a well written command line application can support a gui, if needed. But, command line applications require a lot of printing to the console screen. In java, this resulted in a lot of ugly code like
But using printf, you can clean that up a little....
I don't suggest that you abuse the printf function, but know it's there. Also know that the String function has a static method for using printf formatting. This can be handy at times when you need to log a lot of data in a single line, or if you need to simply format a String for some reason.
For example,
or
The whole printf function can do a lot of pretty complex formatting, so check it out, and the next your are printing messages to the console, just maybe you'll use printf().
As you may know, Java 5 introduced the printf() function. Even though I knew it was there, I still resisted using it until recently. And now, I can't imagine not having it. I don't know why I resisted using it? I used Generics as soon as it was availble, but printf() just eluded me, even though I found it to a great function in C.
I may be one of the last people that still write command line applications. I like command line applications, and a well written command line application can support a gui, if needed. But, command line applications require a lot of printing to the console screen. In java, this resulted in a lot of ugly code like
System.out.println("Unable to open File: " + file.getAbsolutePath() + " for writing. Please check permissions.");
But using printf, you can clean that up a little....
System.out.printf("Unable to open File: %s for writing. Please check permissions.", file.getAbsolutePath());
I don't suggest that you abuse the printf function, but know it's there. Also know that the String function has a static method for using printf formatting. This can be handy at times when you need to log a lot of data in a single line, or if you need to simply format a String for some reason.
For example,
log.debug(String.format("The Process: %s took %sms to run.", process, time));
or
String msg = String.format("%-20s: %s", cmd, description);
The whole printf function can do a lot of pretty complex formatting, so check it out, and the next your are printing messages to the console, just maybe you'll use printf().
Java RPC for SageTV
I released a Java RPC library for SageTV. Sometimes, I find myself needing remote access to SageTV to do things that are just not convenient to do from the SageUI or the web server interface.
Initially the small project started out as a part of the GUI redesign of the Batch Metadata tools that I released earlier, but I thought it would be useful in other cases. (The GUI redesign is not released yet, but it's getting there)
The API is completely generated from the public SageTV javadoc, so it is complete. Also, the API enables you to write code and then choose to either embed it in SageTV or run it externally.
An example use of this api would include... Write a small Java utility to find all Watched TV Shows and then move them to an archival area. Or, on a nightly basis, find all HD recorded shows and transcode them into SD so that your SD MVP extenders can play them as well.
Both the client and the server are included in the same small jar (~70k), and the client will attempt to automatically find the running RPC server, so it should be zero configuration from the client side.
I hope the API may be of use to people that want to write java applications that interact with SageTV.
Initially the small project started out as a part of the GUI redesign of the Batch Metadata tools that I released earlier, but I thought it would be useful in other cases. (The GUI redesign is not released yet, but it's getting there)
The API is completely generated from the public SageTV javadoc, so it is complete. Also, the API enables you to write code and then choose to either embed it in SageTV or run it externally.
An example use of this api would include... Write a small Java utility to find all Watched TV Shows and then move them to an archival area. Or, on a nightly basis, find all HD recorded shows and transcode them into SD so that your SD MVP extenders can play them as well.
Both the client and the server are included in the same small jar (~70k), and the client will attempt to automatically find the running RPC server, so it should be zero configuration from the client side.
I hope the API may be of use to people that want to write java applications that interact with SageTV.
Thursday, September 18, 2008
Media Center / PVR Concept
Recently, I had an idea for an open concept Media Center and PVR. This concept includes a 3 tier system consisting of a Front End, Application Server, and Backend.
The First Tier
The Front End consists of an Html/Css/Javascript rendering engine combined with a media player. WebKit and Mplayer would be a good choices for this, since both can already be ported to different hardware, including PCs and low powered devices.
Using Html as the front end seems like a logical choice since there is a large pool of existing web developers that are familiar with technologies. The Front End engine will also require a robust media player engine such as mplayer or vlc. Html pages can embed video windows into their pages, as when displaying the Guide data, or play fullscreen, when watching regular TV or movies.
The Html UI itself would have several common branded UI elements, such as input boxes, tables, buttons, etc, and Application Designers would be encouraged to leverage those UI elements so that themes would would work with their custom applications.
The Second Tier
The second tier would be an Application Server. My choice for this, because I use java, would be to use Tomcat or Jetty as the server. The server's role would be to serve up resources to the Front End and to handle Rest services. The Server, since it is a standard Application Server, can host any number of custom, server side applications. The applications would be deployed to the Server and then accessible to any of the clients. There would be a well defined set of restful services that would define the core interactions between the Client and the Application Server.
Two standard applications that would be deployed on the the Server would be a Media Center application and a PVR Application. These 2 core applications would simply be pluggable proxy applications that proxy Front End requests to the Back End. For example, the Frond End may send to a request to the Server for a list of all movies in the Media Center. The Server would dispatch that request to one or more Backend plugins, and send the formatted results to the Front End. The Server, in this case, would accept plugins for different Back Ends, and the server could, in theory, utilize multiple backends or different types. Examples of backends, could include MythTV or SageTV.
When media is being streamed to the Client, it would either do so via a proxy service in the Application Server, or the Client would play the Url directly from the backend. Using this model, if a back end can support exporting a media streams over http, then it can elect to have its stream read directly by the client. In the case where the back end cannot export it's media stream over http, then the proxy application in the application server would provide an http stream to the client. But, even if a client is receiving a stream directly from the backend, it would still be required to send its commands via the application server. In order words, the backends are media exporters only, and should not be interacted with directly from a client.
The Third Tier
The third tier is the Back End. As mentioned above, a back end would probably consist of using MythTV, SageTV, or some other extensible PVR/MediaCenter that is already well established. By using an existing backend, as a plugin, the user is not locked into any technology, and they can move between different backend solutions. This may not be an attractive feature to backend providers, but it is an attractive feature to consumers.
Keep in mind, the concept here remains the same, no matter what the actual technology that is used. The concept is an open media center consisting of 3 tiers; Html Frontend, Application Web Server, and PVR Backend. I've chosen Java as the preferred Application Web Server, but in reality, it could be any open web server technology.
Pros and Cons
Pros
I own a number of small embedded devices, such as the MVP and HD-100. At some point, I'd like to play around with seeing how well these devices could handle a WebKit rendering engine and see if this idea could actually come to life on these devices. I know some people have played with the MVP and have used it as a front-end to ReplayTV and MythTV. My challenge would be so see if WebKit could actually run on these devices and be usuable as a MediaCenter/PVR front end.
The First Tier
The Front End consists of an Html/Css/Javascript rendering engine combined with a media player. WebKit and Mplayer would be a good choices for this, since both can already be ported to different hardware, including PCs and low powered devices.
Using Html as the front end seems like a logical choice since there is a large pool of existing web developers that are familiar with technologies. The Front End engine will also require a robust media player engine such as mplayer or vlc. Html pages can embed video windows into their pages, as when displaying the Guide data, or play fullscreen, when watching regular TV or movies.
The Html UI itself would have several common branded UI elements, such as input boxes, tables, buttons, etc, and Application Designers would be encouraged to leverage those UI elements so that themes would would work with their custom applications.
The Second Tier
The second tier would be an Application Server. My choice for this, because I use java, would be to use Tomcat or Jetty as the server. The server's role would be to serve up resources to the Front End and to handle Rest services. The Server, since it is a standard Application Server, can host any number of custom, server side applications. The applications would be deployed to the Server and then accessible to any of the clients. There would be a well defined set of restful services that would define the core interactions between the Client and the Application Server.
Two standard applications that would be deployed on the the Server would be a Media Center application and a PVR Application. These 2 core applications would simply be pluggable proxy applications that proxy Front End requests to the Back End. For example, the Frond End may send to a request to the Server for a list of all movies in the Media Center. The Server would dispatch that request to one or more Backend plugins, and send the formatted results to the Front End. The Server, in this case, would accept plugins for different Back Ends, and the server could, in theory, utilize multiple backends or different types. Examples of backends, could include MythTV or SageTV.
When media is being streamed to the Client, it would either do so via a proxy service in the Application Server, or the Client would play the Url directly from the backend. Using this model, if a back end can support exporting a media streams over http, then it can elect to have its stream read directly by the client. In the case where the back end cannot export it's media stream over http, then the proxy application in the application server would provide an http stream to the client. But, even if a client is receiving a stream directly from the backend, it would still be required to send its commands via the application server. In order words, the backends are media exporters only, and should not be interacted with directly from a client.
The Third Tier
The third tier is the Back End. As mentioned above, a back end would probably consist of using MythTV, SageTV, or some other extensible PVR/MediaCenter that is already well established. By using an existing backend, as a plugin, the user is not locked into any technology, and they can move between different backend solutions. This may not be an attractive feature to backend providers, but it is an attractive feature to consumers.
Keep in mind, the concept here remains the same, no matter what the actual technology that is used. The concept is an open media center consisting of 3 tiers; Html Frontend, Application Web Server, and PVR Backend. I've chosen Java as the preferred Application Web Server, but in reality, it could be any open web server technology.
Pros and Cons
Pros
- Web technologies are widely used and fairly easy to understand
- Using a middle tier means that you don't have vendor lock in
- Doesn't "reinvent the wheel" when it comes to PVR solutions, since you are reusing existing PVR Backends.
- WebKit and MPlayer haven been ported to many embedded devices.
- Rapid development and deployment of Media Center applications using Html
- Middle Tier can proxy more than 1 back end, allowing you to add/remove backends for testing, etc.
- Many systems are single tier, some are 2. Adding in a third tier (in this case ,the middle tier) adds some complexity.
- Html won't allow from some of the eye candy that some Media Centers are using today.
- Interaction between the Front-end and the Middle Tier needs to be well thought out.
I own a number of small embedded devices, such as the MVP and HD-100. At some point, I'd like to play around with seeing how well these devices could handle a WebKit rendering engine and see if this idea could actually come to life on these devices. I know some people have played with the MVP and have used it as a front-end to ReplayTV and MythTV. My challenge would be so see if WebKit could actually run on these devices and be usuable as a MediaCenter/PVR front end.
Wednesday, September 17, 2008
Metadata Tool Goes Visual
I originally wrote the Batch Metadata tool because I had a large collection of movies, and Sage didn't provide a way to import my existing collection with metadata. Nielm's IMDB tool was good, but it's a one at a time solution.
So, a tool was born, and it works quite well at what it's meant to do; fetch metadata and create output properites and thumbnails. Now, I'm looking at a bigger picture, that includes full media management. Obviously the Batch Metadata tool is a part of the solution,
and I decided to use GWT (Google Widget Toolkit) as the UI. I was looking for an excuse to try out GWT and this project became my excuse.
I decided to make this a web application for one main reason; I like web applications. I read my email online, my photos are online, my calendar is online, and all this translates into convenient access to my information. I wanted my media to be accessed in the same way. I have 7 computers in my house. I don't use all of them, but I do use 4 of them. I wanted to be able to quickly access my media, make changes and import new movies from any of those computers. A web application made sense.
The features that I'm looking at putting into this application include
Stay in touch. I'll update my blog on the progress.
So, a tool was born, and it works quite well at what it's meant to do; fetch metadata and create output properites and thumbnails. Now, I'm looking at a bigger picture, that includes full media management. Obviously the Batch Metadata tool is a part of the solution,
and I decided to use GWT (Google Widget Toolkit) as the UI. I was looking for an excuse to try out GWT and this project became my excuse.I decided to make this a web application for one main reason; I like web applications. I read my email online, my photos are online, my calendar is online, and all this translates into convenient access to my information. I wanted my media to be accessed in the same way. I have 7 computers in my house. I don't use all of them, but I do use 4 of them. I wanted to be able to quickly access my media, make changes and import new movies from any of those computers. A web application made sense.
The features that I'm looking at putting into this application include
- Media importing from local filesystem.
- Metadata fetching (from multiple sources)
- Batch metadata updating (from multiple sources)
- Metadata editing
- Cover art updating (from mulitple sources)
- File management (moving and deleting)
- UPnP Server
- Media playback
- SageTV integration
- Handle TV media (recorded shows) as well as movies.
Stay in touch. I'll update my blog on the progress.
Monday, September 15, 2008
SageTV - PVR and Media Center
Several months ago I decided to take SageTV for a spin. I'm a long time XBMC fan, but with HD becoming ubiquitous, I needed to find a solution that could deliver HD content to my TV, and XBMC on the Xbox wasn't doing it.
My first experience with SageTV was a little disappointing. I only needed a HD Media Center, and Sage's Media Center functionality is severely lacking. But, despite that, I forged ahead with a complete SageTV install. The final selling point for me was the SageTV could use a thin client media extender as a front end. Shortly after installing SageTV, I purchased the HD100 Media Extender for SageTV
. This extender product worked flawlessly on my divx, xvid, dvd, and HD content. Without the HD extender, SageTV is just like any other Media Center solution, except that it costs money.
One of the core features missing in the SageTV Media Center is the lack of an automated metadata import tool, that can import movie metadata from external sources, such as IMDB, or other locations. This is a standard feature in my XMBC configuration and not having it made the movie experience so much less enjoyable. Not having this feature bothered me so much that I decided to write an external tool that could scrape movie information from several sources and allow SageTV to import that information. This tool is the Batch MetaData Tool. Although the Batch MetaData Tool was written with SageTV in mind, it can be extended to output it's metadata information in different formats. I'll post more about the this tool later.
Since Installing SageTV and buying the HD100, I decided to give the PVR funtionality a try. I started out with SD content, then I purchased the HD-PVR and a Bell 6141 reciever and I started recording HD content. The quality and the performance was very good. SageTV has a very nice interface for recording TV shows, resolving conflicts, and managing recorded shows. I still can't use it to replace my Bell dual tuner HD PVR, but I do use it to supplement it. The great thing about having SageTV is that all of my recordings can be accessed via any computer, or extender, in the house, or even over the internet using the Placeshifter client. Record once, Watch anywhere; a dream come true.
Unfortunately, it's not all bliss. My SageTV setup has locked up from time to time. It seems that it is a combination of SageTV and the HD-PVR. If I disconnect the HD-PVR, then SageTV does not lock up at all. In fact, my SageTV was up for several months until I hooked up the HD-PVR. This may have nothing to do with SageTV and everything to do with the HD-PVR drivers. I'm still investigating.
Just for reference, I thought I'd make a Pros and Cons list of SageTV features.
SageTV Pros
If you want a slick HD setup, without a computer in the living room, then SageTV is your answer. It may not be the most visually appealing software, but it will get the job done. If you plan on having a full blown computer in the livingroom, then perhaps something free and open source might be a better option. When I first bought SageTV, XMBC for Linux was not available. Given all that I really wanted was a HD Media Center with lots of functionality, then XMBC for Linux would be been a great choice. It would have required that I put a computer in the livingroom, but given what I've spent on SageTV licenses and hardware (HD-PVR and HD100), I could have put a computer in the livingroom.
So, I've jumped into SageTV with both feet. My next steps are to personalize it and make it better for my needs. To achieve this, I've compiled a list of projects that I'm either working on, or plan to work on, in order to make SageTV better suit my needs.
Proposed Personal Projects
Stay in touch, and I'll keep you posted on how I make out with these ambitious projects.
My first experience with SageTV was a little disappointing. I only needed a HD Media Center, and Sage's Media Center functionality is severely lacking. But, despite that, I forged ahead with a complete SageTV install. The final selling point for me was the SageTV could use a thin client media extender as a front end. Shortly after installing SageTV, I purchased the HD100 Media Extender for SageTV
. This extender product worked flawlessly on my divx, xvid, dvd, and HD content. Without the HD extender, SageTV is just like any other Media Center solution, except that it costs money.One of the core features missing in the SageTV Media Center is the lack of an automated metadata import tool, that can import movie metadata from external sources, such as IMDB, or other locations. This is a standard feature in my XMBC configuration and not having it made the movie experience so much less enjoyable. Not having this feature bothered me so much that I decided to write an external tool that could scrape movie information from several sources and allow SageTV to import that information. This tool is the Batch MetaData Tool. Although the Batch MetaData Tool was written with SageTV in mind, it can be extended to output it's metadata information in different formats. I'll post more about the this tool later.
Since Installing SageTV and buying the HD100, I decided to give the PVR funtionality a try. I started out with SD content, then I purchased the HD-PVR and a Bell 6141 reciever and I started recording HD content. The quality and the performance was very good. SageTV has a very nice interface for recording TV shows, resolving conflicts, and managing recorded shows. I still can't use it to replace my Bell dual tuner HD PVR, but I do use it to supplement it. The great thing about having SageTV is that all of my recordings can be accessed via any computer, or extender, in the house, or even over the internet using the Placeshifter client. Record once, Watch anywhere; a dream come true.
Unfortunately, it's not all bliss. My SageTV setup has locked up from time to time. It seems that it is a combination of SageTV and the HD-PVR. If I disconnect the HD-PVR, then SageTV does not lock up at all. In fact, my SageTV was up for several months until I hooked up the HD-PVR. This may have nothing to do with SageTV and everything to do with the HD-PVR drivers. I'm still investigating.
Just for reference, I thought I'd make a Pros and Cons list of SageTV features.
SageTV Pros
- Stable and reliable PVR and Media Center
- Supports SD and HD extenders
- Supports Plugins
- User-friendly UI
- Java based (not everyone would consider this a Pro, but I do)
- Runs on Windows/Linux/Mac
- Has built-in EPG data
- Great at managing recordings
- Placeshifter that turns SageTV into a Sling like appliance.
- Linux version has no trial
- Plugin model requires learning a new Xml scripting language
- Media Center is very lacking in features (IMDB lookup, Stacking, Genres)
- Cost. You license everything. Server, Client and Extenders.
- No UPnP Media Server or Renderer support.
- Can't play DVDs unless they have been decrypted.
- Can't play iso files.
- Placeshifter can't play DVDs at all.
If you want a slick HD setup, without a computer in the living room, then SageTV is your answer. It may not be the most visually appealing software, but it will get the job done. If you plan on having a full blown computer in the livingroom, then perhaps something free and open source might be a better option. When I first bought SageTV, XMBC for Linux was not available. Given all that I really wanted was a HD Media Center with lots of functionality, then XMBC for Linux would be been a great choice. It would have required that I put a computer in the livingroom, but given what I've spent on SageTV licenses and hardware (HD-PVR and HD100), I could have put a computer in the livingroom.So, I've jumped into SageTV with both feet. My next steps are to personalize it and make it better for my needs. To achieve this, I've compiled a list of projects that I'm either working on, or plan to work on, in order to make SageTV better suit my needs.
Proposed Personal Projects
- GWT based media management tool (extending what I've already done with the Batch MetaData Tool) (in progress)
- Add in UPnP Server support so that I can use my Xbox's as SD clients, and potentially a PS3 as a client. (researching)
- Remote API for SageTV (Export the SageAPI as a set of restful services) (in progress)
- GWT based plugin manager. Tool that will show plugins, and allow you install them from the web interface. (researching)
Stay in touch, and I'll keep you posted on how I make out with these ambitious projects.
Subscribe to:
Posts (Atom)