google
yahoo
bing

Coding Tips & Info


Hey Everyone,

Time for another post. I know it's been awhile but I've been pretty heavy into the Google API stuff. Honestly was kinda tricky to work with a first but I finally might be onto it... yeah, I'm just a bit of a slow learner I guess :)

In my last post I briefly mentioned using the Java Client Library. I've now got some code examples that might help some people who might have bumped into some of the same issues I was having (mostly grabbing an individual event from the Google Calendar). We are working on building a free online application called YourTeam. It's going to combine a community for Hockey Coaches, Players and Parents and also a Private Team area for teams to stay informed and have fun! If you'd like to read all about it and how excited we are about the new beta release about to come out, click here to read my brothers post!

Here is the code that I was pulling my hair out for a few days over. These examples use the client library and are Java Server Pages. Enjoy! I hope they help. You will have to replace a few variables to get it working with your own code (ie: ACCOUNTNAME is your Google account name)

Adding an Event to the Google Calendar:

JAVA:
  1. try{
  2.   //get connection
  3.   URL feedUrl = new URL("http://www.google.com/calendar/feeds/ACCOUNTNAME/private/full");
  4.   GoogleService myService = new GoogleService("cl", str_service);
  5.   myService.setUserCredentials(ACCOUNTNAME, ACCOUNTPASSWORD);
  6.                        
  7.   //create event here
  8.   URL postUrl = new URL("http://www.google.com/calendar/feeds/"+str_email+"/private/full");
  9.   EventEntry myEntry = new EventEntry();
  10.   myEntry.setTitle(new PlainTextConstruct(request.getParameter("event_name")));
  11.   myEntry.setContent(new PlainTextConstruct(request.getParameter("event_desc")));
  12.  
  13.   //these are your date values for the calendar   
  14.   DateTime startTime = DateTime.parseDateTime("2006-09-14T15:00:00-08:00");
  15.   DateTime endTime = DateTime.parseDateTime("2006-09-14T17:00:00-08:00");
  16.                        
  17.   When eventTimes = new When();
  18.   eventTimes.setStartTime(startTime);
  19.   eventTimes.setEndTime(endTime);
  20.   myEntry.addTime(eventTimes);
  21.            
  22.   Where eventWhere = new Where();
  23.   eventWhere.setValueString(request.getParameter("event_location"));
  24.   myEntry.addLocation(eventWhere);
  25.            
  26.   // Send the request and receive the response:
  27.   EventEntry insertedEntry = (EventEntry)myService.insert(postUrl, myEntry);
  28.   str_msg="Event Added Successfully.";
  29. }
  30. catch(Exception ex){
  31.     System.out.println("google ad event ex:"+ex);
  32.     str_msg="Error adding Google Calendar Event:"+ex;
  33. }

Getting a Date Range of Events from the Google Calendar:

Note: This code might not compile, I tried to take out a lot of code to shorten it but it should be a good starting point.

