Portal Item
An item (unit of content) stored in an ArcGIS portal, such as a layer, web map, package file, or map service. 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 Portal, 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 formats: http://www.arcgis.com/home/item.html?id=[itemId]. 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=[itemId] from the ArcGIS Online Map Viewer. In both cases, you can use the itemId as the ID to instantiate a portal item.
Alternatively, you can obtain a portal item directly from a portal using a method such as Portal.findItems(PortalQueryParameters).
Since
200.0.0
See also
Constructors
Creates a new portal item object with the specified type in the specified portal. Use this constructor if you wish to create a new a PortalItem to add to a portal.
Creates a portal item object using the specified portal and item ID. The portal item ID can be determined from the URL of the item details web page or the ArcGIS Online map viewer and scene viewer web applications in your portal. The item details page has the following format https://www.arcgis.com/home/item.html?id=[itemId]. The map viewer has the format https://www.arcgis.com/home/webmap/viewer.html?webmap=[itemId] or https://www.arcgis.com/apps/mapviewer/index.html?webmap=[itemId] depending on whether you use the classic map viewer or the new map viewer. The scene viewer has the following format https://www.arcgis.com/home/webscene/viewer.html?webscene=[itemId]. In all cases, you can use the itemId as the ID to instantiate a portal item.
Creates a portal item from the specified portal item URL. Use this object to create a portal item from a URL. The supported URL formats are:
Properties
The portal item access. A portal item can be accessed by various types of users. There are four levels of access that can be associated with a PortalItem. Some of the access levels can be concurrent, others cannot. PortalItem.access however only returns a single PortalAccess level enumeration even though multiple levels of access may have been specified. If multiple access levels have been specified on a PortalItem, the returned access level will be the least restrictive access level.
The average rating of this portal item.
The number of comments on this portal item.
True if the comments are allowed on the portal item, false otherwise. Will return false if an error occurs.
The number of ratings on the portal item.
The URL of the service that this portal item represents. This only applies to portal items that represent web-accessible resources such as map services. Will return an empty string if the item doesn't represent a web-accessible resource or if the item isn't loaded.
The GIS content type of this portal item. A portal item's type cannot be changed once it has an item ID. If you wish to change the type you must create a new PortalItem.
The type name of this portal item. Most generally the type name is the string representation of the PortalItemType returned by PortalItem.type. However if the type is PortalItemType.Unknown, the type name is set with the type found in the portal item JSON. This allows API to deal with new portal item types added since the latest API release.
Inherited properties
The information on the source of the item and its copyright status.
The description of the specified item.
The load status.
The spatial reference name of the specified item. The coordinate system of the specified item.
The user defined tags that describe the specified item.
The terms of use of the item. It is stored in the "licenseInfo" property in json. The property can contain HTML markup.
The thumbnail of the item.
An array of keywords that further describes the type of this item. Each item is tagged with a set of type keywords that are derived based on its primary type. The type keywords of the specified item.
Functions
Adds a comment to a portal item that the user has access to. This method is only available to authenticated users.
Adds a rating to a portal item that the user has access to. Only one rating can be given to a portal item per user. If this call is made on an already rated portal item, the new rating will overwrite the current one. A user cannot rate their own portal item. This method is only available to authenticated users.
Fetches the comments for the portal item that you have access to. This method is only available to authenticated users.
Fetches the groups this portal item belongs to. Only those groups that are visible to the current portal user will be returned.
Fetches all related portal items with the specified relationship to this portal item.
Fetches all related portal items with any of the specified relationships to this portal item.
Shares this portal item with everyone or just with the user's organization. This method is only available to authenticated users. If both 'everyone' and 'organization' are true, the portal item will be shared with everyone (Public). If both 'everyone' and 'organization' are false, the portal 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 PortalAccess.Shared. The groups an item has been shared with are not affected by this method.
Shares this portal item with the specified portal groups. This method is only available to authenticated users. The portal groups are added to the existing set of portal groups the item is shared with. The result of this method is an unmodifiable collection of portal groups, one for each group with which the item could not be shared. It is empty if all groups were shared with successfully. It is not necessary to load the PortalGroup objects that are passed to this method.
Stops all sharing of this portal item. This sets the access property of the item to PortalAccess.Private and makes the item accessible to only the item owner. Removes all groups from the set of groups the item is shared with.
Stops sharing this portal item with the specified collection of portal groups. The collection of groups are removed from the set of groups the item is shared with. The result is an unmodifiable collection of portal groups, one for each group for which the item could not be unshared, empty if all groups were unshared with successfully. It is not necessary to load the PortalGroup objects that are passed to this method.
Update the portal item with the given PortalItemContentParameters.
Executes an asynchronous operation to update any item properties that have been changed (using the setter methods). This causes the values that have been changed to be updated on the portal (for PortalItems) or on disk (for LocalItems).
Inherited functions
Cancels loading metadata for the Loadable object.
Sets the thumbnail of the item with the specified image. This method invokes Bitmap.compress and may be long running.