Groovy/Grails Talk
Home     Login     Register
19.Jun.2010 02:03 PM in Plug-ins
Adding Feeds With Grails Plugins
I added some feeds to the CompareXY.com site (see some other blogs on the experiment). Technically, I already had one feed already, but I'll go over it anyway. Eventually, I think I'll support Atom, and add some feeds based upon tags, or searches, but for now I just created feeds for the blog (about building the site), the latest-n articles, and a site map.

Basically, the idea for creating feeds is:
  • Install RSS feed plugin
  • Make a shared service for getting articles
  • Make a feeds controller with a few actions for delivering the feeds including:

    • latest - For feeding the n latest articles
    • sitemap - For feeding the site map of the site
    • blogs - For feeding the world my incredible blog updates

  • Put some links on the site, and tell browsers how to handle them

  1. First, I installed the "feeds" plugin from Grails.org, http://grails.org/Feeds+Plugin. There is reasonable documentation on how to use the feeds plugin on the site, but basically:

     >grails install-plugin feeds

  2. Second, I created a SiteMap service, and added a method called "list":

    >grails create-service com.comparexy.services.SiteMap

    I will be able to re-use the "list" method for both the full site map feed, and for the latest-n feed. The list method accepts three arguments:

    • size - The maximum number of elements to list in feed. For instance, Google will only read 50,000 items in an RSS site map. If my site ever (which I am not holding my breath) gets within a magnitude of that, I'll adjust the controller to split the feeds up.
    • minState & maxState - Just a filter range that is specific to the articles. Basically, it ranges from Official, and Valid to Suggested, Flagged, and Garbage. I don't really need to feed Google a site map of the Garbage articles, so I'll filter them out. Also, the latest feeds will filter everything out that isn't marked as Official, so (assuming anyone ever subscribes) it isn't feeding merely Suggested articles, but just Official articles).


    Maybe fortunate, or unfortunately, I modeled the comparison articles to maintain their history by having multiple versions in the same database table. The latest article in the table that is marked Official by an editor (me) will be the version of the article that will be displayed when an article is requested. So, to get a list of unique articles, I need to group them by the article identifiers, and order them by their createdDate (as you can see in the HQL below).

    I am going to pass the HQL statement that I wrote to the GORM method, executeQuery(), that was injected into the Comparison domain object. I'll add additional filters, and the maximum number of records to return.

    (Sorry for putting the code in images, but blogger.com seems to be a bit a pain to keep code formatted)
    (Snippet from SiteMapService.groovy) SiteMap Service

    * Parenthetically, the first time I used executeQuery(), I mistakenly assumed it for something that executed a native SQL statement, rather than a GORM or HQL statement, as it looks like java.sql.Statement#executeQuery(). That was quickly rectified. If you want to execute native SQL in GORM, you'll have to create an instance of groovy.sql.Sql.


  3. Thirdly, I created a controller, and added a few actions for it including "latest", "sitemap", and "blogs":

    >grails create-controller com.comparexy.controllers.Feeds

    For the latest-n feed, I needed to pass in a number from the URL, or use a default value if a good number wasn't passed in. Since the path to the feeds was already organized by Grails default (i.e."/$controller/$action/$id"), I could have just gone with that, but I figured it would be a bit clearer for me if I passed in a "num" parameter specifically instead of the "id" parameter. To do this, I updated the /conf/UrlMappings.groovy file with an entry that points to this controller, and action, but names the third parameter $num:

    (Snippet from UrlMapping.groovy)

    In the "latest" action (see code below):

    • I take the param.num that I set up in the UrlMapping.groovy above, and make it a reasonable integer that I can use.
    • I call the siteMapService.list() method, and load up some results with Official comparison articles.
      • The service's list method takes a range of states, and in this case, the upper and lower bounds ofthe range are both Official identified with the constant STATE_OFFICIAL.

    • I broke up the URL that I will eventually pass to the "feeds" service, into parts (mainly so it would fit into a screen shot) with the base, and path variables.

    Now the meat of the feeds: I pass the values for feedType, and feedVersion into the controller's render method. I hard-code the those values for RSS, but I could have (and I will be doing a little refactoring here shortly) passed in a "feedType" argument to the action, and dynamically set this to be an Atom, ROME, or ITunes feed rather than RSS. The "feeds" plugin defines a Builder DSL, which I used to define the content of the feed such as title, link (of the feed), and description. Then, for each record that I received from the SiteMap service, I add an entry element in the Builder DSL. The entry method takes a title inside it's parenthesis, and inside of the closure, you set the author, publishedDate, and link. For my title, I used the terms from the comparison like "This vs That".

    (Snippet from FeedsController.groovy)


    To the above controller, I also added an action for both sitemap, and blogs. The "sitemap" action uses the same SiteMap service method that "latest" action uses. The "blogs" action just used the Gorm DomainObject.list() method with a couple of properties for sorting: Blog.list(sort: 'dateCreated', order: 'desc' )

  4. So, that was fairly easy so far. The hardest thing was deciding what I wanted to put into the feed. Now I need to share the feed with the world by putting some links on my site.

    Before I put the links back to the appropriate actions, I used the feeds plugin's <feed:meta...> tags for assisting me in telling the browser the content type to expect at the other end of the RSS links. Again, I could have done this dynamically, and placed Atom, ROME, or ITunes in, but here I hard-coded RSS. I placed these in the <head...> tag of my main.gsp layout file.

    Snippet from main.gsp layout


    The output from the above feeds tags on the source code of the rendered web pages is as follows below:

    Snippet output from the what the above <feed:meta...> tags created


    Now, when I put the following orange feed squares links in my page as below, the browser will recognize the same URL that is referenced in the tag, and know that the intention is render the content at the other end of the link as a feed, and not as the plain XML that is delivered to the browser.RSS feeds to the site blog (left), and to the latest 20 articles (right)



    RSS feed to the sitemap for Google (and maybe other search engines if they accept RSS)


    Ok, it took me longer to write this blog than it did to add the feeds.

