Databases Reference
In-Depth Information
When the Portal is accessed without authentication, every portal request loads the
barebone bundle in the response. If the user accesses the Portal after authentication,
every portal request loads the everything bundle in the response. Liferay Portal
configures these JavaScript bundles using the configuration property. We can modify
the list of files that are loaded by these bundles. The content of the barebone bundle
can be modified by adding the following property in the
portal-ext.properties
file:
javascript.barebone.files=
In this property, we need to provide comma-separated JavaScript files. We can
provide a relative path of the JavaScript files from the
/html/js
directory of the
ROOT web application. For example, suppose we are using an AUI-based dialog
box on most of our pages. It will require loading the
aui-dialog.js
file located
in the
liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\webapps\ROOT\html\
js\aui\aui-dialog\
directory. Instead of making a separate request for this file
from the browser, we can add this file in the barebone bundle. This can be done
by appending
aui\aui-dialog\ aui-dialog.js
to the existing values of the
javascript.barebone.files
property in
portal-ext.properties
.
To configure the list of JavaScript files of the everything bundle, we need to add the
following property in
portal-ext.properties
:
javascript.everything.files=
By default, the everything bundle extends the barebone bundle. So, in the everything
bundle, we need to provide only those JavaScript files that are not there in the
barebone bundle. Liferay also provides a way to disable the barebone bundle. If we
disable the barebone bundle, Liferay Portal loads the everything bundle for both
authenticated and nonauthenticated requests. We can disable the barebone bundle
by adding the following property in the
portal-ext.properties
file:
javascript.barebone.enabled=false
So far we talked about merging the JavaScript files of the Liferay Portal bundle. But
we use Liferay Portal as a platform and develop portlets on top of it. Portlets also
contain JavaScript files. It is recommended to merge the commonly-used JavaScript
files of a portlet into one portlet to reduce the number of JavaScript requests.
The JavaScript merging feature of Liferay is implemented using
the
minifier
filter. Hence, it is very important to make sure the
minifier
filer is not disabled. The
minifier
filter is by default
enabled but can be controlled by using the following property:
com.liferay.portal.servlet.filters.minifier.
MinifierFilter