HubTemplate
Hub Template Class - this class encapsulates the standard operations for a "Solution" item despite the Hub team not "owning" this item type. Our primary goal is to allow editing of the item's meta information, manage sharing, etc.
Implements
- IWithStoreBehavior
- IWithSharingBehavior
- IWithThumbnailBehavior
- IWithFeaturedImageBehavior
- IWithPermissionBehavior
- IWithDiscussionsBehavior
- IWithFollowersBehavior
Extends
Constructors
Constructor Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
entity Required | IHubTemplate | ||
context Required | IArcGISContext |
Properties
Property | Type | Notes |
---|---|---|
Protected Inherited | IArcGISContext | |
Protected Inherited | IHubTemplate | |
Protected Inherited | false | |
Protected Inherited | null |
Accessors
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<HubTemplate> |
Create a new HubTemplate, returning a HubTemplate instance. This does not automatically persist the Template into the backing store unless save is set to true NOTE: we have no immediate plans to allow template creation from the context of the Hub application, but scaffolding this method for potential future implementation. The underlying createTemplate function will throw an error if attempted. |
|
Promise<HubTemplate> |
Fetch a HubTemplate from the backing store and return a HubTemplate instance |
|
HubTemplate |
Create an HubTemplate instance from an IHubTemplate object |
|
Promise<void> |
Delete the Hub Template's backing item and set a flag indicating it's been destroyed |
|
Promise<IHubTemplate> |
Transform editor values into a template entity |
|
Promise<IEditorConfig> | |
|
Promise<void> |
Save the HubTemplate to the backing store |
|
Promise<IHubTemplateEditor> |
Transform template entity into an editor object |
|
void |
Update the instance's internal entity state |
|
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 |
|
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 |
|
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 |
|
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. |
|
IHubTemplate |
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
StaticParameters
Parameter | Type | Default | Notes |
---|---|---|---|
partialTemplate Required | Partial<IHubTemplate> | ||
context Required | IArcGISContext | ||
save Optional | boolean | false |
Returns
NOTE: we have no immediate plans to allow template creation from the context of the Hub application, but scaffolding this method for potential future implementation. The underlying createTemplate function will throw an error if attempted.
fetch
StaticFetch a HubTemplate from the backing store and return a HubTemplate instance
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
identifier Required | string | ||
context Required | IArcGISContext |
Returns
fromJson
StaticCreate an HubTemplate instance from an IHubTemplate object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
json Required | Partial<IHubTemplate> |
JSON object to create a HubTemplate from |
|
context Required | IArcGISContext |
ArcGIS context |
Returns
delete
Delete the Hub Template's backing item and set a flag indicating it's been destroyed
Returns
fromEditor
Transform editor values into a template entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editor Required | IHubTemplateEditor |
Returns
getEditorConfig
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
i18nScope Required | string | ||
type Required | TemplateEditorType |
Returns
toEditor
Transform template entity into an editor object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editorContext Optional | IEntityEditorContext | {} | |
include Optional | string[] | [] |
Returns
update
Update the instance's internal entity state
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
changes Required | Partial<IHubTemplate> |
Returns
addPermissionPolicy
Add a policy to the entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
policy Required | IEntityPermissionPolicy |
Returns
afterSave
Hook that subclasses should call to invoke shared post-save behavior
Returns
checkPermission
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
clearThumbnail
Clear the thumbnail from the item, if one exists. Persisted on next .save()
call
Returns
getPermissionPolicies
Get all policies related to a specific permission
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission |
Returns
getThumbnailUrl
Return the full url to the thumbnail, optionally with a width parameter
Parameters
Returns
removePermissionPolicy
Remove a policy from the entity
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
permission Required | Permission | ||
id Required | string |
Returns
setAccess
Set the access level of the backing item
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
access Required | SettableAccessLevel |
Returns
setFeaturedImage
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
Parameters
Returns
setFollowersGroupAccess
Sets the access level of the followers group
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
access Required | SettableAccessLevel |
Returns
setFollowersGroupIsDiscussable
Sets whether or not the followers group is discussable
Parameters
Returns
setThumbnail
Store thumbnail information to be sent with the next .save()
call
Parameters
Returns
updateIsDiscussable
Updates the isDiscussable property
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
isDiscussable Required | boolean |
whether to enable or disable discussions |
Returns
Class defined in common/src/templates/HubTemplate.ts:25
Create a new HubTemplate, returning a HubTemplate instance. This does not automatically persist the Template into the backing store unless save is set to true