Show / Hide Table of Contents

Class PortalItem

Represents an item (a unit of content) in the portal. An item may have associated binary or textual data which is available via the GetDataAsync(). For example an item of type map package returns the actual bits corresponding to the map package via the item data resource.

Inheritance
Object
Item
PortalItem
Implements
System.ComponentModel.INotifyPropertyChanged
Item.PropertyChanged
Item.ItemId
Item.Created
Item.Modified
Item.Title
Item.Description
Item.Tags
Item.Snippet
Item.Extent
Item.SpatialReferenceName
Item.AccessInformation
Item.TypeKeywords
Item.UpdateItemPropertiesAsync()
Item.UpdateItemPropertiesAsync(CancellationToken)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Object.ToString()
Namespace: Esri.ArcGISRuntime.Portal
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class PortalItem : Item, INotifyPropertyChanged
Remarks

ArcGISPortal Class is the gateway to build applications with Esri's cloud infrastructure of ArcGIS Online or ArcGIS Portal. ArcGIS Portal is software technology from Esri that customers can deploy either on premise or in the cloud. ArcGIS Online is Esri's Software as a Service offering that represents GIS as a Service and is implemented using the same technology as ArcGIS Portal. The classes in the Esri.ArcGISRuntime.Portal namespace allow developers to work with users, groups and content hosted within ArcGIS Online or within an ArcGIS Portal.

The portal item ID can be used along with a portal URL to quickly instantiate a new portal item object. The ID can be determined from the URL of the item details web page or the map viewer URL (for maps only) in your portal. The item details page has the following format: http://www.arcgis.com/home/item.html?id=[item_id]. The webmap viewer has the following format: http://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id]. In both cases the [item_id] can be used as the ID to instantiate a portal item.

A PortalItem is an item of content in the ArcGISPortal Class. There are several ways to obtain an PortalItem via the Esri.ArcGISRuntime.Portal Assembly; they include:

  • FindItemsAsync(PortalQueryParameters) Method
  • GetContentAsync() Method

Constructors

Name Description
PortalItem(ArcGISPortal, PortalItemType)

Initializes a new instance of the PortalItem class. Creates a new portal item object with the specified type for the specified portal.

PortalItem(ArcGISPortal, PortalItemType, String)

Initializes a new instance of the PortalItem class. Creates a new portal item object with the specified type and title for the specified portal.

PortalItem(String, ArcGISPortal)

Initializes a new instance of the PortalItem class. Creates a portal item object from a JSON string and a portal.

Properties

Name Description
Access

Gets or sets the access level on the item. Private is the default and only the item owner can access. Shared allows the item to be shared with a specific group. Setting to Organization restricts item access to members of your organization. If Public, all users can access the item.

AverageRating

Gets the average rating for this portal item.

CommentCount

Gets the number of comments on the portal item.

Culture

Gets the item locale (language and country) information.

FolderId

Gets or sets the ID of the folder in which the owner has stored the item. The property is only returned to the item owner or the org admin.

Guid

Gets the GUID of this portal item.

IsCommentsEnabled

Gets a value indicating whether comments are allowed on this portal item.

Name

Gets or sets the name of this portal item.

Owner

Gets the username of the user who owns this portal item.

Portal

Gets the ArcGIS portal containing the item.

RatingCount

Gets the number of ratings on the portal item.

ServiceUrl

Gets the URL of the service that this portal item represents. Applies only to items that represent web-accessible resources such as map services.

Size

Gets the size of the portal item.

TermsOfUse

Gets or sets the terms of use of this portal item.

Thumbnail

Gets this item's thumbnail image.

ThumbnailUri

Gets the URI of the thumbnail image used for this portal item.

Type

Gets the GIS content type of this portal item. A portal item's type cannot be changed once it has an item ID; create a new portal item if you wish to change the type.

TypeName

Gets the type name of this portal item.

UnknownJson

Gets unknown data from the source JSON.

UnsupportedJson

Gets unsupported data from the source JSON.

Url

Gets the URL of this portal item.

ViewCount

Gets the number of views of this portal item.

Methods

Name Description
AddCommentAsync(String)

Adds a comment to an item. Available only to authenticated users who have access to the item.

AddCommentAsync(String, CancellationToken)

Adds a comment to an item. Available only to authenticated users who have access to the item.

AddRatingAsync(Double)

Adds a rating to an item that you have access to. Only one rating can be given to an item per user. If this call is made on an already rated item, the new rating will overwrite the current one. A user cannot rate their own item. Available only to authenticated users.

