CatalogMember

CatalogMember

(abstract) new CatalogMember(terria)

Source:

A member of a CatalogGroup. A member may be a CatalogItem or a CatalogGroup.

Parameters:
Name Type Description
terria Terria

The Terria instance.

Members

(static) defaultPropertiesForSharing :Array.<String>

Source:

Gets or sets the default set of properties that are serialized when serializing a CatalogMember-derived object for a share link.

Type:
  • Array.<String>

(static) defaultSerializers :Object

Source:

Gets or sets the set of default serializer functions to use in CatalogMember#serializeToJson. Types derived from this type should expose this instance - cloned and modified if necesary - through their CatalogMember#serializers property.

Type:
  • Object

(static) defaultUpdaters :Object

Source:

Gets or sets the set of default updater functions to use in CatalogMember#updateFromJson. Types derived from this type should expose this instance - cloned and modified if necesary - through their CatalogMember#updaters property.

Type:
  • Object

(static) itemFilters

Source:

A collection of static filters functions used during serialization

_memoizedInfoItemsSourceLookup

Source:

Lookup table for _sourceInfoItemNames, access through CatalogMember#_infoItemsWithSourceInfoLookup

cacheDuration :String

Source:

Gets or sets the cache duration to use for proxied URLs for this catalog member. If undefined, proxied URLs are effectively cachable forever. The duration is expressed as a Varnish-like duration string, such as '1d' (one day) or '10000s' (ten thousand seconds).

Type:
  • String

customProperties :Object

Source:

Gets or sets the dictionary of custom item properties. This property is observable.

Type:
  • Object

description :String

Source:

Gets or sets the description of the item. This property is observable.

Type:
  • String

forceProxy :Boolean

Source:

Gets or sets whether or not this member should be forced to use a proxy. This property is not observable.

Type:
  • Boolean

hasDescription :Boolean

Source:

Tests whether a description is available, either in the 'description' property or as a member of the 'info' array.

Type:
  • Boolean

hideSource :boolean

Source:

