Wednesday, June 20, 2012

First Thoughts on the New Project

I have been experimenting with STS and Grails 2.0.4 for one week now. The initial idea was to spend two hours a night five nights a week. The first thing I learned is Monday through Thursday spending two hours at something that feels like work is all right. Friday night I didn't feel like it but I thought Sunday night made more sense anyway. Sunday night I didn't feel like it either. So I am not sure if five nights a week is really going to happen.

Quick Hits


  • If you want to use Groovy Eclipse in STS don't install STS in the Program Files directory.
  • STS is easy to move if you need to, just drop the folder somewhere else.
  • H2 has a console and Grails makes it available in the dev environment (grails dev run-app).
  • You can add an environment to the STS menu commands using Run > Run Configurations...

STS Run Configurations dialog box.
  • Pressing Ctrl+Shift+Alt+G brings up a Grails command prompt.
  • When running in dev use  http://localhost:8080/{appname}/dbconsole to get to the console.
  • The default JDBC URL is jdbc:h2:mem:devDb and Password is blank.
H2 Console login page.
I did write a very small amount of code. Small amounts of code is one of the reasons I really enjoy Grails. One domain class, scaffold controller with two additional actions, taggable plugin, one template, six lines added to the show view and the result is some jQuery fun.




Thursday, June 14, 2012

And the Winner is...

...STS

The first task I will try and document is setting up a development machine. I have a nice vanilla 64-bit Windows 7 PC with almost nothing installed. Not even a JDK. The first decision I made is to use Grails, current production version, 2.0.4. The second decision was more difficult, which IDE? I haven't worked in Eclipse for quite awhile. I used to have a total Sun fascination including using NetBeans. There is definitely a pun to be made but I'll restrain myself. If Grails support was included in the community edition of IntelliJ IDEA it would receive strong consideration. One of the reasons I chose STS is there are a lot of resources available to help me learn to use the software. This webinar recording got me excited to get going.

Groovy and Grails Applications with the SpringSource Tool Suite

When I went to download STS I noticed the following:

The following pre-requisites must be fulfilled in order to install STS:
  • Operating System: Microsoft Windows XP/Vista/7, Apple Mac OS X, Linux
  • Java Runtime: latest version of JDK 5 or 6 (a JRE will not be enough to use all STS features)
  • Hardware: 500MB free disk space, 2GB memory

Now I have another decision to make. Is there any reason I wouldn't use Java 6? Additional research may be required. I grabbed the STS version that needs a 64-bit JDK so off to find me some Java. Interesting discovery, I noticed the JRE installed on my 64-bit operating system is a 32-bit version. Might as well get rid of that while I am in setup mode. Wow, Oracle just informed me that 3 billion devices run Java. JDK 6 installed. While installing STS 2.9.2 I have another question. Should I let it install their app server? I am used to Grails having a built-in app server. Do I need vFabric tc Server 2.7.0? I am going to skip it and Maven for now.
Perfect timing, it is 11:00pm.

Wednesday, June 13, 2012

Nine Two Eleven

What can you accomplish in ten hours a week? What if you tried to find out? That is my plan. I want to see how long it takes me to launch a new web site working on it from 9:00 - 11:00pm five nights a week. Here is my expected schedule:
  • 9 -5 work to pay the bills
  • 5 - 9 enjoy my family
  • 9 - 11 do something different
It is highly likely I won't actually work at doing something different as often as I plan but I need to start somewhere so that is what I'll start with.

I have been trying to come up with something to work on and so far the favorite idea is a fairly simple web site. Two items will be displayed and one can be voted for to determine the winner each day. The day's winner will be sent out via Twitter and can be viewed on the site. Simple.

Supply List

Data store to hold the items and the votes
Ability to track who voted
Scheduled process to calculate the winner
Some kind of broadcast

I will try and explain the decisions I make when selecting tools to use in the project. So far I am leaning toward being a SpringSource fanboy and developing a Grails application for Cloud Foundry using STS. Follow along and see if I change my mind.

Wednesday, November 4, 2009

Adding a User Property to Oracle WebCenter Interaction

Recently I had to create a portal security group for director level and above employees. Our HR system feeds Active Directory a field containing each persons grade. Based on the grade it is possible to determine which users should be included in the security group. All I needed to do was add a property for grade to the user profile, populate it, and create a group with dynamic memberships based on the contents of the new property.

Monday, November 2, 2009

Blogger Buzz: New Transparent Navbar Styles

