Configuring Object Definitions
While defining the structure and relationships of your Liferay Objects is essential, configuring their behavior and functionality is equally important. From determining data scope to enabling draft mode, configuring your object ensures it aligns with your requirements. You can configure object definitions in the Objects UI, where options appear in these sections:
-
Object Data
-
Entry Display
-
Scope
-
Account Restriction
-
Configuration
-
Translations
Object Data
In the Object Data section, you can manage the object's name and labels. The labels identify the object in the Liferay UI and can be localized at any time, while the name identifies the object in the Liferay backend and cannot be localized. You can update the labels at any time, though you cannot change the object’s name after publishing.
This section also displays the object's database table name, which is managed by Liferay and cannot be changed. When you publish an object, Liferay creates this table, which includes the object’s fields and relationships defined at the time of publishing. Fields and relationships added after publishing are added to a side table (i.e., [Initial_Table_Name]_x
).
After publishing, you can also activate or deactivate the object at any time. While active, users can interact with the object and its entries. When deactivated, the object becomes inaccessible, preventing any interaction or usage. Note that deactivating an object definition does not remove its entries; only deleting the object removes its entries.
Entry Display
In the Entry Display section, you can set the object’s Entry Title Field, which determines the object field used to identify its entries when using relationships. This applies only to the object’s default view and layout and does not affect custom UIs created using fragments or client extensions. By default, this configuration uses the entry’s ID. However, it's recommended to select a custom field with unique values that provide meaningful context for users.
Scope
This section includes two settings: Scope and Panel Link. Scope determines how the object’s data is stored; whether it is stored at the instance level or for individual sites. Two options are available:
-
Company: Object entries are accessible across the entire Liferay instance, including all sites.
-
Site: Object entries are restricted to the specific site where they're created.
Panel Link determines where object appears in the Liferay UI. For company-scoped objects, you can select a tab and category in the Global Menu (
After publishing, the object’s scope cannot be changed, so it’s crucial to ensure you understand how you plan to use the object and select the appropriate scope before publishing. When selecting a scope, the deciding factor is usually whether the object’s entries must be shared across multiple sites. If so, you must use the Company scope; otherwise, you can use the Site scope.
Clarity's apps illustrate this distinction. The distributor management app is designed to collect inquiries regardless of site, so its objects should use the Company scope. Conversely, the ticketing app could use the Site scope, since users from different sites may need to open different types of tickets, and those tickets may require site-specific users to resolve them.
Account Restriction
In some scenarios, you may need to restrict access to object entries by account. Liferay Objects supports this capability, enabling account users to only access entries scoped to their account while preserving full visibility for organization users across all accounts. To do this, you’ll need to enable account restriction, which requires a relationship with the Account system object. You’ll learn more about this feature and how to set it up in Module 4.
For Clarity’s ticketing app, account restriction offers a practical benefit: it allows client accounts to view and manage their tickets without accessing those belonging to other clients. Simultaneously, Clarity's support team retains full visibility across all tickets, regardless of the associated account.
Additional Configurations
The Configuration and Translations sections includes a range of configuration options to customize the object’s behavior and Liferay integrations. These are the available options:
-
Show Widget in Page Builder: Exposes a widget for adding the object to site pages. This widget uses the object’s default interface. Enable it when you have administrative users who need access to the object but shouldn’t have access to the Global Menu or Site Menu. For this reason, Clarity wants to enable it for their apps. You’ll explore options for object interfaces in Module 6.
-
Enable Categorization of Object entries: Enables users to apply categories to object entries, which can improve filtering and rendering lists of object entries. To take advantage of these benefits, Clarity wants to enable this feature for Distributor Applications and Tickets.
-
Enable Comments in Page Builder: Enables users to add page comments to object entry display pages, which can improve communication and collaboration. Clarity wants to enable this for Tickets so customers and support team members can communicate asynchronously.
-
Enable Indexed Search: Enables indexing and search for object entries. Use this setting when the object’s entries are valid search results. This feature can help Clarity’s teams find what they need, specifically for Distributor Applications and Tickets.
-
Enable Entry History in Audit Framework: Uses Liferay’s audit framework to track events for custom object definitions and their entries (e.g., when entries are created, updated, or deleted). Only enable this option if necessary for your solution. For Clarity’s apps, auditing isn't necessary.
-
Allow Users to Save Entries as Draft: Enables draft mode for object entries. When enabled, users can save entries as drafts without triggering validations, workflow processes, or actions usually triggered by entry creation or update. Instead, they’re triggered when the entry is approved. Also, draft mode is necessary for multi-page forms. This feature is necessary for Clarity’s Distributor Applications object because it uses a multi-page form and they plan to incorporate business logic that relies on draft approval.
-
Enable Entry Translation: Enables support for localization so you can enable localization for text fields. This is especially useful when object entries are used to dynamically populate website content, ensuring your site adapts to different languages. For example, you could use an object to populate page banners for each site language. Clarity’s objects-based apps are not driving displays, so translation is not necessary.
Conclusion
Understanding object configuration options is crucial to ensuring your objects align with your requirements. Next, you’ll learn about how you can extend system objects when building custom solutions.
Capabilities
Product
Education
Contact Us