Skip To Content ArcGIS for Developers Sign In Dashboard

Portal QML Type

Represents a view into a portal by a user, either anonymous or with a Credential. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

The Portal type is the main entry point into the API used to work with portals and organization subscriptions. It implements all the operations to interface with the backend ArcGIS REST API. Use Portal to search for items and groups and see the contents of the portal, such as services, layers, and so on.

Portals allow users and organizations to publish and share content over the web. A portal can support subscriptions which provide organizations a sandboxed area on the portal. The website www.arcgis.com (ArcGIS Online) is an example of a portal.

Organizations

A Portal may contain multiple organizations. An organization has users in different roles including administrators, publishers, and other users.

  • Administrators can add users to their organization subscriptions and have access to all content within the organization.
  • Publishers within an organization can in addition create hosted services based on data files that they upload.
  • All users can create web maps based on mashing up services that they have access to and can register services running on external servers.

Content

Users create and share content that organized into Items. A Portal can contain different types of content items including:

  • Web maps
  • Map services (that can be used as layers in web maps)
  • Applications (that are built around web maps)
  • Data files (that can be uploaded and downloaded)

Users can choose to keep the content they create private, or share it with other members of the same group, or make content public and accessible to everyone.

Users and Groups

A user of the Portal sees the view of the Portal that corresponds to their organization's subscription. This view includes users, groups, and items that belong to the organization or have been shared with them. This view may also include users, groups, and items that are external to the user's organization and have been shared with the user. A Portal can have users who are affiliated with an organization or users who are not.

Users can create and join groups.

Example: Create a portal anonymously:

Portal {
    id: agolAnon
    url: "http://www.arcgis.com"
}

Example: Create and load a portal with a credential:

Portal {
    id: agolAsNamedUser

    credential: Credential {
        username: myUsername
        password: myPassword
    }

    Component.onCompleted: load();

    onErrorChanged: {
        if (loadStatus === Enums.LoadStatusFailedToLoad)
            console.log(error.message);
    }
}

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.

TypeDefault Property
Credentialcredential
RequestConfigurationrequestConfiguration (since Esri.ArcGISRuntime 100.1)

See also Loadable, RemoteResource, PortalUser, and PortalGroup.

Property Documentation

basemaps : BasemapListModel

Returns the list of portal basemaps (read-only).

You must first call fetchBasemaps in order to access the list of basemaps.

See also Basemap.


[default] credential : Credential

The credential for the portal.


featuredGroups : PortalGroupListModel

Returns the list of groups featured for the portal (read-only).

You must first call fetchFeaturedGroups in order to access the list of featured groups.

See also PortalGroup.


featuredItems : PortalItemListModel

Returns the list of items featured for the portal (read-only).

You must first call fetchFeaturedItems in order to access the list of featured items.

See also PortalItem.


fetchBasemapsStatus : Enums.TaskStatus

Returns the status of a the fetchBasemaps task (read-only).

See also Enums.TaskStatus.


fetchFeaturedGroupsStatus : Enums.TaskStatus

Returns the status of a the fetchFeaturedGroups task (read-only).

See also Enums.TaskStatus.


fetchFeaturedItemsStatus : Enums.TaskStatus

Returns the status of a the fetchFeaturedItems task (read-only).

See also Enums.TaskStatus.


fetchHomepageFeaturedContentStatus : Enums.TaskStatus

Returns the status of a the fetchHomepageFeaturedContent task (read-only).

See also Enums.TaskStatus.


findGroupsResult : PortalQueryResultSetForGroups

Returns the results of a call to findGroups (read-only).

See also PortalQueryResultSetForGroups and PortalQueryParametersForGroups.


findGroupsStatus : Enums.TaskStatus

Returns the status of a the findGroups task (read-only).

See also Enums.TaskStatus.


findItemsResult : PortalQueryResultSetForItems

Returns the results of a call to findItems (read-only).

See also PortalQueryResultSetForItems and PortalQueryParametersForItems.


findItemsStatus : Enums.TaskStatus

Returns the status of a the findItems task (read-only).

See also Enums.TaskStatus.


homepageFeaturedContent : PortalItemListModel

Returns the list of items featured on the homepage of the portal (read-only).

You must first call fetchHomepageFeaturedContent in order to access the list of homepage featured items.

See also PortalItem.


loadError : Error

Returns the load error for the item (read-only).


loadStatus : Enums.LoadStatus

Returns the load status of the item (read-only).

See also Enums.LoadStatus.


loginRequired : bool

Whether login is required for the portal.

If loginRequired is set to true, loading will always require a Credential. If the credential property has not been set, the user will be prompted for login credentials.

If loginRequired is false, a credential is required only if the remote resource is secured.

This property cannot be changed after the portal is loaded.


portalInfo : PortalInfo

Returns information about the loaded portal (read-only).