I just started using a new Blogger feature and it looks great.
Blogger Buzz: New Transparent Navbar Styles
If you can't tell the difference it is because this blog looks good with the default navbar at the top. However, the new light transparent style really looks good over at Social Media at Work.

Thursday, October 29, 2009

Amazon EC2 Now 15% Lower Price

Effective November 1, 2009 United States prices for Linux/UNIX usage will drop from 10 cents an hour to 8.5 cents per hour. By my quick calculations this will drop the minimum monthly fee for a continuously available instance from around $72 to just over $61. Prices in Europe are also dropping. Get the pricing details.

Thursday, October 22, 2009

Oracle WebCenter Interaction Security

One of the strengths of the WebCenter Interaction (WCI) portal is extremely granular security.  Every WCI portal object has security.  This can also create a maintenance nightmare when security needs change.  It is difficult to remember all of the objects that need to be updated.  If you change a page and forget the portlets it doesn't work very well.  Likewise, a user can have access to a snapshot query portlet but if they don't have access to the objects being queried they would see an empty portlet.  It reminds me of the saying, with great power comes great pain-in-the-tush.

Friday, October 16, 2009

IntelliJ IDEA Community Edition — Free and OS Java IDE

This is almost great news. The open source version of IntelliJ IDEA will only be missing one feature that I want, the Grails framework.

http://www.jetbrains.com/idea/nextversion/free_java_ide.html

Somehow I doubt they will sell me one feature without the need to purchase the Ultimate Edition.
http://www.jetbrains.com/idea/nextversion/editions_comparison_matrix.html

Thursday, September 17, 2009

Grails Hosting in the Cloud

How simple can hosting become? I’m not interested in a private cloud or putting servers in a public cloud, I want a cloud web site. To me the difference is with a server in the cloud you need to configure and manage the application server, while hosting an application in the cloud allows the provider to manage the application server for you. Ideally I’d like a solution like Heroku with their instant Ruby platform. What are the choices for completely managed Grails hosting today?

Morph Labs

Used by grailspodcast.com – The Groovy & Grails Podcast.
Morph Labs appears to be ready to manage everything except writing your application. With Exist thrown into the mix they may even do that for you too.

Google App Engine

Used by groovytweets ::: groovy in the twitter universe.
Google App Engine is from Google so I assume it will eventually dominate the Earth and any additional planets that tap into our Internet. Long denied Java love this solution grew from Google’s amazing amount of cheap servers and can now host Groovy and Grails.

Cloud Foundry

I don’t have an example site but Marcel’s excellent blog post provides detailed instructions on how to deploy a Grails application. There are a ton of comments wishing you didn’t need to bring your own fulltime Amazon EC2 instance with you as that sets the floor for pricing above most dedicated Virtual Private Server offerings.

Stax

This one came from a comment on Marcel’s blog and it looks promising. They web site claims to support Grails and it can scale down below a full EC2 instance as well as up to multi-server clusters. Being able to begin with less than a 24/7 server instance sounds appealing but may need further investigation.

Something Else

I’m certain that I must have missed something.  There are probably lots of other capable solutions because there seem to be new offerings every week. Of course they need to support Java. I looked at Rackspace and Joyent but they didn’t seem to cover the management and/or Java requirements. If you know of additional services for Grails hosting in the cloud please let me know in the comments. I’d like to develop a comprehensive list.

Thursday, September 10, 2009

Resource List from kellyrob99.com: The Kaptain on ... stuff

I found this great list of resources today:
Do you make keeping up with technology a priority? Have you found a way to prevent drowning in the vast sea of content AND still keep abreast of everything you want to? Me neither, but here’s where I go to learn new things, find solutions and keep up with the general state of the union regarding software I use; not to mention keeping track of what new tools are available to speed development.  This is far from an exhaustive list but I wanted to concentrate on primarily free sources of information and tooling. Yes ladies and gentlemen pretty much everything mentioned on this page requires at most an internet connection and a web browser to use.kellyrob99.com, The Kaptain on … stuff, Sep 2009
You should read the whole article.

Thursday, September 3, 2009

Waiting on Oracle Sunset

The worry over MySQL may hold up Oracle's acquisition of Sun. Sun has so much hardware and software yet it is the potential Oracle ownership of the open source database that could be a problem for competition. I don't know that I disagree but it is interesting that an open source product could be cause for an anti-competitive issue. If the competitors (SAP and Microsoft) really felt this way couldn't they get the bits? It is the chance that Oracle could slack off on future development of MySQL that seems to be the problem. Europe to Review Oracle’s Takeover of Sun

