Wednesday, 24 July 2013

Properties Hook

Properties Hook

Difference  between  portal.properties and propertieshook  ?

Portal.properties -  It is core properties file which is available in portal-Impl.jar file and it has 1500+ properties, wherein some of the properties are by default enabled and some are disabled. If we want the properties to be used for the requirement, we can remove the comment creating new file called portal-ext.properties and can use in our application.
If we want to do changes in portal.properties, we  can  do  but  we  have  to extract  the  Impl  jar file  then  only  we  do the  changes  after that again wrap  it  and  give  it  to tomcat.  If  we  do like this everytime, the consuming time will be increased and at the same time it will effect the performance. Also we need to restart the server as and we make the changes to portal-ext.properties file.
In Hooks properties file, it will not support all the properties of portal.properties but supports upto 50 to 60 properties. No need to restart the server and the size of the file is very low as a result there will be no performance issues. So, that’s the reason it is recommended to use hooks properties instead of portal-ext.properties. 

How  to create the Properties Hook

·     Create  Project
New > LiferayProject > Project Name > Select the Plugin HOOK

·     Right Click on Project
New > Liferay hook > Select portal.properties > click on Next


·     Click on ‘add’ (second ‘add’ button) button, the select the property which we have to override/modify, also give the value (either true of false) and click add Button
·     Deploy in ANT
·     Run as server.
·     Then Go to Browser http://localhost:8080

Examples: --
--‘Birthday’ Property
--‘Gender’ Property
--‘Terms and Conditions’ Property etc…

O/P: Whenever we click on ‘create new account’, the features/properties will be reflected as per our modifications (following is the page where we can see the changes)


No comments:

Post a Comment