Class: PropertyStructureDescriptionBuilder

datarestructor.PropertyStructureDescriptionBuilder()

new PropertyStructureDescriptionBuilder()

Builder for a PropertyStructureDescription.

Source:

Members

description :module:datarestructor.PropertyStructureDescription

Type:
Source:

Methods

abbreviation(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the optional abbreviation.

Contains a symbol character or a very short abbreviation of the category.

  • "P" for products
  • "V" for vendors
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
abbreviation("P")

build() → {module:datarestructor.PropertyStructureDescription}

Finalizes the settings and builds the PropertyStructureDescription.

Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription

category(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the category.

Contains a short domain nam, for example:

  • "product" for products
  • "vendor" for vendors
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
category("Product")

deduplicationPattern(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the pattern to be used to remove duplicate entries.

A pattern may contain variables in double curly brackets {{variable}}. A pattern may contain variables in double curly brackets {{variable}}.

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
deduplicationPattern("{{category}}--{{type}}--{{index[0]}}--{{index[1]}}--{{fieldName}}")

displayPropertyName(valueopt) → {module:datarestructor.PropertyStructureDescription}

Overrides the display name of the property.

If it is not set or set to "" then it will be derived from the last part of original property name starting with an upper case character.

For example:

  • "Product"
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
displayPropertyName("Product")

fieldName(valueopt) → {module:datarestructor.PropertyStructureDescription}

Overrides the (technical) field name of the property.

If it is not set or set to "" then it will be derived from the last part of original property name.

For example:

  • "product"
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
fieldName("product")

groupDestinationName(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the name of the group when it had been moved to the destination.

The default value is the groupName, which will be used when the value is not valid (null or empty)

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
groupDestinationPattern("options")

groupDestinationPattern(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the pattern that describes where the group should be moved to.

Default=""=Group will not be moved. A pattern may contain variables in double curly brackets {{variable}}.

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
groupDestinationPattern("main-{{category}}")

groupName(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the name of the property, that contains grouped entries.

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
groupName("details")

groupPattern(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the pattern that describes how to group entries.

"groupName" defines the name of this group. A pattern may contain variables in double curly brackets {{variable}}.

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
groupPattern("{{type}}-{{category}}")

image(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the optional path to an image resource.

Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
image("img/product.png")

indexStartsWith(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the optional beginning of the id that needs to match. Matches all indices if set to "" (or not called).

For example:

  • "1." will match id="1.3.4" but not "0.1.2".
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
indexStartsWith("1.")

propertyPattern(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the property name pattern.

Contains single property names with sub types separated by "." without array indices. May contain variables in double curly brackets.

Example:

  • responses.hits.hits._source.{{fieldName}}
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
propertyPattern("responses.hits.hits._source.{{fieldName}}")

propertyPatternEqualMode() → {module:datarestructor.PropertyStructureDescription}

Sets "equal mode" for the property pattern.

"propertyPattern" need to match exactly if this mode is activated. It clears propertyPatternTemplateMode which means "equal" mode.

Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription

propertyPatternTemplateMode() → {module:datarestructor.PropertyStructureDescription}

Sets "template mode" for the property pattern.

"propertyPattern" can contain variables like {{fieldName}} and doesn't need to match the property name exactly. If the "propertyPattern" is shorter than the property name, it also matches when the property name starts with the "propertyPattern".

Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription

type(valueopt) → {module:datarestructor.PropertyStructureDescription}

Sets the type.

Contains the type of the entry, for example:

  • "summary" for e.g. a list overview.
  • "detail" e.g. when a summary is selected.
  • "filter" e.g. for field/value pair results that can be selected as search parameters.
Parameters:
Name Type Attributes Default Description
value String <optional>
""
Source:
Returns:
Type
module:datarestructor.PropertyStructureDescription
Example
type("summary")