Mixin: Base

Base

This provides methods to store and use global settings when interacting with Nuxeo Platform.

It's not meant to be used directly.

Source:

Methods

_computeOptions()

Computes a full options object from an optional opts object and the ones from this object.
schemas, enrichers, fetchProperties and headers are not merged but the ones from the opts object
override the ones from this object.

Source:

depth() → {Base}

Sets the depth.
Possible values are: root, children and max.

Source:
Returns:

The object itself.

Type
Base

enricher(entity, name) → {Base}

Adds an enricher for a given entity.

Parameters:
Name Type Description
entity string

The entity name.

name string

The enricher name.

Source:
Returns:

The object itself.

Type
Base

enrichers(enrichers, override) → {Base}

Sets the enrichers.

By default, the new enrichers override completely the existing ones. By setting override to false,
enrichers are merged.

Parameters:
Name Type Default Description
enrichers object

The new enrichers.

override boolean true

If the new enrichers override the existing ones. Default to true.

Source:
Returns:

The object itself.

Type
Base
Example
{ document: ['acls', 'permissions'] }

fetchProperties(fetchProperties, override) → {Base}

Sets the properties to fetch.

By default, the new properties override completely the existing ones. By setting override to false,
the properties to fetch are merged.

Parameters:
Name Type Default Description
fetchProperties object

The new properties to fetch.

override boolean true

If the new fetchProperties override the existing ones. Default to true.

Source:
Returns:

The object itself.

Type
Base
Example
{ document: ['dc:creator'] }

fetchProperty(entity, name) → {Base}

Adds a property to fetch for a given entity.

Parameters:
Name Type Description
entity string

The entity name.

name string

The property name.

Source:
Returns:

The object itself.

Type
Base

Adds a header.

Parameters:
Name Type Description
name string

the header name

value string

the header value

Source:
Returns:

The object itself..

Type
Base

headers(headers) → {Base}

Sets the headers.

Parameters:
Name Type Description
headers object

the new headers.

Source:
Returns:

The object itself.

Type
Base

httpTimeout() → {Base}

Sets the HTTP timeout, in milliseconds.

The HTTP timeout works only in a Node.js environment.

Source:
Returns:

The object itself.

Type
Base

repositoryName(repositoryName) → {Base}

Sets the repository name.

Parameters:
Name Type Description
repositoryName string

The repository name.

Source:
Returns:

The object itself.

Type
Base

schemas(schemas) → {Base}

Sets the schemas.

Parameters:
Name Type Description
schemas Array

The schemas.

Source:
Returns:

The object itself.

Type
Base

timeout() → {Base}

Sets the global timeout, used as HTTP timeout and transaction timeout
by default.

Deprecated:
  • since 3.6.0, use {#httpTiemout} or {#transactionTimeout} instead.
Source:
Returns:

The object itself.

Type
Base

transactionTimeout() → {Base}

Sets the transaction timeout, in seconds.

Source:
Returns:

The object itself.

Type
Base

translateProperties(translateProperties, override) → {Base}

Sets the properties to translate.

By default, the new properties override completely the existing ones. By setting override to false,
the properties to translate are merged.

Parameters:
Name Type Default Description
translateProperties object

The new properties to translate.

override boolean true

If the new translateProperties override the existing ones. Default to true.

Source:
Returns:

The object itself.

Type
Base
Example
{ directoryEntry: ['label'] }

translateProperty(entity, name) → {Base}

Adds a property to translate for a given entity.

Parameters:
Name Type Description
entity string

The entity name.

name string

The property name.

Source:
Returns:

The object itself.

Type
Base