Represents a list of portal items. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
Signals
- countChanged()
- errorChanged()
- itemAdded(int index)
- itemRemoved(int index)
Methods
- bool contains(PortalItem portalItem)
- error forEach(callback)
- PortalItem get(int index)
- int indexOf(PortalItem portalItem)
Detailed Description
A PortalItem is a unit of content in the Portal. This type is populated by starting an operation to retrieve content and then can be accessed after the operation is complete. For example, the list of items can be retrieved by querying the portal (such as with PortalQueryParametersForItems) or by fetching the featuredItems or by fetching the items belonging to a user.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
url | url | The URL for the resource represented by the item. |
itemId | string | The ID of the item. |
access | Enums.PortalAccess | The level of access to the item. |
accessAndUseConstraintsHtml (deprecated) | string | The access and use constraints HTML. Use termsOfUse instead. |
averageRating | real | The average rating of the item. |
commentCount | int | The number of comments for the item. |
commentsEnabled | bool | Whether comments are allowed on the item. |
culture | string | The item locale information (language and country). |
folderId | string | The ID of the folder containing the item. |
name | string | The name of this item. |
owner | string | The username of the user who owns the item. |
ratingCount | int | The number of ratings received by the item. |
serviceUrl | url | The service URL for the item. |
size | qint64 | The size of the item in bytes. |
type | Enums.PortalItemType | The type of the item. |
typeKeywords | list<string> | A set of keywords that further describes the type of the item. |
typeName | string | The name of the type of this item. |
viewCount | int | The number of times this item has been viewed. |
description | string | The item description. |
extent | Envelope | The bounding rectangle of the item. |
snippet | string | The short summary description of the item. |
title | string | The title of the item. |
accessInformation | string | The access information on the source of the item. |
tags | list<string> | The user-defined tags that describe the item. |
created | date | The creation date of the item. |
modified | date | The date the item was last modified. |
spatialReference | SpatialReference | The spatial reference of the item. |
termsOfUse | string | The terms of use of the item. |
Example: Accessing roles from a PortalItemListModel from within a QML delegate:
Text { anchors { fill: parent margins: 10 } text: title color: "white" elide: Text.ElideRight wrapMode: Text.Wrap horizontalAlignment: Text.AlignHCenter }
See also Portal, PortalUser, and PortalItem.
Property Documentation
error : Error |
Returns the error (if any) that occurred (read-only).
Signal Documentation
Emitted when the count property of the model changes.
Note: The corresponding handler is onCountChanged
.
Signal emitted when the error property changes, which can indicate that an error occurred.
Note: The corresponding handler is onErrorChanged
.
Signal emitted when an item is added to the model. index The index at which the item was added.
Note: The corresponding handler is onItemAdded
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Signal emitted when an item is removed from the model. index The index at which the item was removed.
Note: The corresponding handler is onItemRemoved
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
bool contains(PortalItem portalItem) |
Returns true
if the list model contains the specified portalItem.
Receives a callback function to execute for each portalItem in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element - The current PortalItem.
- index - The current index in array.
- array - Reference to PortalItemListModel.
Returns undefined if no error occurred, and an error message otherwise.
const error = PortalItemListModel.forEach(function(element, index, array) { ... }); if (error) { console.error(error.message); }
PortalItem get(int index) |
Returns the PortalItem at the specified index.
int indexOf(PortalItem portalItem) |
Returns the index of a specific portal item (portalItem) from the list model.
This method was introduced in Esri::ArcGISRuntime 100.5..