JAVA:
  1. try{
  2.     //get connection
  3.     URL feedUrl = new URL("http://www.google.com/calendar/feeds/ACCOUNTNAME/private/full");
  4.     CalendarQuery myQuery = new CalendarQuery(feedUrl);
  5.                                
  6.     String str_start="2006-09-14T00:00:00";
  7.     String str_end="2006-09-21T23:59:59";
  8.                                
  9.     myQuery.setMinimumStartTime(DateTime.parseDateTime(str_start));
  10.     myQuery.setMaximumStartTime(DateTime.parseDateTime(str_end));
  11.     myQuery.addCustomParameter(new Query.CustomParameter("orderby", "starttime"));
  12.     myQuery.addCustomParameter(new Query.CustomParameter("sortorder", "ascending"));
  13.     myQuery.addCustomParameter(new Query.CustomParameter("singleevents", "true"));
  14.                                
  15.     CalendarService myService = new CalendarService(str_service);
  16.     myService.setUserCredentials(ACCOUNTNAME, ACCOUNTPASS);
  17.                                
  18.     // Send the request and receive the response:
  19.     Feed resultFeed = (Feed)myService.query(myQuery, Feed.class);
  20.                                
  21.     new EventFeed().declareExtensions(myService.getExtensionProfile());
  22.             EventFeed calFeed = (EventFeed) myService.query(myQuery,EventFeed.class);
  23.                            
  24.              EventEntry calEntry = null;
  25.            
  26.             if (calFeed.getEntries().size()> 0) {
  27.                          java.util.List lTimes = null;
  28.                          java.util.List lLocs = null;
  29.                                    
  30.                 for (int n=0; n<calFeed.getEntries().size();n++){
  31.                       calEntry = (EventEntry) calFeed.getEntries().get(n);
  32.                       
  33.                                //grabs description for event
  34.                                TextContent tc = (TextContent)calEntry.getContent();
  35.               PlainTextConstruct ptc = (PlainTextConstruct)tc.getContent();
  36.                                        
  37.              calEntry.getTitle().getPlainText();
  38.                               lTimes=calEntry.getTimes();
  39.                      When when =null;
  40.                
  41.                                for (java.util.Iterator iterator1 = lTimes.iterator();iterator1.hasNext();) {
  42.                       when = (When)iterator1.next();
  43.             strTempStart=when.getStartTime().toUiString();
  44.             strTempStart=strTempStart.substring(strTempStart.indexOf(" "),strTempStart.length());
  45.                                        
  46.                     strTempEnd=when.getEndTime().toUiString();
  47.                     strTempEnd=strTempEnd.substring(strTempEnd.indexOf(" "),strTempEnd.length());
  48.             strTempEnd=convertTime(strTempEnd);
  49.               }
  50.                            
  51.                       lLocs=calEntry.getLocations();
  52.                       for (java.util.Iterator iterator1 = lLocs.iterator();iterator1.hasNext();) {
  53.                       Where where = (Where)iterator1.next();
  54.             where.getValueString();
  55.               }
  56.                            }
  57.     }
  58.     catch(Exception ex){
  59.         System.out.println("google view events ex:"+ex);
  60.         str_msg="Error viewing Team Google Calendar:"+ex;
  61.     }

Editing a Google Calendar Event:

JAVA:
  1. //get connection
  2. CalendarService calendarService = new CalendarService(str_service);
  3. calendarService.setUserCredentials(ACCOUNTNAME, ACCOUNTPASSWORD);
  4.  
  5. //call calEntry.getSelfLink().getHref() to get the url
  6. //example: http://www.google.com/calendar/feeds/ACCOUNTNAME/private/full/d1gn05stk3175uthp30s3et3is 
  7. URL entryUrl = new URL(str_event_url);
  8.            
  9. // Mark the feed as an Event feed:
  10. final ExtensionProfile profile = calendarService.getExtensionProfile();
  11. new EventFeed().declareExtensions(profile);
  12. final EventFeed feed = (EventFeed)calendarService.getFeed(entryUrl, EventFeed.class);
  13.             
  14. EventEntry retrievedEntry = (EventEntry)calendarService.getEntry(entryUrl, EventEntry.class);
  15. retrievedEntry.setTitle(new PlainTextConstruct(request.getParameter("event_name")));
  16. retrievedEntry.setContent(new PlainTextConstruct(request.getParameter("event_desc")));
  17.  
  18. //same date format as adding       
  19. DateTime startTime = DateTime.parseDateTime(str_start_time);
  20. DateTime endTime = DateTime.parseDateTime(str_end_time);
  21.            
  22. java.util.List lTimes=retrievedEntry.getTimes();
  23. When when =null;
  24. for (java.util.Iterator iterator1 = lTimes.iterator();iterator1.hasNext();) {
  25.       when = (When)iterator1.next();
  26.       when.setStartTime(startTime);
  27.       when.setEndTime(endTime);
  28. }
  29.            
  30. java.util.List lLocs=retrievedEntry.getLocations();
  31. for (java.util.Iterator iterator1 = lLocs.iterator();iterator1.hasNext();) {
  32.               Where where = (Where)iterator1.next();
  33.      where.setValueString(request.getParameter("event_location"));
  34. }
  35.            
  36. // Update the info
  37. // call retrievedEntry.getEditLink().getHref() to get the edit url like this: http://www.google.com/calendar/feeds/info%40webscope.ca/private/full/d1gn05stk3175uthp30s3et3is/63294552679
  38. URL editUrl = new URL(str_edit_event_url);
  39. EventEntry updatedEntry = (EventEntry)calendarService.update(editUrl, retrievedEntry);
  40. str_msg="Event Updated Successfully.";

So, hopefully that code can help someone out there. It might be a bit messy and long to look at but if you grab it and use it along with the Tutorials from Google I hope it can start working. Up next for me will be deleting Google Calendar Events from our webapp (YourTeam) and then hopefully some other enhancements!

So, if anyone has any questions about the information above let me know and I'll try my best :) and if anyone knows any hockey coaches, players or fans out there that are looking for a great, fun team software package send them to YourTeam!

YourTeam

Cheers,
Adrian

Hey Everyone! Yeah, it's been awhile since my last blog... been traveling a bit... waiting for a laptop to get fixed... blah blah.

So, Google is in the news a lot these days. Google and Web 2.0 seem to almost go hand in hand. Almost as much as Microsoft trying to take down Google :O (sorry MS fans... just a cheap shot)

Our company Evolving Solutions is working on a new web application that is going to try and integrate a few Web 2.0 applications within it... let's say a Calendar (Google Calendar possibly?)... maybe some uploading of videos (Google Video possibly?) and maybe a couple other features. So, I figured it was time to dive into the Google API's that I've heard so much about.

First thing I have to say is their site is very difficult to navigate around. I think partly it's just because they have so much on the go, but I found it difficult to find the information for "Integrating the Google Calendar". But after searching around and reading some (which I'm terrible at when looking for something new... as most developers are). I stumbled across 2 important links:

