HubSite
Hub Site Class NOTE: This is a minimal implementation. Create operations are not supported at this time
Implements
- IWithStoreBehavior
- IWithSharingBehavior
- IWithThumbnailBehavior
- IWithFeaturedImageBehavior
- IWithPermissionBehavior
- IWithDiscussionsBehavior
- IWithFollowersBehavior
- IWithStoreBehavior
- IWithPermissionBehavior
- IWithCatalogBehavior
- IWithSharingBehavior
- IWithVersioningBehavior
- IWithEditorBehavior
Extends
Constructors
Constructor Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
entity Required | IHubSite | ||
context Required | IArcGISContext |
Properties
Property | Type | Notes |
---|---|---|
Protected Inherited | IArcGISContext | |
Protected Inherited | IHubSite | |
Protected Inherited | false | |
Protected Inherited | null |
Accessors
Accessor | Type | Notes |
---|---|---|
Catalog |
Catalog instance for this site. Note: Do not hold direct references to this object; always access it from the site. |
|
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. |
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. |
Inherited | string |
Return the entity id |
Inherited | string |
The orgId of the Entity, if available |
Inherited | string |
Return the entity owner |
Methods
Method | Returns | Notes |
---|---|---|
|
Promise<HubSite> |
NOT IMPLEMENTED YET: Create a new HubSite, returning a HubSite instance. By default, this does not save the site to the backing store. |
|
Promise<HubSite> |
Fetch a Site from the backing store and return a HubSite instance. |
|
HubSite |
Create an instance from an IHubSite object |
|
Promise<IContainsResponse> |
Check if a particular entity is contained is this HubSite. By default, this checks the Site catalog for the entity, by executing a search. Transitive containment is supported by passing in an array of Scenario:
Check if Dataset
The site catalog and id will be added in automatically. If you already have the This function will also build a cache of the catalogs so subsequent calls will be faster. |
|
Promise<IVersion> |
Creates a new version of the site |
|
Promise<void> |
Delete the HubSite from the store set a flag to indicate that it is destroyed |
|
Promise<{
|
Deletes the specified version of the entity |
|
Promise<IHubSite> |
Load the project from the editor object |
|
Promise<IEditorConfig> | |
|
Promise<IVersion> |
Gets the specified version of the site |
|
Promise<void> |
Save the HubSite to the backing store. Currently Sites are stored as Items in Portal |
|
Promise<IVersionMetadata[]> |
Gets all the versions of the site |
|
Promise<IHubSiteEditor> |
Return the project as an editor object |
|
void |
Apply a new state to the instance |
|
Promise<IVersion> |
Updates the specified version of the site |
|
Promise<IVersionMetadata> |
Updates the specified version's metadata |
|
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. |
|
IHubSite |
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 |
---|---|---|---|
partialSite Required | Partial<IHubSite> | ||
context Required | IArcGISContext | ||
save Optional | boolean | false |
Returns
fetch
StaticFetch a Site from the backing store and return a HubSite instance.
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
identifier Required | string |
Identifier of the site to load |
|
context Required | IArcGISContext |
Returns
fromJson
StaticCreate an instance from an IHubSite object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
json Required | Partial<IHubSite> |
JSON object to create a HubSite from |
|
context Required | IArcGISContext |
ArcGIS context |
Returns
contains
Check if a particular entity is contained is this HubSite.
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
identifier Required | string | ||
hierarchy Optional | IDeepCatalogInfo[] | [] |
Returns
By default, this checks the Site catalog for the entity, by executing a search.
Transitive containment is supported by passing in an array of IDeepCatalogInfo
objects, in the order of the containment hierarchy.
Scenario:
- Site
00a
's Catalog contains Initiative00b
. - Initiative
00b
's Catalog contains Site00c
. - Site
00c
's catalog contains Dataset00d
.
Check if Dataset 00d
can be displayed in Site 00a
, pass in the following
[
{id: '00c', entityType:"item"}, // site
{id: '00b', entityType:"item"}, // initiative
]
The site catalog and id will be added in automatically.
If you already have the IHubCatalog
for the site or initiative, you can
pass that in as well, and it will save a request.
This function will also build a cache of the catalogs so subsequent calls will be faster.
createVersion
Creates a new version of the site
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
options Optional | ICreateVersionOptions |
Returns
delete
Delete the HubSite from the store set a flag to indicate that it is destroyed
Returns
deleteVersion
Deletes the specified version of the entity
Parameters
Returns
- success:
- boolean
fromEditor
Load the project from the editor object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editor Required | IHubSiteEditor |
Returns
getEditorConfig
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
i18nScope Required | string | ||
type Required | SiteEditorType |
Returns
save
Save the HubSite to the backing store. Currently Sites are stored as Items in Portal
Returns
toEditor
Return the project as an editor object
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
editorContext Optional | IEntityEditorContext | {} | |
include Optional | string[] | [] |
Returns
update
Apply a new state to the instance
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
changes Required | Partial<IHubSite> |
Returns
updateVersion
Updates the specified version of the site
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
version Required | IVersion |
Returns
updateVersionMetadata
Updates the specified version's metadata
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
version Required | IVersionMetadata |
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/sites/HubSite.ts:62
NOT IMPLEMENTED YET: Create a new HubSite, returning a HubSite instance. By default, this does not save the site to the backing store.