AddRatingAsync(Double, CancellationToken)

Adds a rating to an item that you have access to. Only one rating can be given to an item per user. If this call is made on an already rated item, the new rating will overwrite the current one. A user cannot rate their own item. Available only to authenticated users.

CreateAsync(ArcGISPortal, String)

Initializes a new instance of the PortalItem class from the specified item ID.

CreateAsync(ArcGISPortal, String, CancellationToken)

Initializes a new instance of the PortalItem class from the specified item ID.

CreateAsync(Uri)

Creates a portal item object from a portal item Url.

GetCommentsAsync()

Gets the comments for the item that you have access to. Available only to authenticated users.

GetCommentsAsync(CancellationToken)

Gets the comments for the item that you have access to. Available only to authenticated users.

GetDataAsync()

Gets the item data. The data component of an item (the "item file") is used to stream the actual data represented by the item to the client. This resource is available only for the file and text item types.

GetDataAsync(CancellationToken, String)

Gets the item data. The data component of an item (the "item file") is used to stream the actual data represented by the item to the client. This resource is available only for the file and text item types.

GetGroupsAsync()

Gets the groups that this item belongs to. Only those groups that are visible to the current portal user will be returned.

GetGroupsAsync(CancellationToken)

Gets the groups the item is a part of. Only shows the groups which the calling user can access.

GetRelatedItemsAsync(PortalItemRelationship, PortalItemRelationshipDirection, CancellationToken)

Gets all related items with the specified relationship to this item.

GetRelatedItemsAsync(IEnumerable<PortalItemRelationship>, PortalItemRelationshipDirection, CancellationToken)

Gets all related items with any of the specified relationships to this item.

GetThumbnailDataAsync()

Get the thumbnail image data for this portal item.

SetThumbnail(Stream)

Sets the thumbnail for this portal item from the given data stream.

ShareWithAsync(Boolean, Boolean)

Shares the portal item with everyone or just with the user's organization. If both 'everyone' and 'organization' arguments are true, the item will be shared with everyone (Public). If both 'everyone' and 'organization' arguments are false, the item will be made private, unless the item has been shared with one or more groups. In that case, the items Access property will be set to Shared. The groups an item has been shared with are not affected by this method. This Method is available only to authenticated users.

ShareWithAsync(Boolean, Boolean, CancellationToken)

Shares the portal item with everyone or just with the user's organization. If both 'everyone' and 'organization' arguments are true, the item will be shared with everyone (Public). If both 'everyone' and 'organization' arguments are false, the item will be made private, unless the item has been shared with one or more groups. In that case, the items Access property will be set to Shared. The groups an item has been shared with are not affected by this method. This Method is available only to authenticated users.

ShareWithGroupsAsync(IEnumerable<PortalGroup>)

Shares this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.

ShareWithGroupsAsync(IEnumerable<PortalGroup>, CancellationToken)

Shares this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.

ToJson()

Serializes the item to a JSON string.

UnshareAsync()

Unshare (make private) this portal item.

UnshareAsync(CancellationToken)

Unshare (make private) this portal item.

UnshareGroupsAsync(IEnumerable<PortalGroup>)

Stops sharing this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.

UnshareGroupsAsync(IEnumerable<PortalGroup>, CancellationToken)

Stops sharing this PortalItem with the specified list of PortalGroup. This Method is available only to authenticated users.

UpdateDataAsync(Stream)

Updates the file data for this portal item on the portal asynchronously. This call is available to the item owner and the administrator of the organization.

UpdateDataAsync(Stream, CancellationToken)

Updates the file data for this portal item on the portal asynchronously. This call is available to the item owner and the administrator of the organization.

UpdateDataAsync(String)

Updates the JSON data for this portal item on the portal asynchronously. This call is available to the item owner and the administrator of the organization.

UpdateDataAsync(String, CancellationToken)

Updates the JSON data for this portal item on the portal asynchronously. This call is available to the item owner and the administrator of the organization.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.0 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 100.15

Relevant samples

Access load status: Determine the map's load status which can be `NotLoaded`, `FailedToLoad`, `Loading`, `Loaded`.
Add an integrated mesh layer: View an integrated mesh layer from a scene service.
Add ENC exchange set: Display nautical charts per the ENC specification.
Add features: Add features to a feature layer.
In This Article
Back to top Copyright © 2022 Esri.