HubInitiative

Class

Hub Initiative Class

Implements

Extends

Constructors

Constructor Parameters

Parameter Type Default Notes
entity Required IHubInitiative
context Required IArcGISContext

Properties

Property Type Notes
context Protected Inherited IArcGISContext
entity Protected Inherited IHubInitiative
isDestroyed Protected Inherited false
thumbnailCache Protected Inherited null

Accessors

Accessor Type Notes
catalog Catalog

Catalog instance for this Initiative. Note: Do not hold direct references to this object; always access it from the Initiative.

permissions PermissionManager

PermissionManager instance for this Initiative. Note: Do not hold direct references to this object; always access it from the Initiative.

id Inherited string

Return the entity id

owner Inherited string

Return the entity owner

Methods

Method Returns Notes
Promise<HubInitiative>

Create a new HubInitiative, returning a HubInitiative instance. Note: This does not persist the Initiative into the backing store

Promise<HubInitiative>

Fetch an Initiative from the backing store and return a HubInitiative instance.

HubInitiative

Create an instance from an IHubInitiative object

Promise<void>

Delete the HubInitiative from the store set a flag to indicate that it is destroyed

Promise<void>

Save the HubInitiative to the backing store. Currently Initiatives are stored as Items in Portal

void

Apply a new state to the instance

Promise<void>

Hook that subclasses should call to invoke shared post-save behavior

Promise<boolean>

Can the current user delete the Entity? In order to delete an item, the user must be the owner of the item or a full org_admin in the owner's organization.

Promise<boolean>

Can the current user edit the Entity? In order to edit an item, the user must be the owner of the item or be a member of a shared editing group, to which the item is shared.

Promise<void>

Remove the featured image from the item

string

Return the full url to the thumbnail, optionally with a width parameter

Promise<void>

Set the access level of the backing item

Promise<void>

Set a featured image on the Entity, if one already exists it is cleared out before the new one is set to keep the number of resources in control

void

Store thumbnail information to be sent with the next .save() call

Promise<void>

Share the Entity with the specified group id

Promise<IGroup[]>

Return a list of groups the Entity is shared to.

IHubInitiative

Return the backing entity as an object literal

Promise<void>

Unshare the Entity with the specified group id

create

Static Static Class Method

Create a new HubInitiative, returning a HubInitiative instance. Note: This does not persist the Initiative into the backing store

Parameters

Parameter Type Default Notes
partialInitiative Required Partial<IHubInitiative>
context Required IArcGISContext
save Optional boolean false

Returns

Promise<HubInitiative>

fetch

Static Static Class Method

Fetch an Initiative from the backing store and return a HubInitiative instance.

Parameters

Parameter Type Default Notes
identifier Required string

slug or item id

context Required IArcGISContext

Returns

Promise<HubInitiative>

fromJson

Static Static Class Method

Create an instance from an IHubInitiative object

Parameters

Parameter Type Default Notes
json Required Partial<IHubInitiative>

JSON object to create a HubInitiative from

context Required IArcGISContext

ArcGIS context

Returns

delete

Class Method

Delete the HubInitiative from the store set a flag to indicate that it is destroyed

  • delete() : Promise<void>

Returns

Promise<void>

save

Class Method

Save the HubInitiative to the backing store. Currently Initiatives are stored as Items in Portal

  • save() : Promise<void>

Returns

Promise<void>

update

Class Method

Apply a new state to the instance

Parameters

Parameter Type Default Notes
changes Required Partial<IHubInitiative>

Returns

void

afterSave

Class Method

Hook that subclasses should call to invoke shared post-save behavior

  • afterSave() : Promise<void>

Returns

Promise<void>

canDelete

Class Method

Can the current user delete the Entity? In order to delete an item, the user must be the owner of the item or a full org_admin in the owner's organization.

  • canDelete() : Promise<boolean>

Returns

Promise<boolean>

canEdit

Class Method

Can the current user edit the Entity? In order to edit an item, the user must be the owner of the item or be a member of a shared editing group, to which the item is shared.

  • canEdit() : Promise<boolean>

Returns

Promise<boolean>

clearFeaturedImage

Class Method

Remove the featured image from the item

  • clearFeaturedImage() : Promise<void>

Returns

Promise<void>

getThumbnailUrl

Class Method

Return the full url to the thumbnail, optionally with a width parameter

  • getThumbnailUrl(width: number) : string

Parameters

Parameter Type Default Notes
width Optional number 200

Returns

string

setAccess

Class Method

Set the access level of the backing item

Parameters

Parameter Type Default Notes
access Required SettableAccessLevel

Returns

Promise<void>

setFeaturedImage

Class Method

Set a featured image on the Entity, if one already exists it is cleared out before the new one is set to keep the number of resources in control

  • setFeaturedImage(file: any) : Promise<void>

Parameters

Parameter Type Default Notes
file Required any

Returns

Promise<void>

setThumbnail

Class Method

Store thumbnail information to be sent with the next .save() call

  • setThumbnail(file: any, filename: string) : void

Parameters

Parameter Type Default Notes
file Required any
filename Required string

Returns

void

shareWithGroup

Class Method

Share the Entity with the specified group id

  • shareWithGroup(groupId: string) : Promise<void>

Parameters

Parameter Type Default Notes
groupId Required string

Returns

Promise<void>

sharedWith

Class Method

Return a list of groups the Entity is shared to.

  • sharedWith() : Promise<IGroup[]>

Returns

Promise<IGroup[]>

toJson

Class Method

Return the backing entity as an object literal

Returns

unshareWithGroup

Class Method

Unshare the Entity with the specified group id

  • unshareWithGroup(groupId: string) : Promise<void>

Parameters

Parameter Type Default Notes
groupId Required string

Returns

Promise<void>

Class defined in common/src/initiatives/HubInitiative.ts:29