Wednesday, September 2, 2009

The Pragmatic Programmers Have a Free Magazine

For three months there has been a magazine available from the The Pragmatic Programmers and I just found out. Scott Davis has a nice Groovy article in the September edition.

Wednesday, August 19, 2009

SpringSource Launches Enterprise Java Cloud

SpringSource Launches Enterprise Java Cloud

This is interesting. However, I am always a little nervous about a single vendor providing every part of a solution. I think that may not be justified, especially in this case. I've assumed for some time that any future Grails projects I do would be hosted in the cloud. There are multiple vendors doing a good job of supporting Grails in the cloud already. I will keep an eye on what SpringSource does because I expect they will do a great job of supporting Grails.

Monday, August 17, 2009

Friday, August 14, 2009

New iGoogle Social Features

This morning I noticed new menu items on my iGoogle home page. They have enabled social features. Gadgets can now share information with your Friends. I think this is interesting because it seems to shift to more passive notification. Instead of updating a social network manually the updates are simply a stream of actions taken by Friends. Your friends don't need to tell you they updated online photos, Google lets you know. For example, this post is being made in an iGoogle gadget that is social enabled and configured to share with my Friends. They will be able to see that I made a blog post on their iGoogle home page. For more information see Introducing social gadgets for iGoogle.

Wednesday, August 12, 2009

About

Time to reboot the blog. I've let it sit long enough.

Since this post will serve as the new information station for those who would like to learn more about All The Way To The Beginning , I'll provide a little history and try to predict a tiny bit of the future.

Originally this blog was intended to follow a web development project from inception until launch. It came close, but I didn't recognize it at the time. There was a launch but it wasn't intended to be a real site, it was the practice round to ensure everything would work as expected. Unfortunately the big idea never materialized and the process stopped short of the goal. The practice site was the only product launch achieved. Now I have decided to let the Quote of Tomorrow site remain down permanently.

For round two I plan to be a little more personal, after all it is just me this time. The topics will continue to be technologies that interest me. However, I will likely add in more of the 9 to 5 things I deal with as an Oracle Web Center Interaction portal administrator. Yes, it is a mouthful and the acronym is even worse, Oracle WCI 10gR3. The dream is, of course, convergence of the work hours efforts with the free time pursuits and I'll be sure to detail any chance I have to use Groovy and Grails in portal deployments. It is not currently on the radar screen but you have to have a dream, right?

Sunday, February 8, 2009

OpenSolaris Workstation Step 3

OpenSolaris BibleI installed a new video card so I could set up dual monitors. It works great. I made sure to get a card with an Nvidia chip set since I knew the Nvidia driver utility was already installed in OpenSolaris 2008.11. Once I got everything configured just the way I liked, I wanted to see what real development would feel like with the new setup. I downloaded Grails 1.1 Beta 3 and extracted the download in my home directory. Then I set the GRAILS_HOME environment variable to that folder.
ed@opensolaris:~$ export GRAILS_HOME=~/grails-1.1-beta3
That is easier to type than /export/home/ed/grails-1.1-beta3. JAVA_HOME hadn’t been set so that was next.
ed@opensolaris:~$ export JAVA_HOME=/usr/java
Then I totally screwed up my PATH. I didn’t know how to reference the existing path in the new path and basically wiped out the entire path when I tried to add on GRAILS_HOME/bin. If someone can educate me I’d appreciate a comment. It was easy to figure out I did something wrong because printenv didn’t work at all when I tried to check my new path. Once I redid PATH and added ~/grails-1.1-beta3/bin I crossed my fingers and typed grails in a terminal window.
ed@opensolaris:~$ grails
Welcome to Grails 1.1-beta3 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /export/home/ed/grails-1.1-beta3

No script name specified. Use 'grails help' for more info or 'grails interactive
' to enter interactive mode
In NetBeans 6.5 I set the Grails_Home under Tools > Options > Groovy then I began a new project and selected Groovy, Grails Application. Now everything really is groovy!

Sunday, February 1, 2009

Grails Training

Congratulations to the Pittsburgh Steelers on winning Superbowl XLIII. I lost a bet on the game. The Cardinal's "Feather Curtain" just didn't hold up. Regardless, it was an exciting game and you know there had to be great preparation and training for these players, like in any professional sport. Programmers on the other hand, do not always get lucrative contracts, sponsors or their own line of sneakers...but they still have to train. I recently attended a 3-day training class, "Introduction to Groovy, Grails and AJAX", hosted by Smokejumper IT's Robert Fischer. The outline of the class was as follows:

