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.
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 …
Facet Creation and Registration
Please refer to the HOWTO: Create and Use a Document Facet documentation page.