Monthly Archives: May 2012

Embedding a portlet in the theme – velocity template

Liferay themes are developed using the Velocity template language (.vm extention). It has Liferay built-in features to perform special activity. We can embed a built-in Liferay portlet or a plugin portlet which can be either instanceable or non-instanceable portlets. Here …

Posted in Liferay | Tagged | Leave a comment

Calendar or Date difference in Java – example difference in day, hour, minute and second

This example shows how to to get Calendar or Date difference in day, hour, minute and second using Java code. First, get the date in milliseconds for both of the date object and then get their difference. Finally divide it by …

Posted in Java-J2ee | Tagged | Leave a comment

Loading bar on Image loading using javascript

We some times need to show loading bar or “please wait…”  while loading a big image. We can do it very easy using simple javascript. Below is the javascript method to do the same. We have used one ajax rotating …

Posted in HTML | Tagged | Leave a comment

Java – get calendar time of other time zone

Java java.util.TimeZone class represents time zones. We can do easy calendar arithmetic across time zones in conjunction with the java.util.Calendar class. Here is an example which prints all the available time zones: String TimeZoneIds[] = TimeZone.getAvailableIDs(); for (String zoneId: TimeZoneIds) { System.out.println(zoneId); } The below method …

Posted in Java-J2ee | Tagged | Leave a comment