You might be tired of hearing about it by now, but it’s worth repeating: Liferay DXP is modular. It’s composed of many applications, which are divided into even smaller “chunks” of functionality. The applications, and sometimes even code chunks, are configurable at several scopes, as discussed in the introductory article for this section.
If you need to make configuration changes to an application that take effect in
a system-wide fashion, where do you do it? Readers who have been around a while
will be raising their hands hoping to be called on, sure that the correct answer
is “why, system-wide application configuration takes place in a properties file,
most commonly the portal-ext.properties
file”. They then expect to get a
sticker of
Ray
on their mobile device for their attentiveness. However, that’s an incomplete
answer, so they need to sit back down and listen like the rest of the class.
There’s a brand new way to make configuration changes at the system scope in
Liferay DXP 7.0, and you don’t need to go messing around in a properties file to
do it. These settings can now be made in the Control Panel, in Configuration
→ System Settings.
Editing the Default Configuration
In System Settings, the configuration options are categorized into logical groupings based on their functionality, and there’s a Search box to make finding the app you want to configure easier.
Changing an app’s default configuration options in System Settings isn’t difficult. Once you find what you’re looking for, simply click the name of the component you want to configure, or click the actions button () then click Edit. Make any changes you’d like, then click Save. Your configuration changes are saved and applied throughout the system.
If you make some regrettable configuration decisions and can’t recall exactly what you did, start over by clicking the actions button (), then clicking Reset Default Values.
Configuration Scope
While browsing the categories of System Settings, you’ll notice that each entry has a Name and a Scope. This scope is different than the overall application configuration scope discussed in the introduction to this section. This is the System Settings application after all, so all of the configuration done here affects the System scope. The Scope field here refers to the scope at which this default, system-wide configuration can be overridden. There are four values that you’ll see under Scope:
-
System: Any configuration made at the system scope here becomes the final value for the application in a system-wide fashion. It affects the whole system and cannot be overridden anywhere else.
-
Default Configuration for Application: Making configuration changes at this level affects the application in a system-wide fashion as well. However, while these become the system-wide defaults for the application, they can be overridden from each application instance.
-
Default Configuration for All Sites: Configuration at this scope can be overridden in each site.
-
Default Settings for All Instances: Configuration at this scope can be overridden in each Liferay DXP instance (usually via Instance Settings).
If an application is configurable from Instance Settings and System Settings, use System Settings to configure it whenever possible. If you use Instance Settings and later want to revert to using the System Settings default configurations, look for the Reset Values button from the Instance Settings entry.
The Reset Values button removes configuration values from the Liferay DXP database so you can rely on the defaults specified in System Settings. If there is no Reset Values button for an Instance Settings entry, once you use Instance Settings to configure the application, you can’t later decide to use System Settings. Only changes to Instance Settings will be recognized.
Exporting and Importing Configurations
What if you change many default configurations in System Settings, and then need to make the same changes in another Liferay DXP installation? Don’t worry, you don’t need to remember and duplicate every choice you made. The System Settings application lets you export a single entry’s configurations (e.g., the Dynamic Data Lists entry’s configurations), or all the settings you made in the System Settings interface. Then you can deploy them in the target Liferay DXP installation.
To export a single entry’s configurations, click the actions button
(), then click Export. A .config
file then downloads that contains any configuration changes you saved.
To export all the configuration changes you’ve made in System Settings, click
the System Settings options button
(), then click Export All
Settings. The .config
files for all the entries you edited then download in a
ZIP file.
To make these configurations active in the destination Liferay DXP system, simply
unzip and place the .config
files in the [Liferay_Home]/osgi/configs
folder.
Awesome! Now you know what System Settings is and how to use it. All that’s left is to explore the entries to see what configuration options you can make. If you aren’t sure what something does, check the documentation for the feature you’re interested in, as specific configurations are covered there.