One nice thing is that Google is trying to develop all their services to be accessed through similar API code... the technical term is: The Google data APIs ("GData" for short) and you can read more about it at the following link: http://code.google.com/apis/gdata/overview.html

Now, it might seem a bit overwhelming at first... but if you are a Java developer (or C# developer, there is a client library also) I suggest taking an afternoon and looking into this stuff. For example, if you or a client of yours has a Google Account and use the Calendar service to organize their life, you can easily integrate it within your web applications. So, basically you can set it up so they can add/edit/remove events directly to and from their Google Calendar while logged into your application. You can also grab all the events and have them displayed. Very powerful stuff when you think about it. Takes them 5 seconds to sign up and you gain the advantage of a powerful Web 2.0 application supported by one of todays best technology companies (not a bad deal really for free)... well, I guess you have to build a few pages to interact with it, but that's about it. Welcome to WEB 2.0 my friend!

I won't put many code examples here, they step you through it pretty well in the Java Client Library Tutorials (working with the Calendar actually).

After about a day or 2 of working with the Google API's, I feel very comfortable and excited to look into more potential integration with Google services. I don't think they are going away any time soon... so it wouldn't hurt to jump on board! It's only gonna get better!

Cheers,
Adrian

WEB 2.0 IS HOT RIGHT NOW! A lot of people are talking big about the new way of technology and building applications. It's hard to describe WEB 2.0 because it can mean so many different things to so many people. So, I'm going to steal a quote from the Wikipedia documentation on it:

The term Web 2.0 refers to a second generation of services available on the World Wide Web that lets people collaborate and share information online. In contrast to the first generation, Web 2.0 gives users an experience closer to desktop applications than the traditional static Web pages. Web 2.0 applications often use a combination of techniques devised in the late 1990s, including public web service APIs (dating from 1998), Ajax (1998), and web syndication (1997). They often allow for mass participation (web-based social software). The concept may include blogs and wikis.

So, me being the prototypical techie, I am always interested in new technologies... so I've gotten myself involved in Web 2.0... which involves a lot of AJAX. AJAX is new... and it can be a bit overwhelming at first (as I posted previously).

I bought a book to start off with (AJAX Hacks)... which was a good starting point. Lots of good examples to get started with AJAX and WEB 2.0. I read an interesting chapter that talked about an AJAX Framework called script.aculo.us. First thing I thought was weird name, still not sure how to say it to be honest :) . Then, I read how it's used to create some really, really neat (and useful) AJAX effects for applications. Even they state the obvious on their homepage:

script.aculo.us provides you with easy-to-use, compatible and, ultimately, totally cool JavaScript libraries to
make your web sites and web applications fly, Web 2.0 style.

Visit the site to read up more on it. There site can be a bit confusing, but basically it's a refreshing JavaScript library that is very easy to setup and use. Here are some key links to the site to assist if you want to looking into it more:

I think the best way to figure out this library is to dive in, setup up the files (very easy 5 step process) and play around with all the different method calls. If you need assistance, here is what I did to become familiar with the library. I created a JSP Page with the following code:

