HubSiteManager

Class

Implements

Methods

Method Returns Notes
HubSiteManager

Factory function to construct a new HubProjectManager instance.

Note: Used so that we could do async actions in the ctor.

Promise<IHubSite>

Create and store a new Site

This also registers the item for oAuth and registers domain names with the hub Domain system

Sites are stored as Items in the Sharing API

Promise<void>

Destroy a Site This permanently removes the backing Item, and clears the domain entries for it.

Promise<IHubSite>

Fetch a Site via Id, slug or domain

This function does not require a user to be authenticated, but it does require an IRequestOptions which contains the portal instance to communicate with

  • fromItem(item: IItem, requestOptions: IRequestOptions)
Promise<IHubSite>

Convert a Hub Project Item to a IHubProject

Promise<ISearchResponse<IHubSite>>

Search for Sites

Promise<IHubSite>

Update a Site

Promise<IHubSite>

Set the thumbnail for the Site

init

Static Static Class Method

Factory function to construct a new HubProjectManager instance.

Parameters

Parameter Type Default Notes
contextOrManager Required ArcGISContextManager | IArcGISContext

Returns


Note: Used so that we could do async actions in the ctor.

create

Class Method

Create and store a new Site

Parameters

Parameter Type Default Notes
site Required Partial<IHubSite>
requestOptions Optional IHubRequestOptions

Returns

Promise<IHubSite>

This also registers the item for oAuth and registers domain names with the hub Domain system

Sites are stored as Items in the Sharing API

destroy

Class Method

Destroy a Site This permanently removes the backing Item, and clears the domain entries for it.

Parameters

Parameter Type Default Notes
id Required string
requestOptions Optional IHubRequestOptions

Returns

Promise<void>

fetch

Class Method

Fetch a Site via Id, slug or domain

Parameters

Parameter Type Default Notes
identifier Required string
requestOptions Optional IHubRequestOptions

Returns

Promise<IHubSite>

This function does not require a user to be authenticated, but it does require an IRequestOptions which contains the portal instance to communicate with

fromItem

Class Method

Convert a Hub Project Item to a IHubProject

  • fromItem(item: IItem, requestOptions: IRequestOptions) : Promise<IHubSite>

Parameters

Parameter Type Default Notes
item Required IItem
requestOptions Optional IRequestOptions

Returns

Promise<IHubSite>

update

Class Method

Update a Site

Parameters

Parameter Type Default Notes
site Required IHubSite
requestOptions Optional IHubRequestOptions

Returns

Promise<IHubSite>

updateThumbnail

Class Method

Set the thumbnail for the Site

  • updateThumbnail(site: IHubSite, file: any, filename: string, requestOptions: IUserRequestOptions) : Promise<IHubSite>

Parameters

Parameter Type Default Notes
site Required IHubSite
file Required any
filename Required string
requestOptions Optional IUserRequestOptions

Returns

Promise<IHubSite>

Class defined in common/src/sites/HubSiteManager.ts:27