HubInitiativeTemplate

Class

Hub Initiative Template Class

Implements

Extends

Constructors

Constructor Parameters

Parameter Type Default Notes
entity Required IHubInitiativeTemplate
context Required IArcGISContext

Properties

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

Accessors

Accessor Type Notes
catalog Catalog
canDelete Inherited 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.

canEdit Inherited 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.

id Inherited string

Return the entity id

orgId Inherited string

The orgId of the Entity, if available

owner Inherited string

Return the entity owner

Methods

Method Returns Notes
Promise<HubInitiativeTemplate>

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

Promise<HubInitiativeTemplate>

Fetch a HubInitiativeTemplate from the backing store and return a HubInitiativeTemplate instance.

HubInitiativeTemplate

Create an instance from an IHubInitiativeTemplate object

IHubCardViewModel

Convert the project entity into a card view model that can be consumed by the suite of hub gallery components

Promise<void>

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

Promise<HubEntity>

Load the initiative template from the editor object

Promise<IEditorConfig>

Get the editor config for the HubInitiativeTemplate entity.

Promise<void>

Save the HubInitiativeTemplate to the backing store.

Promise<IHubInitiativeTemplateEditor>

Return the initiative template as an editor object

void

Apply a new state to the instance

void

** DEPRECATED: please use requestAssociation instead. This will be removed in the next breaking version **

Add an association to this entity

void

Add a policy to the entity

Promise<void>

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

IPermissionAccessResponse

Check if current user has a specific permission, accounting for both system and entity level policies

Promise<void>

Remove the featured image from the item

void

Clear the thumbnail from the item, if one exists. Persisted on next .save() call

Promise<IGroup>

Returns the followers group

IEntityPermissionPolicy[]

Get all policies related to a specific permission

string

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

IAssociationInfo[]

** DEPRECATED: This will be removed in the next breaking version **

Return a list of IAssociationInfo objects representing the associations this entity has, to the specified type

void

** DEPRECATED: please use breakAssociation instead. This will be removed in the next breaking version **

Remove an association from this entity

void

Remove a policy from the entity

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

Promise<void>

Sets the access level of the followers group

Promise<void>

Sets whether or not the followers group is discussable

void

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

Promise<void>

Share the Entity with the specified group id

Promise<void>

Share the Entity with the specified group ids

Promise<IGroup[]>

Return a list of groups the Entity is shared to.

IHubInitiativeTemplate

Return the backing entity as an object literal

Promise<void>

Unshare the Entity with the specified group id

Promise<void>

Unshare the Entity with the specified group ids

void

Updates the isDiscussable property

create

Static Static Class Method

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

Parameters

Parameter Type Default Notes
partialInitiativeTemplate Required Partial<IHubInitiativeTemplate>
context Required IArcGISContext
save Optional boolean false

Returns

fetch

Static Static Class Method

Fetch a HubInitiativeTemplate from the backing store and return a HubInitiativeTemplate instance.

Parameters

Parameter Type Default Notes
identifier Required string

Identifier of the initiative template to load

context Required IArcGISContext

Returns

fromJson

Static Static Class Method

Create an instance from an IHubInitiativeTemplate object

Parameters

Parameter Type Default Notes
json Required Partial<IHubInitiativeTemplate>

JSON object to create a HubInitiativeTemplate from

context Required IArcGISContext

ArcGIS context

Returns

  • instance of HubInitiativeTemplate

convertToCardModel

Class Method

Convert the project entity into a card view model that can be consumed by the suite of hub gallery components

Parameters

Parameter Type Default Notes
opts Optional IConvertToCardModelOpts

view model options

Returns

delete

Class Method

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

  • delete() : Promise<void>

Returns

Promise<void>

fromEditor

Class Method

Load the initiative template from the editor object

Parameters

Parameter Type Default Notes
editor Required IHubInitiativeTemplateEditor

Returns

Promise<HubEntity>

getEditorConfig

Class Method

Get the editor config for the HubInitiativeTemplate entity.

Parameters

