After test driving Liferay 3 weeks ago, and then trying out Alfresco, I finally got serious about figuring out how best to approach building rich(er) browser based clients, which seems to boil down to which Javascript framework to use. Since the introduction of Google AppEngine support for Java, it occurred to me that one approach worth re-evaluating would be Google Web Toolkit (GWT), which allows you to write client/server apps in Java, and have the client side compiled to Javascript to run on the browser.
When I first heard about this, must be over a year ago, I thought it was a dumb idea. Having struggled since then to attempt to build browser based apps, it is starting to look pretty nice. So nice in fact that I am willing to go back into the Java side of the industry for my consulting practice, after moving away from it several years ago. My complaints at that time were:
1. There are just too many libraries and frameworks that are needed to make a system work
2. Picking the right versions was a dependency nightmare
3. All those libraries required extensive XML configuration
4. Hosting was complex and expensive, making its suitable for high end applications only.
Google's support for Java on App Engine eliminates the last objection for those applications suitable for the Google environment, which includes a number of my clients.
Having made the decision to move back into Java because of GWT, it made sense to try out Google AppEngine/Java as well. So I dutifully went through the excellent tutorials, and found it quite easy to deal with. Then I tried to actually use it to build my own web application. Having worked with several major MVC web application frameworks (Rails, Zend Framework and Catalyst), it was a major disappointment that out of the box, AppEngine doesn't offer an MVC framework for Java. So I started to look around, and explore the Java framework universe. Spring seems to be the most popular (based on shelf space at Barnes & Noble) , but the complexity of attempting to use the Spring stack (including Spring, Spring MCV, Spring Flow..., each with its own book) on AppEngine was starting to make me rethink my decision to move back into Java. That is until I discovered Grails.
Over a year ago, a collegue of mine suggested I take a look at the language Groovy. At the time it didn't seem that robust, and certainly didn't address the web application framework issue. And while Grails did attempt to solve this issue, I thought that it didn't make sense to learn both a new language and a new framework just to write web applications that would only run on high end servers.
So this week I decided it was time to give Groovy/Grails another look since several postings indicated that this now works on AppEngine. I am not going to go into the gory details here, but I can speak from personal experience that it is now possible to build a Grails app, (using JDO instead of Hibernate and GORM), and have it run on Google AppEngine. The benefit is that it takes care of the Java configuration issues mentioned earlier by using Convention over Configuration, and it provides a very capable MVC style web application framework.
The online instructions (http://www.grails.org/plugin/app-engine) and video (http://grails.org/dist/screencasts/grails-appengine-screencast.mov) are excellent , although there are several issues and bugs that I ran into. None of these seem to be show stoppers, but a couple can be major annoyances. Unfortunately that discussion will have to wait that for another day, as well as exploring how to use GWT from Grails. The Google I/O conference (http://code.google.com/events/io) is next week, there should be more information and discussions around these topics there.
Friday, May 22, 2009
Tuesday, April 28, 2009
Liferay Portal Demo with MySQL
In my previous post I discussed the reasons that Liferay Portal is interesting from an enterprise solutions perspective, followed by an initial perspective on the out of the box demo. Basically I was able to get the canned demo working, but then attempting to change from the embedded hsql database to mysql was not initially successful. After initially attempting it on Windows, I switched to Linux because MySQL was already installed on that server.
In searching for a solution, I ran across the following the post Windows Quick Installation Guide For Liferay 5.2.1 With Tomcat 6.0 Bundle and MySQL Database which described the procedure for running against MySQL in a Windows environment. The following procedure is an adaptation of that which worked for me in Linux (Ubuntu). Note: I am assuming that the downloads are installed in my home directory. You can install them anywhere, but need to adjust the instructions accordingly.
1. Download Java
While this is not necessary, I decided to bypass the normal Java installation using Ubuntu packages, and instead downloaded and installed the Java SE bundle from SUN. From the menu bar at the top of the page, click Download >> Java SE. While a Java runtime should be sufficient, I downloaded the Java SE Development Kit (JDK) part way down the page.
2. Install Java SDK
Once downloaded, it is necessary to make the downloaded file executable and then execute it to unpack the files. Note: The following assumes you downloaded the JDK into your home directory. From the command prompt:
chmod +x ~/jdk-6u13-linux-i586.bin
~/jdk-6u13-linux-i586.bin
3. Download the Liferay Portal bundle.
Go to the Liferay Portal site http://www.liferay.com/. Part way down the page, under the heading Liferay Portal Standard Edition click the download link. Note: There are a lot of other bundles to choose from further down on the page, but this will suffice for now. Unzip the downloaded bundle in a directory of your choice. You need to make the scripts in the bundle executable as follows:
chmod +x ~/liferay-portal-5.2.2/tomcat-5.5.27/bin/*.sh
Note: Your versions may be different, so substitute the version numbers in the bundle that you actually downloaded.
4. Monitor Tomcat server
You can optionally open a new window to monitor the Tomcat server:
tail -f ~/liferay-portal-5.2.2/tomcat-5.5.27/catalina.out
5. Run the Basic Demo
At this point you should be able to run the demo bundle using the default HSQL database and demo configuration as follows. Open a command prompt, and change to the root directory of the liferay bundle. Then set the JAVA_HOME environment variable, and run the system. Note: substitute the actual path of your installation. After the system starts up in approximately 1-2 minutes, it should automatically open a window in your browser and display the demo site.
cd ~/liferay-portal-5.2.2
JAVA_HOME=~/jdk1.6.0_13
export JAVA_HOME
tomcat-5.5.27/bin/startup.sh
6. Stop the Basic Demo
When you are done, shutdown Liferay:
tomcat-5.5.27/bin/shutdown.sh
The following steps move to the basic test system, running under mysql. It assumes that mysql is already installed on your system.
7 Remove the Basic App from the Bundle
I am not sure this is actually required for this step, but it worked when I did it, so why not.
rm -r ~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/sevencogs-theme
rm -r ~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/sevencogs-hook
8. Create MySQL database
From your mysql command prompt:
create database lportal character set utf8;
9. Create Configuration Extension File
In order to tell Liferay to use a MySQL database instead of the preconfigured HSQL database, it is necessary to create the an extension file with the MySQL properties. Note: substitute your own MySQL userid/password in the following
Open the following file using your favorite editor (create if necessary):
~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Enter the following lines:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=YOURUSERNAME
jdbc.default.password=YOURPASSWORD
10. Run the MySQL Test Site
At this point you should be able to run the test site using the MySQL database. Using the same procedure as step #5, open a command prompt, and change to the root directory of the liferay bundle. Then set the JAVA_HOME environment variable, and run the system.
cd ~/liferay-portal-5.2.2
JAVA_HOME=~/jdk1.6.0_13
export JAVA_HOME
tomcat-5.5.27/bin/startup.sh
You should be able to see a line in the output window where the portal-ext.properties file is loaded, as well as where the MySQL database tables are initially loaded.
Now that I got to this point, it isn't so bad. And in all fairness, it wasn't the XML configuration swamp that kept me from success in the previous post. :-)
In searching for a solution, I ran across the following the post Windows Quick Installation Guide For Liferay 5.2.1 With Tomcat 6.0 Bundle and MySQL Database which described the procedure for running against MySQL in a Windows environment. The following procedure is an adaptation of that which worked for me in Linux (Ubuntu). Note: I am assuming that the downloads are installed in my home directory. You can install them anywhere, but need to adjust the instructions accordingly.
1. Download Java
While this is not necessary, I decided to bypass the normal Java installation using Ubuntu packages, and instead downloaded and installed the Java SE bundle from SUN. From the menu bar at the top of the page, click Download >> Java SE. While a Java runtime should be sufficient, I downloaded the Java SE Development Kit (JDK) part way down the page.
2. Install Java SDK
Once downloaded, it is necessary to make the downloaded file executable and then execute it to unpack the files. Note: The following assumes you downloaded the JDK into your home directory. From the command prompt:
chmod +x ~/jdk-6u13-linux-i586.bin
~/jdk-6u13-linux-i586.bin
3. Download the Liferay Portal bundle.
Go to the Liferay Portal site http://www.liferay.com/. Part way down the page, under the heading Liferay Portal Standard Edition click the download link. Note: There are a lot of other bundles to choose from further down on the page, but this will suffice for now. Unzip the downloaded bundle in a directory of your choice. You need to make the scripts in the bundle executable as follows:
chmod +x ~/liferay-portal-5.2.2/tomcat-5.5.27/bin/*.sh
Note: Your versions may be different, so substitute the version numbers in the bundle that you actually downloaded.
4. Monitor Tomcat server
You can optionally open a new window to monitor the Tomcat server:
tail -f ~/liferay-portal-5.2.2/tomcat-5.5.27/catalina.out
5. Run the Basic Demo
At this point you should be able to run the demo bundle using the default HSQL database and demo configuration as follows. Open a command prompt, and change to the root directory of the liferay bundle. Then set the JAVA_HOME environment variable, and run the system. Note: substitute the actual path of your installation. After the system starts up in approximately 1-2 minutes, it should automatically open a window in your browser and display the demo site.
cd ~/liferay-portal-5.2.2
JAVA_HOME=~/jdk1.6.0_13
export JAVA_HOME
tomcat-5.5.27/bin/startup.sh
6. Stop the Basic Demo
When you are done, shutdown Liferay:
tomcat-5.5.27/bin/shutdown.sh
The following steps move to the basic test system, running under mysql. It assumes that mysql is already installed on your system.
7 Remove the Basic App from the Bundle
I am not sure this is actually required for this step, but it worked when I did it, so why not.
rm -r ~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/sevencogs-theme
rm -r ~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/sevencogs-hook
8. Create MySQL database
From your mysql command prompt:
create database lportal character set utf8;
9. Create Configuration Extension File
In order to tell Liferay to use a MySQL database instead of the preconfigured HSQL database, it is necessary to create the an extension file with the MySQL properties. Note: substitute your own MySQL userid/password in the following
Open the following file using your favorite editor (create if necessary):
~/liferay-portal-5.2.2/tomcat-5.5.27/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Enter the following lines:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=YOURUSERNAME
jdbc.default.password=YOURPASSWORD
10. Run the MySQL Test Site
At this point you should be able to run the test site using the MySQL database. Using the same procedure as step #5, open a command prompt, and change to the root directory of the liferay bundle. Then set the JAVA_HOME environment variable, and run the system.
cd ~/liferay-portal-5.2.2
JAVA_HOME=~/jdk1.6.0_13
export JAVA_HOME
tomcat-5.5.27/bin/startup.sh
You should be able to see a line in the output window where the portal-ext.properties file is loaded, as well as where the MySQL database tables are initially loaded.
Now that I got to this point, it isn't so bad. And in all fairness, it wasn't the XML configuration swamp that kept me from success in the previous post. :-)
Labels:
cms,
enterprise portal,
j2ee,
java,
liferay portal,
mysql,
open source,
tomcat,
web applications
Saturday, April 25, 2009
In Search of an Enterprise Portal
It is always a little amusing, and overwhelming to wander over to the CMS Matrix site and try to figure out from their listings which of the over 1000 different content management systems listed has the specific set of characteristics that are necessary for a particular client. (As an aside, they seem to have implemented a new Web 2.0 style user interface, which is really, really slow. I mean really, really, really slow. I thought Web 2.0 was about performance!) Anyway, I digress.
My particular hot button in the selection of a competent CMS/Portal system is its ability to handle flexible groups with granular permissions. By that I mean it should support a large organization, with different groups, and in each group, different people can assume different roles/responsibilities. The check boxes on the CMS matrix often sound like the right sort of indicator, but once I dig into the systems that it recommends, I usually come away disappointed. What is meant by "Granular Permissions", "Sub-sites", etc. mean different things to different people, and even in the matrix there is no consistency.
After my last foray into matrix confusion, I took a pause, and a deep breath, and decided to have another look at a system that was in principle one of my favorites in the past, even though it has never quite had the features necessary to solve my clients problems. The system is the Liferay Portal. There are several things I liked about it when I evaluated it in the past. One was its ability to handle a complex organizational structure. Another was its ability to have many instances of each content type. Where simple CMS systems may allow for a single forum for example, Liferay Portal allows for many forums, and they can be localized in each part of the organization. And another feature I liked was that its URLs are structured in a way that makes sense to PEOPLE, not some artifact of MVC routing based on module/controller/action. And I love the portlet concept, which was in some ways a predecessor to the current widget craze, but based on real server architecture.
The thing I didn't like about it was its dependence on J2EE, with the complex hosting requirements and daunting XML configuration requirements just to make it work. Chalk it up to personal preference, but I absolutely hate having to sort through directories searching for just the right configuration option (in XML) to make the system work the way I want it to. That was one reason I moved away from J2EE systems in the past. Personally I love Java, but just couldn't stand the nightmare of configuration required to make the systems work. In contrast many popular PHP-based CMS systems run the user through a simple web-based configuration script, after which it just works.
I have been hearing rumblings from the Java community about adopting some of the principles espoused by the Ruby on Rails community, especially regarding "Convention over Configuration", so I thought it might be time for another look at my old friend the Liferay Portal.
At first glance, I have to say it has developed in the ~18 months since I last looked at it into quite a nice system. In fact it now has capabilities that I wasn't even dreaming about until I saw them on its feature list. It has grown to include many of the latest things from the web world, and it still has all of the enterprise connection capabilities provided by the application servers. And it supports more application servers than I will ever have a need, or desire to use. (In fact if anyone can tell me which I should be using, it would save me a lot of time and a lot of XML configuration headaches trying them out.)
And surprise of surprises, I was able to download the Liferay Portal demo bundle (Tomcat-based), and it actually ran with no fuss on my Windows Vista system! I never run web apps on Windows. Most of the time I work on Linux, because it is such a pain to make open source stuff work on Windows (especially Perl!). Boy, that was what I loved most about Java! It really does work anywhere.
Then I decided to push the envelop, and see if it would work behind an Apache server. Another thing I didn't like about Java based CMS systems in the past was their inability to work in an Apache environment. After installing the missing mod_proxy family of modules, and messing with the virtual host site configuration file, in less than 2 hours I had the demo Liferay Portal running along side a dozen other sites behind Apache 2. Awesome!
Unfortunately, this is as far as it goes for now. I attempted to replace the out of the box demo database server with MySQL, and ended up back in the J2EE/XML configuration swamp. After reading the various documents offered on the Liferay website, and after reading the one book I found on the Liferay Portal on Amazon, my enthusiasm has dropped almost as much as it did watching the San Jose Sharks in the first round of the NHL playoffs, after they won the presidents trophy this year. (They are down 3 games to 1 at the time this post was written.) The worst part is that the procedure for reconfiguring the Liferay Portal demo bundles to work on other database systems seems to have changed in a recent release, and the different documents all describe different procedures to make it work, none of which actually seem to work. Hopefully this roadblock will be short lived, but that will have to wait for another day.
My particular hot button in the selection of a competent CMS/Portal system is its ability to handle flexible groups with granular permissions. By that I mean it should support a large organization, with different groups, and in each group, different people can assume different roles/responsibilities. The check boxes on the CMS matrix often sound like the right sort of indicator, but once I dig into the systems that it recommends, I usually come away disappointed. What is meant by "Granular Permissions", "Sub-sites", etc. mean different things to different people, and even in the matrix there is no consistency.
After my last foray into matrix confusion, I took a pause, and a deep breath, and decided to have another look at a system that was in principle one of my favorites in the past, even though it has never quite had the features necessary to solve my clients problems. The system is the Liferay Portal. There are several things I liked about it when I evaluated it in the past. One was its ability to handle a complex organizational structure. Another was its ability to have many instances of each content type. Where simple CMS systems may allow for a single forum for example, Liferay Portal allows for many forums, and they can be localized in each part of the organization. And another feature I liked was that its URLs are structured in a way that makes sense to PEOPLE, not some artifact of MVC routing based on module/controller/action. And I love the portlet concept, which was in some ways a predecessor to the current widget craze, but based on real server architecture.
The thing I didn't like about it was its dependence on J2EE, with the complex hosting requirements and daunting XML configuration requirements just to make it work. Chalk it up to personal preference, but I absolutely hate having to sort through directories searching for just the right configuration option (in XML) to make the system work the way I want it to. That was one reason I moved away from J2EE systems in the past. Personally I love Java, but just couldn't stand the nightmare of configuration required to make the systems work. In contrast many popular PHP-based CMS systems run the user through a simple web-based configuration script, after which it just works.
I have been hearing rumblings from the Java community about adopting some of the principles espoused by the Ruby on Rails community, especially regarding "Convention over Configuration", so I thought it might be time for another look at my old friend the Liferay Portal.
At first glance, I have to say it has developed in the ~18 months since I last looked at it into quite a nice system. In fact it now has capabilities that I wasn't even dreaming about until I saw them on its feature list. It has grown to include many of the latest things from the web world, and it still has all of the enterprise connection capabilities provided by the application servers. And it supports more application servers than I will ever have a need, or desire to use. (In fact if anyone can tell me which I should be using, it would save me a lot of time and a lot of XML configuration headaches trying them out.)
And surprise of surprises, I was able to download the Liferay Portal demo bundle (Tomcat-based), and it actually ran with no fuss on my Windows Vista system! I never run web apps on Windows. Most of the time I work on Linux, because it is such a pain to make open source stuff work on Windows (especially Perl!). Boy, that was what I loved most about Java! It really does work anywhere.
Then I decided to push the envelop, and see if it would work behind an Apache server. Another thing I didn't like about Java based CMS systems in the past was their inability to work in an Apache environment. After installing the missing mod_proxy family of modules, and messing with the virtual host site configuration file, in less than 2 hours I had the demo Liferay Portal running along side a dozen other sites behind Apache 2. Awesome!
Unfortunately, this is as far as it goes for now. I attempted to replace the out of the box demo database server with MySQL, and ended up back in the J2EE/XML configuration swamp. After reading the various documents offered on the Liferay website, and after reading the one book I found on the Liferay Portal on Amazon, my enthusiasm has dropped almost as much as it did watching the San Jose Sharks in the first round of the NHL playoffs, after they won the presidents trophy this year. (They are down 3 games to 1 at the time this post was written.) The worst part is that the procedure for reconfiguring the Liferay Portal demo bundles to work on other database systems seems to have changed in a recent release, and the different documents all describe different procedures to make it work, none of which actually seem to work. Hopefully this roadblock will be short lived, but that will have to wait for another day.
Labels:
cms,
enterprise portal,
j2ee,
java,
liferay portal,
web applications
Subscribe to:
Posts (Atom)
