List of few tools and services which I have successfully integrated or have come to know.
CAS -- The Central Authentication Service the most widely used tool works with almost all version of LR ,very less issues while integrating.
Read on -- CAS
Ease of configuration & integration with Liferay --- 4/5
Performance -------------------------------------- 4/5
SOLR -- features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling. Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world's largest internet sites.
Read on --SOLR
Ease of configuration & integration with Liferay ---- 2.5/5
Performance -------------------------------------- 4/5
Terracotta -- Ehcache boost application performance, enhance operational control, and easily scale to large virtualized environments and clouds.
Read On
Ease of configuration & integration with Liferay --- 2.5/5
Performance -------------------------------------- 4/5
LDAP -- All open source LDAP work fairly good ,coolest features in LR 6.0
Read On Open LDAP
NTLM Works perfectly fine
Facebook Works perfectly however make sure to do cross browser testing use at least LR ver6.0.5
PayPal Works with almost all versions of Liferay
Alfresco It has been used in many project ,I am awaiting more feedback to comment on capabilities on different version
Read on Alfresco
I have created this blog to share my learnings in a consolidated form and quick reference.... Abhishek Saxena
Disclaimer: The views expressed on this blog are my personal opinion and do not indicate or reflect any official opinion.
Thursday, March 3, 2011
Monday, February 28, 2011
Book I am reading currently
Hi currently I am going through Liferay User Interface Development book
This book is amongst few compact reference resources of LR UI development, the book has a lot of information and will be very helpful in deciding which UI technology to use as per your specification .It has good section on theme,template,layout ,portlet UI ,use of alloy etc.
You can get a free chapter for advanced theme
This book is amongst few compact reference resources of LR UI development, the book has a lot of information and will be very helpful in deciding which UI technology to use as per your specification .It has good section on theme,template,layout ,portlet UI ,use of alloy etc.
You can get a free chapter for advanced theme
Friday, February 4, 2011
Liferay based tech stack
I would like to discuss some Liferay Portal project tech stacks
I will clean the post in coming days :) ,Please share your tech stack as comments
1> Liferay Portal ,defaults CMS , Spring Portlet MVC for custom portlets ,MYSql Databse ,Jqery /JS ,CAS for authentication ,open LDAP.
I believe this stack is most readily used stack with minor changes.
2>Liferay Portal , Default CMS ,Struts MVC , MYSql database ,NTLM authentication ,Open LDAP.
3>Liferay Portal ,Alfresco , Spring Portlet MVC
4> Liferay Portal +Vaadin
I will clean the post in coming days :) ,Please share your tech stack as comments
1> Liferay Portal ,defaults CMS , Spring Portlet MVC for custom portlets ,MYSql Databse ,Jqery /JS ,CAS for authentication ,open LDAP.
I believe this stack is most readily used stack with minor changes.
2>Liferay Portal , Default CMS ,Struts MVC , MYSql database ,NTLM authentication ,Open LDAP.
3>Liferay Portal ,Alfresco , Spring Portlet MVC
4> Liferay Portal +Vaadin
Friday, December 31, 2010
Velocity Templating and its application in liferay
Velocity is my favorite template language which enables me to get the static pages up in no time with rich content(thanks to the document and image library).
I would like to share some of its fantastic capabilities.
Web content in Liferay is controlled by template scrip file,Velocity can be used for simple transformations in web content/journal portlets which detrmines how the content will be displayed on the page.Velocity can also be utlilized for making custom changes in vm files of Liferay themes.
GUI requirements determine the degree of customization required in VM templates. I have observed cases where a lot of coding effort can be reduced if velocity is used in optimally.
In liferay portal services can also be used with help of velocity in Liferay themes(VM templates)or templates of Articles (web content portlet).
Lifeay provides service locator to use the services with velocity.
TO enable access of services in liferay make following changes in portal-ext.properties
# Input a comma delimited list of variables which are restricted from the
# context in Velocity based Journal templates.
#
journal.template.velocity.restricted.variables=serviceLocator
remove serviceLocator in property it will now look as
journal.template.velocity.restricted.variables=
example --- (a complete example is available in my earlier post named quick tips)
#set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set ($roleLocalService = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
----------------------------------------------------------
Objects that can be used OOB in VM files
$user, $company, $layout, and $themeDisplay
example ---> $user.getFirstName()
themeDisplay,company,user,realUser,layout,layouts,plid,layoutTypePortlet,scopeGroupId,permissionChecker,locale,timeZone,theme,colorScheme,portletDisplay,
other variable you can from VelocityVariables.java class from source code
com.liferay.portal.velocity.VelocityVariables
Check null -- #if ($validator.isNotNull($variable))
Example
Now if you have a page which displays news article for a person with his name and a custom welcome message you can get his name in through web content portlet , template along with his name which can be dropped at top of page so no need to write a java portlet just use velocity
< b > Welcome to news page< /b >
$user.getFirstName()
< tags> news begins
Velocity references
Official documentation
Advanced concepts
Quick Learning
My Favourite reference link
I would like to share some of its fantastic capabilities.
Web content in Liferay is controlled by template scrip file,Velocity can be used for simple transformations in web content/journal portlets which detrmines how the content will be displayed on the page.Velocity can also be utlilized for making custom changes in vm files of Liferay themes.
GUI requirements determine the degree of customization required in VM templates. I have observed cases where a lot of coding effort can be reduced if velocity is used in optimally.
In liferay portal services can also be used with help of velocity in Liferay themes(VM templates)or templates of Articles (web content portlet).
Lifeay provides service locator to use the services with velocity.
TO enable access of services in liferay make following changes in portal-ext.properties
# Input a comma delimited list of variables which are restricted from the
# context in Velocity based Journal templates.
#
journal.template.velocity.restricted.variables=serviceLocator
remove serviceLocator in property it will now look as
journal.template.velocity.restricted.variables=
example --- (a complete example is available in my earlier post named quick tips)
#set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set ($roleLocalService = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
----------------------------------------------------------
Objects that can be used OOB in VM files
$user, $company, $layout, and $themeDisplay
example ---> $user.getFirstName()
themeDisplay,company,user,realUser,layout,layouts,plid,layoutTypePortlet,scopeGroupId,permissionChecker,locale,timeZone,theme,colorScheme,portletDisplay,
other variable you can from VelocityVariables.java class from source code
com.liferay.portal.velocity.VelocityVariables
Check null -- #if ($validator.isNotNull($variable))
Example
Now if you have a page which displays news article for a person with his name and a custom welcome message you can get his name in through web content portlet , template along with his name which can be dropped at top of page so no need to write a java portlet just use velocity
< b > Welcome to news page< /b >
$user.getFirstName()
< tags> news begins
Velocity references
Official documentation
Advanced concepts
Quick Learning
My Favourite reference link
Tuesday, October 26, 2010
Hardware Requirements and few examples of possible combinations
There have been many post in Liferay forum around Hardware Requirements
I will share few successful implementation I am aware of and minimum requirements for server and developer sandboxes.
I will update this post every time I come across new config so watch out this space for newer Hardware configs :)
The best resources for server sizing and hardware requirements are Liferay whitepaper, choose the one which is relevant to your version
LPEE 6.2 Deployment Checklist
Liferay Portal 6.2 Performance Whitepaper
https://www.liferay.com/documentation/additional-resources/whitepapers
There can be unlimited combination so please leave your requirements and I will try to device optimal hardware requirements for you as per my learning's :D
General thumb rule before finalizing the architecture and server sizing / hardware configuration is
1. Gather requirements for
a. Total number of users
b. Concurrent users & maximum logged in users expected at one time
c. Operation expected WCM scenario, Content reading, content access, transaction / login, search etc
d. High availability required
e. Clustering required (Need to request for a cluster key)
Based on the inputs you can reach a rough sizing estimate using the performance whitepaper
make sure when you are taking vCPU into consideration use 2 vCPU = 1 physical core.
Again hardware will also depend on the application being built on top of Liferay so if its a page with login and WCM etc it will handle smaller number of user than plain text age and you need to prorate and adjust the users based on the application and OOB components used from Liferay.
Make sure in a HA architecture the nodes / cluster node are in same network / DC
Liferay portal 6.2
Production Box
RAM --Min : 16 GB , Good to have 32 - 64 GB RAM
Processor - Min 4 CPU (I1 quad core processor) , Good to have 8 CPU ( 2 quad core processor)
example - 2 X Intel core 2 Quad X5677 3.46GHz, 12MB L2 cache
Liferay portal 6.1 and below :
Developer Box
Minimal -- 1 GB RAM , processor with clocks more than 2.X Ghz for example celeron processor will suffice if you provide 2 GB RAM and Processor 2.6GHz
if you are working with LR portal 5.1X below you can use processor with lower clock.
In scenarios where developers have a complete sandbox setup on their local machine my recommendation is at least 2 GB RAM is used with dual core CPU @2.50GHz
(MySQL , eclipse , LR portal , Apache webserver +3rd party integration component
----------
For Testing /UAT / Staging environment
The number of nodes will depend on the load / traffic expected however its good to have Minimum of 2 portal nodes 2 authentication server nodes and a hot standby of DB
Minimal --
Liferay portal 1.5 GB RAM , dual core CPU @2.50GHz or more (per node)
------------
Production Environment
Some possible combination
1>
OS: Redhat Linux
Sever : Dell Power edge
CPU :1 quad core @2.5Ghz or 2 Dual core with no less clock
Ram :4GB
2>
Sever : Dell Power edge or Sunfire in case of Solaris
2X 2.0Ghz
quad core
8GB
Linux
--------------------------
For DB and third party servers
Sever : Dell Power edge or Sunfire in case of Solaris
4X1.6GHz
8Gb
Solaris
I will share few successful implementation I am aware of and minimum requirements for server and developer sandboxes.
I will update this post every time I come across new config so watch out this space for newer Hardware configs :)
The best resources for server sizing and hardware requirements are Liferay whitepaper, choose the one which is relevant to your version
LPEE 6.2 Deployment Checklist
Liferay Portal 6.2 Performance Whitepaper
https://www.liferay.com/documentation/additional-resources/whitepapers
There can be unlimited combination so please leave your requirements and I will try to device optimal hardware requirements for you as per my learning's :D
General thumb rule before finalizing the architecture and server sizing / hardware configuration is
1. Gather requirements for
a. Total number of users
b. Concurrent users & maximum logged in users expected at one time
c. Operation expected WCM scenario, Content reading, content access, transaction / login, search etc
d. High availability required
e. Clustering required (Need to request for a cluster key)
Based on the inputs you can reach a rough sizing estimate using the performance whitepaper
make sure when you are taking vCPU into consideration use 2 vCPU = 1 physical core.
Again hardware will also depend on the application being built on top of Liferay so if its a page with login and WCM etc it will handle smaller number of user than plain text age and you need to prorate and adjust the users based on the application and OOB components used from Liferay.
Make sure in a HA architecture the nodes / cluster node are in same network / DC
Liferay portal 6.2
Production Box
RAM --Min : 16 GB , Good to have 32 - 64 GB RAM
Processor - Min 4 CPU (I1 quad core processor) , Good to have 8 CPU ( 2 quad core processor)
example - 2 X Intel core 2 Quad X5677 3.46GHz, 12MB L2 cache
Liferay portal 6.1 and below :
Developer Box
Minimal -- 1 GB RAM , processor with clocks more than 2.X Ghz for example celeron processor will suffice if you provide 2 GB RAM and Processor 2.6GHz
if you are working with LR portal 5.1X below you can use processor with lower clock.
In scenarios where developers have a complete sandbox setup on their local machine my recommendation is at least 2 GB RAM is used with dual core CPU @2.50GHz
(MySQL , eclipse , LR portal , Apache webserver +3rd party integration component
----------
For Testing /UAT / Staging environment
The number of nodes will depend on the load / traffic expected however its good to have Minimum of 2 portal nodes 2 authentication server nodes and a hot standby of DB
Minimal --
Liferay portal 1.5 GB RAM , dual core CPU @2.50GHz or more (per node)
------------
Production Environment
Some possible combination
1>
OS: Redhat Linux
Sever : Dell Power edge
CPU :1 quad core @2.5Ghz or 2 Dual core with no less clock
Ram :4GB
2>
Sever : Dell Power edge or Sunfire in case of Solaris
2X 2.0Ghz
quad core
8GB
Linux
--------------------------
For DB and third party servers
Sever : Dell Power edge or Sunfire in case of Solaris
4X1.6GHz
8Gb
Solaris
Monday, October 25, 2010
Liferay Installation Checklist
I wanted to share a checklist to follow after Liferay installation to minimize portal start up failures
1>Check your JAVA_HOME variable .It`s good to use JRE available in JDK bundle
Check for compatibility of JRE required for portal version being used
2>Check LIFERAY_HOME variable This folder is one folder higher than the location of the application server itself
3>Check database connection setting & verify database JDBC driver .jar
4>Check consistency of Liferay portal bundle and dependency jars .
corrupt or incompletely downloaded jars create issues hard to investigate
4b>Check consistency of The portal-ext.properties File verify changes made as per your environment
5>Check for folder permissions (mostly this issue come in Linux/UNIX or other open source OS)
Troubleshooting
a>If server does not start check for setenv.bat
{tomcat-home}/bin/setenv.bat and point JRE_HOME to folder where you installed Java. You setenv.bat haas following entries :
set "JRE_HOME=C:\Program Files\Java\jre6"
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
b>Check for database availability
c> Cheksum jar /portal library
1>Check your JAVA_HOME variable .It`s good to use JRE available in JDK bundle
Check for compatibility of JRE required for portal version being used
2>Check LIFERAY_HOME variable This folder is one folder higher than the location of the application server itself
3>Check database connection setting & verify database JDBC driver .jar
4>Check consistency of Liferay portal bundle and dependency jars .
corrupt or incompletely downloaded jars create issues hard to investigate
4b>Check consistency of The portal-ext.properties File verify changes made as per your environment
5>Check for folder permissions (mostly this issue come in Linux/UNIX or other open source OS)
Troubleshooting
a>If server does not start check for setenv.bat
{tomcat-home}/bin/setenv.bat and point JRE_HOME to folder where you installed Java. You setenv.bat haas following entries :
set "JRE_HOME=C:\Program Files\Java\jre6"
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8 -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
b>Check for database availability
c> Cheksum jar /portal library
Thursday, October 21, 2010
Database connection settings
I have seen numerous post around database connection not working or portal server not starting properly due to the database connections not working properly.Many post including mine are available on Liferay forum for resolving the issue however I thought of making a checklist here for database connection settings.
Developer need to keep in mind that settings have been changing for every version in lower version till 5.1X DB setting were done in Root.xml , 5.2.X onwards all the setting entries are made in portal-ext.properties file
lets discuss the different version setting first.
Version 6.X and 5.2X have same config
put JDBC setting in portal-ext.properties
location :\\webapps\ROOT\WEB-INF\classes
< 6.X or 5.X>
copy your JDBC settings from portal.properties ---> ## JDBC section
get file from the downloaded source or tomcat setup or directly from SVN
SVN location : http://svn.liferay.com/repos/public/portal/trunk/portal-impl/src/portal.properties
username is : guest and password is : leave the password field blank
e.g.
# MySQL
#
#jdbc.default.driverClassName=com.mysql.jdbc.Driver
#jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
#jdbc.default.username=
#jdbc.default.password=
Liferay 5.1.X and lower versions
Make JDBC changes in Root.xml
ROOT.xml can be found in tomcat\conf\Catalina\localhost\ROOT.xml
e.g. Sample setting get exact setting from portal.properties file
MySQL
Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username=""
password=""
maxActive="20"
Set properties for schema
## Schema
##
#
# Set this to true to automatically create tables and populate with default
# data if the database is empty.
#
schema.run.enabled=true
#
# Set this to to true to populate with the minimal amount of data. Set this
# to false to populate with a larger amount of sample data.
#
schema.run.minimal=true
Checklist:
1> Make sure you have copied your database driver support
e.g. for oracle copy ojdbc14.jar to\\lib\ext
2> Test your DB availability and creation of schema
Schema name should match the schema name mentioned in jdbc.default.url
3>Check that you have correct version of driver support jar and is compatible with your your installation I have seen number of user facing problem due to incompatible version.
4> Check for proper character set settings for your database
Detailed Learning resource official documentation
Developer need to keep in mind that settings have been changing for every version in lower version till 5.1X DB setting were done in Root.xml , 5.2.X onwards all the setting entries are made in portal-ext.properties file
lets discuss the different version setting first.
Version 6.X and 5.2X have same config
put JDBC setting in portal-ext.properties
location :
< 6.X or 5.X>
copy your JDBC settings from portal.properties ---> ## JDBC section
get file from the downloaded source or tomcat setup or directly from SVN
SVN location : http://svn.liferay.com/repos/public/portal/trunk/portal-impl/src/portal.properties
username is : guest and password is :
e.g.
# MySQL
#
#jdbc.default.driverClassName=com.mysql.jdbc.Driver
#jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
#jdbc.default.username=
#jdbc.default.password=
Liferay 5.1.X and lower versions
Make JDBC changes in Root.xml
ROOT.xml can be found in tomcat\conf\Catalina\localhost\ROOT.xml
e.g. Sample setting get exact setting from portal.properties file
MySQL
Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8"
username=""
password=""
maxActive="20"
Set properties for schema
## Schema
##
#
# Set this to true to automatically create tables and populate with default
# data if the database is empty.
#
schema.run.enabled=true
#
# Set this to to true to populate with the minimal amount of data. Set this
# to false to populate with a larger amount of sample data.
#
schema.run.minimal=true
Checklist:
1> Make sure you have copied your database driver support
e.g. for oracle copy ojdbc14.jar to
2> Test your DB availability and creation of schema
Schema name should match the schema name mentioned in jdbc.default.url
3>Check that you have correct version of driver support jar and is compatible with your your installation I have seen number of user facing problem due to incompatible version.
4> Check for proper character set settings for your database
Detailed Learning resource official documentation
Thursday, September 9, 2010
Links to official standards
Adding links for most common standards which need to be referred while development
1. CLick on link below for email standards
Email Standards
Example : Sample 1
2. W3C's easy-to-use markup validation service, based on SGML and XML parsers.
http://validator.w3.org/
3. JSR-000286 Portlet Specification 2.0
Final release
JSR 168 final specifications
4. Scripting
ecma-international standards
5. Code Conventions for the Java Programming Language
Conventions
1. CLick on link below for email standards
Email Standards
Example : Sample 1
2. W3C's easy-to-use markup validation service, based on SGML and XML parsers.
http://validator.w3.org/
3. JSR-000286 Portlet Specification 2.0
Final release
JSR 168 final specifications
4. Scripting
ecma-international standards
5. Code Conventions for the Java Programming Language
Conventions
Tuesday, September 7, 2010
Quick Workaround & Temporary fixes
Theme > Change in portlet.vm for requirement to remove portlet title showing text "web content diplay"
Summary : #if( $portlet_title =='Web Content Display')
#else
$theme.iconPortlet() $portlet_title
#end
2>
Change is custom.css to acomdate tab space for 'BiggerNameTab' tab in navigation
Summary:
#navigation ul li.parent-nav-item {
text-align:center;
width:109px;
Summary : #if( $portlet_title =='Web Content Display')
#else
$theme.iconPortlet() $portlet_title
#end
2>
Change is custom.css to acomdate tab space for 'BiggerNameTab' tab in navigation
Summary:
#navigation ul li.parent-nav-item {
text-align:center;
width:109px;
Wednesday, September 1, 2010
Enable user creation with duplicate email id
To enable user creation with duplicate email -id
If you don't have ant ext environment and still want to add this functionality leave me a note and I will send you steps for creating a separate jar and configurations to make your custom code work for your custom application.
For extension environment -- Write a new class in ext-environment
public class AbhishekUserLocalServiceImpl extends UserLocalServiceImpl
Now override two validate methods and make following changes
1. For method with signature
protected void validate(long userId, String screenName, String emailAddress, String firstName, String lastName, String smsSn)
remove ----> throw new DuplicateUserEmailAddressException();
from
if (userPersistence.fetchByC_EA(
user.getCompanyId(), emailAddress) != null) {
throw new DuplicateUserEmailAddressException();
}
2. For method with signature
protected void validate(long companyId, long userId, boolean autoPassword, String password1,String password2, boolean autoScreenName, String screenName, String emailAddress, String firstName, String lastName, long[] organizationIds)
remove --->throw new DuplicateUserEmailAddressException();
from
if (Validator.isNotNull(emailAddress)) {
User user = userPersistence.fetchByC_EA(companyId, emailAddress);
if (user != null) {
throw new DuplicateUserEmailAddressException();
}
}
If you don't have ant ext environment and still want to add this functionality leave me a note and I will send you steps for creating a separate jar and configurations to make your custom code work for your custom application.
For extension environment -- Write a new class in ext-environment
public class AbhishekUserLocalServiceImpl extends UserLocalServiceImpl
Now override two validate methods and make following changes
1. For method with signature
protected void validate(long userId, String screenName, String emailAddress, String firstName, String lastName, String smsSn)
remove ----> throw new DuplicateUserEmailAddressException();
from
if (userPersistence.fetchByC_EA(
user.getCompanyId(), emailAddress) != null) {
throw new DuplicateUserEmailAddressException();
}
2. For method with signature
protected void validate(long companyId, long userId, boolean autoPassword, String password1,String password2, boolean autoScreenName, String screenName, String emailAddress, String firstName, String lastName, long[] organizationIds)
remove --->throw new DuplicateUserEmailAddressException();
from
if (Validator.isNotNull(emailAddress)) {
User user = userPersistence.fetchByC_EA(companyId, emailAddress);
if (user != null) {
throw new DuplicateUserEmailAddressException();
}
}
Monday, August 30, 2010
Change existing context 'ROOT' with your chosen context
I have come across many instance in which developers want to change the existing context 'ROOT'
Steps mentioned below is one easy way of doing it , however I have tried this on versions prior to 6.X . I will update post once I do it successfully on ver 6.X
1. Download tomcat bundle
Using the tomcat bundles saves you from making unwanted changes ,if you start fresh portal installation over tomcat and then try to change the 'ROOT' context , you will have to change many files .
2. Change the name of the existing context ROOT
liferay-portal-5.2.3\tomcat-5.5.27\webapps\ROOT
to
liferay-portal-5.2.3\tomcat-5.5.27\webapps\MyChosenContext
MyChosenContext is the context name you want to use
2b . Change the name of config file
\liferay-portal-5.2.3\tomcat-5.5.27\conf\Catalina\localhost\ROOT.xml
to
\liferay-portal-5.2.3\tomcat-5.5.27\conf\Catalina\localhost\MyChosenContext.xml
3. create a new file named portal-ext.properties which will override portal.properties
location -- liferay-portal-5.2.3\tomcat-5.5.27\webapps\ROOT\WEB-INF\classes\portal-ext.properties
3b. Change portal.ctx property or add in case of new installation
portal.ctx=/MyChosenContext
Snipet of property to be added to portal-ext.properties
## Portal Context
##
#
# Set this property if you deploy the portal to another path besides root.
#
portal.ctx=/
Steps mentioned below is one easy way of doing it , however I have tried this on versions prior to 6.X . I will update post once I do it successfully on ver 6.X
1. Download tomcat bundle
Using the tomcat bundles saves you from making unwanted changes ,if you start fresh portal installation over tomcat and then try to change the 'ROOT' context , you will have to change many files .
2. Change the name of the existing context ROOT
liferay-portal-5.2.3\tomcat-5.5.27\webapps\ROOT
to
liferay-portal-5.2.3\tomcat-5.5.27\webapps\MyChosenContext
MyChosenContext is the context name you want to use
2b . Change the name of config file
\liferay-portal-5.2.3\tomcat-5.5.27\conf\Catalina\localhost\ROOT.xml
to
\liferay-portal-5.2.3\tomcat-5.5.27\conf\Catalina\localhost\MyChosenContext.xml
3. create a new file named portal-ext.properties which will override portal.properties
location -- liferay-portal-5.2.3\tomcat-5.5.27\webapps\ROOT\WEB-INF\classes\portal-ext.properties
3b. Change portal.ctx property or add in case of new installation
portal.ctx=/MyChosenContext
Snipet of property to be added to portal-ext.properties
## Portal Context
##
#
# Set this property if you deploy the portal to another path besides root.
#
portal.ctx=/
Monday, July 19, 2010
Quick Tips
Tips
For using Liferay services in Web Content portlet Previously known as journal content portlet , we use LR services in templates
e.g. #set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
However at first attempt we encounter null which happens when we forget to update the property in portal-ext.properties.
Use of LR services are restricted by default in templates.
Following property has list of restricted variables
so change property from journal.template.velocity.restricted.variables=serviceLocator
journal.template.velocity.restricted.variables=
Once serviceLocator is available we can invoke the services to achieve desired results.
===================================================
Get httpRequest within the portlet
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);
===================================================
CMS Template VM code for finding user and roles
This code has been used by developers time and again I have used some different methods than existing approach to make it simpler.
#set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set ($roleLocalService = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set ($user_id = $request.getAttribute("USER_ID"))
#set ($user = $userLocalService.getUserById($user_id))
#set ($role = $roleLocalService.getRole($user.getCompanyId(),"sponsor"))
#set ($hasUserRole = $roleLocalService.hasUserRole($user.getUserId(),$role.getRoleId()))
======================================================
For using Liferay services in Web Content portlet Previously known as journal content portlet , we use LR services in templates
e.g. #set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
However at first attempt we encounter null which happens when we forget to update the property in portal-ext.properties.
Use of LR services are restricted by default in templates.
Following property has list of restricted variables
so change property from journal.template.velocity.restricted.variables=serviceLocator
journal.template.velocity.restricted.variables=
Once serviceLocator is available we can invoke the services to achieve desired results.
===================================================
Get httpRequest within the portlet
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);
===================================================
CMS Template VM code for finding user and roles
This code has been used by developers time and again I have used some different methods than existing approach to make it simpler.
#set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
#set ($roleLocalService = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set ($user_id = $request.getAttribute("USER_ID"))
#set ($user = $userLocalService.getUserById($user_id))
#set ($role = $roleLocalService.getRole($user.getCompanyId(),"sponsor"))
#set ($hasUserRole = $roleLocalService.hasUserRole($user.getUserId(),$role.getRoleId()))
======================================================
Tuesday, June 22, 2010
Using newly launched Liferay IDE 1.0
IDE is awesome , it rocks .I was able to configure the IDE by following the instructions on IDE release wiki Installation Guide, its easy to configure and if you have the resource downloaded you will be able to start developing portlets in no time.
Follow the getting started tutorial Getting started
Watch demos if you need some help around creating portlets rely on demo videos Portlet development video demo
Feature like auto deployment ,hot sync are very helpful changes are reflected as soon as a change is made in the code , gone are the days when you needed to redeploy manually .GUI based wizard options are available for selecting portlet mode and Liferay portlet mode, choose category for portlets choose file location resource location etc. Truly wonderful.
I haven't encountered any bug yet , I will update the post once I use more features and encounter bugs.
Follow the getting started tutorial Getting started
Watch demos if you need some help around creating portlets rely on demo videos Portlet development video demo
Feature like auto deployment ,hot sync are very helpful changes are reflected as soon as a change is made in the code , gone are the days when you needed to redeploy manually .GUI based wizard options are available for selecting portlet mode and Liferay portlet mode, choose category for portlets choose file location resource location etc. Truly wonderful.
I haven't encountered any bug yet , I will update the post once I use more features and encounter bugs.
Wednesday, June 16, 2010
Liferay IDE 1.0.0 Released
For all Liferay enthusiast First version of IDE has been release based on Eclipse Galileo SR2.
Click here to get IDE
I will use it today and post some of the capabilities and reviews
Click here to get IDE
I will use it today and post some of the capabilities and reviews
Monday, May 24, 2010
Liferay IDE 1.0
I have seen the video demos and the IDE rocks, it has all the features a developer would love to see in first version
The IDE has not been released yet. Once the next release candidate LR portal(6.0RC2) is released, then IDE will be rolled out as it will support version 6.0RC2 onwards
In my next post I will detail the features once IDE is available for general use.
I also plan for a post with detailed usage of OOB(out of the box) portlets and their configuration.
The IDE has not been released yet. Once the next release candidate LR portal(6.0RC2) is released, then IDE will be rolled out as it will support version 6.0RC2 onwards
In my next post I will detail the features once IDE is available for general use.
I also plan for a post with detailed usage of OOB(out of the box) portlets and their configuration.
Subscribe to:
Posts (Atom)