HTML:
  1. <title>Evolving Solutions Ajax Examples</title>
  2.  
  3. <script src="/evolve/javascripts/prototype.js" type="text/javascript"></script>
  4. <script src="/evolve/javascripts/scriptaculous.js" type="text/javascript"></script>
  5. <script src="/evolve/javascripts/custom/ade_functions.js" type="text/javascript"></script>
  6.  
  7. <div id="ade_test">
  8. <table width="500" border="1" cellpadding="0" cellspacing="0">
  9.     <tr>
  10.         <td valign="top">
  11.             <b>Text box:</b>
  12.         </td>
  13.         <td valign="top">
  14.             <input type="text" size="40" maxlength="100"  id="txBox" value="Type something here, it will stay...">
  15.         </td>
  16.     </tr>
  17. </table>
  18. <table width="500" border="0" cellpadding="0" cellspacing="0">
  19.     <tr>
  20.         <td valign="top">
  21.             <center><img src="anadeau_482_portrait.jpg"></center>
  22.         </td>
  23.     </tr>
  24. </table>
  25. </div>
  26.  
  27.  
  28. <table width="500" border="0" cellpadding="0" cellspacing="0">
  29.     <tr>
  30.         <td valign="top">
  31.             <input type="button" value="Appear" onclick="testFunction('appear');">&nbsp;
  32.             <input type="button" value="Fade Me" onclick="testFunction('fade');">&nbsp;
  33.             <input type="button" value="Fade Slow" onclick="testFunction('fadeslow');">&nbsp;
  34.             <input type="button" value="Puff Up" onclick="testFunction('puff');">&nbsp;
  35.             <input type="button" value="Drop Me" onclick="testFunction('dropme');">&nbsp;
  36.             <input type="button" value="Shake Me" onclick="testFunction('shake');">&nbsp;
  37.            
  38.             <BR><BR>
  39.            
  40.             <input type="button" value="Hilite" onclick="testFunction('hilite');">&nbsp;
  41.             <input type="button" value="Switch Off" onclick="testFunction('switchoff');">&nbsp;
  42.             <input type="button" value="Blind Up" onclick="testFunction('blindup');">&nbsp;
  43.             <input type="button" value="Blind Down" onclick="testFunction('blinddown');">&nbsp;
  44.             <input type="button" value="Slide Up" onclick="testFunction('slideup');">&nbsp;
  45.             <input type="button" value="Slide Down" onclick="testFunction('slidedown');">&nbsp;
  46.            
  47.             <BR>
  48.             <input type="button" value="Pulse" onclick="testFunction('pulse');">&nbsp;
  49.             <input type="button" value="Squish" onclick="testFunction('squish');">&nbsp;
  50.             <input type="button" value="Fold" onclick="testFunction('fold');">&nbsp;
  51.             <input type="button" value="Grow Top Left" onclick="testFunction('growtl');">&nbsp;
  52.             <input type="button" value="Grow Center" onclick="testFunction('growc');">&nbsp;
  53.             <input type="button" value="Shrink" onclick="testFunction('shrink');">&nbsp;
  54.         </td>
  55.     </tr>
  56. </table>
  57.  
  58. </BODY>
  59. </HTML>

Then inside the file referenced at the top of the JSP page named ade_functions.js, I added this simple method call to test all the different methods available:

JavaScript:
  1. function testFunction(affect_type) {
  2.  if(affect_type=="fade"){
  3.         Effect.Fade('ade_test');
  4.  }
  5.  else if(affect_type=="fadeslow"){
  6.        Effect.Fade('ade_test',{duration:5, from:1.0, to:0.0});
  7.  }
  8.  else if(affect_type=="puff"){
  9.        Effect.Puff('ade_test');
  10.  }
  11.  else if(affect_type=="dropme"){
  12.        Effect.DropOut('ade_test');
  13.  }
  14.  else if(affect_type=="appear"){
  15.        Effect.Appear('ade_test', { duration: 3.0 });
  16.  }
  17.  else if(affect_type=="shake"){
  18.        Effect.Shake('ade_test');
  19.  }
  20.  else if(affect_type=="hilite"){
  21.        new Effect.Highlight('txBox', {startcolor:'#ff99ff', endcolor:'#999999', duration: 3.0});
  22.  }
  23.  else if(affect_type=="switchoff"){
  24.        Effect.SwitchOff('ade_test');
  25.  }
  26.  else if(affect_type=="blindup"){
  27.        Effect.BlindUp('ade_test');
  28.  }
  29.  else if(affect_type=="blinddown"){
  30.        Effect.BlindDown('ade_test');
  31.  }
  32.  else if(affect_type=="slideup"){
  33.        Effect.SlideUp('ade_test');
  34.  }
  35.  else if(affect_type=="slidedown"){
  36.        Effect.SlideDown('ade_test');
  37.  }   
  38.  else if(affect_type=="pulse"){
  39.        Effect.Pulsate('ade_test');
  40.  } 
  41.  else if(affect_type=="squish"){
  42.        Effect.Squish('ade_test');
  43.  }
  44.  else if(affect_type=="fold"){
  45.        Effect.Fold('ade_test');
  46.  }
  47.  else if(affect_type=="growtl"){
  48.        new Effect.Grow('ade_test', {direction: 'top-left'});
  49.  }
  50.  else if(affect_type=="growc"){
  51.        new Effect.Grow('ade_test', {direction: 'center'});
  52.  }
  53.  else if(affect_type=="shrink"){
  54.        new Effect.Shrink('ade_test');
  55.  }
  56.  
  57. }