26.Apr.2010 08:22 AM in News, Jobs, Marketplace
April 2010 Groovy - Grails Job Market

The Tiobe Index shows a drop in the rating, though it held steady in rank. Dice and Grailsjobs both showed increases, while Indeed showed a drop in all three categories, perhaps reflecting a regression to mean after two months of very solid increases.

The TIOBE Programming Community Index for Groovy
Month / YearRatingChange Rank
04/20100.238%-0.142%44
03/20100.380%0.119%44
02/20100.261%0.013%40
01/20100.248%0.078%41
12/20090.170%0.018%44
11/20090.152%0.152%47
10/2009---0.154%--
09/20090.154%0.037%46
08/20090.117%0.003%48
07/20090.114%-0.038%47
06/20090.152%0.020%36
05/20090.132%-0.033%41

Dice Keyword Search for Groovy and Grails
Month / YearGroovy/GrailsChangeGrailsChangeGroovyChange
04/20106147871258
03/20105723711811717
02/201034553111009
01/2010292426910
12/200927-836-1091-7
11/200935-1446-1298-17
10/20094915581611534
09/2009341542108116
08/200919-832-365-3
07/20092743566812
02/2009231129125625
01/200912--17--31--

Indeed Keyword Search for Groovy and Grails
Month / YearGroovy/GrailsChangeGrailsChangeGroovyChange
04/2010335-64487-69754-98
03/2010399132556174852146
02/20102674738234706131
01/2010220109348160575248
12/2009111-145188-168327-303
11/2009256-83562630-13
10/200926410335475643218
09/20091613279-17425-52
08/2009158-102962247770
07/200916879274164407102
02/20098918110-11305-80
01/200971--121--385--

GrailsJobs Postings By Month
Month / YearPostingsChange
04/2010124
02/201086
01/201020
12/20092-1
11/200931
10/200922
09/20090-8
08/200980
07/200985
06/200931
05/200922
04/200900

This is a non-scientific survey. It is meant to give the interested reader a general idea of trends within the GR8 technologies job market. Results from keyword searches of job boards should be considered carefully as the results represent the number jobs containing the keyword in the description. The numbers from GrailsJobs represent the total number postings by month. The numbers from Tiobe are pulled from the survey published this month. The numbers from Dice and Indeed represent the results of keyword searches as of the day this survey was published. Suggestions of other sources of job market information are always welcome. Please comment on this blog post with any suggestions you may have.

13.Apr.2010 11:09 AM in GR8 In The US
GR8 in the US is Friday
GR8 in the US happens Friday! I feel as I am giving birth! I am stoked! Shaun Jurgemeyer, Dave Klein and I have worked very hard to make sure that this event comes off well, that everyone is satisfied and looks forward to next year. We have 25 books to giveaway, a copy of GroovyMag and t-shirts. We believe we have put together a good mix of sessions covering a wide range of topics, and with the round table and the after event mixer/happy hour, we think the event is a GR8 value. Of course, we are really looking forward to reading the evaluations to see what needs improving. Those forms are important. Everyone will be read! Most attendees should already know how to reach us, either through the GR8 in the US site, or directly via one of our social networking sites. I would really love to hear from those that decided not to come, there reasons for not doing so, and suggestions that would increase the likelihood they would attend next year.

