WEB CONTENT MANAGEMENT
Liferay’s Web Content Management (WCM) is a system which allows non-technical users to publish content to the Web without having advanced knowledge of Web technology or programming of any sort. Liferay Content Management System (CMS) empowers you to publish your content with a simple point-and-click interface, and it helps you to keep your site fresh.
You can use WCM to author both structured and unstructured content. Unstructured content is authored using an HTML-based WYSIWYG editor. Structured content is authored and displayed by combining Web Content Structures, Web Content Templates, and Web Contents. Structures and Templates are defined individually using a text editor or through the Liferay WCM UI.
Accessing Structure Elements
The following table shows how to access structure data from your Web Content Template code (when using Velocity templates; other template languages such as FreeMarker, XSL, or CSS have similar constructs). The variable name defined in the structure are denoted in bold and will be different depending on the name assigned in the structure.
Velocity Template Accessors
$tf.name, $tf.data, $tf.type
Text Area (HTML)
#foreach($selection in $mylist.options)
Link to Page
#foreach($child in $el.children)
Template and Theme Variables
The following table lists the most common built-in variables accessible from Velocity Template code (when using Velocity templates; other template languages such as FreeMarker, CSS, or XSL have similar constructs). For example, $layout.getChildren(). Items marked with an asterisk (*) are only available from Liferay Theme files.
The current company object. This represents the portal instance on
which the user is currently navigating.
The current company ID.
ID of the group in which this web content is published.
The current user's locale, as defined by Java.
A randomized string. It is very useful for creating IDs that are
guaranteed to be unique.
Dynamic browser capabilities. e.g.$browserSniffer.isMobile()
Current portal instance
Creates portlet URLs (action URLs, etc)
Useful string utilities
Standard PortletConfig object describing information from the
Standard Portlet RenderRequest object
Standard Portlet RenderResponse object
Contains many useful items, such as the logged in user, the layout,
logo information, paths, and much more.
The User object representing the current user.
The set of pages to which the user has currently navigated. Generally,
communities and organizations have two: a public set and a private set.
groupId that is used to identify the scope where the data of the
current portlet is stored and retrieved. The scope can represent a
community, organization, user, the global scope, or a scope tied to a
The current user's time zone, as defined by Java.
e.g. “print” when clicked print icon
Path to all templates used.
Title of the page
Access to other Liferay services. Note by default this variable is
disabled, must be enabled via portal-ext.properties
Access to portal settings that were set from the Control Panel or
through the portal.properties configuration file.
An object which can determine given a particular resource whether or
not the current user has a particular permission for that resource.
Full path to various theme files
Liferay uses the concept of overriding the defaults in a separate file, rather than going in and customizing the default configuration file. The default configuration file is called portal. properties, and it resides inside of the portal-impl.jar file.
This .jar file is located in Liferay Portal’s WEB-INF/lib folder. If you have a copy of the Liferay source code, this file can be found in portal-impl/src. The file which is used to override the configuration is portal-ext.properties. This file can be created in your Liferay Home folder or anywhere in the application server’s classpath.
Out of the box, Liferay bundles are configured to use HSQLDB, which should only be used for development or demo purposes. You cannot use this database in production.
For production use, Liferay supports the following databases: MySQL, Microsoft SQL Server, Oracle Database, IBM DB2, PostgresSQL, and Sybase. Liferay can also connect to Apache Derby, Firebird, Informix, Ingres, or SAP DB. To use these databases, the database and user with appropriate access must be created, and the appropriate JDBC driver must
be available in your app server. Consult your database documentation for details on syntax and how to create databases and users.
To use a particular database, you must set the following four
properties in your portal-ext.properties.
jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe jdbc.default.username=lportal
It’s also possible to delegate this configuration to the application server through a DataSource by using the following property:
App Server Configuration
Liferay is supported on the following app servers or servlet containers: Geronimo, GlassFish, JBoss, Jetty, JOnAS, Oracle, Resin, Tomcat, WebLogic, and WebSphere. Consult your app server documentation for details on configuration. The following table lists common files that are involved in configuring your app server.
Primary Log Files
Default Domain Directory
Primary Log Files
Default Instance Directory
Primary Log Files
Troubleshooting and Debugging
The following items should be checked when troubleshooting a problem.
Log files for several app servers are listed above. These should be checked for
warnings, errors, Java stack traces, etc.
Liferay uses the Apache Log4j library to perform all of its logging operations.
See below on how to configure log settings.
Liferay provides out-of-the-box JMX MBeans, which allow introspection into
the runtime, for example to identify and isolate problematic behavior such as
poor cache performance or slow portlet rendering.
To attach a Java debugger to Liferay, you must start the JVM with special
properties. Some servers have done this for you. For example, to start Tomcat
under a debugger, run “bin/catalina.sh jpda start”
Other servers may need the JVM properties added manually. A typical set of