Wednesday, September 22, 2010

Deployment/Undeployment with Ext plugins environment

I found some weird behavior when i started working with ext plugins using Liferay version 6.0.5. These problems are related to deployment & undeployment of ext plugins.I thought it might be helpful to beginners of new liferay ext plugins.

You will be having files related to your each ext plugin under following places

Suppose for example i have created a ext plugin named "second"

1) You will be having some jars @ temp folder of your tomcat instance @ \temp\liferay\com\liferay\portal\deploy\dependencies

In my case,

2) You will be having jars related to each of your ext plugin @ \webapps\ROOT\WEB-INF\lib

In my case,

3) xml file related to each ext plugin will be placed @ \webapps\ROOT\WEB-INF

In my case,

4) Service file @ global class path of app server - \lib\ext\ext-second-ext-service.jar. Since this is a shared library/global class path you cannot undeploy when server is in running state.


5) Once your ext plugin is deployed properly you may see some message some thing like below
[ExtHotDeployListener:188] Extension environment for "YOUR_EXT_PLUGIN_NAME" has been applied. You must reboot the server and redeploy all other plugin

Copy the below code to a bat file, change tomcat_home according to your tomcat instance
> you need to send your ext plugin name as parameter , in my case "second"
> before redeploying stop the server & run the following command then redeploy

@echo off
set app_name=%1
if "%app_name%" == "" goto end
set tomcat_home=E:\Liferay605\bundles\tomcat-6.0.26
rmdir /S /Q %tomcat_home%\webapps\%app_name%-ext
del /S /Q %tomcat_home%\lib\ext\ext-%app_name%-ext-service.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-java.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-impl.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\ext-%app_name%-ext.xml
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-java.jar
Please post your comments/feedback/suggestions on this topic if possible

Friday, September 10, 2010

Where you can find versions of jars included Liferay

You will find the versions information @ following path


Tuesday, September 7, 2010

Introducing Friendly URL Routes

A very good article related to Friendly URLs - Friendly URL Routes feature, which is available from Liferay version 6.0.3+. Its kind of killer feature i can say

Wednesday, September 1, 2010

Liferay control panel changes in 6.0.x

Here are the first glance changes i observed in control panel of Liferay 6.0.4 which are marked by red arrow (Navigation changes only)

Marked by comparing with "My Account "& "Content" related sections in earlier version (5.2.3)

Marked by comparing with "Portal" & "Server" related sections of earlier version (5.2.3)

Communities/Organizations scope section moved as shown in below (near content section in Liferay 5.2.3)

Now bread crumb looks like below

New bread crumb look

Isn't it cool? :)

Monday, August 30, 2010

How to generate & add certificates using keytool

Some times you need to use secure http calls depending upon requirements.

At that time if you want to generate a certificate temporarily here are the simple steps for how to generate , put it in JDK & how to configure the same in server (Here i am using tomcat).I got explored a bit while integrating CAS with Liferay.

C:\Documents and Settings\nagendra.busam>keytool -genkey -alias cas-liferay-infocast -keypass changeit -keyalg RSA
Enter keystore password:
What is your first and last name?
[Unknown]: localhost
What is the name of your organizational unit?
[Unknown]: Information systems
What is the name of your organization?
[Unknown]: CIGNEX
What is the name of your City or Locality?
[Unknown]: AHMEDABAD
What is the name of your State or Province?
[Unknown]: GUJARAT
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=localhost, OU=Information systems, O=CIGNEX, L=AHMEDABAD, ST=GUJARAT, C=IN correct?
[no]: yes

C:\Documents and Settings\nagendra.busam>keytool -export -alias cas-liferay -keypass changeit -file D:\projects\liferay\project-docs\infocast\server_cas_infocast.crt
Enter keystore password:
Certificate stored in file

C:\Documents and Settings\nagendra.busam>keytool -import -file D:\projects\liferay\project-docs\infocast\server_cas_infocast.crt -keypass changeit -keystore C:\Java\jdk1.6.0_19\jre\lib\security\cacerts
Enter keystore password:
keytool error: java.lang.Exception: Certificate not imported, alias <mykey> already exists

Some times you will get above error (here mykey is the default alias - it might have taken already). In that case import the certificate with alias name as below
C:\Documents and Settings\nagendra.busam>keytool -import -alias cas-liferay-infocast -file D:\projects\liferay\project-docs\infocast\server_cas_infocast.crt -keystore C:\Java\jdk1.6.0_19\jre\lib\security\cacerts

Here is my server.xml related change in TOMCAT_HOME/conf

Search for 8443 in that file, you will find some thing like this
<connector clientauth="false" maxthreads="150" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslenabled="true" sslprotocol="TLS"></connector>
change above to
<connector clientauth="false" keyalias="cas-liferay-infocast" maxthreads="150" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslenabled="true" sslprotocol="TLS"
keystorefile="C:/Documents and Settings/nagendra.busam/.keystore" keystorepass="changeit"
Reference link(s)

Sunday, August 1, 2010

Liferay: Using JSONObject for Ajax in Plugin Portlet

Here is a good article about the same

Many times we face situations when we need to use Ajax call from JSP pages. Using jQuery, its very easy to call any JSP through AJAX. You can just call the JSP and show its response from callback into some DOM element.

Spring MVC portlet with annotations

Here is a good blog about Spring MVC portlet implementation using annotations

Java portlet framework is awesome for portal developers. Different portal frameworks are there which supports portlet development in their environment. They also support spring portlet. Spring's portlet support is exposed through Spring MVC interface. Spring provides MVC based portlet development which is so easy and neatly architectured.

Saturday, July 31, 2010

Liferay 6.0.x related links

New Features in Liferay Portal v6.0

Upgrade Instructions from 5.2 to 6.0

Upgrade 5.2.x Themes to 6.0.x

Staging - 6.0 - Differential Publishing

Staging - 6.0

Liferay 6.0 Development on Ubuntu Lucid 10.04

Antisamy hook

Applying workflow on any assets in Liferay 6

Using jQuery (or any Javascript library) in Liferay 6.0

Building jQuery based plugins in Liferay 6

Several jQuery versions within Liferay

Can I have different jQuery versions in Liferay?

If any body has any good links related to Liferay 6.0.x they are most welcome to post them as comments