ArcGIS for Developers

ItemPackage QML Type

The ItemPackage component provides Access to Item Package related information and status. More...

Import Statement: import ArcGIS.AppFramework 1.0
Inherits:

AppFrameworkObject

Properties

Signals

Methods

Detailed Description

The ItemPackage component is used specifically for downloading item packages, either from ArcGIS Online or Portal for ArcGIS. It handles the location and ID of the package to download, as well as various signals to describe the downloads progress.

This code sample, derived from AppStudio Player, provides a button to download a given item package. Be aware that for this sample to function, 'portal' and 'itemId' needs to be defined elsewhere in your app.

Item {
        ItemPackage {
                id: itemPackage
                portal: app.portal

                onDownloadComplete: {
                        console.log("Itempackage downloaded")
                }

                onDownloadError: {
                        messageDlg.text = error.message;
                        messageDlg.informativeText = error.details;
                        messageDlg.open();
                }
        }

        MessageDialog {
                id: messageDlg
                title: "Download Error"
                icon: StandardIcon.Critical
        }

        Button {
                text: "Download"
                onClicked: {
                        itemPackage.download(app.info.itemId);
                }
        }
}

Enumerations

Status enumeration

Enum describing the current status of the download process.

NameValue
ItemPackage.Null0
ItemPackage.Ready1
ItemPackage.Downloading2
ItemPackage.Error3

Property Documentation

itemId : string

Holds the item ID of the Portal item being downloaded.


portal : object

The object defining the portal being used to access the item.


[read-only] status : Status

Returns the current status of the download process, as described by the Status enum.


Signal Documentation

downloadComplete()

Signal emitted when the download process has completed.


downloadError( AppFrameworkError error)

Signal emitted when the download process has encountered an error.


downloadProgress( int percentage, int secondsRemainingEstimate)

Signal emitted whenever the download progresses.


downloadStarted()

Signal emitted when the download process has started.


Method Documentation

download(itemId)

Begins downloading the declared item.

The itemId parameter

The ID of the item to download.


bool exists(itemId)

Checks whether the item described by the given item ID exists, returning true or false as appropriate.

The itemId parameter

The item ID to check the presence of.