Class PortalItem
An item (a unit of content) stored in an ArcGIS portal, such as a layer, web map, package file, or map service.
Implements
Namespace: Esri.ArcGISRuntime.Portal
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class PortalItem : Item, INotifyPropertyChanged
Remarks
ArcGIS portals support various types of portal items, including:
- Web maps and scenes.
- Services such as feature, map, scene, image, and OGC services that can be added as layers to a map.
- Data files that can be uploaded, stored, and downloaded, such as .mmpk or .vtpk files.
- Applications and tools.
Each portal item contains information about the item such as its unique ID, the owning ArcGISPortal, and the type of item it is (PortalItemType). Portal items can be kept private to the users that created them, shared with other users in specific groups, or made public and accessible to everyone.
You can use the portal item ID along with a portal URL to quickly instantiate a new portal item object. The item's
details page has the following URL format: https://www.arcgis.com/home/item.html?id=[item_id]
. If your portal item
is a web map, you can also obtain a URL with the format: https://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id]
from the ArcGIS Online Map Viewer.
In both cases, you can use the [item_id]
as the ID to instantiate a portal item.
Alternatively, you can obtain a portal item directly from a portal using a method such as FindItemsAsync(PortalQueryParameters).
Constructors
Name | Description |
---|---|
PortalItem(ArcGISPortal, PortalItemType) | Initializes a new instance of the PortalItem class with the specified type for the specified portal. |
PortalItem(ArcGISPortal, PortalItemType, String) | Initializes a new instance of the PortalItem class with the specified type and title for the specified portal. |
PortalItem(String, ArcGISPortal) | Initializes a new instance of the PortalItem class 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 ID is only returned to the item owner or an administrator for the organization. |
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. |
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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.5 |
.NET | 100.13 - 200.5 |
.NET Windows | 100.13 - 200.5 |
.NET Android | 200.0 - 200.5 |
.NET iOS | 200.0 - 200.5 |
.NET Framework | 100.0 - 200.5 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.5 |