Sun GlassFish Web Space Server 10.0 Administration Guide

JavaScript

JavaScript is a property in the portal.properties file, which is the default configuration file for Sun GlassFish Web Space Server. You can override this property using portal-ext.properties file.

Set a list of JavaScript files that will be loaded programmatically in /html/common/ themes/top_js.jsp.

There are two lists of files specified in the properties javascript.barebone.files and javascript.everything.files.

As the name suggests, the barebone list is a trimmed down version of the everything list whereas the everything list is a list of all loaded JavaScript files.

The two lists of files exist for performance reasons because unauthenticated users usually do not utilize all the JavaScript that is available. See the property javascript.barebone.enabled for more information on the logic of when the barebone list is used and when the everything list is used and how to customize that logic.

The list of files are also merged and packed for further performance improvements. See the property javascript.fast.load for more details.

Specify the list of barebone files.

The ordering of the JavaScript files is important. Specifically, all JQuery scripts should go first.

The Liferay scripts are grouped in such a way that the first grouping denotes utility scripts that are used by the second and third groups. The second grouping denotes utility classes that rely on the first group, but does not rely on the second or third group. The third grouping denotes modules that rely on the first and second group.


javascript.barebone.files=\
\
#
# JQuery scripts
#
\
jquery/jquery.js,\
jquery/cookie.js,\
jquery/hover_intent.js,\
jquery/j2browse.js,\
jquery/livequery.js,\
jquery/ui.core.js,\
jquery/ui.datepicker.js,\
jquery/ui.dialog.js,\
\
#
# Miscellaneous scripts
#
\
misc/class.js,\
misc/swfobject.js,\
\
#
# Liferay base utility scripts
#
\
liferay/liferay.js,\
liferay/browser.js,\
liferay/util.js,\
\
#
# Liferay utility scripts
#
\
liferay/events.js,\
liferay/popup.js,\
liferay/portal.js,\
liferay/portlet.js,\
\
#
# Liferay modules
#
\
liferay/dock.js,\
liferay/menu.js
#
# Specify the list of everything files.
#
javascript.everything.files=\
\
#
# JQuery scripts
#
\
jquery/jquery.js,\
jquery/cookie.js,\
jquery/form.js,\
jquery/hover_intent.js,\
jquery/j2browse.js,\
jquery/jeditable.js,\
jquery/json.js,\
jquery/livequery.js,\
jquery/media.js,\
jquery/ui.core.js,\
jquery/ui.accordion.js,\
jquery/ui.dialog.js,\
jquery/ui.draggable.js,\
jquery/ui.droppable.js,\
jquery/ui.resizable.js,\
jquery/ui.selectable.js,\
jquery/ui.slider.js,\
jquery/ui.sortable.js,\
jquery/ui.tabs.js,\
jquery/effects.core.js,\
jquery/effects.blind.js,\
jquery/effects.bounce.js,\
jquery/effects.clip.js,\
jquery/effects.drop.js,\
jquery/effects.explode.js,\
jquery/effects.fold.js,\
jquery/effects.highlight.js,\
jquery/effects.pulsate.js,\
jquery/effects.scale.js,\
jquery/effects.shake.js,\
jquery/effects.slide.js,\
jquery/effects.transfer.js,\
jquery/ui.color_picker.js,\
jquery/ui.autocomplete.js,\
\
#
# Miscellaneous scripts
#
\
misc/class.js,\
misc/swfobject.js,\
\
Advanced Liferay Configuration
#
# Liferay base utility scripts
#
\
liferay/liferay.js,\
liferay/browser.js,\
liferay/util.js,\
liferay/language.js,\
liferay/layout.js,\
\
#
# Liferay utility scripts
#
\
liferay/events.js,\
liferay/popup.js,\
liferay/portal.js,\
liferay/portlet.js,\
\
#
# Liferay modules
#
\
liferay/auto_fields.js,\
liferay/color_picker.js,\
liferay/dock.js,\
liferay/dynamic_select.js,\
liferay/layout_configuration.js,\
liferay/layout_exporter.js,\
liferay/menu.js,\
liferay/notice.js,\
liferay/navigation.js,\
liferay/session.js,\
liferay/tags_selector.js,\
liferay/upload.js

Set this property to false to always load JavaScript files listed in the property javascript.everything.files. Set this to true to sometimes load javascript.barebone.files and sometimes load javascript.everything.files.

The default logic is coded in com.liferay.portal.events.ServicePreAction in such a way that unauthenticated users get the barebone list of JavaScript files whereas authenticated users get the everything list of JavaScript files.


javascript.barebone.enabled=true

Set this property to true to load the packed version of files listed in the properties javascript.barebone.files or javascript.everything.files.

Set this property to false for easier debugging for development. You can also disable fast loading by setting the URL parameter js_fast_load to 0.


javascript.fast.load=true

Set the following to true to enable the display of JavaScript logging.


javascript.log.enabled=false