An item in a portal. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Inherits: |
Properties
- access : Enums.PortalAccess
- addCommentStatus : Enums.TaskStatus
- addRatingStatus : Enums.TaskStatus
- adminGroups : PortalGroupListModel
- averageRating : real
- commentCount : int
- comments : PortalItemCommentListModel
- commentsEnabled : bool
- culture : string
- failedToShareGroupIds : list<string>
- failedToUnshareGroupIds : list<string>
- fetchCommentsStatus : Enums.TaskStatus
- fetchDataProgress : NetworkRequestProgress
- fetchGroupsStatus : Enums.TaskStatus
- folderId : string
- itemId : string
- json : jsobject
- loadError : Error
- loadStatus : Enums.LoadStatus
- memberGroups : PortalGroupListModel
- otherGroups : PortalGroupListModel
- owner : string
- portal : Portal
- ratingCount : int
- serviceUrl : url
- shareWithGroupsStatus : Enums.TaskStatus
- shareWithStatus : Enums.TaskStatus
- size : string
- sizeAsInt : int
- type : Enums.PortalItemType
- typeName : string
- unknownJson : jsobject
- unshareGroupsStatus : Enums.TaskStatus
- unshareStatus : Enums.TaskStatus
- unsupportedJson : jsobject
- updateDataStatus : Enums.TaskStatus
- url : url
- viewCount : int
Signals
- accessAndUseConstraintsHtmlChanged()
- accessChanged()
- addCommentStatusChanged()
- addRatingStatusChanged()
- averageRatingChanged()
- commentCountChanged()
- commentsEnabledChanged()
- cultureChanged()
- failedToShareGroupIdsChanged()
- failedToUnshareGroupIdsChanged()
- fetchCommentsStatusChanged()
- fetchDataProgressChanged()
- fetchGroupsStatusChanged()
- folderIdChanged()
- jsonChanged()
- loadErrorChanged()
- loadStatusChanged()
- ownerChanged()
- portalChanged()
- ratingCountChanged()
- serviceUrlChanged()
- shareWithGroupsStatusChanged()
- shareWithStatusChanged()
- sizeAsIntChanged()
- sizeChanged()
- typeChanged()
- typeNameChanged()
- unshareGroupsStatusChanged()
- unshareStatusChanged()
- updateDataStatusChanged()
- urlChanged()
- viewCountChanged()
Methods
- void addComment(string comment)
- void addRating(real rating)
- void cancelLoad()
- void fetchComments()
- void fetchGroups()
- void load()
- void retryLoad()
- void shareWith(bool everyone, bool organization)
- void shareWithGroups(list<string> groupIds)
- void unshare()
- void unshareGroups(list<string> groupIds)
- void updateDataWithJson(jsobject json)
- void updateDataWithUrl(url fromUrl, string fileName)
Detailed Description
Contains information about an item of content within the portal. Each item has a unique identifier and a well-known URL that is independent of the user owning the item.
A new item can be created using PortalUser.addPortalItemWithJson or PortalUser.addPortalItemWithUrl; or an existing item can be loaded from online portal using PortalItem.load.
An item may also have associated binary or textual data which can be downloaded separately.
Create a new portal item
To add a new item to a portal, create the PortalItem object passing the portal as a parameter to the constructor, then call PortalUser::addPortalItemWithJson or PortalUser::addPortalItemWithUrl. The portal user must have been created with credentials that provide sufficient privileges to add items to the portal.
Before adding an item to the portal, the title and type must be set. If itemId is set, this will be ignored and a new unique ID will be provided when the item is added to the portal and loaded.
PortalItem { id: portalItemWithoutId portal: portal title: "My Item" type: Enums.PortalItemTypeWebMap onErrorChanged: console.log("Error in portal item: " + error.message + "(" + error.additionalMessage + ")"); onItemIdChanged: console.log("Item receive itemId: " + itemId); } function addPortalItem(json) { portal.portalUser.addPortalItemWithJson(portalItemWithoutId, json); }
Load existing portal item
To load an existing item from portal, create a PortalItem object with a valid itemId, set using one of:
After this information is set, call PortalItem::load.
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: https://www.arcgis.com/home/item.html?id=[itemId]
. The web map viewer has the following format: https://www.arcgis.com/home/webmap/viewer.html?webmap=[itemId]
. In both cases the [itemId] can be used as the ID to instantiate a portal item.
PortalItem { id: portalItemWithId portal: portal itemId: id onErrorChanged: { console.log("Error in portal item: " + error.message + "(" + error.additionalMessage + ")"); } onLoadStatusChanged: { if (loadStatus === Enums.LoadStatusLoaded) console.log("Item title: " + title); } } function loadPortalItem() { portalItemWithId.load(); }
Retrieve an existing portal item
Alternatively, you can search for and load existing items in the portal using Portal::findItems or PortalUser::items. If you know the specific ID of the item you wish to retrieve, you can construct the portalItem by passing both the portal and the ID to its constructor and calling PortalItem::load to retrieve the details.
This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.
See also JsonSerializable, Loadable, Layer::item, GeoModel::item, and Basemap::item.
Property Documentation
Returns the level of access to this item (read-only).
See also Enums.PortalAccess.
Returns the status of the addComment method (read-only).
See also Enums.TaskStatus.
Returns the status of the addRating method (read-only).
See also Enums.TaskStatus.
adminGroups : PortalGroupListModel |
Returns a list of groups that the item is in and for which the current portal user is an administrator (read-only).
To access these groups, call fetchGroups, and wait for the fetchGroupsStatusChanged signal to emit with a status of Enums.TaskStatusCompleted
.
Returns the average rating of this item (read-only).
Uses a weighted average called "Bayesian average."
The number of comments that the PortalItem has (read-only).
comments : PortalItemCommentListModel |
The list of comments associated with this PortalItem.
To access these comments, call fetchComments, and wait for the fetchCommentsStatusChanged signal to emit with a status of Enums.TaskStatusCompleted
.
Returns the list of groups the item could not be shared with.
This property was introduced in Esri.ArcGISRuntime 100.1.
Returns the list of groups the item could not be unshared with.
This property was introduced in Esri.ArcGISRuntime 100.1.
Returns the status of the fetchComments method (read-only).
See also Enums.TaskStatus.
fetchDataProgress : NetworkRequestProgress |
Returns progress information for the fetch data request.
Returns the status of the fetchGroups method (read-only).
See also Enums.TaskStatus.
The ID of the portal item.
Set this property if you wish to fetch a particular item from a portal. Call load on the object to fetch the metadata for this item. Note that most of the properties will return null
, 0
or an empty string until the load operation is complete (see loadStatus).
The ID can also 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: https://www.arcgis.com/home/item.html?id=[itemId]
. The web map viewer has the following format: https://www.arcgis.com/home/webmap/viewer.html?webmap=[itemId]
. In both cases the [itemId] can be used to set the itemId property.
This property cannot be changed after the object is loaded.
The JSON representation of the PortalItem
Returns the load status of the item (read-only).
See also Enums.LoadStatus.
memberGroups : PortalGroupListModel |
Returns a list of groups that the item is in and for which the current portal user is a member (read-only).
To access these comments, call fetchGroups, and wait for the fetchGroupsStatusChanged signal to emit with a status of Enums.TaskStatusCompleted
.
otherGroups : PortalGroupListModel |
Returns a list of groups that the item is in that are public or shared to the user's organization, but that the current user is not a member (read-only).
To access these comments, call fetchGroups, and wait for the fetchGroupsStatusChanged signal to emit with a status of Enums.TaskStatusCompleted
.
[default] portal : Portal |
The portal that this item is associated with.
This property cannot be changed after the object is loaded.
Returns the status of the shareWithGroups method.
See also Enums.TaskStatus.
Returns the status of the shareWith method (read-only).
See also Enums.TaskStatus.
Returns the size of the item in bytes (read-only).
Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.
See also sizeAsInt.
The same as size but represented as an integer type (read-only).
Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.
This property was introduced in Esri.ArcGISRuntime 100.3.
The item's type.
Note: Setting this property is only allowed during instantiation starting at the 100.6 release. This is because the Portal Rest API does not allow changing the type of an existing PortalItem.
See also Enums.PortalItemType.
Returns the unknown JSON from the source JSON.
See also JsonSerializable.
Returns the status of the unshareGroups method (read-only).
See also Enums.TaskStatus.
Returns the status of the unshare method (read-only).
See also Enums.TaskStatus.
Returns the unsupported data from the source JSON.
See also JsonSerializable.
Returns the status of the updateDataWithJson or updateDataWithUrl method (read-only).
This property was introduced in Esri.ArcGISRuntime 100.1.
See also Enums.TaskStatus.
Returns the url of the portal item.
The supported URL formats are:
- The URL of the portal item (with or without the query parameter f=json). Example:
https://www.arcgis.com/sharing/rest/content/items/12345678901234567890123456789012?f=json
- The URL of the portal item data. Example:
https://www.arcgis.com/sharing/rest/content/items/12345678901234567890123456789012/data
- The URL of an ArcGIS.com item. Example:
https://www.arcgis.com/home/item.html?id=12345678901234567890123456789012
- The URL of an ArcGIS.com web map viewer. Example:
https://www.arcgis.com/home/webmap/viewer.html?webmap=12345678901234567890123456789012
This property cannot be changed after the object is loaded.
The number of views of this PortalItem (read-only).
Signal Documentation
Emitted when the accessAndUseConstraintsHtml property changes.
Note: The corresponding handler is onAccessAndUseConstraintsHtmlChanged
.
Emitted when the access property changes.
Note: The corresponding handler is onAccessChanged
.
Emitted when the addCommentStatus property changes.
Note: The corresponding handler is onAddCommentStatusChanged
.
Emitted when the addRatingStatus property changes.
Note: The corresponding handler is onAddRatingStatusChanged
.
Emitted when the averageRating property changes.
Note: The corresponding handler is onAverageRatingChanged
.
Emitted when the commentCount property changes.
Note: The corresponding handler is onCommentCountChanged
.
Emitted when the commentsEnabled property changes.
Note: The corresponding handler is onCommentsEnabledChanged
.
Emitted when the culture property changes.
Note: The corresponding handler is onCultureChanged
.
Emitted when the failedToShareGroupIds property changes.
Note: The corresponding handler is onFailedToShareGroupIdsChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.1.
Emitted when the failedToUnshareGroupIds property changes.
Note: The corresponding handler is onFailedToUnshareGroupIdsChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.1.
Emitted when the fetchCommentsStatus property changes.
Note: The corresponding handler is onFetchCommentsStatusChanged
.
Emitted when the fetchDataProgress property changes.
Note: The corresponding handler is onFetchDataProgressChanged
.
Emitted when the fetchGroupsStatus property changes.
Note: The corresponding handler is onFetchGroupsStatusChanged
.
Emitted when the folderId property changes.
Note: The corresponding handler is onFolderIdChanged
.
Emitted when the json property changes.
Note: The corresponding handler is onJsonChanged
.
Emitted when the loadError property changes.
Note: The corresponding handler is onLoadErrorChanged
.
Emitted when the loadStatus property changes.
Note: The corresponding handler is onLoadStatusChanged
.
Emitted when the owner property changes.
Note: The corresponding handler is onOwnerChanged
.
Emitted when portal property is changed.
Note: The corresponding handler is onPortalChanged
.
Emitted when the ratingCount property changes.
Note: The corresponding handler is onRatingCountChanged
.
Emitted when the serviceUrl property changes.
Note: The corresponding handler is onServiceUrlChanged
.
Emitted when the shareWithGroupsStatus property changes.
Note: The corresponding handler is onShareWithGroupsStatusChanged
.
Emitted when the shareWithStatus property changes.
Note: The corresponding handler is onShareWithStatusChanged
.
Emitted when the sizeAsInt property changes.
Note: The corresponding handler is onSizeAsIntChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.3.
Emitted when the size property changes.
Note: The corresponding handler is onSizeChanged
.
Emitted when the type property changes.
Note: The corresponding handler is onTypeChanged
.
Emitted when the typeName property changes.
Note: The corresponding handler is onTypeNameChanged
.
Emitted when the unshareGroupsStatus property changes.
Note: The corresponding handler is onUnshareGroupsStatusChanged
.
Emitted when the unshareStatus property changes.
Note: The corresponding handler is onUnshareStatusChanged
.
Emitted when the updateDataStatus property changes.
Note: The corresponding handler is onUpdateDataStatusChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.1.
Emitted when url property is changed.
Note: The corresponding handler is onUrlChanged
.
Emitted when the viewCount property changes.
Note: The corresponding handler is onViewCountChanged
.
Method Documentation
Adds a comment to the PortalItem.
The addCommentStatus property shows whether the operation was successful.
Adds a rating to the PortalItem.
The addRatingStatus property shows whether the operation was successful.
rating must be a floating point number between 1.0 and 5.0.
See Loadable.
Starts an asynchronous task to fetch comments.
Example: Add a comment and fetch the comments model for an item:
Connections { target: portalItem function onAddCommentStatusChanged() { if (portalItem.addCommentsStatus !== Enums.TaskStatusCompleted) return; console.log("comment added"); } function onFetchCommentsStatusChanged() { if (portalItem.fetchCommentsStatus !== Enums.TaskStatusCompleted) return; console.log("total comments = " + portalItem.comments.count); } }
The fetchCommentsStatusChanged signal will emit once complete.
Starts an asynchronous task to fetch the groups that this item belongs to.
Only those groups that are visible to the current portal user will be returned. The fetchGroupsStatusChanged signal will emit once complete and the fetchGroupsStatus property will show whether the operation was successful.
See Loadable.
See Loadable.
Shares a PortalItem with everyone and/or the organization the item belongs to.
Shares a PortalItem with the specified list of groupIds.
Unshares the PortalItem with everyone.
Unshares a PortalItem with the specified list of groupIds.
Starts an asynchronous task to update the remote PortalItem with the provided json.
The updateDataStatus property shows the status of the operation.
This method was introduced in Esri.ArcGISRuntime 100.1.
Starts an asynchronous task to update the remote PortalItem from a local or online URL.
The portalItem will be updated using the following arguments:
- fromUrl - The local or online URL from which the portalItem will be populated. For local files, this should be of the form
"qrc:/example.csv"
or "file://"; for online resources this should be of the form"https://..."
. - fileName - (optional). The name of the file which will be associated with the PortalItem (including extension). If a file name is not supplied, the portal item will have no file associated with it for future downloads.
Note: A file name is only relevant for certain item types such as Enums.PortalItemType
Enums.PortalItemTypeImage
.
The updateDataStatus property shows the status of the operation.
This method was introduced in Esri.ArcGISRuntime 100.1.
See also Items and item types.