Skip to Content

So you think you know JavaScript

This will be my first post a new Web 2.0 category where I will be posting more stuff this year. It will concentrate mostly on AJAX and UI stuff.

So I recently ran into Douglas Crockford's JavaScript presentations at YUI Theater. Those really got me thinking that I had figured JavaScript all wrong and didn't even consider it as a full programming language that it is. Douglas Crockford is a JavaScript architect at Yahoo! and inventor of JSON.

I really recommend everyone who deals with JavaScript to watch these three series: The JavaScript Programming Language, Advanced JavaScript and An Inconvenient API: The Theory of the Dom. They take about 4 hours to go through but it is worth it. These three video presentation series are something I really wish existed when I took my first look at JavaScript about 10 years ago. Everyone who thinks they know JavaScript should watch those series and state that again.

New Liferay Portal 4.2 released

I'm really pleased that Liferay finally released Liferay Portal 4.2 few days ago. I've been anxiously waiting for the official release since I met Brian Chan at Open Mind in Tampere about month and a half ago. I've been demoing some of the new features from svn trunk to some potential clients and also internally and everyone has been impressed with Liferay.

The Liferay community has grown since the day I started investigating and using Liferay about 18 months ago and I see that it has great potential also in corporate use. The community here in Finland is still quite small but I am certain that it will grow. Also having a full Finnish translation of Liferay will help. To boost the growth I've been thinking about setting up a local community to provide help and documentation in Finnish to Finnish users of Liferay and to gather the Finnish developers under one site. I've seen that with many other open source projects such as Joomla Portal and Ubuntu Linux.

When I was working the Finnish translation I got some help from others and a major contribution from Arto Santala who was doing the same thing as me that is doing a full translation of Liferay. With a good local community site we can avoid such overlap when doing additions and improvements needed by the community. I have already started to setup infrastructure for such community by registering Liferay.fi domain and providing the platform for the site. It is ofcourse based on Liferay Portal. I just need to upgrade it to the official release. If you are interested in helping write Finnish documentation and presentations or just aswer questions in the forums please contact me.

And now for the actual part of introducing and evaluating the new features in Liferay 4.2.

Enhanced UI

As always Liferay keeps on making their UI better and more amazing. The Drag 'n Drop feature has been enhanced to be even better than it already was. A lot of AJAX is in the new UI most of it in Classic theme but some of it made it into the Brochure theme. Portlets are now paraller rendered asyncronously with AJAX. You can disable this feature by portlet if the portlet already uses AJAX or you otherwise don't want it to be rendered with AJAX.

ESB and Workflow Engine

ServiceMix ESB was added as the integration platform for the portal and jBPM was integrated through it to the Workflow portlet that comes with the portal. Unfortunatelly there isn't any workflow examples that come with the portal and the Journal does not leverage this workflow yet. Anyways this is a good foundation where you can build on top. I'm also told that in new releases there will be portlets that leverages this workflow engine.

Alfresco ECM

There is a Alfresco Content portlet that comes with the new Liferay and with that you can display content on the portal from Alfresco's repository. You can also have the Alfresco Web client portlet in Liferay but there isn't SSO with Alfresco and Liferay. Also the Alfresco Web client portlet UI doesn't work in Liferay. You can see the Guest workspace but none of the links doesn't anything.

Chat

A new AJAXed Jabber client comes prebundled. All you need to do is configure it in portal-ext.properties and sign in to Liferay and it automatically logs you into the Jabber server. Unfortunatelly it uses a hardcoded password for your account and if you don't have an account it creates one for you. It would be great if it could use your username and password to sign in to the Jabber server or if you could give it another username and password to use. Also it would be great if you could have a embedded Jabber server with the portal. It was like this in the svn trunk for a while but then Jive Software removed the war support from their Wildfire Jabber server. Also I wasn't able to get any messages through to another account signed in the server althought I could see that the session was signed into to the Wildfire server from it's admin console.

Other

Other features include a LDAP/AD support and syncronization and also JA-SIG CAS SSO support. Now you can also use Spring 2.0 features in your extension environment since the portal core was upgraded to use it. Using Liferay services is now possible from external wars since all the service interfaces were refactored to portal-service.jar which resides in the global classloader for all the portlets to use. Over all a great package once the bugs are weeded out. I will definately continue to use the latest version in my own and also work projects. Great job Brian and all the other Liferay guys.

A little bit of everything

It's been quite a while since my last post. A lot has happened since: Apache ServiceMix 3.0 was released, Spring Framework 2.0 got final. I have been using a lot of time messing with those and also using Maven 2 for my build and dependency management. I should also mention Mergere Maestro which combines maven 2 repository, continuum to create a continuous integration environment. Also a lot of development has happened on Liferay. One thing I should mention for people in Finland that Brian Chan from Liferay is coming to Finland to speak at Openmind 2006 in Tampere at end of this month. Hope to see you all there. It's official! Spring Portlet MVC portlets work in Liferay 4.1.2 when using the final release of Spring 2.0. I updated my previously released guestbook example to use the latest Spring 2.0 release and I also changed the build system to use maven 2. Download Spring Portlet MVC Guestbook-v0.2. It seems that Liferay SVN trunk has servicemix included. Unfortunately it's only version 2.0.2 which is quite buggy and recently a brand new version was released. I think Liferay and ServiceMix community should work together to create a really powerful open source SOA platform. Logicblaze the company behind ServiceMix has already included Liferay to their Fuse platform. They've added some nice management portlets where you can monitor and manage the JBI container. It's based on LiveTribe a management and monitoring tools framework.

