CkanCatalogGroup

CkanCatalogGroup

new CkanCatalogGroup(terria)

Source:

A CatalogGroup representing a collection of layers from a CKAN server.

Parameters:
Name Type Description
terria Terria

The Terria instance.

Extends

Members

(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

_memoizedInfoItemsSourceLookup

Source:
Inherited From:

Lookup table for _sourceInfoItemNames, access through CatalogMember#_infoItemsWithSourceInfoLookup

allowEntireWfsServers :Boolean

Source:
Default Value:
  • false

True to allow entire WFS servers (that is, WFS resources without a clearly-defined layer) to be added to the catalog; otherwise, false.

Type:
  • Boolean

allowEntireWmsServers :Boolean

Source:
Default Value:
  • false

True to allow entire WMS servers (that is, WMS resources without a clearly-defined layer) to be added to the catalog; otherwise, false.

Type:
  • Boolean

blacklist :Object

Source:

Gets or sets a hash of names of blacklisted groups and data sources. A group or data source that appears in this hash will not be shown to the user. In this hash, the keys should be the names of the groups and data sources to blacklist, and the values should be "true". This property is observable.

Type:
  • Object

cacheDuration :String

Source:
Inherited From:

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

csvResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a CSV resource.

Type:
  • RegExp

customProperties :Object

Source:
Inherited From:

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

Type:
  • Object

czmlResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a CZML resource.

Type:
  • RegExp

dataCustodian :String

Source:

Gets or sets a description of the custodian of the data sources in this group. This property is an HTML string that must be sanitized before display to the user. This property is observable.

Type:
  • String

description :String

Source:
Inherited From:

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

Type:
  • String

esriFeatureServerResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is an Esri MapServer or FeatureServer resource. A valid FeatureServer resource must also have FeatureServer in its URL.

Type:
  • RegExp

esriMapServerResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is an Esri MapServer resource.

Type:
  • RegExp

filterByWmsGetCapabilities :Boolean

Source:

Gets or sets a value indicating whether the CKAN datasets should be filtered by querying GetCapabilities from each referenced WMS server and excluding datasets not found therein. This property is observable.

Type:
  • Boolean

filterQuery :Array.<String>|Array.<Object>

Source:

Gets or sets the filter query to pass to CKAN when querying the available data sources and their groups. Each item in the array causes an independent request to the CKAN, and the results are concatenated. The search string is equivalent to what would be in the parameters segment of the url calling the CKAN search api. See the Solr documentation for information about filter queries. Each item can be either a URL-encoded string ("fq=res_format%3awms") or an object ({ fq: 'res_format:wms' }). The latter format is easier to work with. To get all the datasets with wms resources: [{ fq: 'res_format%3awms' }] To get all wms/WMS datasets in the Surface Water group: [{q: 'groups=Surface Water', fq: 'res_format:WMS' }] To get both wms and esri-mapService datasets: [{q: 'res_format:WMS'}, {q: 'res_format:"Esri REST"' }] To get all datasets with no filter, you can use [''] This property is required. This property is observable.

Type:
  • Array.<String> | Array.<Object>

forceProxy :Boolean

Source:
Inherited From:

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

Type:
  • Boolean

geoJsonResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a GeoJSON resource.

Type:
  • RegExp

groupBy :String

Source:

Gets or sets a value indicating how datasets should be grouped. Valid values are:

  • none - Datasets are put in a flat list; they are not grouped at all.
  • group - Datasets are grouped according to their CKAN group. Datasets that are not in any groups are put at the top level.
  • organization - Datasets are grouped by their CKAN organization. Datasets that are not associated with an organization are put at the top level.
Type:
  • String

hasDescription :Boolean

Source:
Inherited From:

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

Type:
  • Boolean

hideSource :boolean

Source:
Inherited From:

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:
Inherited From:

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

includeCsv :Boolean

Source:

True to allow CSV resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeCzml :Boolean

Source:
Default Value:
  • false

True to allow CZML resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeEsriFeatureServer :Boolean

Source:
Default Value:
  • false

True to allow ESRI FeatureServer resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeEsriMapServer :Boolean

Source:
Default Value:
  • false

True to allow ESRI MapServer resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeGeoJson :Boolean

Source:
Default Value:
  • false

True to allow GeoJSON resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeKml :Boolean

Source:
Default Value:
  • false

True to allow KML resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeWfs :Boolean

Source:
Default Value:
  • true

True to allow WFS resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

includeWms :Boolean

Source:
Default Value:
  • true

True to allow WMS resources to be added to the catalog; otherwise, false.

Type:
  • Boolean

info :Array.<Object>

Source:
Inherited From:
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:
Inherited From:

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:
Inherited From:

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:
Inherited From:

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:
Inherited From:
Default Value:
  • false

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

Type:
  • Boolean

isOpen :Boolean

Source:
Inherited From:

Gets or sets a value indicating whether the group is currently expanded and showing its children. This property is observable.

Type:
  • Boolean

isPromoted :Boolean

Source:
Inherited From:
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:
Inherited From:
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:
Inherited From:

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

Type:
  • boolean

itemProperties :Object

Source:

Gets or sets a hash of properties that will be set on each child item. For example, { "treat404AsError": false }

Type:
  • Object

items :Array.<CatalogMember>

Source:
Inherited From:

Gets the collection of items in this group. This property is observable.

Type:

kmlResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a KML resource.

Type:
  • RegExp

minimumMaxScaleDenominator :Number

Source:

Gets or sets the minimum MaxScaleDenominator that is allowed for a WMS dataset to be included in this CKAN group. If this property is undefined or if CkanCatalogGroup#filterByWmsGetCapabilities is false, no filtering based on MaxScaleDenominator is performed. This property is observable.

Type:
  • Number

name :String

Source:
Inherited From:

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

Type:
  • String

nameInCatalog :String

Source:
Inherited From:

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:
Inherited From:

The parent CatalogGroup of this member.

Type:

path :String

Source:
Inherited From:

The complete path of this member's location.

Type:
  • String

preserveOrder

Source:
Inherited From:

Gets or sets flag to prevent items in group being sorted. Subgroups will still sort unless their own preserveOrder flag is set. The value of this property only has an effect during {@CatalogGroup#load} and {@CatalogItem#updateFromJson}.

propertiesForSharing :Array.<String>

Source:
Inherited From:

Gets the set of names of the properties to be serialized for this object for a share link.

Type:
  • Array.<String>

serializers :Object

Source:
Overrides:

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:
Inherited From:

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:
Inherited From:

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

Type:
  • String

shortReportSections :Array.<ShortReportSection>

Source:
Inherited From:

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:
Inherited From:

Gets the Terria instance.

Type:

type :String

Source:
Overrides:

Gets the type of data member represented by this instance.

Type:
  • String

typeName :String

Source:
Overrides:

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

Type:
  • String

ungroupedTitle :String

Source:

Gets or sets a title for the group holding all items that don't have a group in CKAN. If the value is a blank string or undefined, these items will be left at the top level, not grouped.

Type:
  • String

uniqueId :String

Source:
Inherited From:

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:
Overrides:

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.

Type:
  • Object

url :String

Source:

Gets or sets the URL of the CKAN server. This property is observable.

Type:
  • String

useCombinationNameWhereMultipleResources :Boolean

Source:

Gets or sets a value indicating whether each catalog item's name should be populated from individual resources and the CKAN dataset where the are multiple resources for a single dataset.

Type:
  • Boolean

useResourceName :Boolean

Source:

Gets or sets a value indicating whether each catalog item's name should be populated from individual resources instead of from the CKAN dataset.

Type:
  • Boolean

wfsResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a WMS resource.

Type:
  • RegExp

wmsParameters :Object

Source:

Gets or sets any extra wms parameters that should be added to the wms query urls in this CKAN group. If this property is undefined then no extra parameters are added. This property is observable.

Type:
  • Object

wmsResourceFormat :RegExp

Source:

Gets or sets a regular expression that, when it matches a resource's format, indicates that the resource is a WMS resource.

Type:
  • RegExp

Methods

(protected) _getValuesThatInfluenceLoad() → {Array}

Source:
Overrides:

When implemented in a derived class, gets an array containing the current value of all properties that influence this group's load process. See CatalogGroup#load for more information on when and how this is used. The base class implementation returns an empty array.

Returns:

The array of values that influence the load process.

Type
Array

(protected) _load() → {Promise}

Source:
Overrides:

When implemented in a derived class, this method loads the group. The base class implementation does nothing. This method should not be called directly; call CatalogGroup#load instead.

Returns:

A promise that resolves when the load is complete.

Type
Promise

add(item)

Source:
Inherited From:

Adds an item or group to this group.

Parameters:
Name Type Description
item CatalogMember

The item to add.

connectsWithRoot()

Source:
Inherited From:

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:
Inherited From:

"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.

findFirstItemByName(name) → {CatalogMember}

Source:
Inherited From:

Finds the first item in this group that has the given name. The search is case-sensitive.

Instead of using this function, consider using Catalog#shareKeyIndex to look the item up, as this works in constant time and allows lookups to continue working for items that have been renamed or moved as long as they have a stable shareKey set. This function is retained mainly for backwards-compatibility with existing share links that used names for matching.

Parameters:
Name Type Description
name String

The name of the item to find.

Returns:

The first item with the given name, or undefined if no item with that name exists.

Type
CatalogMember

findInfoSection(sectionName) → {Object}

Source:
Inherited From:

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

load() → {Promise}

Source:
Inherited From:

Loads the contents of this group, if the contents are not already loaded. It is safe to call this method multiple times. The CatalogGroup#isLoading flag will be set while the load is in progress. Derived classes should implement CatalogGroup#_load to perform the actual loading for the group. Derived classes may optionally implement CatalogGroup#_getValuesThatInfluenceLoad to provide an array containing the current value of all properties that influence this group's load process. Each time that CatalogGroup#load is invoked, these values are checked against the list of values returned last time, and CatalogGroup#_load is invoked again if they are different. If CatalogGroup#_getValuesThatInfluenceLoad is undefined or returns an empty array, CatalogGroup#_load will only be invoked once, no matter how many times CatalogGroup#load is invoked.

Returns:

A promise that resolves when the load is complete, or undefined if the group is already loaded.

Type
Promise

remove(item)

Source:
Inherited From:

Removes an item or group from this group.

Parameters:
Name Type Description
item CatalogMember

The item to remove.

serializeToJson(optionsopt) → {Object}

Source:
Inherited From:

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

sortFunction()

Source:
Inherited From:

Gets or sets the function to be used when sorting the group's items. This function takes two CatalogItem parameters and should return a negative, zero, or positive value depending on the order in which they should be sorted.

sortItems(sortRecursivelyopt)

Source:
Inherited From:

Sorts the items in this group.

Parameters:
Name Type Attributes Default Description
sortRecursively Boolean <optional>
false

true to sort the items in sub-groups as well; false to sort only the items in this group.

toggleOpen()

Source:
Inherited From:

Toggles the CatalogGroup#isOpen property of this group. If it is open, calling this method will close it. If it is closed, calling this method will open it.

updateFromJson(json, optionsopt) → {Promise}

Source:
Inherited From:

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