With a number of last minute registrations, there will be a pretty good turnout. We would like more, so if you have not registered yet and are planing on coming, do so now. The registration system shuts down as the servers cross midnight tomorrow and they are not located in the US (okay, a bit of a design flaw, live with it). Register now or miss out on the opportunity to hear 11 GR8 speakers, choose from 14 sessions and mix and mingle during happy hour after the event. Do not miss out on this GR8 event. Register today! Come join the fun!
31.Mar.2010 10:09 AM in News, Jobs, Marketplace
March 2010 Groovy - Grails Job Market

Dice, Indeed and Grails Jobs all showed strong growth over the previous month, while the Tiobe index, both the rating and rank, fell.

Note that after the GR8 in the US conference, I am going to devote more time to improving this regular posting, pulling in more sources, fully automating it, and, eventually, providing year over year and other comparisons. Suggestions are welcome.

The TIOBE Programming Community Index for Groovy
Month / Year Rating Change Rank
03/2010 0.238% -0.023% 44
02/2010 0.261% 0.013% 40
01/2010 0.248% 0.078% 41
12/2009 0.170% 0.018% 44
11/2009 0.152% 0.152% 47
10/2009 -- -0.154% --
09/2009 0.154% 0.037% 46
08/2009 0.117% 0.003% 48
07/2009 0.114% -0.038% 47
06/2009 0.152% 0.020% 36
05/2009 0.132% -0.033% 41
04/2009 0.165% 0.031% 36

Dice Keyword Search for Groovy and Grails
Month / Year Groovy/Grails Change Grails Change Groovy Change
03/2010 57 23 71 18 117 17
02/2010 34 5 53 11 100 9
01/2010 29 2 42 6 91 0
12/2009 27 -8 36 -10 91 -7
11/2009 35 -14 46 -12 98 -17
10/2009 49 15 58 16 115 34
09/2009 34 15 42 10 81 16
08/2009 19 -8 32 -3 65 -3
07/2009 27 4 35 6 68 12
02/2009 23 11 29 12 56 25
01/2009 12 -- 17 -- 31 --

Indeed Keyword Search for Groovy and Grails
Month / Year Groovy/Grails Change Grails Change Groovy Change
03/2010 399 132 556 174 852 146
02/2010 267 47 382 34 706 131
01/2010 220 109 348 160 575 248
12/2009 111 -145 188 -168 327 -303
11/2009 256 -8 356 2 630 -13
10/2009 264 103 354 75 643 218
09/2009 161 3 279 -17 425 -52
08/2009 158 -10 296 22 477 70
07/2009 168 79 274 164 407 102
02/2009 89 18 110 -11 305 -80
01/2009 71 -- 121 -- 385 --

GrailsJobs Postings By Month
Month / Year Postings Change
03/2010 8 6
01/2010 2 0
12/2009 2 -1
11/2009 3 1
10/2009 2 2
09/2009 0 -8
08/2009 8 0
07/2009 8 5
06/2009 3 1
05/2009 2 2
04/2009 0 0
03/2009 0 -3

This is a non-scientific survey. It is meant to give the interested reader a general idea of trends within the GR8 technologies job market. Results from keyword searches of job boards should be considered carefully as the results represent the number jobs containing the keyword in the description. The numbers from GrailsJobs represent the total number postings by month. The numbers from Tiobe are pulled from the survey published this month. The numbers from Dice and Indeed represent the results of keyword searches as of the day this survey was published. Suggestions of other sources of job market information are always welcome. Please comment on this blog post with any suggestions you may have.

03.Mar.2010 06:43 AM in GR8 In The US
Last chance for GR8 in the US conference $100 discount!
Register now! Save $100! Space is limited!

GR8 in the US is a one day conference dedicated to the software language Groovy, software development frameworks Grails and Griffon, and related technology. Eleven different speakers will present fourteen talks and two workshops. A round table discussion will conclude the formal sessions. The conference will close with a Meet
The Speakers Happy Hour and Networking
event.

Guillaume Laforge, the Groovy project lead and co-author of Groovy in Action will be the keynote speaker. Venkat Subramaniam, founder of Agile Developer and author or co-author of the books .NET Gotchas, Practices of an Agile Developer, Programming Groovy: Dynamic Productivity for the Java Developer and Programming Scala, will be delivering the kickoff speech.