That was it really... once you have this setup you can load the page and click on all the buttons to see the different effects that script.aculo.us provides. I'm now using this library in a number of applications and clients really seem to enjoy the refreshing new look and features... nice work script.aculo.us!!!

Cheers,
Adrian

A Web Content Management System is a type of Content management system (CMS) software used for managing websites.

The software manages content (text, graphics, links, etc.) for distribution on a web server. Usually the software provides tools where users with little or no knowledge of programming languages and markup languages (such as HTML) can create and manage content with relative ease of use. Most systems use a database to hold content, and a presentation layer displays the content to regular website visitors based on a set of templates. Management of the software is typically done through a web browser, but some systems may be modified in other ways.

Ok, sounds simple right? Not always the case... or so it seems with OpenSource tools for providing these features to clients. Our company, Evolving Solutions has been building CMS systems for some time now and we've been looking for an OpenSource CMS solution that might help us and speed up development time... which in turn lets us get more work done and also charge our clients less! a win-win situation.

So, after many attempts at searching, I've found that most CMS systems are just way to confusing for everyday users... the users that are going to be updating their sites, everyday ;)

I decided to look around again a couple weeks ago and I found MeshCMS I read about the OpenSource project on another site and decided to check it out. I wasn't really excited when I saw the project homepage... I honestly think that they could update it maybe and make it a little catchier since they say that the site is running off MeshCMS. Just my humble opinion.

Anyway, I didn't judge a book by it's cover and I decided to give it a shot. Here are a few key points to what I've found out so far:

  • I was pleasantly surprised at first how easy it was to setup... real easy... you just deploy it as a webapp if you are using Tomcat or any other Servlet Container and it's ready to rock! Refreshing start.

  • No database required for MeshCMS. It's all file driven (templates and JSP's), could be good, good be bad I guess, all depends on what you prefer. But eliminates one step of the setup (creating a DB)

  • All theme/template based. So basically you can set up a theme really easy, here's a quick glimpse if you are curious on simple it really is: http://www.meshcms.org/userguide/index.html#create_theme. Anyone familiar with JSP's and Tag Libraries will appreciate how easy it is to setup a Theme.

  • Extremely user friendly for the end user (which is most important!).

Now, someone looking for a more robust, permission based, blah blah type of Document/CMS system will not be interested in MeshCMS. It's definitely more for someone or some company looking to get a CMS system up and running smoothly and quickly. They even state it on their website:

MeshCMS has been thought as a quick tool to edit pages online, manage files and create some common components like menus, breadcrumbs, mail forms, image galleries and so on.

So, in conclusion, I haven't had a chance to dive in and really use MeshCMS for a production website yet (just being honest, hopefully will soon), but if you are in the market for an easy to use and easy to setup CMS System, I would recommend looking at the features and trying it out for yourself. It'll only take a few minutes and it'll be well worth it!

If anyone has used it or tried it out and has any suggestions or comments, please feel free to share!

Good luck, happy CMS'n!
Adrian

Has you ever looked for an easy way to add searching capabilities to your web site or application?

For some reason when I started looking a year ago I didn't have much luck. I was fairly familiar with an Apache Product named Lucene (probably one of my favorite product names ever... I just love how it sounds), but it really didn't seem to work well with web applications. It seems much more useful to search documents (word docs, text, pdf, etc) and index them for a search. A very useful tool for a company portal, but not for a website that is built with dynamic content or has jsp includes.