Day 1:
Installing Groovy and Grails, GroovyConsole, Classes, Properties, Methods, Closures, MVC, Structure of Grails, Configuring Grails.
Day 2:
Controllers, Views, Taglibs, Parameters, the Flash, Session, Domain Objects, Domain Objects in Controllers, Command Objects, Services.
Day 3:
Rendering non-view responses, RemoteField, RemoteFunction, RemoteLink, FormRemote, Custom AJAX via Prototype, AJAX Plugins.

This was a much-needed introduction to Groovy and Grails, especially for me since I'm a beginner to the framework. I was able to get questions answered and have access to Robert's depth of knowledge on the subject. I learned about the Grails configuration, ranges, iterators, closures, lists, maps, Grails MVC and testing. Robert also demonstrated use of the many available Grails plugins to enhance your development needs.

Whenever I'm learning a new technology, I'm grateful just to find a good book on the subject. Having Grails training available where you can learn the right way quickly is very exciting. I'm already looking ahead for the next class. Smokejumper IT has other classes scheduled on Grails Object Relational Mapping (GORM), Domain-Specific Languages, Plugins, etc. They are also available in other cities throughout the country. Details can be found at http://www.smokejumperit.com.

Friday, January 23, 2009

Grails Templates and the 960 Grid System

I stumbled across the 960 Grid System and wanted to see if it could serve as the layout foundation in a Grails application. I am pleased with the results and believe this will help speed up the initial design of new web sites. Having read several articles and blog posts demonstrating the use of templates in Grails, I could have started from scratch but decided to follow along with Mo and add the 960 Grid System to the mix.

My first impression was, "That's a lot of stylesheets!" It took me awhile to decide if I liked the modularization of the CSS but I grew to appreciate it because it helped me focus. This is the same reason I like breaking a layout into Grails templates. I haven't tried to make the result look good yet, it is intended to demonstrate a quick way to customize the structure of your layouts.

I ended up with five templates stored in a folder named common. I added a stylesheet specific to the application named layout.css since I named the application layout. Later I decided that was a confusing name but luckily this is just a quick proof of concept. I did not include the standard main.css but of course you can if desired.

The only feature of 960 Grid System that didn't perform as I wanted it to right out of the box (no offense Dave Klein) was centering the page in Internet Explorer. In order to center the page in IE I added the wrapper div with text-align: center. This required me to tweak container_12 to return everything to text-align: left. This demonstrates a very simple example but it should be easy to see how you could use Grails templates and the 960 Grid System to create just about any fixed layout you could want.

Here is main.gsp:
<html>
<head>
<title><g:layouttitle default="Layout Example"></title>
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'reset.css')}">
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'960.css')}">
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'text.css')}">
<link rel="stylesheet" href="${createLinkTo(dir:'css',file:'layout.css')}">
<g:layouthead>
</head>
<body>
<div id="wrapper">
<div class="container_12">

<div class="grid_12">
<g:render template="/common/topbar">
</div>

<div class="grid_12">
<g:render template="/common/header">
</div>

<div class="grid_12">
<g:render template="/common/menu">
</div>

<div class="grid_8">
<div id="content">
<g:layoutbody>
</div>
</div>

<div class="grid_4">
<g:render template="/common/sidepanel">
</div>

<div class="clear">

<div class="grid_12">
<g:render template="/common/footer">
</div>

</div>
</div>
</body>
</html>

Here is layout.css:
body
{
background: #99BADD;
}

#wrapper {
text-align: center;
}

.container_12 {
text-align: left;
}

#topbar {
background: url(../images/30-y.gif) repeat-x;
height: 30px;
margin-top: 20px;
}

#header {
background: url(../images/120-y.gif) repeat-x;
height: 120px;
text-align: center;
margin-top: 20px;
}

#menu {
background: url(../images/60-y.gif) repeat-x;
height: 60px;
margin-top: 20px;
}

#content {
background: url(../images/620-x.gif) repeat-y;
width: 620px;
margin-top: 20px;
}

#sidepanel {
background: url(../images/300-x.gif) repeat-y;
width: 300px;
margin-top: 20px;
}

#footer {
background: url(../images/45-y.gif) repeat-x;
height: 45px;
text-align: center;
margin-bottom: 20px;
}