Friday, October 26, 2012

Liferay Password Retrival - Password Decryption

Liferay passwords can not be retrieved from the database. By default liferay uses MD5 hashes for password encryption. MD5 hashes are designed to be non reversible. When you call the method onthe user object as user.getPassword(), it wsill retrieve the encrypted password.

You can change this feature and store the plain password with out encryption by setting the property in the portal-ext.properties as passwords.encryption.algorithm=NONE.

This will store your password in plain text. This means your db admin would be able to see all including admin's password. Also, be aware that you have to set this before you first server start up.  Because changing password encryption may result in not being able to login.

When the first time the user is registered the user will get the email notification with password. This is achieved as the the email is sent in the same session as the user registration. The password is stored in the SessionMessages and retrieved from there (rather than the database) while sending the email.

Friday, September 7, 2012

Installing LIferay 6.1 on Websphere 8.


Liferay install and liferay home directory


  1. Create the Websphere Application Server.
  2. Deploy liferay.war
  3. Create the liferay home folder and create portal-ext.properties with the following properties            liferay.home=e:/myapps/liferay/sandbox         auto.deploy.dest.dir=e:/myapps/liferay/sandbox/websphere-deploy
  4. Create websphere-deploy in the liferay home folder.
  5. Once the liferay is installed, it will create all other necessary folders in the liferay home directory(data, deploy, logs)


Deploying Liferay Portlets in Websphere

Deploying the liferay portlets on websphere is 2 step process

  1. Put the .war in the deploy folder. Here the liferay will massage the .war file and add the necessary liferay dependent files and moves it to websphere-deploy folder. 
  2.        Install the application (.war) in the websphere-deploy folder from the admin console.


Specifying the portal-ext properties to liferay.war


Need to specify the liferay about the portal-ext.properties. So we do this by adding the app server JVM argument. For doing this do the following


Open Websphere Admin Console
Select the App server you created, on which you install liferay
In the configuration tab, Server Infrastructure-->Java and Process Management--> Process definition --> Additional Properties ---> Java Virtual Machine ---> Generic JVM arguments, add the following

-Dfile.encoding-UTF-8
-Dexternal-properties=e:/myapps/liferay/sandbox/portal-ext.properties

And in the Custom Properties add the following
java.net.preferIPv4Stack =true
java.net.preferIPv6Addresses=false

Adding the Shared Libraries and class loaders

Liferay requires the shared jars that it provides along with the liferay war file.

Change the Class Loader Order and add the shared libraries path

Application Servers --> <<App Server Name>> Class Loader --->
Class Loader Order = Classes loaded with parent class loader first

Application Servers --> <<App Server Name>> Class Loader ---> Additional Properties ---> Shared liferay references ---> and here create the library name  where is created in the:  Environment ---> Shared Libraries to refer the shared libraries folder of the liferay.

That is pretty much it. You are ready to go.





Wednesday, August 8, 2012

Liferay Hook Execution Order

a-hook and b-hook, both are extending com.liferay.portal.kernel.events.Action in order to make sure that always B-hook is called after the A-hook, the below configuration  liferay-plugin-package.properties of a-hook is required

required-deployment-contexts=\a-hook

Changing the Time zone in Liferay Tomcat Server

Set the system variable to CATALINA_OPTS=-Duser.timezone=America/Chicago
You can also specify the CATALINA_OPTS in the $TOMCAT_HOME/bin/catalina.sh or %TOMCAT_HOME%\bin\catalina.bat file as well.

Monday, June 18, 2012

Custom Log out

You could create a log out link to Liferay's internal logout functionality like this one in your JSP:

<%@page import="com.liferay.portal.util.PortalUtil"%>

<a href="<%= PortalUtil.getPortalURL(request) %>/c/portal/logout">Log Out</a>