Parameter Type Default Notes
i18nScope Required string

translation scope to be interpolated into the uiSchema

type Required InitiativeTemplateEditorType

editor type -- corresponds to the returned uiSchema

Returns

Promise<IEditorConfig>

save

Class Method

Save the HubInitiativeTemplate to the backing store.

  • save() : Promise<void>

Returns

Promise<void>

toEditor

Class Method

Return the initiative template as an editor object

Parameters

Parameter Type Default Notes
editorContext Optional IEntityEditorContext {}
include Optional string[] []

Returns

update

Class Method

Apply a new state to the instance

Parameters

Parameter Type Default Notes
changes Required Partial<IHubInitiativeTemplate>

Returns

void

addAssociation

Class Method

** DEPRECATED: please use requestAssociation instead. This will be removed in the next breaking version **

Parameters

Parameter Type Default Notes
info Required IAssociationInfo

Returns

void

Add an association to this entity

addPermissionPolicy

Class Method

Add a policy to the entity

Parameters

Parameter Type Default Notes
policy Required IEntityPermissionPolicy

Returns

void

afterSave

Class Method

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

  • afterSave() : Promise<void>

Returns

Promise<void>

checkPermission

Class Method

Check if current user has a specific permission, accounting for both system and entity level policies

Parameters

Parameter Type Default Notes
permission Required Permission

Returns

clearFeaturedImage

Class Method

Remove the featured image from the item

  • clearFeaturedImage() : Promise<void>

Returns

Promise<void>

clearThumbnail

Class Method

Clear the thumbnail from the item, if one exists. Persisted on next .save() call

  • clearThumbnail() : void

Returns

void

getFollowersGroup

Class Method

Returns the followers group

  • getFollowersGroup() : Promise<IGroup>

Returns

Promise<IGroup>

getPermissionPolicies

Class Method

Get all policies related to a specific permission

Parameters

Parameter Type Default Notes
permission Required Permission

Returns

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

listAssociations

Class Method

** DEPRECATED: This will be removed in the next breaking version **

Parameters

Parameter Type Default Notes
type Required AssociationType

Returns


Return a list of IAssociationInfo objects representing the associations this entity has, to the specified type

removeAssociation

Class Method

** DEPRECATED: please use breakAssociation instead. This will be removed in the next breaking version **

Parameters

Parameter Type Default Notes
info Required IAssociationInfo

Returns

void

Remove an association from this entity

removePermissionPolicy

Class Method

Remove a policy from the entity

  • removePermissionPolicy(permission: Permission, id: string) : void

Parameters

Parameter Type Default Notes
permission Required Permission
id Required string

Returns

void

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, clearExisting: boolean) : Promise<void>

Parameters

Parameter Type Default Notes
file Required any
clearExisting Optional boolean false

Returns

Promise<void>

setFollowersGroupAccess

Class Method

Sets the access level of the followers group

Parameters

Parameter Type Default Notes
access Required SettableAccessLevel

Returns

Promise<void>

setFollowersGroupIsDiscussable

Class Method

Sets whether or not the followers group is discussable

  • setFollowersGroupIsDiscussable(isDiscussable: boolean) : Promise<void>

Parameters

Parameter Type Default Notes
isDiscussable Required boolean

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>

shareWithGroups

Class Method

Share the Entity with the specified group ids

  • shareWithGroups(groupIds: string[]) : Promise<void>

Parameters

Parameter Type Default Notes
groupIds 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>

unshareWithGroups

Class Method

Unshare the Entity with the specified group ids

  • unshareWithGroups(groupIds: string[]) : Promise<void>

Parameters

Parameter Type Default Notes
groupIds Required string[]

Returns

Promise<void>

updateIsDiscussable

Class Method

Updates the isDiscussable property

  • updateIsDiscussable(isDiscussable: boolean) : void

Parameters

Parameter Type Default Notes
isDiscussable Required boolean

whether to enable or disable discussions

Returns

void

Class defined in common/src/initiative-templates/HubInitiativeTemplate.ts:34