Liferay portal 4 and Spring MVC portlets

It's been almost a month since my last post. I've been extremely busy developing a enterprise portal for a large Finnish airline. This portal is based on IBM Websphere Portal 5.1 and for CMS we are using IBM Workplace Web Content Management. There has been a bundle of things to solve since IWWCM and it's built-in portlets don't support multilingual content. I think we solved this quite elegantly by writing our own portlets that support multilingual content. And now to the actual topic using Spring MVC portlets with Liferay Portal 4.0. For writing these instructions I used Liferay Portal Enterprise 4.0.0 RC2 with JBoss and Tomcat. I have created a really simple guestbook portlet that uses hibernate 3 for persisting GuestbookEntry objects into database. You can download it from here. The JBoss bundle of Liferay still has the same non J2EE compliant classloading policy enabled and Liferay still relies on that. Liferay is promising improvements on that for the final 4.0.0 release. In the meantime we can fix that on portlet basis by adding jboss-web.xml to our portlets. Below I have an example taken from my guestbook portlet. It makes JBoss run this portlet in isolated mode enabling it use different version of jars than in the global classloader. This should also work with Liferay 3.6.1.

<jboss-web>
 <class-loading java2ClassLoadingCompliance="false">
 <loader-repository>
 javaguru.fi:loader=1guestbook.war
 <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
 </loader-repository>
 </class-loading>
</jboss-web>

Now you can easily deploy your portlet just by dropping it into Liferays autodeploy directory. From there Liferay modifies your web.xml and adds couple jars to your WEB-INF/lib. After the deployment you can see your portlet in the portlets list but wait how can you add it to a page. Well you can't it's just not showing up in the "Add Content" list of portlets. To get it to show up in that list you need to add liferay-display.xml in your portlets WEB-INF directory. This specifies the category under which your portlet appears. The id is the portlet-name defined in portlet.xml

<display>
	<category name="category.test">
		<portlet id="guestbook" />
	</category>
</display>

This information should get you started with using Spring Portlet MVC with Liferay Portal Enterprise 4.0. All comments are welcome.

Ruby on rails experiment

There has been lately a lot of hype around Ruby on Rails so I decided to find out is there anything behind that hype. First I should start by introducing what is Ruby on Rails!

Ruby is a fully object-oriented interpreted scripting language. It prides on combining the best features from other languages such as Eiffel, Java, Python and Perl. Ruby is natural and easy language and everything is an object no exceptions. Best source for more information about Ruby is the Official Ruby language site.

So what about Rails what is that really?

Ruby on Rails is a web application framework built using ruby as it language. It is open source and promises easy of use and programmer happiness. All Rails applications are built using MVC pattern and its all built-in. When you create a new rails applications it is as easy as issuing

rails /path/to/application

Next thing you might want to do is configure your environment. All you really need is to put in your database name, username, password and host in config/database.yml. Now you can create your model on tables you have. For my example I created a table entries which had columns name, email and message at first. Generating the model from that was as easy as issuing

./scripts/generate model Entry

Notice that the model is singular and the table name is plural. Now that we have a model to work with. Lets create a controller and views for it.

./scripts/generate scaffold Entry

Now you have the basic CRUD operations and views for you to customize and not a single line of code written. Scaffold is a handy little thing that generates all that for you. You can use scaffold also with out generating the code first generating a controller for your model and then inserting scaffold :entry into your controller which would then look like

class EntriesController < ApplicationController
        scaffold :entry
end

Well that concludes my introductio to rails. You can find more thorough tutorials from the Ruby on Rails website. As a result of this experiment I ended up with a simple guestbook application which I'm making available for everyone to download

 

Installation of RoR

Next I should probably provide some information about the installation process to by Debian based server. This information might be also useful to my friends whose site I'm hosting on this server.

Since this server is running Debian stable I had to add testing to the apt source.list. Now to make sure my other packages weren't upgraded to testing versions I added following line to my apt.conf

APT::Default-Release "stable";

Now installing latest rails was as easy as issuing

aptitude -t testing rails

I also took the latest version of ruby and rake by issuing

aptitude -t testing ruby
aptitude -t testing rake

 

Configuring Apache

Next thing is to configure apache. That was also fairly simple task even though I'm using suExec to run CGI. The good thing is that Debian installs ruby in the safe path used by suExec so I'm covered.

<VirtualHost *:80>
    ServerName rails.javaguru.fi
    DocumentRoot /path/to/wwwsites/rails.javaguru.fi

    SuexecUserGroup username group
    <Directory /path/to/wwwsites/rails.javaguru.fi/>
      Options ExecCGI FollowSymLinks
      AllowOverride all
      Allow from all
      Order allow,deny
    </Directory>
</VirtualHost>

My rails.javaguru.fi directory is actually a symlink to my guestbook/public directory. Rails generates everything needed to use rails with apache in the public directory of the application. You should never make the application root as your apache document root. That could cause some serious security issues.

 

Conclusion

I think Ruby on rails lives up to it's expectation but I don't think it will ever replace Java and J2EE. I'm sure it will become more popular over time and it could be a replacement for PHP. I for sure will learn more about ruby and everything I would normally do with php I will from now on do with RoR. Rails to me looks like a web framework with bunch or scripts that automate things. This could well be done with some ant or maven build scripts for a Spring MVC + Hibernate. Perhaps we'll see Spring on Rails some day.

Showing 36 - 40 of 41 results.
Items per Page 5
of 9

7.95e/mo hosting for Liferay