Managing Data Sets

Liferay DXP 2024.Q1+/Portal GA112+

Important

Currently, this feature is behind a release feature flag (LPS-164563).

Once you create a data set, you can customize how users see it. Choose which fields appear, define and pre-apply filters, set default sorting rules, redirect users to a different URL where they can perform actions, and configure pagination options for your data set.

Using System Data Sets

You can use system data sets to adjust and customize an (otherwise unchangeable) Java-based data set, while keeping its underlying implementation. Adding a system data set creates a copy of the Java-based data set, which you can then treat like a custom data set by adding or removing visualization modes, filters, actions, etc.

To create a system data set,

  1. Navigate to the data set manager (Global Menu (Global menu icon) → Control PanelData Sets).

  2. Click the System Data Sets tab at the top of the page.

    A modal appears with a list of all available Java-based data sets.

    Creating a system data set copies the implementation and configuration from an existing Java-based data set.

    Tip

    Some Java-based data sets don’t support system data sets yet, so they don’t appear.

  3. Select the desired data set to use as the basis for your customizable system data set.

  4. Click Create.

The system data set that appears on the page is a copy of the original data set. Edits you make are independent of the original data set, and the new data set is not affected by changes to the original Java-based data set.

Creating a system data set also replaces the original data set’s usages in your pages with the new customizations. At any point after its creation, you can disable or enable the system data set in the data set manager by clicking the toggle button in the Status column.

Click the toggle button to enable or disable the system data set, switching between using it and the original Java-based data set.

Disabling the system data set reverts pages to using the original Java-based data set. This keeps your customized data set available for future edits even when you’re not actively using it.

Managing Data Set Permissions

When defining a role’s permissions, data set permissions are grouped under ObjectsData Set (although Control PanelObjectData Sets has the permissions to use the Data Sets page in the control panel).

Assign permissions for data sets and all of their contained entities.

Assigning permissions for data sets includes the permission to manage all entities contained in data sets, too, including filters, data set actions, etc. Users must have the Update permission to manage those features for existing data sets.

Managing Data Set Layout and Settings

The Data Set application is divided into tabs:

  • Details tab: see and edit the name (1) and description (2) of your data set. Click Save once the alterations are complete.

    You can also see the information about the REST Application, Schema, and Endpoint (3) used with that data set.

    In the Details tab, edit the name and description of your data set.

  • Liferay DXP 2024.Q2+/Portal GA120+ Visualization Modes tab: select fields and manage how they appear in your data set using three different visualization modes: Table, List, and Cards.

    Edit the fields, add friendly labels and localize them, choose a renderer for the fields, and define them as sortable or not sortable.

    You can also customize the list and the card visualization modes by mapping their elements to fields from your data set.

  • Filters tab: define filters that users can apply to the data set fragment.

    You can apply customized filters using Client Extensions, use date-type fields and show entries within a given period, or configure Picklists as the source of the options for the filter.

  • Liferay DXP 2024.Q3+/Portal GA125+ Sorting tab: set sorting options that are applied to the entries once the user visits a page with a Data Set fragment. You can also set a default sorting option.

    Sort entries using a specific field as a criterion and in ascending or descending order.

  • Liferay DXP 2024.Q2+/Portal GA120+ Actions tab: create actions linked to the elements in the data set.

    With Item Actions, you can perform many actions related to items in the data set, depending on the specific needs and context of the data. For example, if a data set item represents a user, possible actions include activating/deactivating it or impersonating it. Similarly, for a web content item, actions could include expiring content or viewing its history and usage.

    With Creation Actions, users can create new data or you can redirect them to a different location where they can create it.

    See Using Data Set Actions for more information.

  • Pagination tab: configure the pagination options for the data set. Pagination divides a large set of data into smaller, more manageable parts.

    Set a default number of items per page and provide users with a list of options from which they can select their preferred number of items to display on each page.

    Use positive numbers separated by commas to define the list of options.

    In the Pagination tab, set a default number of items per page and add a list of defined values from which users can select their preferred number of items to display on a page.

  • Settings tab: configure your data set (e.g., set a default visualization mode).

    In the Settings tab, you can configure your data set.

Adding Advanced Parameters to a Data Set

In the Advanced Optional Parameters section, enter a string of parameters in the Parameters field to add them to the request URL when showing the data set. You can enter any parameters that are compatible with the endpoint, including nestedFields, filter, and sort parameters. These parameters are used by default when the data set is shown.

The URL Preview field below shows what the resulting URL is after adding your parameters.

Note

Your parameters must both be appropriate for your chosen endpoint and use correct syntax. If you add an unsupported or incorrect parameter, rendering the data set returns an error and no results from the data set. See API Query Parameters for more information on API query parameters.

Set parameters in the Parameters field, then check the result with the read-only URL Preview field.

If you’ve configured fields, filters, or sorting criteria in the other tabs that may conflict with these parameters, those configurations are accounted for in the request URL, following these rules:

  • nestedFields parameters: if a parameter adds a field already included with a field mapped in the Visualization Modes tab, it is not re-added to the URL to avoid duplicated fields.

  • filter parameters: if you’ve added a filter both in the Parameters field and in the Filters tab, the filters are joined together with an and operator.

  • sort parameters: if a sorting criteria is configured in the Sorting tab for the same field, it overrides the criteria in the Parameters field. Sorting criteria added in the Sorting tab are added to the final URL before the criteria in the parameters.

For example, if you have a data set of users with their familyName field set as a filter in the Filters tab, and you add filter=givenName eq 'Firstname' to the Parameters field, this URL is shown by default:

/headless-admin-user/v1.0/user-accounts?filter=givenName%20eq%20'Firstname'

If a user viewing the data set enables the familyName filter for the last name Lastname, the URL then joins the two filters together for the resulting filter, (familyName eq 'Lastname') and (givenName eq 'Firstname':

/headless-admin-user/v1.0/user-accounts?filter=%28%28familyName+eq+%27Lastname%27%29%29+and+%28givenName+eq+%27Firstname%27%29%

Relevant Topics

Capabilities

Product

Education

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy