Catalog

Class

Catalog Class

Abstracts working with Catalogs and fetching collections with the correct scope applied.

For more information, check out the Catalog & Collection Guide

Implements

Accessors

Accessor Type Notes
availableScopes EntityType[]

Return an array of the entity types available in this Catalog

collectionNames string[]

Get the names of the collections

collections IHubCollection[]

Get the collections array. Returns simple objects not Collection instances

schemaVersion number

Return the schema version

scopes ICatalogScope

Return the existing scopes hash

title string

Title getter Title setter

Methods

Method Returns Notes
Catalog

Create a Catalog instance from a Catalog Definition Json object

Promise<Catalog>

Create a Catalog instance from a site url or itemId '''js const catalog = await Catalog.create('https://site-org.hub.arcgis.com', context); '''

Promise<IContainsResponse>

Does the Catalog contain a specific piece of content?

Collection

Get a Collection instance by name

IHubCollection

Get the Collection json by name

Collection

Get a Collection instance, based on a specific entity type and filters This extends from the base scope for the entity type

IHubCollection

Create a custom collection based on a specific entity type and filters Returned collection extends from the base scope for the entity type

IQuery | undefined

Get the scope's query for a particular entity type

Promise<ISearchResponseHash>

Execute a search against all the collections in the Catalog

Promise<IHubSearchResponse<IHubSearchResult>>

Search for Groups Will throw if the Catalog does not have a scope defined for groups

Promise<IHubSearchResponse<IHubSearchResult>>

Search for Items Will throw if the Catalog does not have a scope defined for items

Promise<ISearchResponseHash>

Execute a search against all the scopes in the Catalog

Promise<IHubSearchResponse<IHubSearchResult>>

Search for Users Will throw if the Catalog does not have a scope defined for users

void

Set the scope for a specific entity type

IHubCatalog

Return the JSON object backing the instance

fromJson

Static Static Class Method

Create a Catalog instance from a Catalog Definition Json object

Parameters

Parameter Type Default Notes
json Required IHubCatalog
context Optional IArcGISContext

Returns

init

Static Static Class Method

Create a Catalog instance from a site url or itemId '''js const catalog = await Catalog.create('https://site-org.hub.arcgis.com', context); '''

Parameters

Parameter Type Default Notes
identifier Required string
context Optional IArcGISContext

Returns

Promise<Catalog>

contains

Class Method

Does the Catalog contain a specific piece of content?

Parameters

Parameter Type Default Notes
identifier Required string

id or slug of the content

options Required IContainsOptions

entityType if known; otherwise will execute one search for each scope

Returns

getCollection

Class Method

Get a Collection instance by name

Parameters

Parameter Type Default Notes
name Required string

Returns

getCollectionJson

Class Method

Get the Collection json by name

Parameters

Parameter Type Default Notes
name Required string

Returns

getCustomCollection

Class Method

Get a Collection instance, based on a specific entity type and filters This extends from the base scope for the entity type

Parameters

Parameter Type Default Notes
type Required EntityType
filters Required IFilter[]

Returns

getCustomCollectionJson

Class Method

Create a custom collection based on a specific entity type and filters Returned collection extends from the base scope for the entity type

Parameters

Parameter Type Default Notes
type Required EntityType
filters Required IFilter[]

Returns

getScope

Class Method

Get the scope's query for a particular entity type

Parameters

Parameter Type Default Notes
type Required EntityType

Returns

IQuery | undefined

searchCollections

Class Method

Execute a search against all the collections in the Catalog

Parameters

Parameter Type Default Notes
query Required string
options Optional IHubSearchOptions {}

Returns

searchGroups

Class Method

Search for Groups Will throw if the Catalog does not have a scope defined for groups

Parameters

Parameter Type Default Notes
query Required string | IQuery
options Optional IHubSearchOptions

Returns

searchItems

Class Method

Search for Items Will throw if the Catalog does not have a scope defined for items

Parameters

Parameter Type Default Notes
query Required string | IQuery
options Optional IHubSearchOptions

Returns

searchScopes

Class Method

Execute a search against all the scopes in the Catalog

Parameters

Parameter Type Default Notes
query Required string
options Optional IHubSearchOptions {}

Returns

searchUsers

Class Method

Search for Users Will throw if the Catalog does not have a scope defined for users

Parameters

Parameter Type Default Notes
query Required string | IQuery
options Optional IHubSearchOptions {}

Returns

setScope

Class Method

Set the scope for a specific entity type

Parameters

Parameter Type Default Notes
type Required EntityType
query Required IQuery

Returns

void

toJson

Class Method

Return the JSON object backing the instance

Returns


Class defined in common/src/search/Catalog.ts:34