GR8 in the US will be held April 16th, 2010 at the Holiday Inn Bloomington I-35W, 1201 West 94th Street, Bloomington, MN 55431, just minutes from the Minneapolis/St. Paul International Airport (MSP) and the Mall of America.

It will be fun! Come join us!
20.Feb.2010 03:25 PM in GR8 In The US
GR8 In The US Conference Agenda Now Available
The agenda for the GR8 in the US conference has been posted. There are eleven GR8 speakers giving presentations and leading hands-on workshops. What I find particularly exciting is that the conference will close with a Meet The Speakers Happy Hour where attendees will be able to meet and discuss GR8 subjects with the speakers and other attendees.

Register now! Save $100! Space is limited!

GR8 in the US is a one day conference dedicated to the software language Groovy, software development frameworks Grails and Griffon, and related technology. It will be held April 16th, 2010 at the Holiday Inn Bloomington I-35W, 1201 West 94th Street, Bloomington, MN 55431. Guillaume Laforge, the Groovy project lead and co-author of Groovy in Action will be the keynote speaker. Venkat Subramaniam, founder of Agile Developer and author or co-author of the books .NET Gotchas, Practices of an Agile Developer, Programming Groovy: Dynamic Productivity for the Java Developer and Programming Scala, will be delivering the kickoff speech.
15.Feb.2010 04:45 PM in News, Jobs, Marketplace
February 2010 Groovy - Grails Job Market

The trend looks positive again this month, acheiving the highest rating at Tiobe since I've begun tracking (though not the highest rank), and the highest number of postings in all three categories at Indeed. Dice showed gains across all three categories, though did not reach new heights. Grailsjobs is the outlier with the number of postings remaining flat.

The TIOBE Programming Community Index for Groovy
Month / Year Rating Change Rank
02/2010 0.261% 0.013% 40
01/2010 0.248% 0.078% 41
12/2009 0.170% 0.018% 44
11/2009 0.152% 0.152% 47
10/2009 -- -0.154% --
09/2009 0.154% 0.037% 46
08/2009 0.117% 0.003% 48
07/2009 0.114% -0.038% 47
06/2009 0.152% 0.020% 36
05/2009 0.132% -0.033% 41
04/2009 0.165% 0.031% 36
03/2009 0.134% 0.005% 42

Dice Keyword Search for Groovy and Grails
Month / Year Groovy/Grails Change Grails Change Groovy Change
02/2010 34 5 53 11 100 9
01/2010 29 2 42 6 91 0
12/2009 27 -8 36 -10 91 -7
11/2009 35 -14 46 -12 98 -17
10/2009 49 15 58 16 115 34
09/2009 34 15 42 10 81 16
08/2009 19 -8 32 -3 65 -3
07/2009 27 4 35 6 68 12
02/2009 23 11 29 12 56 25
01/2009 12 -- 17 -- 31 --

Indeed Keyword Search for Groovy and Grails
Month / Year Groovy/Grails Change Grails Change Groovy Change
02/2010 267 47 382 34 706 131
01/2010 220 109 348 160 575 248
12/2009 111 -145 188 -168 327 -303
11/2009 256 -8 356 2 630 -13
10/2009 264 103 354 75 643 218
09/2009 161 3 279 -17 425 -52
08/2009 158 -10 296 22 477 70
07/2009 168 79 274 164 407 102
02/2009 89 18 110 -11 305 -80
01/2009 71 -- 121 -- 385 --

GrailsJobs Postings By Month
Month / Year Postings Change
01/2010 2 0
12/2009 2 -1
11/2009 3 1
10/2009 2 2
09/2009 0 -8
08/2009 8 0
07/2009 8 5
06/2009 3 1
05/2009 2 2
04/2009 0 0
03/2009 0 -3
02/2009 3 1

This is a non-scientific survey. It is meant to give the interested reader a general idea of trends within the GR8 technologies job market. Results from keyword searches of job boards should be considered carefully as the results represent the number jobs containing the keyword in the description. The numbers from GrailsJobs represent the total number postings by month. The numbers from Tiobe are pulled from the survey published this month. The numbers from Dice and Indeed represent the results of keyword searches as of the day this survey was published. Suggestions of other sources of job market information are always welcome. Please comment on this blog post with any suggestions you may have.

