HubProjectManager

Class

Centralized functions used to manage IHubProject instances

This class is a convenience wrapper over util functions which are also directly accessible for use in scenarios where classes are inconvenient.

Implements

Methods

Method Returns Notes
HubProjectManager

Factory function to construct a new HubProjectManager instance.

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

Promise<IHubProject>

Create and store new project.

Projects are stored as Items in the Sharing API

  • destroy(id: string, requestOptions: IUserRequestOptions)
Promise<void>

Destroy a project. This permanently removes the backing Item

  • fetch(identifier: string, requestOptions: IRequestOptions)
Promise<IHubProject>

Fetch a Project via id or it's slug

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<IHubProject>

Convert a Hub Project Item to a IHubProject

  • get(identifier: string, requestOptions: IRequestOptions)
Promise<IHubProject>
Promise<ISearchResponse<IHubProject>>

Search for Projects

Promise<IHubProject>

Update a project

Promise<IHubProject>

Set the thumbnail for the Project

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 new project.

Parameters

Parameter Type Default Notes
project Required Partial<IHubProject>
requestOptions Optional IUserRequestOptions

Returns

Promise<IHubProject>

Projects are stored as Items in the Sharing API

destroy

Class Method

Destroy a project. This permanently removes the backing Item

  • destroy(id: string, requestOptions: IUserRequestOptions) : Promise<void>

Parameters

Parameter Type Default Notes
id Required string
requestOptions Optional IUserRequestOptions

Returns

Promise<void>

fetch

Class Method

Fetch a Project via id or it's slug

  • fetch(identifier: string, requestOptions: IRequestOptions) : Promise<IHubProject>

Parameters

Parameter Type Default Notes
identifier Required string
requestOptions Optional IRequestOptions

Returns

Promise<IHubProject>

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<IHubProject>

Parameters

Parameter Type Default Notes
item Required IItem
requestOptions Optional IRequestOptions

Returns

Promise<IHubProject>

get

Class Method

  • get(identifier: string, requestOptions: IRequestOptions) : Promise<IHubProject>

Parameters

Parameter Type Default Notes
identifier Required string
requestOptions Optional IRequestOptions

Returns

Promise<IHubProject>

update

Class Method

Update a project

Parameters

Parameter Type Default Notes
project Required IHubProject
requestOptions Optional IUserRequestOptions

Returns

Promise<IHubProject>

updateThumbnail

Class Method

Set the thumbnail for the Project

  • updateThumbnail(project: IHubProject, file: any, filename: string, requestOptions: IUserRequestOptions) : Promise<IHubProject>

Parameters

Parameter Type Default Notes
project Required IHubProject
file Required any
filename Required string
requestOptions Optional IUserRequestOptions

Returns

Promise<IHubProject>

Class defined in common/src/projects/HubProjectManager.ts:32