Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This feature makes it possible to make an object structure "elastic" by making it possible to dynamically modify visible, editable or mandatory fields according to various parameters such as the value of other fields.

Configuration

The facets of an object can be edited from the "facets" tab located to the right of the structure.

The configuration screen is then divided into two fields:

...

On top: The selector is a piece of java or groovy code to select the set of facets to apply to the current object. The parameters available for determining which facets to activate are indicated by the selector’s signature above the input field. This signature is as follows :

Code Block
CopyCollection<String> getFacesNames(IObjectReadOnly object, CTSurfer surfer, Map<String, String> params) {
}

It is therefore possible to determine which facets to activate according to:

  • the current object (object),

  • of the current user (snowboard),

  • in some cases, specific parameters added by the developer when asking for common facets. These parameters are variable and optional.

This method can return:

  • an empty collection if no facets could be selected.

  • a collection of one or more facet names that will be combined. The possible names are those visible in the title of the tabs below the selector code.

More information is available in the javadoc of this selector (wsnoheto. engine. faces. FaceSelector).

The facets represent the configuration of the fields to be modified when this facet is selected. This object has three facets, for example.

Each facet lists the available properties. To change the view of a property, you must:

  1. mark this property as managed by this facet by checking the corresponding "use" box.

  2. check / uncheck the boxes of attributes to be modified (mandatory, editable, visible).e It is possible that some checkboxes do not appear or are grayed out: this is normal and is explained in the section "Combination of facets".

Combination of facets and interaction with structure and workflow

The selector allows you to flip several facets. This section will explain how to combine these different facets together and how they interact with the default configuration of the object by which they are ported, as well as the possible configuration applied at the workflow level of the same object Assign a Workflow.

Calculation sequence of the object view:

  1. The object starts with its default configuration as configured in the structure.

  2. Next, the workflow configuration is applied.

  3. Finally, we apply the facets.

Even if the facets arrive last, this does not mean that they will take precedence over the structure and workflow because one facet can only increase the constraints on a field and not reduce them. In other words, a facet can only do one thing:

  • make a property compulsory,

  • make a property invisible in dataview,

  • to prevent the editing of a property in dataedit.

If a property is already defined as mandatory, non-editable and non-visible, no facet can operate on this property and the corresponding options will not appear in the facet configuration.

In the same way, if several facets are selected and some of them relate to the same properties, the most constraining combination of the two (or logical) is applied. To illustrate, let’s take two facets F1 and F2 acting on a P property in the following way:

Prop

F1

F2

F1 + F2

P

Mandatory = Yes
Visible = No
Editable = No

Mandatory = No
Visible = No
Edit = Yes

Mandatory = Yes
Visible = No
Editable = No

Use of facets

Once the facets are configured, they are automatically managed in the default back office.

It is possible to use facets in plugins or in the front end via:

  • the JSP tag <noheto: face />

  • the API wsnoheto.engine.CTObject.getFace() and the whole package wsnoheto.engine.faces