Concept
Facets can be seen as a property, a flag or configuration option of a document type:
- It can add schemas of properties to the document
- It can be defined as part of the default document type configuration in Nuxeo Studio
- It can be added/removed from a document using Automation
Document facets are part of the document definition.
Available Facets
The default document facets are listed in the Available Facets documentation page.
Creating a New Facet
To create a facet, click on New.
- Feature ID: Technical ID of the feature
- Label: The label that will be displayed when selecting facets of a Document Type. Choose a short explicit name and capitalize it if you want it to appear before the built-in facets.
- Description: The description of the facet, its functional purpose and where/when to use it. This description is here for information purposes.
Editing a Facet
Once created, your can attach schemas to your facet
- Associated Schemas: This is the list of schemas associated to your facet. You don't have to add anything here if you use the facet as a flag.
Functional Use Cases
When a document is validated, we need to store the validation period. More details about this use case in the HOWTO: Customize the Default Document View documentation page.
After a document is indicated as a "template", we need to store information about who can use and publish the document.
We need to indicate which documents are "Assets" and should be returned in standard search results.
To avoid having to determine if a document is linked to rights data, we will set a "Has Rights" facet.
When a Document is sent to an external service, we need to store information on this service to know how to access that external instance of the document.
Facets Used as Flag
Facets can be used to filter searches:
SELECT * FROM Document WHERE ecm:mixinType != 'HiddenInNavigation' AND ...
Facets can be used to show-hide widgets:
<template is="dom-if" if="[[hasFacet('MyFacet')]]">...
Facets can be checked in automation or Java code:
if(input.hasFacet("MyFacet")) {
...
} else …
Use an External Facet
In order to reference an externally contributed Facet, you have to add it manually to the registries using the custom facet registries.