Studio

Content View - Query and Form Tab

Updated: December 16, 2024

JSF UI Deprecation
This requires to have the JSF UI addon installed on your server that is deprecated since Nuxeo Platform LTS 2019.
Please refer to the Web UI documentation.

This page explains the Query & Form tab in the content view definition.

This tab lets you define:

Pre-Requisites

Select the Nuxeo JSF UI target package in your Application Definition for the Content View feature to be available.

Default Filtering Definition

This section explains the following elements of the Query & Form tab:

Here are the fields you can play with:

  • Use Elasticsearch index: Lets you use the Elasticsearch aggregates
  • Query filter: Lets you manage where clauses (filtering expression) applied by default
  • Query parameters: Lets you set dynamic expressions in your default where clauses
  • Default sort: Lets you set the default sort applied to the result list

Use Elasticsearch index

Starting from Nuxeo Platform 6.0, Elasticsearch is embedded in the platform. Check this box to be able to use the Elasticsearch aggregates widgets in the form definition.

A new advanced option is available: Generate Usage Statistics. It enables to include the current content view into account in the search statistics available from the Admin > Activity > Search Analytics tab. This option is available starting from Nuxeo Platform LTS 2015.

Query Filter Field

Defining the query lets you define the list of documents you want to show in your content view if no information is set by the Nuxeo user.

The Nuxeo query system is based on our NXQL technology, which is very similar to SQL query expression. For those who know SQL, using NXQL will be very easy. For those who are not familiar with SQL, you can read the NXQL dedicated documentation and look at some NXQL examples .

You don't have to specify the SELECT * FROM Document part of the request that is automatically managed by the content view. If the Query filter field is empty, then there is no restriction. So it displays all documents, including:

  • Deleted documents,
  • Versioned documents,
  • Technical Documents normally hidden from end users,
  • etc.

By default, Nuxeo Studio fills this field to filter out:

  • documents marked as hidden in navigation (ecm:mixinType != 'HiddenInNavigation')
  • documents that are not archived versions (ecm:isCheckedInVersion = 0)
  • and documents that are deleted (ecm:currentLifeCycleState != 'deleted')

You can change or remove these filter clauses if you wish.

By default, this field is limited to static filtering (specific document type, specific date, specific lifecycle state, etc.). If you want the content view filter to be based on the context of execution, you can set some "where" clauses to apply by default to the result list. See the next section.

Query Parameters Field

The Query Filter field enables you to express the "where" clauses of your content view filter. The query parameters field lets you define a "where" clause based on the execution context. For instance:

  • The current date (for instance documents issued before today)
  • The user that displays the content view (documents created by the current user or to which the current user has contributed)
  • The currently displayed document (its document children, descendants or documents linked to the current document)

To express a dynamic expression:

  1. Write your where clause in the Query Filter field but with a question mark as the right value (for instance ecm:parentId = ?),
  2. Define the dynamic value in the query parameters field.

Here are some examples.

Query filter Query parameter
Keeping the documents created by the current user dc:creator = ? #{currentUser.name}
Keeping the children documents of the currently displayed document ecm:parentId = ? #{currentDocument.id}
Keeping the descendant of the currently displayed document Note that this request is less efficient than the previous one. ecm:path STARTSWITH ? #{currentDocument.path}
Keeping documents issued before today dc:issued < ? #{currentDate.toString()}

When your query filter has several ? parameters, you must add the query parameters in the same order as the criteria in the query filter.

More information on NXQL and examples are available on the dedicated page in the developer documentation.

Note to people familiar with Nuxeo products customization: The syntax that is to be used in those parameters is the same EL syntax as the one used in XHTML files. You have access to the SEAM context. Other sample expressions:

  • #{currentDate.toString()}: that can be used with date properties, like dc:created > DATE ?
  • #{currentDocument.dc.rights}
  • #{empty currentDocument.getProperty("dublincore","subjects") ? '%' : currentDocument.getProperty( ("dublincore","subjects" )} for multivalued property

Default Sort Field

The Default Sort field lets you express the default sorting applied to the results list. The end user can choose the sorting in the UI based on column actions. If you want more information about that look the Result tab documentation.

Default Sorting Configuration
Default Sorting Configuration

You can sort through:

  • A field of the listed documents,
  • A property of the listed documents (lifecycle state, lock date, lock owner, etc.).

To sort through a field:

  1. Click on the Add button.
  2. In the first drop down list, select the schema in which the field is defined.
  3. In the second drop down list, select the field.
  4. Check the box Sort ascending box if you want ascending sorting (alphabetical, chronological, etc.).

To sort through a property:

  1. Click on the Add button.
  2. In the first drop down list, select system.
  3. In the second drop down list, select the property.
  4. Check the box Sort ascending box if you want ascending sorting (alphabetical, chronological, etc.).

If you want to sort through multiple criteria, just repeat the steps above for each criterion.

Flags

This section explains the flags section and what the different flags enable.

  • Search content view: Since Nuxeo Platform 6.0. Enables to have your content view available in Search tab drop down list. Selecting this flag makes the Search layout required so as to have a search form displayed in the Search tab. It also adds a tab Enablement on the content view in Studio to define when the content view should be available in the Search tab.
  • Document content: Enables to use your content view on a custom tab, or to have it available in the local configuration of a workspace.
  • DAM: Enables to display the content view in the DAM tab. Since Nuxeo Platform 6.0, the flag is available when you select the target package Nuxeo DAM Compat.
  • Faceted search: Since Nuxeo Platform 5.7. Enables to display the content view in the Faceted search tab and have it available in the local search configuration of a workspace. Since Nuxeo Platform 6.0, this flag is available when you select the target package Faceted search.
  • Advanced search: Enables to have the content view available in the local search configuration of a workspace. Since Nuxeo Platform 6.0, this flag is not available anymore. You should use the Search content view flag instead.

Flag Zone
Flag Zone

Check out the page Specific Upgrade Instructions migrate your content views to Nuxeo Platform 6.0.

Search Layout

This section is focused on the search layout definition:

Search Layout Fragment
Search Layout Fragment

This is where you define the form, by drag and dropping widgets from the right panel into the form.