Then I stumbled across another Apache Project named Nutch (pretty neat name also).

Nutch is open source web-search software. It builds on Lucene Java, adding web-specifics, such as a crawler, a link-graph database, parsers for HTML and other document formats, etc.

In a nutshell, that means you can search your website or application with Lucene :) Probably may not be really useful for smaller sites, but some of our applications have around 100 pages of content so users always appreciate a search option. Nutch is still in the early stages but we have used it a few times and it seems very solid already. The crawling part can be a bit confusing if you have to setup CYGWIN on your Windows OS for the first time. But once that step is completed and you index a few sites it becomes pretty easy. As with most Open Source tools, the documentation is a bit tricky but give it a shot if you need to integrate search capabilities into your applications!

Here are a couple examples of sites that use Nutch:

OfficeGateway
More of a basic implementation for searching the website for information.
OfficeGateway.ca

Krugle
A more in depth implementation that searches thousands (guessing) of files when you enter a search criteria.
Krugle.com

Searching may not seem to important to some, but it seems to come up quite a bit in our projects... so I guess it might just be important after all! Check out Nutch if you need to find a solid search feature today!

Cheers,
Adrian

Hey,

Just a quick post this evening on a couple tools that have become part of my daily life. The are OpenOffice.org and Mozilla products (mainly Firefox Browser and Thunderbird Email Client). I just started using both Firefox (for browsing) and Thunderbird for my Email client about a year ago. I'm a very big advocate of Open Source so I felt obligated to give them a try. Sure glad I did.

I've become extremely comfortable and happy with both applications. Firefox was a refreshing change for me to browse the Internet (I won't mention any other names of browsers here that don't work very well... that seem clunky... and that have the initials IE). Right away I setup Firefox and my default browser and haven't looked back! I love the multiple tabs options... I find it faster and it's more secure. All great features. While on the browser topic, another alternative that seems pretty solid, although I haven't tested it out too much is Opera. Opera is similar to Mozilla... it appears as though they have some neat products on the go... and a great looking website!

Thunderbird is an easy to install email client application that seems as solid as any others I have seen. It's got a great plugin interface, so you can download plugins from the open source world and include them in your application (calendars, signatures etc etc). Here's the link to find more from the community. Definitely worth looking at, even just to see what's out there. You can also download some cool plugins for Firefox here.

OpenOffice... is comparable to Microsoft Office. It has a number of applications included in the suite including OpenOffice Writer (Word Processor), OpenOffice Calc (Spreadsheet Application), Impress (to create PowerPoint presentations) not to mention a number of other applications. I would recommend OpenOffice to any business owner who likes to use free software, that works :) NO Licensing fees... no setup fees... just go to the site, download it, install it and start using it! How refreshing! I still don't believe that many people in the business world know about OpenOffice. We at Evolving Solutions are trying to promote is much as possible and hopefully over time we can help make a difference and get people on board using it! So, feel free to check it out.. download it and try it out. If you don't like it, you can always keep paying licensing fees for other software that doesn't work that great :) .

So, no real technical talk tonight in this post... just me recommending some software that might help you and your business in the long run. The best thing about them both is you can try them out for free, if you don't like them (which I would be very surprised) you can simply remove them from your computer and carry on.

Cheers,
Adrian

RSS Feeds... making big news these days! Most will know what they are but if not here is a quick explanation of what they consist of:


RSS is a family of web feed formats, specified in XML and used for Web syndication. RSS is used by (among other things) news Web sites, weblogs and podcasting. The abbreviation is variously used to refer to the following standards:

  • Really Simple Syndication (RSS 2.0)
  • Rich Site Summary (RSS 0.91, RSS 1.0)
  • RDF Site Summary (RSS 0.9 and 1.0)

We've been talking a lot lately at our company about RSS Feeds. Our product OfficeGateway has an RSS Reader for users and it's becoming quite popular. Everyday, the first thing I do (as a user of OfficeGateway) is login and read my favorite feeds from many different news sites, blogs, etc. We are always looking for better/easier ways to integrate new technology with our software products and I was able to find another great JSP Tag Library. The name of it is RSS Utilities and it was developed by By Rodrigo Oliveira of Sun. Thanks Rodrigo, you did a great job.

It's basically the same as implementing the Mailer Tag Library that I posted about earlier. 3 simple steps to get rss feeds reading into your applications:

  • Step 1: Include the following code in your web.xml file.
    XML:
    1. <taglib>
    2.         <taglib-uri>/WEB-INF/rssutils.tld</taglib-uri>
    3.         <taglib-location>/WEB-INF/rssutils.tld</taglib-location>
    4. </taglib>

  • Step 2: Include this single line at the top of your JSP page.
    CODE:
    1. <%@ taglib uri="/WEB-INF/rssutils.tld" prefix="rss" %>

  • Step 3: Include the call on your JSP page where you would like to read in the feed.
    CODE:
    1. <rss:feed
    2. url="http://servlet.java.sun.com/syndication/rss_java_highlights-XYZCompany-10.xml"
    3. feedId="example1"/>
    4. <b>Image: </b><rss:channelImage feedId="example1" asLink="true"/><br>
    5. <b>Title: </b><rss:channelTitle feedId="example1"/><br>
    6. <b>Link: </b><rss:channelLink feedId="example1" asLink="true"/><br>
    7. <b>Description: </b><rss:channelDescription feedId="example1"/><br>
    8. <ul>
    9.   <li><rss:itemTitle feedId="example1" index="0"/><br>
    10.       <rss:itemDescription feedId="example1" index="0"/><br><br>
    11.   <li><rss:itemTitle feedId="example1" index="1"/><br>
    12.       <rss:itemDescription feedId="example1" index="1"/><br>
    13. </ul>

  • After you have the 3 steps completed (and the jar file included in your classpath) that's it! Start reading in Feeds from anywhere. Very easy to integrate with applications. The tag library has a number of useful properties that can be set to customize your feeds.

    Here is a link if you would like to view the tutorial from Sun and I've also included a link here to a resource if anyone is interested in investigating RSS Feeds further!

    RSS Feed Resource

    Best of luck with RSS feeds, it's definitely going to be a big part of the future on the Internet!

    And oh yeah! If anyone would like to include my blog in their RSS feeds, please feel free. Here is the link http://www.evolvingsolutions.ca/devwing/?feed=rss2

    Thanks,
    Adrian

    PS: Thanks goes out to Amit Gupta for his WordPress plugin for including code within your Posts (as seen above). Anyone interested in looking at his plugin (iG:Syntax Hiliter - seemed to work better than most for me) feel free to visit his blog and download it here.

    Anyone that has researched Open Source Portal Servers will recognize tonights post on Liferay Portal Server.

    About 2 years ago our company started researching Portal Software and at first we found that most of it was very expensive and not very friendly to work with.  We were trying to find a portal server to develop our business idea... which later became know as OfficeGateway.

    We had an idea to build an online collaboration tool for Small and Medium sized businesses.  A place for shared calendars... document sharing... CRM... etc.  As mentioned above we spent sometime researching a few commercial portal servers - won't mention any names here :) ... and late one night we stumbled upon Liferay.  We tested it out that night (over a couple beverages)... and found that it was very easy to download and setup, it actually came bundled with Tomcat so it took about 10 minutes to get it up and running.  We were amazed to see when we logged in that the user interface was actually quite easy to follow and there were a number of pre-configured "portlets" available to use with the product.  Oh, and probably the biggest point about the software is that it's ABSOLUTELY FREE TO USE AND IT'S OPEN SOURCE!

    We decided to check out a couple other portal servers, but we always seemed to come back to Liferay.  So, we moved ahead with Liferay Portal Server and began developing/integrating out own Portlets within it.  After a couple of months of tweaking here and there, we had our Business Collaboration Portal ready... OfficeGateway was launched!  Please visit OfficeGateway to find out more about the product if you are interested in using it with your company and/or reselling it.

    More on Liferay: to steal a quote from their site that I think sums up why developers should look into it as a possible portal solution:

    Companies routinely choose Liferay Portal for its out-of-the-box functionality, compatibility across all major application servers and database platforms, scalability, and the relentless innovation of its development team.

    I think that sentence couldn't sum it up better.  Feel free to visit their site for a demo.  The software has come a long way since day 1.  The interface has improved immensely (the look and feel and number of themes, etc), I believe the API has been improved with each version and it also has AJAX integrated into it now.  Take a look at the demo, you won't be disappointed.  There is a lot of other information on their site as well, and also a nice story on OfficeGateway and some other case studies on the site.  Check them out to learn more on how Liferay Portal Server has been integrated over the years!  If anyone is interested or has any questions regarding Liferay don't hesitate to post a comment or contact me directly.

    Cheers,

    Adrian

    My business partner and brother introduced me to an interesting new WEB 2.0 application a couple weeks ago.  The name Krugle.  At first I was skeptical when I went and looked at the beta version that stated "Welcome to krugle - your place to find code and technical content"

    It seemed to good to be true for a developer like myself who is searching for examples and resources many times a day (as posted earlier).  Krugle wasn't quite released when my brother mentioned for me to check it out a few weeks ago (you can read his blog here if you are interested in business ideas, cool software, etc).  I looked around and it sounded like a "neat" idea.  I decided to go back and take a look a couple days.... WOW, does this thing appear to be useful!  The application is nice and easy to use (which is sometimes rare these days).  You have 3 main options for searching:

      1. Code
      2. Tech Pages
      3. Projects

    I've been testing it out for a day or 2 now and it seems very interesting so far.  I've mostly been looking at the Code and Tech Page tabs and it's bringing back some very accurate search results.  Another great feature of Krugle is that you can do multiple searches and it opens a new tab for you each time so you don't lose your previous searches (unlike Google, hint hint).

    I thought for sure that Google was the best tool for searching for code on such technologies as AJAX, Java, Web Services, etc... but Krugle may be above and beyond Google (appears to be at this point to me, but time will tell I guess).  I would recommend anyone that searches for code on a regular basis give Krugle a Test Drive.  Even just test it out a couple times and you might be surprised.  When you find results for code, it displays the code properly formatted in a special window (that is easy to copy and paste from) and also gives you the option to "Save As..." so you can save the file to your desktop.

    Very impressive Krugle! Great start to what will hopefully be a great breakthrough in the future... and oh yeah, thanks for sending it on brother!

    Cheers,

    Adrian

    Hello  Developers and Amigos!

    Tonight I'm going to blog about one of the hottest topics out there... AJAX. I know most are probably sick of hearing about it, but I've been working on a new AJAX application (a shopping cart) for the past 5 hours and I'm still questioning a few things here...

    1. What the heck am I doing and how did I get here?
    2. Is this really a better solution?
    3. Where should I use it and where should I not use it?

    I am still relatively knew to the whole AJAX world. I have my text book that I bought for 40 bucks (Canadian Dollars - I'll put a link at the bottom for the same book). I won't go into to many details on how AJAX works, but basically it the acronym stands for

    Asynchronous JavaScript and XML

    So as you can guess it mostly involves JavaScript, Document Object Model (DOM) and Cascading Style Sheets (CSS). If you have an understanding of these technologies I think it's pretty straight forward to learn AJAX. For me the hardest part has been putting it all together and trying to decide where to use and where not to. I guess (and I am hoping) that this will improve over time. I found myself debating a few different ways to build my shopping cart and because AJAX is so new it's very hard to find a lot of valuable information on it, besides the odd helloworld application.

    As the technologies evolve, I think it will become easier to use. There are already some JSP Tag Libraries out there just for AJAX. Here is a link to one that looks pretty impressive although I didn't have the time to check it out too much:

    http://ajaxpatterns.org/Java_Ajax_Frameworks#AJAX_JSP_Tag_Library

    If anyone has tried it or has any suggestions please share.

    I won't go into too much more detail about AJAX right now. I guess for me it's been a bit of a learning curve to figure out how everything interacts, but it's coming along... I promise you that work with me :) So... if you have the patience to try it out, I would definitely recommend it since it's a very hot technology and I don't think it's going away anytime soon! Wish me luck on my shopping cart journey, all the best to you that decide to test it out. Here are some useful links that might help you get going (I'm throwing in a WEB 2.0 wiki link because it has a lot of good examples of AJAX applications):

    http://java.sun.com/developer/technicalArticles/J2EE/AJAX/
    http://www-128.ibm.com/developerworks/library/j-ajax1/
    http://en.wikipedia.org/wiki/AJAX
    http://en.wikipedia.org/wiki/Web_2.0

    Also, as promised a link to the book that I started with (below). I find it great because there's really not much for theory, just a lot of examples to get you going quickly (I see it's cheaper now to, bonus).

    AJAX Hacks - Bruce Perry

    I hope I was able to help if you are thinking of looking into AJAX.  I think it's worth a shot, it's actually nice when you see it in action... after 4 or 5 hours! haha... Good luck with AJAX everyone! 
    -- Adrian

    Next Page »