Configuring Clarity's Workspaces
Liferay Workspace offers extensive configuration options. As Clarity's team prepares for upcoming development initiatives, they want to fine-tune their workspace and ensure it aligns with their project requirements. In these exercises, you'll gain hands-on experience modifying workspace configurations using Liferay Developer Studio.
Exercise: Upgrading the Liferay Workspace Version
In a previous exercise, you created the clarity-lds-workspace
project based on the dxp-2023.q3.9
Liferay version. By default, this uses the 10.1.7
workspace version. Clarity wants to update the project’s workspace. Here' you’ll update the workspace’s version.
-
In Liferay Developer Studio, open the
settings.gradle
file. -
Note the
version
for thecom.liferay.gradle.plugins.workspace
dependency (i.e.,10.1.7
).
-
Change the value to
12.1.0
and save the file. -
Click the Search button in the top right corner, search
Terminal
and select Open Local Terminal on Selection.
This opens a terminal window in the workspace’s root folder (i.e.,clarity-lds-workspace
). -
In the terminal window, run this command:
-
Verify the build is successful.
Once complete, the workspace has been updated.
Exercise: Configuring Portal Properties
During development, Clarity's team plans to test features with various users with different roles. By default, Liferay requires users to change their password upon initial login and verify their email address. To reduce manual configurations, Clarity wants to disable these requirements for local development. They also want to change the document library’s max file size and enable JQuery.
-
In Liferay Developer Studio, open the
configs/local/portal-ext.properties
file. -
Add this property to the file to disable additional email verification:
-
Add these properties to the file to disable password from being changed upon initial login:
-
Add this property to change the document library’s max file size:
This sets the limit to 10mb.
-
Save the file.
Now when you initialize and start the local bundle, you’re not required to verify emails or reset passwords. -
Within the
/configs/common
folder, create this folder structure:osgi/configs
. -
Add a file to the
/configs/common/osgi/configs
folder with this name -
Open this file and add
enableJQuery=B"true"
.
-
Save the file.
-
Run this command to initialize the Liferay local bundle:
-
Once finished, open the
bundles/portal-ext.properties
file and verify it includes the properties from theconfigs/local/portal-ext.properties
file.
Note: If the build is successful and thebundles
folder does not appear, open the File drop-down menu and click Refresh. -
Verify the
bundles/osgi/configs
folder includes your JQuery configuration file.
-
Open the
configs/prod/portal-ext.properties
file. -
Add this property:
This increases the max file size to 50mb for your production environment.
-
Save the file.
-
Open the
gradle.properties
file and add this property:This configures Gradle tasks to target the production environment.
-
Save the file.
-
Remove the
bundles
directory. -
Run this command to initialize the Liferay local bundle:
-
Once finished, open the
bundles/portal-ext.properties
file and verify it includes the properties from theconfigs/prod/portal-ext.properties
file. -
Remove the
bundles
directory again. -
Run this command to target different environments on the fly:
-
Once finished, open the
bundles/portal-ext.properties
file and verify it includes the properties from theconfigs/local/portal-ext.properties
file.
common
folder and an environment-specific folder share the same name, the environment-specific version takes precedence. For example, if a portal-ext.properties
file exists in both configs/common
and an environment-specific folder (e.g., configs/prod
), the version in the environment-specific folder is used.Conclusion
Great! You’ve configured upgraded Clarity’s workspace and applied custom portal and Gradle properties. Next, you’ll review what you’ve learned before moving on to the next module.
Capabilities
Product
Education
Contact Us