PortalUser Class

  • PortalUser
  • class Esri::ArcGISRuntime::PortalUser

    A registered user of a portal or organization. More...

    Header: #include <PortalUser.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Object, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::JsonSerializable

    Public Functions

    PortalUser(Esri::ArcGISRuntime::Portal *portal, const QString &username, QObject *parent = nullptr)
    virtual ~PortalUser() override
    Esri::ArcGISRuntime::PortalAccess access() const
    QFuture<void> addPortalItemWithJsonAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const QString &json, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())
    QFuture<void> addPortalItemWithUrlAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const QUrl &fromUrl, const QString &fileName = QString(), const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())
    QFuture<void> addToFavoritesAsync(Esri::ArcGISRuntime::PortalItem *portalItem)
    QFuture<Esri::ArcGISRuntime::PortalFolder> createFolderAsync(const QString &title)
    QDateTime created() const
    QFuture<void> deleteFolderAsync(const Esri::ArcGISRuntime::PortalFolder &folder)
    QFuture<void> deletePortalItemAsync(Esri::ArcGISRuntime::PortalItem *portalItem)
    QString email() const
    QString favoritesGroupId() const
    QFuture<void> fetchContentAsync()
    QFuture<void> fetchContentInFolderAsync(const QString &folderId)
    QFuture<bool> fetchFavoritesStatusAsync(Esri::ArcGISRuntime::PortalItem *portalItem)
    Esri::ArcGISRuntime::PortalFolderListModel *folders() const
    QString fullName() const
    Esri::ArcGISRuntime::PortalGroupListModel *groups() const
    Esri::ArcGISRuntime::PortalItemListModel *items() const
    QDateTime modified() const
    QFuture<void> movePortalItemAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())
    QFuture<QList<Esri::ArcGISRuntime::PortalResult>> movePortalItemsAsync(const QList<Esri::ArcGISRuntime::PortalItem *> &portalItems, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())
    QString organizationId() const
    QString phone() const
    Esri::ArcGISRuntime::Portal *portal() const
    Esri::ArcGISRuntime::PortalPrivilegeListModel *privileges() const
    QFuture<void> removeFromFavoritesAsync(Esri::ArcGISRuntime::PortalItem *portalItem)
    Esri::ArcGISRuntime::PortalUserRole role() const
    QStringList tags() const
    QUrl thumbnailUrl() const
    Esri::ArcGISRuntime::UnitSystem units() const
    QString userDescription() const
    QString username() const

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual void retryLoad() override
    virtual QString toJson() const override
    virtual QJsonObject unknownJson() const override
    virtual QJsonObject unsupportedJson() const override

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
    void thumbnailUrlChanged()

    Static Public Members

    Esri::ArcGISRuntime::PortalUser *fromJson(const QString &json, Esri::ArcGISRuntime::Portal *portal = nullptr, QObject *parent = nullptr)

    Detailed Description

    A Portal may have users who are unaffiliated with an organization or users who are part of an organization. Users sign in to the portal and create and share content which is organized into items (PortalItem). Users can create and join groups (PortalGroup) and share items with groups. This makes the items visible and accessible to other members of the group. Users could be in different roles including administrators, publishers and information workers. Administrators can add users to their organizations and have access to all content within the organization. All users can create web maps based on mashing up services that they have access to and can register services running on external servers. Publishers within an organization can in addition create hosted services based on data files that they upload.

    Member Function Documentation

    [explicit] PortalUser::PortalUser(Esri::ArcGISRuntime::Portal *portal, const QString &username, QObject *parent = nullptr)

    Constructs a user for the given portal.

    portal: The Portal for the user to access. username: The registered name of the user. parent (optional).

    [override virtual] PortalUser::~PortalUser()

    Destructor.

    Esri::ArcGISRuntime::PortalAccess PortalUser::access() const

    Returns the visibility of a user's information.

    If set to PortalAccess.Private, the user's descriptive information will not be available to others nor will the username be searchable. The organization's administrator can always see all users.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::addPortalItemWithJsonAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const QString &json, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())

    Adds a PortalItem from a JSON object.

    The portalItem will be created using the following arguments:

    • portalItem. The local PortalItem which will be added to the portal.
    • json. The JSON representation of the portal item. This format is particularly suitable for adding items such as web maps and is the format used by the Map::saveAsAsync method.
    • toFolder (optional). The folder in which the item will be located. If empty, the item will be placed in the user's root folder.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    See also Items and item types.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::addPortalItemWithUrlAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const QUrl &fromUrl, const QString &fileName = QString(), const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())

    Adds a PortalItem from a local or online URL.

    The PortalItem will be created using the following arguments:

    • portalItem. The local PortalItem which will be added to the portal.
    • 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 PortalItemType.Image.

    • toFolder (optional). The folder in whih the item will be located. If empty, the item will be placed in the user's root folder.

    The operation is complete when the QFuture is finished.

    Example:

    Add an item with a local URL and load when added:

    QUrl localCSV("qrc:/Samples/CloudAndPortal/AddItemsToPortal/add_item_sample.csv");
    m_user->addPortalItemWithUrlAsync(m_item, localCSV, "add_item_sample.csv" ).then(
    [this]()
    {
      m_busy = false;
    
      setStatusText("Successfully added item. " + m_item->itemId());
      m_item->load();
    })

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::addToFavoritesAsync(Esri::ArcGISRuntime::PortalItem *portalItem)

    Adds the PortalItem portalItem to the user's favorites group.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [override virtual] void PortalUser::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    [since Esri::ArcGISRuntime 200.4] QFuture<Esri::ArcGISRuntime::PortalFolder> PortalUser::createFolderAsync(const QString &title)

    Creates a new PortalFolder with the given title in the user's root folder.

    Multilevel folders are not supported in a portal.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    QDateTime PortalUser::created() const

    Returns the date and time the user was created.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::deleteFolderAsync(const Esri::ArcGISRuntime::PortalFolder &folder)

    Removes the specified folder from the portal.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::deletePortalItemAsync(Esri::ArcGISRuntime::PortalItem *portalItem)

    Removes the PortalItem portalItem from the portal.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [signal] void PortalUser::doneLoading(const Esri::ArcGISRuntime::Error &loadError)

    Signal emitted when this object is done loading.

    • loadError - Details about any error that may have occurred.

    See also Loadable and Object.

    QString PortalUser::email() const

    Returns the user's email address.

    QString PortalUser::favoritesGroupId() const

    The ID of the group that contains the user's favorites.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::fetchContentAsync()

    Starts an operation that fetches the user's content at the root level (not in a folder).

    The content is made up of lists of PortalItem and PortalFolder objects.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::fetchContentInFolderAsync(const QString &folderId)

    Starts an operation that fetches the user's content within a specific folder (folderId).

    The content is made up of lists of PortalItem objects.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [since Esri::ArcGISRuntime 200.4] QFuture<bool> PortalUser::fetchFavoritesStatusAsync(Esri::ArcGISRuntime::PortalItem *portalItem)

    Starts an operation to determine whether PortalItem portalItem is in the user's favorites group.

    The operation is complete when the QFuture is finished. The QFuture will contain true if the item is in the user's favorites group, false otherwise.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    Esri::ArcGISRuntime::PortalFolderListModel *PortalUser::folders() const

    Returns a list of PortalFolder objects for the user's content.

    The folders are retrieved by calling fetchContent and the signal fetchContentCompleted is emitted when complete.

    [static, since Esri::ArcGISRuntime 100.1] Esri::ArcGISRuntime::PortalUser *PortalUser::fromJson(const QString &json, Esri::ArcGISRuntime::Portal *portal = nullptr, QObject *parent = nullptr)

    Creates a new PortalUser from JSON with an optional Portal and parent.

    The PortalUser will be created using the following arguments:

    • json. The JSON representation of the portal user.
    • portal (optional). A Portal object for use by the PortalUser.
    • parent (optional). A QObject object used as parent.

    To fetch data from an online portal, the JSON must contains the "username" parameter, and portal must be valid.

    const QString json = QStringLiteral(" { \"username\": \"my_username\" }");
    PortalUser* portalUser = PortalUser::fromJson(json, portal, parent);

    This function was introduced in Esri::ArcGISRuntime 100.1.

    See also JsonSerializable.

    QString PortalUser::fullName() const

    Returns the user's full name.

    Esri::ArcGISRuntime::PortalGroupListModel *PortalUser::groups() const

    Returns the list of groups for the portal user.

    See also PortalGroup.

    Esri::ArcGISRuntime::PortalItemListModel *PortalUser::items() const

    Returns a list of PortalItem objects for which the user has access.

    The items are retrieved by calling fetchContent or fetchContentInFolder and the signal fetchContentCompleted is emitted when complete.

    [override virtual] void PortalUser::load()

    Reimplements: Loadable::load().

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Error PortalUser::loadError() const

    Reimplements: Loadable::loadError() const.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::LoadStatus PortalUser::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

    [signal] void PortalUser::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Signal emitted when the loadStatus changes for this object.

    See also Loadable.

    QDateTime PortalUser::modified() const

    Returns the date and time the user was last modified.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::movePortalItemAsync(Esri::ArcGISRuntime::PortalItem *portalItem, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())

    Moves a PortalItem.

    Move item portalItem to the folder specified by toFolder. Leaving toFolder empty will move the item to the user's root folder.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [since Esri::ArcGISRuntime 200.4] QFuture<QList<Esri::ArcGISRuntime::PortalResult>> PortalUser::movePortalItemsAsync(const QList<Esri::ArcGISRuntime::PortalItem *> &portalItems, const Esri::ArcGISRuntime::PortalFolder &toFolder = PortalFolder())

    Moves multiple PortalItems.

    Move the items listed in portalItems to the folder specified by toFolder. Leaving toFolder empty will move the items to the user's root folder.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    QString PortalUser::organizationId() const

    Returns the ID of the organization the user belongs to (if any).

    QString PortalUser::phone() const

    Returns the user's phone number.

    Esri::ArcGISRuntime::Portal *PortalUser::portal() const

    Returns the portal that the user belongs to.

    Esri::ArcGISRuntime::PortalPrivilegeListModel *PortalUser::privileges() const

    A list of the privileges possessed by this user.

    See also PortalPrivilege.

    [since Esri::ArcGISRuntime 200.4] QFuture<void> PortalUser::removeFromFavoritesAsync(Esri::ArcGISRuntime::PortalItem *portalItem)

    Removes the PortalItem portalItem from the user's favorites group.

    The operation is complete when the QFuture is finished.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    [override virtual] void PortalUser::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    Esri::ArcGISRuntime::PortalUserRole PortalUser::role() const

    Returns the user's role in the organization.

    QStringList PortalUser::tags() const

    Returns a list of user-defined tags that describe the user.

    QUrl PortalUser::thumbnailUrl() const

    Returns a URL to the user's thumbnail.

    [signal, since Esri::ArcGISRuntime 100.14] void PortalUser::thumbnailUrlChanged()

    Emitted when thumbnailUrl property is changed.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [override virtual] QString PortalUser::toJson() const

    Reimplements: JsonSerializable::toJson() const.

    Returns the JSON representation of this object.

    See also JsonSerializable.

    Esri::ArcGISRuntime::UnitSystem PortalUser::units() const

    Returns the user's preferred units.

    [override virtual] QJsonObject PortalUser::unknownJson() const

    Reimplements: JsonSerializable::unknownJson() const.

    Returns the unknown JSON of this object.

    See also JsonSerializable.

    [override virtual] QJsonObject PortalUser::unsupportedJson() const

    Reimplements: JsonSerializable::unsupportedJson() const.

    Returns the unsupported JSON of this object.

    See also JsonSerializable.

    QString PortalUser::userDescription() const

    Returns the user's description.

    QString PortalUser::username() const

    Returns the user's username.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.