A PortalInfo object represents details of the portal or organization as seen by the current user, anonymous or logged in. If the current user is a member of an organization on this portal, information about the user and organization is included.

This property is null until the Portal object is loaded.


portalUser : PortalUser

Returns the registered user of the portal/organization (read-only).

This property is null until the Portal object is loaded.


[default] requestConfiguration : RequestConfiguration

The configuration parameters used for network requests sent by this Portal object.

This QML property was introduced in Esri.ArcGISRuntime 100.1.


url : url

The URL of the portal.

If no URL has been set, the default is returned: http://www.arcgis.com (ArcGIS Online).

This property cannot be changed after the portal is loaded.


Signal Documentation

credentialChanged()

Emitted when the credential property changes.


credentialChanged()

Emitted when the credential property changes.


fetchBasemapsStatusChanged()

Emitted when the fetchBasemapsStatus property changes.


fetchFeaturedGroupsStatusChanged()

Emitted when the fetchFeaturedGroupsStatus property changes.


fetchFeaturedItemsStatusChanged()

Emitted when the fetchFeaturedItemsStatus property changes.


fetchHomepageFeaturedContentStatusChanged()

Emitted when the fetchHomepageFeaturedContentStatus property changes.


findGroupsStatusChanged()

Emitted when the findGroupsStatus property changes.


findItemsStatusChanged()

Emitted when the findItemsStatus property changes.


loadErrorChanged()

Emitted when the loadError property changes.


loadStatusChanged()

Emitted when the loadStatus property changes.


loginRequiredChanged()

Emitted when the loginRequired property changes.


portalInfoChanged()

Emitted when the portalInfo property changes.


portalUserChanged()

Emitted when the portalUser property changes.


requestConfigurationChanged()

Emitted when the requestConfiguration property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.1.


urlChanged()

Emitted when the url property changes.


Method Documentation

void cancelLoad()

See Loadable.


void fetchBasemaps()

Retrieve the set of basemaps available for the portal.

Once the basemaps have been retrieved, the results are available via the basemaps property.

Example:

Fetch the basemaps for a portal:

onLoadStatusChanged: {
    if (loadStatus === Enums.LoadStatusFailedToLoad) {
        retryLoad();
        return;
    }

    if (loadStatus !== Enums.LoadStatusLoaded)
        return;

    fetchBasemaps();
}

onFetchBasemapsStatusChanged: {
    if (fetchBasemapsStatus !== Enums.TaskStatusCompleted)
        return;

    basemapsGrid.model = basemaps;
    gridFadeIn.running = true;
}

See also Basemap.


void fetchFeaturedGroups()

Retrieve the set of featuredGroups available for the portal.

Once the groups have been retrieved, the results are available via the featuredGroups property.

See also PortalGroup.


void fetchFeaturedItems()

Retrieve the set of featuredItems available for the portal.

Once the items have been retrieved, the results are available via the featuredItems property.

See also PortalItem.


void fetchHomepageFeaturedContent()

Retrieve the items featured on the homepage of the portal.

Once the content has been retrieved, the results are available via the homepageFeaturedContent property.

See also PortalItem.


void findGroups(PortalQueryParametersForGroups queryParameters)

Perform a query to fetch groups matching specified criteria.

queryParameters defines the query to be applied.

Once the query has completed, the results are available in the findGroupsResult property.

Example:

Use findGroups to retrieve all of the groups for a portal:

property int numGroups: 0

PortalQueryParametersForGroups {
    id: queryParamsGroups
    searchString: "1==1"
}

Portal {
    id: portalWithGroups

    onFindGroupsStatusChanged: {
        if (findGroupsStatus !== Enums.TaskStatusCompleted)
            return;

        numGroups = findGroupsResult.groupResults.count;
    }
}
portalWithGroups.findGroups(queryParamsGroups);

See also PortalQueryParametersForGroups.


void findItems(PortalQueryParametersForItems queryParameters)

Perform a query to fetch items matching specified criteria.

queryParameters defines the query to be applied. Once the query has completed, the results are available in the findItemsResult property.

Example:

Use findItems to retrieve web maps with specific tags from a portal:

// webmaps authored prior to July 2nd, 2014 are not supported - so search only from that date to the current time
property string fromDate: "000000" + new Date('Wed, 02 Jul 2014 00:00:00 GMT').getTime()
property string toDate: "000000" + new Date().getTime()

PortalQueryParametersForItems {
    id: webmapQuery
    types: [ Enums.PortalItemTypeWebMap ]

    searchString: 'tags:\"' + keyWordField.text + '\" AND + uploaded:[' + fromDate + ' TO ' + toDate +']';
}
portal.findItems(webmapQuery);

See also PortalQueryParametersForItems.


void load()

See Loadable.


void retryLoad()

See Loadable.



Feedback on this topic?