15.Feb.2010 08:16 AM in GR8 In The US
GR8 in the US 2010 Conference Registration Now Open
Registration for GR8 in the US is now open! Go to http://www.gr8conf.org/ to register. Save $100! Register today!

GR8 in the US is a one day conference dedicated to the software language Groovy, software development frameworks Grails and Griffon, and related technology. It will be held April 16th, 2010 at the Holiday Inn Bloomington I-35W, 1201 West 94th Street, Bloomington, MN 55431. Guillaume Laforge is the Groovy project lead and co-author of Groovy in Action will be the keynote speaker. Venkat Subramaniam, founder of Agile Developer and author or co-author of the books .NET Gotchas, Practices of an Agile Developer, Programming Groovy: Dynamic Productivity for the Java Developer and Programming Scala, will be delivering the kickoff speech.
27.Jan.2010 11:11 AM in GR8 In The US
GR8 in the US CFP ending 05.Feb.2010
If you wish to submit a presentation, go to http://www.gr8conf.org/proposal/create.

GR8 in the US is a one day conference dedicated to the software language Groovy, software development frameworks Grails and Griffon, and related technology. It will be held April 16th, 2010 at the Holiday Inn Bloomington I-35W, 1201 West 94th Street, Bloomington, MN 55431. Guillaume Laforge is the Groovy project lead and co-author of Groovy in Action will be the keynote speaker. Venkat Subramaniam, founder of Agile Developer and author or co-author of the books .NET Gotchas, Practices of an Agile Developer, Programming Groovy: Dynamic Productivity for the Java Developer and Programming Scala, will be delivering the kickoff speech.
27.Jan.2010 08:17 AM in News, Jobs, Marketplace
January 2010 Groovy - Grails Job Market

The trends are up this month for Tiobe, Dice and Indeed. Grails Jobs showed a slight loss. The Tiobe rating is at the highest level it has ever been since I've begun tracking it. The rank (position) is not, however. After two straight months of declines across all keyword searches on Dice and Indeed, they both showed gains across all keyword searches.

Note that I have slightly altered the way the data is presented. For periods where there was no data, as in the Tiobe numbers from October, I've used zero for the relevant numbers. I felt this was a little better when looking at the month to month changes. I also ignored the fact that there is a several month gap in the Dice and Indeed data, thus comparing July numbers to February numbers. This will correct itself in a few more months. Finally, I've set the negative changes to red, hopefully making upturns and downturns easier to spot.

The TIOBE Programming Community Index for Groovy
Month / YearRatingChange Rank
01/20100.248%0.078%41
12/20090.170%0.018%44
11/20090.152%0.152%47
10/2009---0.154%--
09/20090.154%0.037%46
08/20090.117%0.003%48
07/20090.114%-0.038%47
06/20090.152%0.020%36
05/20090.132%-0.033%41
04/20090.165%0.031%36
03/20090.134%0.005%42
02/20090.129%-0.006%40

Dice Keyword Search for Groovy and Grails
Month / YearGroovy/GrailsChangeGrailsChangeGroovyChange
01/2010292426910
12/200927-836-1091-7
11/200935-1446-1298-17
10/20094915581611534
09/2009341542108116
08/200919-832-365-3
07/20092743566812
02/2009231129125625
01/200912--17--31--

Indeed Keyword Search for Groovy and Grails
Month / YearGroovy/GrailsChangeGrailsChangeGroovyChange
01/2010220109348160575248
12/2009111-145188-168327-303
11/2009256-83562630-13
10/200926410335475643218
09/20091613279-17425-52
08/2009158-102962247770
07/200916879274164407102
02/20098918110-11305-80
01/200971--121--385--

GrailsJobs Postings By Month
Month / YearPostingsChange
12/20092-1
11/200931
10/200922
09/20090-8
08/200980
07/200985
06/200931
05/200922
04/200900
03/20090-3
02/200931
01/20092--

This is a non-scientific survey. It is meant to give the interested reader a general idea of trends within the GR8 technologies job market. Results from keyword searches of job boards should be considered carefully as the results represent the number jobs containing the keyword in the description. The numbers from GrailsJobs represent the total number postings by month. The numbers from Tiobe are pulled from the survey published this month. The numbers from Dice and Indeed represent the results of keyword searches as of the day this survey was published. Suggestions of other sources of job market information are always welcome. Please comment on this blog post with any suggestions you may have.


sun mon tue wed thu fri sat
     1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Archives
Categories
Bookmarks
Authors
Search
Syndicate This Site
Add to Technorati Favorites