Skip to content

ReferenceComponent

component

Form input for references to other dms objects. As the user types, a CMIS fulltext search (narrowed to the allowed target types from the field’s object:reference[...] classification) provides suggestions. The selected object id(s) are stored; on load they are resolved back to display chips.

Label retrieval


The chip label shown for a referenced object is its resolved object-config title, not a raw property. Both search hits and objects resolved on load are turned into a ReferenceEntry by #toEntryFromDms, which asks ObjectConfigService.getResolvedObjectConfig for the title of the object’s data. The tricky part is picking the right config: reference targets are usually secondary object types (SOTs) applied to a generic primary type, and the title-defining config is keyed by the SOT’s virtual config id (colons replaced by dots, e.g. appCasem.caseDocument) inside the owning app’s bucket — not under the primary object type id. #resolveConfigType therefore probes each allowed target type the hit actually carries (as primary type or SOT), trying the dotted and raw config ids, and uses the first bucket that defines one; it falls back to the primary object type’s default config, and ultimately to the raw object id when no title can be resolved. Objects that cannot be fetched at all (e.g. deleted or access-denied) become notFound entries labelled with their id.

Opening a reference entry


A chip can be opened only when a loaded feature app claims responsibility for the referenced object’s type. #openAppId maps the entry’s objectTypeId to an owning app id via ObjectConfigService.getAppIdForType, and canOpen gates the action on ShellService.canOpenObjectFor (and on the entry not being notFound) — this drives whether the chip is rendered as an openable link. Invoking open delegates to ShellService.openObject, passing the app id and the entry’s cached data so the app can route to / display the object without an extra fetch.

Example :

<yuv-reference [multiselect]="true" [classifications]="['object:reference[appCasem:correctionDocument]']" />

Selector: yuv-reference

Standalone: Yes

Implements: ControlValueAccessor, OnInit, OnDestroy

Type: string[] | undefined

Default Value: undefined

Additional semantics for the form element. The object:reference[...] classification restricts the suggestions to the target types listed in the brackets.

Type: number

Default Value: 10

Maximal number of suggestions for the given search term (default: 10)

Type: number

Default Value: 2

Minimal number of characters to trigger the search (default: 2)

Type: boolean

Default Value: false

Indicator that multiple references could be selected, they will be rendered as chips (default: false).

Type: boolean

Default Value: false

Will prevent the input from being changed (default: false)

Type: string | undefined

Default Value: undefined

Possibles values are EDIT (default),SEARCH,CREATE. In search situation validation of the form element will be turned off, so you are able to enter search terms that do not meet the elements validators.

Type: BooleanInput

Type: string

Type: BooleanInput

Type: ReferenceEntry[]

Default Value: []

Type: unknown

Default Value: new FormControl<AutocompleteItem | AutocompleteItem[] | undefined>(undefined)

Type: AutocompleteItem[]

Default Value: []

Type: unknown

Default Value: signal<boolean>(false)

Type: unknown

Default Value: injectNgControl(this)

Type: unknown

Default Value: () => {...}

Type: boolean

Type: string

Type: boolean

Type: unknown

Default Value: new Subject<void>()

Type: string

autocompleteFn(query: string): void
NameTypeDescription
querystring

Whether the referenced object can be opened by a loaded app.

canOpen(entry: ReferenceEntry): boolean
NameTypeDescription
entryReferenceEntry

Open the referenced object via the owning app’s registered open handler.

open(entry: ReferenceEntry): void
NameTypeDescription
entryReferenceEntry
registerOnChange(fn: any): void
NameTypeDescription
fnany
registerOnTouched(fn: any): void
NameTypeDescription
fnany

Resolve stored object ids back to display entries.

resolveFn(ids: string[]): void
NameTypeDescription
idsstring[]
setDisabledState(isDisabled: boolean): void
NameTypeDescription
isDisabledboolean
writeValue(value: string | string[]): void
NameTypeDescription
valuestring | string[]
onContainerClick(event: MouseEvent): void
NameTypeDescription
eventMouseEvent
onFocusIn(): void
onFocusout(): void
onNgOnDestroy(): void
setDescribedByIds(ids: string[]): void
NameTypeDescription
idsstring[]