Indicates that the source of this data should be hidden from the UI (obviously this isn't super-secure as you can just look at the network requests).

Type:
  • boolean

id :String

Source:

An optional unique id for this member, that is stable across renames and moves. Use uniqueId to get the canonical unique id for this CatalogMember, which is present even if there is no id.

Type:
  • String

info :Array.<Object>

Source:
Default Value:
  • []

Gets or sets the array of section titles and contents for display in the layer info panel. In future this may replace 'description' above - this list should not contain sections named 'description' or 'Description' if the 'description' property is also set as both will be displayed. The object is of the form {name:string, content:string}. Content will be rendered as Markdown with HTML. This property is observable.

Type:
  • Array.<Object>

infoSectionOrder :Array.<String>

Source:

Gets or sets the array of section titles definining the display order of info sections. If this property is not defined, DataPreviewSections's DEFAULT_SECTION_ORDER is used. This property is observable.

Type:
  • Array.<String>

initialMessage :Object

Source:

A message object that is presented to the user when an item or group is initially clicked The object is of the form {title:string, content:string, key: string, confirmation: boolean, confirmText: string, width: number, height: number}. This property is observable.

Type:
  • Object

isGroup :Boolean

Source:

Gets a value that tells the UI whether this is a group. Groups, when clicked, expand to show their constituent items.

Type:
  • Boolean

isHidden :Boolean

Source:
Default Value:
  • false

Gets or sets a value indicating whether this item is hidden from the catalog. This property is observable.

Type:
  • Boolean

isPromoted :Boolean

Source:
Default Value:
  • false

Gets or sets a value indicating whether this item is kept above other non-promoted items. This property is observable.

Type:
  • Boolean

isUserSupplied :Boolean

Source:
Default Value:
  • true

Gets or sets a value indicating whether this member was supplied by the user rather than loaded from one of the Terria#initSources. User-supplied members must be serialized completely when, for example, serializing enabled members for sharing. This property is observable.

Type:
  • Boolean

isWaitingForDisclaimer :boolean

Source:

Whether this catalog member is waiting for a disclaimer to be accepted before showing itself.

Type:
  • boolean

name :String

Source:

Gets or sets the name of the item. This property is observable.

Type:
  • String

nameInCatalog :String

Source:

Gets or sets the name of this catalog member in the catalog. By default this is just name, but can be overridden.

Type:
  • String

parent :CatalogGroup

Source:

The parent CatalogGroup of this member.

Type:

path :String

Source:

The complete path of this member's location.

Type:
  • String

propertiesForSharing :Array.<String>

Source:

Gets the set of names of the properties to be serialized for this object when CatalogMember#serializeToJson is called for a share link.

Type:
  • Array.<String>

serializers :Object

Source:

Gets the set of functions used to serialize individual properties in CatalogMember#serializeToJson. When a property name on the model matches the name of a property in the serializers object literal, the value will be called as a function and passed a reference to the model, a reference to the destination JSON object literal, and the name of the property.

Type:
  • Object

shareKeys :Array.<String>

Source:

An array of all possible keys that can be used to match to this catalog member when specified in a share link - used for maintaining backwards compatibility when adding or changing CatalogMember#id.

Type:
  • Array.<String>

shortReport :String

Source:

A short report to show on the now viewing tab. This property is observable.

Type:
  • String

shortReportSections :Array.<ShortReportSection>

Source:

The list of collapsible sections of the short report. Each element of the array is an object literal with a name and content property.

Type:
  • Array.<ShortReportSection>

terria :Terria

Source:

Gets the Terria instance.

Type:

type :String

Source:

Gets the type of data item represented by this instance.

Type:
  • String

typeName :String

Source:

Gets a human-readable name for this type of data source, such as 'Web Map Service (WMS)'.

Type:
  • String

uniqueId :String

Source:

The canonical unique id for this CatalogMember. Will be the id property if one is present, otherwise it will fall back to the uniqueId of this item's parent + this item's name. This means that if no id is set anywhere up the tree, the uniqueId will be a complete path of this member's location.

Type:
  • String

updaters :Object

Source:

Gets the set of functions used to update individual properties in CatalogMember#updateFromJson. When a property name in the returned object literal matches the name of a property on this instance, the value will be called as a function and passed a reference to this instance, a reference to the source JSON object literal, and the name of the property. If part of the update happens asynchronously, the updater function should return a Promise that resolves when it is complete.

Type:
  • Object

Methods

connectsWithRoot()

Source:

Goes up the hierarchy and determines if this CatalogMember is connected with the root in terria.catalog, or whether it's part of a disconnected sub-tree.

enableWithParents()

Source:

"Enables" this catalog member in a way that makes sense for its implementation (e.g. isEnabled for items, isOpen for groups, and all its parents and ancestors in the tree.

findInfoSection(sectionName) → {Object}

Source:

Finds an CatalogMember#info section by name.

Parameters:
Name Type Description
sectionName String

The name of the section to find.

Returns:

The section, or undefined if no section with that name exists.

Type
Object

serializeToJson(optionsopt) → {Object}

Source:

Serializes the data item to JSON.

Parameters:
Name Type Attributes Description
options Object <optional>

Object with the following properties:

Properties
Name Type Attributes Description
propertyFilter function <optional>

Filter function that will be executed to determine whether a property should be serialized.

itemFilter function <optional>

Filter function that will be executed for each item in a group to determine whether that item should be serialized.

Returns:

The serialized JSON object-literal.

Type
Object

updateFromJson(json, optionsopt) → {Promise}

Source:

Updates the catalog member from a JSON object-literal description of it. Existing collections with the same name as a collection in the JSON description are updated. If the description contains a collection with a name that does not yet exist, it is created. Because parts of the update may happen asynchronously, this method returns at Promise that will resolve when the update is completely done.

Parameters:
Name Type Attributes Description
json Object

The JSON description. The JSON should be in the form of an object literal, not a string.

options Object <optional>

Object with the following properties:

Properties
Name Type Attributes Description
onlyUpdateExistingItems Boolean <optional>

true to only update existing items and never create new ones, or false is new items may be created by this update.

isUserSupplied Boolean <optional>

If specified, sets the CatalogMember#isUserSupplied property of updated catalog members to the given value. If not specified, the property is left unchanged.

Returns:

A promise that resolves when the update is complete.

Type
Promise